//#region src/types.d.ts declare global { interface Window { webkitRequestAnimationFrame: (callback: FrameRequestCallback) => number; mozRequestAnimationFrame: (callback: FrameRequestCallback) => number; msRequestAnimationFrame: (callback: FrameRequestCallback) => number; oRequestAnimationFrame: (callback: FrameRequestCallback) => number; webkitCancelAnimationFrame: (handle: number) => void; mozCancelAnimationFrame: (handle: number) => void; oCancelAnimationFrame: (handle: number) => void; msCancelAnimationFrame: (handle: number) => void; webkitIndexedDB: IDBFactory; mozIndexedDB: IDBFactory; msIndexedDB: IDBFactory; indexedDB: IDBFactory; SpeechRecognition: any; webkitSpeechRecognition: any; } interface Navigator { webkitGetUserMedia: () => void; mozGetUserMedia: () => void; msGetUserMedia: () => void; getUserMedia: () => void; } } type Redirect = 'follow' | 'error' | 'manual'; type Cache = 'default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache'; type Mode = 'cors' | 'no-cors' | 'same-origin' | 'navigate'; type ResponseType = 'formData' | 'text' | 'blob' | 'arrayBuffer' | 'json'; type BodyType = 'form' | 'json' | 'file'; type Method = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS'; type Credentials = 'omit' | 'include' | 'same-origin'; interface IFetchInterceptors { request?: { success?: (config: IFetchConfig) => IFetchConfig; error?: (error: any) => Promise; }; response?: { success?: (response: any) => any; error?: (error: any) => Promise; }; success?: (response: Response) => Response; error?: (error: any) => Promise; } interface IFetchConfig extends IFetchOptions { url?: string; keepalive?: boolean; body?: any; retry?: number; integrity?: string; referrer?: string; referrerPolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'unsafe-url' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'same-origin'; method?: Method; credentials?: Credentials; params?: Record; responseType?: ResponseType; bodyType?: BodyType; cache?: Cache; redirect?: Redirect; mode?: Mode; signal?: AbortSignal; cancel?: () => void; transformResponse?: (response: Response) => Response; } interface IFetchOptions { baseURL?: string; timeout?: number; headers?: Record; interceptors?: IFetchInterceptors; } interface DeviceType { os: string; dev: string; } type TrimType = 'all' | 'pre' | 'around' | 'post'; interface EventBus { data: Record; emit: (event: string, data?: any) => void; on: (event: string, fn: (data?: any) => void) => void; off: (event: string, fn: Function) => void; } interface Position { x: number; y: number; } type FileType = 'file' | 'blob' | 'url'; interface JSCookie { get: (key: string) => string | undefined; set: (key: string, value: string, extdays?: number) => void; delete: (key: string) => void; } interface LRU { set: (key: string, value: any) => void; get: (key: string) => any; cache: Map; max: number; size: () => number; } interface ISignature { canvas: HTMLCanvasElement; ctx: CanvasRenderingContext2D; createCanvas: (lineWidth: number, w: number, h: number) => void; clearCanvas: () => void; mount: (el: MaybeElement) => void; unmount: () => void; setColor: (color: string) => void; setBgColor: (bg: string) => void; undo: () => void; redo: () => void; save: (type?: string, quality?: any) => string; } interface FileMD5 { HASH: string; suffix: string; filename: string; buffer: ArrayBuffer; } interface FileChunk { file: Blob; filename: string; } type ChunkDetail = ChunkInfo & { isDone: boolean; remaining: number; type: string; size: number; lastModified: number; }; interface ChunkInfo { start: number; end: number; index: number; hash: string; } interface FileSpliceOptions { file: File; chunkSize?: number; callback?: (chunk: ChunkDetail) => void; workerUrl?: string | URL; } interface Deadline { timeRemaining: () => number; didTimeout: boolean; } interface DragEvent { dragStart?: (e: any) => void; dragMove?: (e: any) => void; dragEnd?: (e: any) => void; } interface MutationObserverInit { childList?: boolean; attributes?: boolean; characterData?: boolean; subtree?: boolean; attributeOldValue?: boolean; characterDataOldValue?: boolean; attributeFilter?: string[]; } interface ParsedURL { protocol?: string; host?: string; auth?: string; pathname: string; hash: string; search: string; } interface IShellMessage { status: number | null; result: string; pid: number; } type PkgTool = 'npm' | 'yarn' | 'pnpm' | 'bun'; type Keys = keyof A | keyof B; type Val = key extends keyof A ? key extends keyof B ? A[key] extends number | string | boolean | symbol | null | undefined ? A[key] | B[key] : Merge : A[key] : key extends keyof B ? B[key] : never; type Merge = { [key in Keys]: Val }; interface IsESModule { default: any; } interface NodeWorkerPayload { params: string | string[]; stdio?: 'inherit' | 'pipe'; errorExit?: boolean; isLog?: boolean; } type UseTimeoutReturn = T extends Function ? () => void : undefined; type MaybeElement = string | HTMLElement; type Lang = 'zh-CN' | 'en-US' | 'ja-JP' | 'ko-KR' | 'zh-TW' | 'zh-HK' | 'zh-MO' | 'zh-SG'; type Direction = 'horizontal' | 'horizontal-reverse' | 'vertical' | 'vertical-reverse' | 'center-out' | 'out-center'; type TimeUnit = 'days' | 'hours' | 'minutes' | 'seconds'; type DateString = `${number}-${number}-${number}` | `${number}/${number}/${number}`; interface ImageData { width: number; height: number; data: Uint8ClampedArray; } interface DotTextCanvasOptions { text: string; fontSize: number; color: string; fontWeight: number; direction?: Direction; isPreferred?: boolean; charSpacing?: number; charSpacings?: number[]; } interface DotImageCanvasOptions { src: string; color: string; fontWeight: number; bgColor?: string; direction?: Direction; isPreferred?: boolean; } type ComparisonOperator = '>' | '<' | '=' | '==' | '>=' | '<=' | '!=' | '!=='; //#endregion export { BodyType, Cache, ChunkDetail, ChunkInfo, ComparisonOperator, Credentials, DateString, Deadline, DeviceType, Direction, DotImageCanvasOptions, DotTextCanvasOptions, DragEvent, EventBus, FileChunk, FileMD5, FileSpliceOptions, FileType, IFetchConfig, IFetchInterceptors, IFetchOptions, IShellMessage, ISignature, ImageData, IsESModule, JSCookie, LRU, Lang, MaybeElement, Merge, Method, Mode, MutationObserverInit, NodeWorkerPayload, ParsedURL, PkgTool, Position, Redirect, ResponseType, TimeUnit, TrimType, UseTimeoutReturn };