import { QRCode } from "jsqr"; import { Point } from "./utils"; export declare class AnchorLocation { topLeftCorner: Point; topRightCorner: Point; bottomLeftCorner: Point; bottomRightCorner: Point; constructor(topLeftCorner: Point, topRightCorner: Point, bottomLeftCorner: Point, bottomRightCorner: Point); getRect(): [number, number, number, number]; } export declare class Anchor { data: string; location: AnchorLocation; orientation: number; size: number; canvas?: HTMLCanvasElement; color: string; constructor(qrCode: QRCode, x: number, y: number, canvas?: HTMLCanvasElement, color?: string); /** * Draws the QR Code on the provided canvas element. * * This method draws the bounding rectangle of the QR Code and places its content above it. */ drawQRCode(): void; /** * Creates an AnchorPath based on the given points relative to the QR Code. * * The points are first translated by the top-left corner of the QR Code and then rotated according to the QR Code's orientation. * * @param {...[number, number][]} points - An array of points represented as [x, y] pairs. * @returns {AnchorPath} A new instance of AnchorPath with the specified points, color, and canvas. */ anchorPath(...points: [number, number][]): AnchorPath; anchorRect(topLeft: [number, number], bottomRight: [number, number]): AnchorPath; } export type DrawOptions = { detectGray: boolean; grayThreshold: number; }; export type DrawResult = { grayRatio?: number; grayAverage?: number; }; export declare class AnchorPath { path: Point[]; color: string; canvas?: HTMLCanvasElement; constructor(path: Point[], color: string, canvas?: HTMLCanvasElement); /** * Draws the path defined by the points on the canvas. * * If no points are present, the function does nothing. * The path is drawn using a dashed line with a specified stroke width. */ draw(options?: Partial): DrawResult; }