Initial commit

This commit is contained in:
2026-03-08 01:34:54 +08:00
commit 1f104f73c8
441 changed files with 64911 additions and 0 deletions

34
shared/types/module.ts Normal file
View File

@@ -0,0 +1,34 @@
import type { LucideIcon } from 'lucide-react'
import type { FileItemDTO as FileItem } from './file.js'
export type {
HttpMethod,
EndpointConfig,
EndpointDefinition,
ModuleEndpoints,
ModuleApiConfig,
ModuleDefinition,
ApiModuleConfig,
} from '../modules/types.js'
export type Brand<T, TBrand extends string> = T & { __brand: TBrand }
export type ModuleId = Brand<string, 'ModuleId'>
import type { ModuleDefinition, ModuleEndpoints } from '../modules/types.js'
export interface FrontendModuleConfig<
TEndpoints extends ModuleEndpoints = ModuleEndpoints
> extends Omit<ModuleDefinition<string, TEndpoints>, 'icon' | 'basePath'> {
basePath?: string
icon: LucideIcon
component: React.ComponentType
}
export interface InternalModuleConfig extends FrontendModuleConfig {
tabId: string
fileItem: FileItem
}
export const createModuleId = (id: string): ModuleId => {
return id as ModuleId
}