Move more things to the ui folder

This commit is contained in:
Ingvar Stepanyan
2021-11-30 19:15:29 +00:00
parent 85b8cc8546
commit b682303c75
3 changed files with 3 additions and 3 deletions

47
ui/libapi.mjs.d.ts vendored Normal file
View File

@@ -0,0 +1,47 @@
export type Config = {
name: string;
info: string;
label: string;
readonly: boolean;
} & (
| { type: 'range'; value: number; min: number; max: number; step: number }
| { type: 'menu' | 'radio'; value: string; choices: string[] }
| { type: 'toggle'; value: boolean }
| { type: 'text'; value: string }
| { type: 'window'; children: Record<string, Config> }
| { type: 'section'; children: Record<string, Config> }
| { type: 'datetime'; value: number }
);
declare interface SupportedOps {
captureImage: boolean;
captureVideo: boolean;
captureAudio: boolean;
capturePreview: boolean;
config: boolean;
triggerCapture: boolean;
}
declare class Context {
configToJS(): Promise<Config & { type: 'window' }>;
setConfigValue(
name: string,
value: number | string | boolean
): Promise<undefined>;
capturePreviewAsBlob(): Promise<Blob>;
captureImageAsFile(): Promise<File>;
consumeEvents(): Promise<boolean>;
supportedOps(): SupportedOps;
delete(): void;
isDeleted(): boolean;
}
export interface Module extends EmscriptenModule {
Context: typeof Context;
}
export type { Context };
declare const initModule: EmscriptenModuleFactory<Module>;
export default initModule;