/** A static class that provides pure functions */ /** * Used to explicitly reset something to default value * if there's ambiguity between previous value and default value */ export declare const DEFAULT: unique symbol; export default class Util { static DEBUG: boolean; /** * Converts 2-D coordinates to their corresponding index in a 1-D array representation * @param x - The x coordinate * @param y - The y coordinate * @param gridHeight - The width of the 2-D representation (the grid height) * @returns The corresponding index */ static coordToIndex(x: number, y: number, gridHeight: number): number; /** * Converts a 1-D array index into an (x, y) coordinate in its corresponding 2-D representation * @param index - the 1D array index * @param gridHeight - The width of the 2-D representation (the grid height) * @returns - The corresponding x and y coordinates */ static indexToCoord(index: number, gridHeight: number): [x: number, y: number]; /** * Draws a rounded rectangle * Adapted from https://stackoverflow.com/a/3368118/2234742 * @param ctx - The canvas context to draw on * @param x - The x coordinate at which to draw the rounded rectangle * @param y - The y coordinate at which to draw the rounded rectangle * @param width - The width of the rounded rectangle to draw * @param height - The height of the rounded rectangle to draw * @param radius - The border radius of the rounded rectangle * @param fill - Whether the rectangle should be filled * @param stroke - Whether the rectangle should be stroked */ static drawRoundedRectangle(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius?: number, fill?: boolean, stroke?: boolean): void; private static devicePixelRatio; /** * Gets the current devicePixelRatio in a performant way * @returns The device pixel ratio */ static getDevicePixelRatio(): number; }