import type { SimplePulseModel } from './pulse'; interface ScanData { code: string; state: number; type: number; } export interface BridgeEventMap { scan: CustomEvent<{code: number, data?: ScanData, message?: string}>; } export class Bridge extends EventTarget { public static getInstance(): Bridge; public static pulse(userId: string): Promise; public static print(): Promise; public static print(params: { url?: string }): Promise; /** * 监听扫码事件 * @param type 事件类型 'scan' * @param listener 事件回调,参数为 ScanEvent * @param options */ addEventListener(type: T, listener: (event: BridgeEventMap[T]) => void, options?: boolean | AddEventListenerOptions): () => void; removeEventListener(type: T, listener: (event: BridgeEventMap[T]) => void, options?: boolean | AddEventListenerOptions): () => void; postMessage(...args: any[]): Promise; } export interface globalAIO { scan(value: string): number; print(value: string): void; }