Initial commit
This commit is contained in:
34
shared/types/module.ts
Normal file
34
shared/types/module.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user