(name: string, description: string, validate: Schema<K>, run: (args: K, report: any) => boolean | Promise<boolean>)
| 27 | } |
| 28 | |
| 29 | function addScript<K>(name: string, description: string, validate: Schema<K>, run: (args: K, report: any) => boolean | Promise<boolean>) { |
| 30 | if (global.Hydro.script[name]) throw new Error(`duplicate script ${name} registered.`); |
| 31 | global.Hydro.script[name] = { description, validate, run }; |
| 32 | return () => delete global.Hydro.script[name]; |
| 33 | } |
| 34 | |
| 35 | function provideModule<T extends keyof ModuleInterfaces>(type: T, id: string, module: ModuleInterfaces[T]) { |
| 36 | if (global.Hydro.module[type][id]) throw new Error(`duplicate module ${type}/${id} registered.`); |
nothing calls this directly
no outgoing calls
no test coverage detected