import { Diagnostic } from "@siteimprove/alfa-act"; import type { CSS4Color } from "@siteimprove/alfa-css"; import type { Equatable } from "@siteimprove/alfa-equatable"; import type { Serializable } from "@siteimprove/alfa-json"; import type { Node } from "@siteimprove/alfa-dom"; import type { Comparable } from "@siteimprove/alfa-comparable"; import { Comparison } from "@siteimprove/alfa-comparable"; import type { Hash, Hashable } from "@siteimprove/alfa-hash"; import type * as json from "@siteimprove/alfa-json"; type Name = ["container", "link"] | ["foreground", "background"]; type FirstColor = N[0]; type SecondColor = N[1]; /** * @public */ export declare class Contrast extends Diagnostic { static of(message: string, threshold?: number, pairings?: Iterable>): Contrast; private readonly _threshold; private readonly _pairings; protected constructor(message: string, threshold: number, pairings: Array>); get threshold(): number; get pairings(): Iterable>; equals(value: Contrast): boolean; equals(value: unknown): value is this; hash(hash: Hash): void; toJSON(options?: Node.SerializationOptions): Contrast.JSON; } /** * @public */ export declare namespace Contrast { export interface JSON extends Diagnostic.JSON { threshold: number; pairings: Array>; } export function isContrast(value: Diagnostic): value is Contrast; export function isContrast(value: unknown): value is Contrast; export class Pairing implements Equatable, Serializable, Hashable, Comparable> { static of(color1: [FirstColor, CSS4Color], color2: [SecondColor, CSS4Color], contrast: number): Pairing; private readonly _color1; private readonly _color2; private readonly _contrast; protected constructor(color1: Color>, color2: Color>, contrast: number); hash(hash: Hash): void; get color1(): Color>; get color2(): Color>; get contrast(): number; equals(value: unknown): value is this; compare(value: Pairing): Comparison; toJSON(): Pairing.JSON; } export namespace Pairing { interface JSON { [key: string]: json.JSON; color1: Color.JSON>; color2: Color.JSON>; contrast: number; } } class Color | SecondColor> implements Equatable, Serializable, Hashable { static of | SecondColor>(name: N, value: CSS4Color): Color; private readonly _name; private readonly _value; protected constructor(name: N, value: CSS4Color); hash(hash: Hash): void; get name(): N; get value(): CSS4Color; equals(value: unknown): value is this; toJSON(): Color.JSON; } namespace Color { interface JSON | SecondColor> { [key: string]: json.JSON; name: N; value: CSS4Color.JSON; } } export {}; } export {}; //# sourceMappingURL=contrast.d.ts.map