import type { Slider } from '../index.js'; import type { Effect } from './program.js'; import type { Hook } from '../canvas.js'; /** A media element: an image or a film. */ export type Media = HTMLImageElement & HTMLVideoElement; /** * @param options Options. * @param options.effects Effects, in * the order they apply. * @param options.maxSize Largest side of a texture, px. * @param options.density Most device pixels per px drawn. * @param options.perspective Distance of the eye for meshes * that bend, px. * @param options.eager Make the canvas with the slider, * not at the first sign of use. * @param options.preserve Keep the drawing readable, for * tests and screenshots. * @param options.hooks Functions that are called with * every quad before it is drawn, * before `change`: a set that the * page may fill and empty while the * layer draws. `canvas()` has * `draw()` for it. */ export declare function gl({ effects, maxSize, density, perspective, eager, preserve, hooks, }?: { effects?: Effect[]; maxSize?: number; density?: number; perspective?: number; eager?: boolean; preserve?: boolean; hooks?: Set; }): (slider: Slider) => { name: string; /** Makes a layer of this kind, for another slider. */ again: typeof gl; /** The canvas, while the layer draws. */ readonly canvas: HTMLCanvasElement | null; /** * Called with every slide of a row before it is drawn, with its * index and its quad: `x`, `y`, `w`, `h` in px of the view, * `a` (numbers of `fit()`), `radius`, `shape` and `speed`, which is * added to the speed of the slider; `fx`, how much the effects * do, 0 to 1; `dim`, what its colour is multiplied by; `clip`, * whether it stays in the view; `p`, the progress of the slide; * `top`, whether it is drawn over the others; and `media`, * another element to take the picture of, while its texture is * there. What it changes is drawn. */ change: Hook | null; /** * An element the canvas goes into, over the whole of it, and * draws the view where the view is: so that a slide can leave * it. Null, back in the slider. Lifted, every slide is drawn, * a stack as a row, and `change` says where. */ lift: HTMLElement | null; /** * Most device pixels per px drawn: what `density` says, until * something lowers it (see `quality()`). */ density: number; /** The post pass, when an effect has one: loaded then. */ post: ((g: WebGL2RenderingContext) => void) | null; /** * @param element Media element. * @return Whether the canvas draws it. */ shows: (element: HTMLElement) => boolean; slides: () => void; measure({ layout }: import("../index.js").View): void; frame(view: import("../index.js").View, dt: number, now: number): void; busy: () => boolean; destroy(): void; };