/* @ts-self-types="./index.d.ts" */ import { Accessor } from "solid-js"; /** * Non-reactive fullscreen helper. No Solid lifecycle dependency. * * @param element The element to make fullscreen. * @param options Standard `FullscreenOptions`. * @returns `[enter, exit]` — `enter()` requests fullscreen, `exit()` leaves it. * Options passed to `enter()` override the creation-time options. * * @example * ```ts * const [enter, exit] = makeFullscreen(ref); * button.addEventListener("click", enter); * ``` */ export declare const makeFullscreen: (element: HTMLElement, options?: FullscreenOptions) => [enter: (options?: FullscreenOptions) => Promise, exit: () => Promise]; export interface FullscreenPrimitiveOptions extends FullscreenOptions { /** Exit fullscreen when the reactive scope is disposed. Default: `true`. */ exitOnCleanup?: boolean; } /** * Reactive fullscreen primitive. Call `enter()` and `exit()` imperatively * from user gesture handlers — the browser requires a direct user interaction * to allow fullscreen. `isActive` tracks the real fullscreen state via the * `fullscreenchange` event and initializes to `true` if the element is already * fullscreen when the primitive is created. * * @param ref The element to fullscreen, or a reactive accessor returning one. * @param options Extends `FullscreenOptions` with `exitOnCleanup` (default `true`). * @returns `{ enter, exit, isActive }` * * @example * ```tsx * const { enter, exit, isActive } = createFullscreen(ref); * * * * * * ``` */ export declare const createFullscreen: (ref: HTMLElement | Accessor, options?: FullscreenPrimitiveOptions) => { enter: (options?: FullscreenOptions) => Promise; exit: () => Promise; isActive: Accessor; }; /** * Ref directive that toggles fullscreen when the element is clicked. * Attach to any element — clicking it enters fullscreen; clicking again exits. * * @example * ```tsx *
Click to go fullscreen
*
Click to go fullscreen
* ``` */ export declare const fullscreen: (options?: FullscreenOptions) => ((el: HTMLElement) => void);