/** * Declarative DOM scanner (#7). * * `bindPencere(selector, opts)` wires up a delegated click handler * on `document` so any link matching the selector — typically * `[data-pencere]` — opens the lightbox. Items are collected lazily * on first click from sibling links sharing a `data-gallery` group, * so consumers never hand-maintain an \`items\` array in JavaScript. * * Returns an `Unbind` function that removes the listener and * destroys any viewer it created. * * Mirrors the Fancybox / GLightbox DX with a tenth of the code. */ import type { ImageItem } from "../types.mjs"; import type { PencereViewerOptions } from "./viewer.mjs"; export interface BindOptions extends Omit, "items"> { /** * Attribute used to group links into a single gallery. Defaults * to `"data-gallery"`. Links in the same group open the same * viewer instance and can be navigated with prev/next. */ groupAttribute?: string; } export type Unbind = () => void; /** * Bind a delegated click handler that opens a pencere viewer for * any element matching `selector`. Returns an unbind function. */ export declare function bindPencere(selector: string, options?: BindOptions): Unbind;