/** * Which slide is seen at a point of the page. * * The page takes a click where the slide is; the canvas draws the slide * where its effects put it. With effects that lay the slides out (covers * that turn away, a pile, a fan, a dome, a row that bends) the two are not * the same place: what is seen at the edge of the slider is a slide whose * place on the page is somewhere else, or out of view. * * `canvas()` brings this plugin when one of its effects moves the mesh and * says so in JS (`place`, see `gl/program.js`). With a layer by its name: * * import { gl, hit, coverflow } from 'gpuslider/gl'; * * const effects = [ coverflow() ]; * createSlider( element, { plugins: [ gl( { effects } ), hit( { effects } ) ] } ); * * Then `click` says the slide that is seen under the pointer, and the * lightbox lets the image grow out of where it is drawn. */ import type { Effect } from './gl/program.js'; import type { Slider } from './index.js'; /** * @param options The options of the canvas. * @param options.effects Its * effects. * @param options.perspective Distance of the eye, px. */ export declare function hit({ effects, perspective }?: { effects?: Effect[]; perspective?: number; }): (slider: Slider) => { name: string; /** * @param x On the page, as `clientX` of an event. * @param y As `clientY`. * @return The slide that is seen there, -1 * for none; nothing when the page * draws the slides. */ at(x: number, y: number): number | undefined; /** * Where the pointer is in a quad as it is drawn: the layers ask * for their effects that follow the pointer. * * @param x Where the page has the quad, in the * root. * @param y The same from the top. * @param w Its width. * @param h Its height. * @param progress How far its slide is from its place. * @param pointer The * pointer in the root. * @return Across and down, 0 to 1 in the * quad and past that out of it; nothing * while no pointer is there. */ uv(x: number, y: number, w: number, h: number, progress: number, pointer: { x: number; y: number; in: number; }): number[] | undefined; /** * @param i Slide. * What is around the slide as it is drawn, on the page; * null when the canvas does not draw it. */ where(i: number): { left: number; top: number; width: number; height: number; } | null; };