35 lines
916 B
TypeScript
35 lines
916 B
TypeScript
|
|
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
|
||
|
|
}
|