mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
refactor(infra): directory structure (#4615)
This commit is contained in:
28
packages/frontend/core/src/shared/index.ts
Normal file
28
packages/frontend/core/src/shared/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { WorkspaceRegistry } from '@affine/env/workspace';
|
||||
import { Workspace as BlockSuiteWorkspace } from '@blocksuite/store';
|
||||
|
||||
export { BlockSuiteWorkspace };
|
||||
|
||||
export type AllWorkspace = WorkspaceRegistry[keyof WorkspaceRegistry];
|
||||
|
||||
export enum WorkspaceSubPath {
|
||||
ALL = 'all',
|
||||
TRASH = 'trash',
|
||||
SHARED = 'shared',
|
||||
}
|
||||
|
||||
export const WorkspaceSubPathName = {
|
||||
[WorkspaceSubPath.ALL]: 'All Pages',
|
||||
[WorkspaceSubPath.TRASH]: 'Trash',
|
||||
[WorkspaceSubPath.SHARED]: 'Shared',
|
||||
} satisfies {
|
||||
[Path in WorkspaceSubPath]: string;
|
||||
};
|
||||
|
||||
export const pathGenerator = {
|
||||
all: workspaceId => `/workspace/${workspaceId}/all`,
|
||||
trash: workspaceId => `/workspace/${workspaceId}/trash`,
|
||||
shared: workspaceId => `/workspace/${workspaceId}/shared`,
|
||||
} satisfies {
|
||||
[Path in WorkspaceSubPath]: (workspaceId: string) => string;
|
||||
};
|
||||
Reference in New Issue
Block a user