mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 07:25:35 +00:00
refactor: use tabs instead of spaces
This commit is contained in:
60
inertia/types/app.d.ts
vendored
60
inertia/types/app.d.ts
vendored
@@ -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[];
|
||||
};
|
||||
|
||||
70
inertia/types/emotion.d.ts
vendored
70
inertia/types/emotion.d.ts
vendored
@@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
8
inertia/types/favicon.d.ts
vendored
8
inertia/types/favicon.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
interface Favicon {
|
||||
buffer: Buffer;
|
||||
url: string;
|
||||
type: string;
|
||||
size: number;
|
||||
buffer: Buffer;
|
||||
url: string;
|
||||
type: string;
|
||||
size: number;
|
||||
}
|
||||
|
||||
8
inertia/types/i18n.d.ts
vendored
8
inertia/types/i18n.d.ts
vendored
@@ -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'];
|
||||
}
|
||||
}
|
||||
|
||||
20
inertia/types/inertia.d.ts
vendored
20
inertia/types/inertia.d.ts
vendored
@@ -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;
|
||||
};
|
||||
|
||||
16
inertia/types/search.d.ts
vendored
16
inertia/types/search.d.ts
vendored
@@ -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;
|
||||
|
||||
32
inertia/types/utils.d.ts
vendored
32
inertia/types/utils.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user