archematics/src/adapptypes.civet

26 lines
766 B
Plaintext
Raw Normal View History

export const flags = ['color', 'commands', 'showall'] as const
export type FlagType = (typeof flags)[number]
export type ConfigType = Partial<Record<FlagType, boolean>>
export type AppletDescription
html: string
params: Record<string, string>
id: string
width: number
height: number
export type AdapParams
codebase?: string
loader?: string
config?: ConfigType
joyceApplets: AppletDescription[]
export function params(kids: HTMLCollection): Record<string, string>
return.value: Record<string, string> := {}
for each kid of kids
unless kid.tagName is 'PARAM' then continue
name := kid.getAttribute 'name'
value := kid.getAttribute 'value'
unless name and value then continue
return.value[name] = value