chore: init web project

This commit is contained in:
Steven
2022-09-12 09:53:15 +08:00
parent e82c821396
commit 5a96e67c6d
66 changed files with 5101 additions and 0 deletions

13
web/src/types/common.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
type BasicType = undefined | null | boolean | number | string | Record<string, unknown> | Array<BasicType>;
type DateStamp = number;
type TimeStamp = number;
type FunctionType = (...args: unknown[]) => unknown;
interface KVObject<T = any> {
[key: string]: T;
}
type Option<T> = T | undefined;

1
web/src/types/modules/common.d.ts vendored Normal file
View File

@ -0,0 +1 @@
type RowStatus = "NORMAL" | "ARCHIVED";

38
web/src/types/modules/shortcut.d.ts vendored Normal file
View File

@ -0,0 +1,38 @@
type ShortcutId = number;
type Visibility = "PRIVATE" | "WORKSPACE";
interface Shortcut {
id: ShortcutId;
creatorId: UserId;
createdTs: TimeStamp;
updatedTs: TimeStamp;
workspaceId: WorkspaceId;
rowStatus: RowStatus;
name: string;
link: string;
visibility: Visibility;
}
interface ShortcutCreate {
workspaceId: WorkspaceId;
name: string;
link: string;
visibility: Visibility;
}
interface ShortcutPatch {
id: ShortcutId;
name?: string;
link?: string;
visibility?: Visibility;
}
interface ShortcutFind {
creatorId?: UserId;
workspaceId?: WorkspaceId;
}

8
web/src/types/modules/system.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
interface Profile {
mode: string;
version: string;
}
interface SystemStatus {
profile: Profile;
}

31
web/src/types/modules/user.d.ts vendored Normal file
View File

@ -0,0 +1,31 @@
type UserId = number;
interface User {
id: UserId;
createdTs: TimeStamp;
updatedTs: TimeStamp;
rowStatus: RowStatus;
email: string;
name: string;
}
interface UserCreate {
email: string;
password: string;
name: string;
}
interface UserPatch {
id: UserId;
rowStatus?: RowStatus;
name?: string;
password?: string;
}
interface UserDelete {
id: UserId;
}

30
web/src/types/modules/workspace.d.ts vendored Normal file
View File

@ -0,0 +1,30 @@
type WorkspaceId = number;
interface Workspace {
id: WorkspaceId;
creatorId: UserId;
createdTs: TimeStamp;
updatedTs: TimeStamp;
rowStatus: RowStatus;
name: string;
description: string;
}
interface WorkspaceCreate {
name: string;
description: string;
}
interface WorkspacePatch {
id: WorkspaceId;
rowStatus?: RowStatus;
name?: string;
description?: string;
}
interface WorkspaceFind {
creatorId?: UserId;
memberId?: UserId;
}

7
web/src/types/view.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
interface DialogProps {
destroy: FunctionType;
}
interface DialogCallback {
destroy: FunctionType;
}