25 lines
505 B
TypeScript
25 lines
505 B
TypeScript
type PartBlueprint = string
|
|
|
|
export type DeskBuilder=
|
|
<
|
|
Parts extends Record<string, PartBlueprint>,
|
|
Desk extends [ name:string, mode:"all"|"one", need:Partial<Record<keyof Parts, number>>, ...make:Array<keyof Parts>]
|
|
>
|
|
(
|
|
parts:Parts,
|
|
...desks:Desk[]
|
|
)
|
|
=>void
|
|
|
|
|
|
type UserBlueprint = string
|
|
export type UserBuilder=
|
|
<
|
|
Users extends Record<string, UserBlueprint>,
|
|
Roles extends Record<string, [ name:string, ...users:Array<keyof Users>]>
|
|
>
|
|
(
|
|
users:Users,
|
|
roles:Roles
|
|
)
|
|
=>void |