refactor: use tabs instead of spaces

This commit is contained in:
Sonny
2024-10-07 01:33:59 +02:00
parent f425decf2c
commit eea9732100
197 changed files with 5206 additions and 5209 deletions

View File

@@ -1,55 +1,55 @@
import { Visibility } from '@/app/enums/visibility';
type CommonBase = {
id: number;
createdAt: string;
updatedAt: string;
id: number;
createdAt: string;
updatedAt: string;
};
type User = CommonBase & {
email: string;
name: string;
nickName: string;
fullname: string;
avatarUrl: string;
isAdmin: boolean;
email: string;
name: string;
nickName: string;
fullname: string;
avatarUrl: string;
isAdmin: boolean;
};
type UserWithCollections = User & {
collections: Collection[];
collections: Collection[];
};
type UserWithRelationCount = CommonBase & {
email: string;
fullname: string;
avatarUrl: string;
isAdmin: string;
count: {
link: number;
collection: number;
};
email: string;
fullname: string;
avatarUrl: string;
isAdmin: string;
count: {
link: number;
collection: number;
};
};
type Link = CommonBase & {
name: string;
description: string | null;
url: string;
favorite: boolean;
collectionId: number;
name: string;
description: string | null;
url: string;
favorite: boolean;
collectionId: number;
};
type LinkWithCollection = Link & {
collection: Collection;
collection: Collection;
};
type Collection = CommonBase & {
name: string;
description: string | null;
visibility: Visibility;
nextId: number;
authorId: number;
name: string;
description: string | null;
visibility: Visibility;
nextId: number;
authorId: number;
};
type CollectionWithLinks = Collection & {
links: Link[];
links: Link[];
};

View File

@@ -1,49 +1,49 @@
import '@emotion/react';
declare module '@emotion/react' {
export interface Theme extends theme {
colors: {
font: string;
background: string;
primary: string;
secondary: string;
export interface Theme extends theme {
colors: {
font: string;
background: string;
primary: string;
secondary: string;
black: string;
white: string;
black: string;
white: string;
lightGrey: string;
grey: string;
lightGrey: string;
grey: string;
lightestBlue: string;
lightBlue: string;
blue: string;
darkBlue: string;
darkestBlue: string;
lightestBlue: string;
lightBlue: string;
blue: string;
darkBlue: string;
darkestBlue: string;
green: string;
green: string;
lightRed: string;
lightRed: string;
yellow: string;
yellow: string;
boxShadow: string;
};
boxShadow: string;
};
border: {
radius: string;
};
border: {
radius: string;
};
media: {
mobile: string;
tablet: string;
small_desktop: string;
medium_desktop: string;
large_desktop: string;
xlarge_desktop: string;
};
media: {
mobile: string;
tablet: string;
small_desktop: string;
medium_desktop: string;
large_desktop: string;
xlarge_desktop: string;
};
transition: {
delay: string;
};
}
transition: {
delay: string;
};
}
}

View File

@@ -1,6 +1,6 @@
interface Favicon {
buffer: Buffer;
url: string;
type: string;
size: number;
buffer: Buffer;
url: string;
type: string;
size: number;
}

View File

@@ -2,8 +2,8 @@ import 'i18next';
import { resources } from '../i18n';
declare module 'i18next' {
interface CustomTypeOptions {
returnNull: false;
resources: (typeof resources)['fr'];
}
interface CustomTypeOptions {
returnNull: false;
resources: (typeof resources)['fr'];
}
}

View File

@@ -1,17 +1,17 @@
import type { User } from './app';
type Auth =
| {
isAuthenticated: true;
user: User;
}
| {
isAuthenticated: false;
user: null;
};
| {
isAuthenticated: true;
user: User;
}
| {
isAuthenticated: false;
user: null;
};
export type InertiaPage<
T extends Record<string, unknown> = Record<string, unknown>,
T extends Record<string, unknown> = Record<string, unknown>,
> = T & {
auth: Auth;
auth: Auth;
};

View File

@@ -1,18 +1,18 @@
type SearchResultCommon = {
id: number;
name: string;
matched_part?: string;
rank?: number;
id: number;
name: string;
matched_part?: string;
rank?: number;
};
export type SearchResultCollection = SearchResultCommon & {
type: 'collection';
type: 'collection';
};
export type SearchResultLink = SearchResultCommon & {
type: 'link';
collection_id: number;
url: string;
type: 'link';
collection_id: number;
url: string;
};
export type SearchResult = SearchResultCollection | SearchResultLink;

View File

@@ -1,24 +1,24 @@
type Join<K, P> = K extends string
? P extends string
? `${K}${'' extends P ? '' : '.'}${P}`
: never
: never;
? P extends string
? `${K}${'' extends P ? '' : '.'}${P}`
: never
: never;
type Paths<T> = T extends object
? {
[K in keyof T]-?: K extends string
? `${K}` | Join<K, Paths<T[K]>>
: never;
}[keyof T]
: '';
? {
[K in keyof T]-?: K extends string
? `${K}` | Join<K, Paths<T[K]>>
: never;
}[keyof T]
: '';
type Leaves<T> = T extends object
? {
[K in keyof T]-?: Join<K, Leaves<T[K]>>;
}[keyof T]
: '';
? {
[K in keyof T]-?: Join<K, Leaves<T[K]>>;
}[keyof T]
: '';
type RemoveSuffix<
Key extends string,
SuffixAfter extends string = '_',
Key extends string,
SuffixAfter extends string = '_',
> = Key extends `${infer Prefix}${SuffixAfter}${string}` ? Prefix : Key;