UNPKG

vision-embedded-web

Version:
44 lines (43 loc) 1.58 kB
export interface IWebContent { startPlay: () => void; stopPlay: () => void; setState: (channelName: string, state: string | object) => void; notifyFolderPlayUpdate: (dirPath: string) => void; notifyVarsChanged: (vars: string) => void; emit(jsonData: string): void; response(requestId: string, error: string | null, jsonResult: string | null): void; } export declare type VoidCallback = () => void; export declare type SetStateCallback<T> = (channelName: string, state: T) => void; export declare type FolderPlayUpdateCallback = (dirPath: string) => void; export declare type Var = { name: string; value: string; }; export declare type VarsChangedCallback = (vars: Var[]) => void; export declare type VarChangedCallback = (varName: string, varValue: string) => void; export declare type WebContentEvent = WCScanEvent | WCDownloadInfoEvent; declare type WCScanEvent = { type: 'scan'; payload: { barcode: string; }; }; declare type WCDownloadInfoEvent = { type: 'download-info'; payload: { processedCount: number; allCount: number; }; }; export declare type WebContentEventCallback = (event: WebContentEvent) => void; export declare type WebContentHooks = { onStartPlay?: VoidCallback; onStopPlay?: VoidCallback; onSetState?: SetStateCallback<any>; onFolderPlayUpdate?: FolderPlayUpdateCallback; onVarsChanged?: VarsChangedCallback; onVarChanged?: VarChangedCallback; onWebContentEvent?: WebContentEventCallback; }; export {};