/**
 * pacem v0.51.10-faraday (https://js.pacem.it)
 * Copyright 2025 Pacem (https://pacem.it)
 * Licensed under Apache-2.0
 */
declare namespace Pacem {
    class Arrays {
        static range(min: number, max: number, items?: number): number[];
        static chunkify(source: any[], size: number): any[][];
    }
}
declare namespace Pacem {
    class Blobs {
        static blobToDataURL(blob: Blob): Promise<string>;
        private static _b64ToUint8Array;
        static base64ToBlob(bstr: string, options?: BlobPropertyBag): Blob;
        static dataURLToBlob(dataurl: string): Blob;
        static blobToText(blob: Blob, encoding?: string): Promise<string>;
        static textToBlob(content: string, type?: string): Blob;
    }
}
declare namespace Pacem.Browsers {
    function detect(userAgent?: string): {
        name: string;
        version: any;
    };
}
declare namespace Pacem {
    interface Rgba {
        readonly r: number;
        readonly g: number;
        readonly b: number;
        a?: number;
    }
    interface Hsla {
        readonly h: number;
        readonly s: number;
        readonly l: number;
        a?: number;
    }
    interface CieXYZ {
        readonly x: number;
        readonly y: number;
        readonly z: number;
        a?: number;
    }
    class Colors {
        static WCAG_MINIMUM_CONTRAST: number;
        static WCAG_NORMAL_TEXT_CONTRAST: number;
        static WCAG_SAFE_CONTRAST: number;
        private static _clampRGB;
        private static _normalize;
        static parse(clr: string): Rgba;
        static hsl(rgb: Rgba): Hsla;
        static cieXYZ(rgb: Rgba): CieXYZ;
        static cieXYZ(hsl: Hsla): CieXYZ;
        static rgb(hsl: Hsla): Rgba;
        static rgb(cieXYZ: CieXYZ): Rgba;
        static stringify(hsl: Hsla, precision?: number): string;
        static stringify(rgb: Rgba, hex?: boolean): string;
        static contrastRatio(clr1: Rgba | Hsla, clr2: Rgba | Hsla): number;
        static luminance(clr: Rgba | Hsla): number;
        static lighten(rgb: Rgba, amount?: number): Rgba;
        static lighten(rgb: Hsla, amount?: number): Hsla;
        static darken(rgb: Rgba, amount?: number): Rgba;
        static darken(rgb: Hsla, amount?: number): Hsla;
        static saturate(rgb: Rgba, amount?: number): Rgba;
        static saturate(rgb: Hsla, amount?: number): Hsla;
        static desaturate(rgb: Rgba, amount?: number): Rgba;
        static desaturate(rgb: Hsla, amount?: number): Hsla;
        static interpolate(rgb1: Rgba, rgb2: Rgba, weight1?: number, weight2?: number): Rgba;
        static interpolate(hsl1: Hsla, hsl2: Hsla, weight1?: number, weight2?: number): Hsla;
        static interpolate(cieXYZ1: CieXYZ, cieXYZ2: CieXYZ, weight1?: number, weight2?: number): CieXYZ;
    }
}
declare namespace Pacem {
    class Dates {
        static parse(input: string | Date | number): Date;
        static isLeapYear(year: number): boolean;
        static daysInMonth(year: number, month: number): number;
        static isDate(date: any): date is Date;
        static dateOnly(datetime: Date): Date;
        static addMonths(input: Date, value: number): Date;
        static addDays(input: Date, value: number): Date;
        static daysBetween(start: Date, end: Date): number;
    }
}
declare namespace Pacem {
    interface Point {
        x: number;
        y: number;
    }
    interface Size {
        width: number;
        height: number;
    }
    interface Rect extends Point, Size {
    }
    interface Angle {
        vertex: Point;
        start: Point;
        end: Point;
    }
    function parseAsNumericalArray(input: string): number[];
    class Angle {
        static isAngle(obj: any): obj is Angle;
        static value(angle: Angle): number;
        static angleBetween(vertex: Point, start: Point, end: Point): number;
    }
    class Size {
        static parse(sz: string): Size;
        static isSize(obj: any): obj is Size;
    }
    class Point {
        static parse(pt: string): Point;
        static isPoint(obj: any): obj is Point;
        static distance(p1: Point, p2: Point): number;
        static subtract(p: Point, from: Point): Point;
        static add(...points: Point[]): Point;
        static multiply(p: Point, f: number): Point;
    }
    class Rect {
        static parse(rect: string): Rect;
        static isRect(obj: any): obj is Rect;
        private static _stretch;
        private static _contain;
        private static _cover;
        private static _align;
        static findTransform(a: Rect, b: Rect, mode?: 'contain' | 'cover' | 'stretch', align?: 'left' | 'center' | 'right', valign?: 'top' | 'middle' | 'bottom'): Matrix2D;
        static intersect(...rects: Rect[]): Rect;
        static expand(...points: Point[]): Rect;
        static expand(rect: Rect, ...points: Point[]): Rect;
    }
}
declare namespace Pacem {
    class HistoryService<TState = any> {
        #private;
        constructor(state: TState, maxlength?: number);
        get current(): TState;
        get canUndo(): boolean;
        get canRedo(): boolean;
        set maxlength(v: number);
        undo(): void;
        redo(): void;
        push(state: TState): void;
        reset(): void;
    }
}
declare namespace Pacem {
    type ImagingResizeOptions = {
        mode?: 'contain' | 'cover' | 'stretch';
        align?: 'left' | 'center' | 'right';
        valign?: 'top' | 'middle' | 'bottom';
        quality?: number;
        type?: string;
        background?: string;
    };
    class Imaging {
        static loadImage(url: string): Promise<Blob>;
        static resizeImage(img: Blob, width: number, height: number, options?: ImagingResizeOptions): Promise<Blob>;
        static resizeImage(img: string, width: number, height: number, options?: ImagingResizeOptions): Promise<Blob>;
    }
}
declare namespace Pacem {
    class Keys {
        #private;
        static uniqueId(): number;
        static uniqueCode(): string;
        static randomString(length: number): string;
    }
}
declare namespace Pacem {
    interface Matrix2D {
        readonly a: number;
        readonly b: number;
        readonly c: number;
        readonly d: number;
        readonly e: number;
        readonly f: number;
    }
    class Matrix2D {
        static isIdentity(m: Matrix2D): boolean;
        static get identity(): Matrix2D;
        static copy(m: Matrix2D): Matrix2D;
        static scale(m: Matrix2D, s: number): Matrix2D;
        static scale(m: Matrix2D, sx: number, sy: number): Matrix2D;
        static translate(m: Matrix2D, t: Point): Matrix2D;
        static rotate(m: Matrix2D, rad: number): Matrix2D;
        static multiply(m: Matrix2D, f: number): Matrix2D;
        static multiply(p: Point, m: Matrix2D): Point;
        static multiply(m1: Matrix2D, m2: Matrix2D): Matrix2D;
        static det(m: Matrix2D): number;
        static invert(m: Matrix2D): Matrix2D;
        static toComponents(m: Matrix2D, transformOrigin?: Point): {
            scaleX: number;
            scaleY: number;
            rotation: number;
            translation: Point;
        };
    }
}
declare namespace Pacem {
    class NullChecker {
        static isNull(o: any): o is null | undefined;
        static isEmpty(o: any): boolean;
        static isNullOrEmpty(o: any): boolean;
    }
}
declare interface Number {
    isCloseTo(other: number, precision?: number): boolean;
    roundoff(precision?: number): number;
    clamp(min: number, max: number): any;
    toBase62(): string;
    toBase36(): string;
}
declare namespace Pacem {
    class Numbers {
        static round(x: number, step?: number): number;
        static log(x: number, base: number): number;
        static rebase(v: number | string, from: number, to: number): string;
    }
}
declare namespace Pacem {
    type DiffMode = 'char' | 'word' | 'line';
    type DiffTokenType = '=' | '-' | '+';
    type DiffToken = {
        type: DiffTokenType;
        value: string;
    };
    class Strings {
        static leftPad(v: any, targetLength: number, padChar: string): any;
        static format(template: string, ...args: any[]): string;
        static diff(a: string, b: string, mode?: DiffMode): DiffToken[];
    }
}
declare namespace Pacem.Compile {
    interface Rule {
        exec: (input: string, lexer?: Lexer) => Token[];
    }
    interface Token {
        readonly index?: number;
        readonly type: string;
        readonly raw: string;
        readonly text: string;
        readonly tokens?: Token[];
    }
    interface Lexer {
        tokenize(input: string, grammar: Rule[]): Token[];
    }
    interface Renderer {
        render: (tree: Token[]) => string;
    }
    class Parser {
        private _lexer;
        constructor(_lexer?: Lexer);
        parse(input: string, grammar: Rule[], renderer: Renderer): string;
    }
}
declare namespace Pacem.Compile.Markdown {
    type ExtraRule = (Rule | {
        rule: Rule;
        type: 'block' | 'inline';
    } | {
        rule: Rule;
        type: 'code';
        lang: string;
    });
    class Parser extends Pacem.Compile.Parser {
        toHtml(input: string, extraGrammar?: ExtraRule[], extraItemRenderer?: (token: Token, allTokens: Token[]) => string): string;
        tokenize(input: string, extraGrammar?: ExtraRule[]): any[];
        parse(input: string): string;
        parse(input: string, renderer: Pacem.Compile.Renderer): string;
        parse(input: string, grammar: Rule[]): string;
        parse(input: string, grammar: Rule[], renderer: Pacem.Compile.Renderer): string;
    }
}
