UNPKG

native-fn

Version:
34 lines (29 loc) 1.07 kB
declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> { installed: boolean; name: Key; module: Module; Constants: Constants; Errors: Errors; } declare interface FullscreenInstance { enabled: boolean; element: any; isFullscreen: boolean; request(target?: any, options?: FullscreenOptions): Promise<void>; exit(): Promise<void>; toggle(target?: any, options?: FullscreenOptions): Promise<void>; onchange(handler: (event: Event) => void): () => void; onerror(handler: (event: Event) => void): () => void; } declare module 'native-fn' { interface NativePlugins { Fullscreen: FullscreenInstance; } interface NativeConstants { } interface NativeErrors { } } declare const NativeFullscreenPlugin: NativePlugin<'Fullscreen', FullscreenInstance, {}, {}>; export { NativeFullscreenPlugin as default }; export type { FullscreenInstance };