iya-sts
    Preparing search index...

    Class export=

    A realm's sign-in appearance. A static utility class; its one store is declared above.

    Index
    AA_CONTRAST: 4.5 = AA_CONTRAST
    DEFAULTS: Readonly<
        {
            accent: "#12107c";
            bad: "#b00020";
            border: "#d5d5dd";
            card: "#ffffff";
            dim: "#555555";
            faint: "#777777";
            good: "#0b6b4f";
            muted: "#666666";
            onAccent: "#ffffff";
            page: "#f4f4f7";
            rule: "#eeeeee";
            text: "#222222";
            tint: "#fafafd";
            tint2: "#f0f0f5";
        },
    > = DEFAULTS
    LAYOUTS: string[] = LAYOUTS
    PATHS: Readonly<
        {
            logo: "/web/branding/logo";
            preview: "/web/branding/preview";
            theme: "/web/theme.css";
        },
    > = PATHS
    • The audit row of a logo's upload or removal.

      Parameters

      • summary: string

        what happened

      • Optionalactor: string

        who did it

      Returns void

    • A #rrggbb colour's channels, 0–255.

      Parameters

      • hex: string

        the colour

      Returns number[]

      [r, g, b], or null when it is not one

    • The contrast ratio of two colours.

      Parameters

      • a: string

        #rrggbb

      • b: string

        #rrggbb

      Returns number

      1 to 21

    • What is wrong with a set of colours under AA (D3), each a sentence; none when it passes.

      Parameters

      • set: Record<string, string>

        accent, card and text

      Returns string[]

      the problems

    • The ambient realm's appearance as the console and GET /admin-api/branding show it: the settings, the derived tones, the contrast results and the logo.

      Returns any

      the description

    • A stored logo as an answer shows it: never the bytes.

      Parameters

      • record: any

        the stored record

      Returns any

      its type, sides, size, digest, address and when it was set

    • The brand header's markup: the logo (a link where one is set) and the name, each escaped; empty where there is neither. The runtime draws the same markup from the shell's attributes (web_surface.ts).

      Parameters

      • facts: any

        name, logo (an address), alt and link

      Returns string

      the markup

    • Whether a text is an absolute https URL.

      Parameters

      • text: string

        the text

      Returns boolean

      true when it is

    • A JPEG's width and height, from its first start-of-frame segment.

      Parameters

      • b: Buffer

        the bytes, starting with the SOI marker

      Returns number[]

      [width, height], [0, 0] where none was found

    • The ambient realm's stored logo, or null.

      Returns any

      the record

    • A colour's relative luminance.

      Parameters

      • hex: string

        #rrggbb

      Returns number

      0 (black) to 1 (white)

    • Two colours mixed: t of the way from a to b.

      Parameters

      • a: string

        #rrggbb

      • b: string

        #rrggbb

      • t: number

        0 (all a) to 1 (all b)

      Returns string

      #rrggbb

    • Every colour a page reads, the four set and the ten derived.

      Parameters

      • set: Record<string, string>

        accent, page, card and text

      Returns Record<string, string>

      the fourteen, by custom property name without its --sts- prefix

    • The preview page's markup.

      Parameters

      • pending: Record<string, string>

        the checked pending values

      Returns string

      the document

    • Checks a preview's values as the settings would, without writing them.

      Parameters

      • query: any

        accent, page, card, text and layout, each optional

      Returns any

      { ok, errors, pending }

    • The text colour mixed toward the card as far as t goes while it keeps AA contrast against the card — a quieter tone that is still readable.

      Parameters

      • text: string

        the text colour

      • card: string

        the card colour

      • t: number

        how far toward the card it would like to go

      Returns string

      #rrggbb

    • Of several colours, the first with AA contrast against a background, or the one with the most where none has it.

      Parameters

      • choices: string[]

        #rrggbb colours, preferred first

      • background: string

        the background

      Returns string

      the chosen colour

    • Registers GET /web/theme.css, GET /web/branding/logo and GET /web/branding/preview; common/protocol_stack.ts calls it.

      Parameters

      • app: any

        the shared express app

      Returns void

    • Removes the ambient realm's logo. Its alternative text stays, so a logo uploaded again needs none sent.

      Parameters

      • Optionalactor: string

        who removed it, for the audit row

      Returns any

      { ok, removed }

    • Sets several appearance settings at once, judged together so that a pair of colours that is legal only together is (withWriteBatch()). Only branding.* keys are taken.

      Parameters

      • values: any

        raw values by setting key

      Returns any

      { ok, errors }; nothing is written when any is refused

    • Checks and stores the ambient realm's logo, and its alternative text when one is given.

      Parameters

      • bytes: Buffer

        the image

      • Optionaloptions: any

        alt (written to branding.logoAlt when given) and actor, for the audit row

      Returns any

      { ok, errors, status, logo }, a refusal marked with its code

    • A setting's value in the ambient realm, or fallback where it cannot be read (a process loading this file before the rows exist).

      Parameters

      • key: string

        the setting

      • fallback: unknown

        what to answer instead

      Returns unknown

      the value

    • The <html> attributes a shell carries for the ambient realm's appearance, and the stylesheet it links after the card's: nothing at all for a realm that has set nothing, so its shell is the one it always was.

      Returns { attributes: [string, string][]; stylesheet: string }

      { attributes, stylesheet }

    • What an image's bytes are and how large it draws: PNG, JPEG or WebP, read from the bytes alone, whatever was declared.

      Parameters

      • bytes: Buffer

        the image

      Returns { height: number; type: string; width: number }

      { type, width, height }; type empty when it is none of the three, the sides 0 when they could not be read

    • The ambient realm's appearance, or the one given by pending (a preview's values, already checked) over it.

      Parameters

      • Optionalpending: Record<string, string>

        colours and a layout to use in place of the realm's

      Returns Theme

      the theme

    • Refuses a colour that would leave the text or the accent below AA against the card (STS-AUTHN-0544), a logo's alternative text emptied while a logo is held (STS-AUTHN-0548), and a logo link that is not an absolute https URL (STS-AUTHN-0551).

      Parameters

      • key: string

        the setting being written

      • parsed: unknown

        its parsed value

      • OptionalinRealm: boolean

        unused; the rules hold in a realm as in the process

      • Optionalbeside: (key: string) => unknown

        another setting's value as this write leaves it

      Returns any

      { problem, code }, or null

    • Writes one setting in the ambient realm: the process's override in the default realm, the realm's own elsewhere — the choice every console page that writes a setting makes.

      Parameters

      • key: string

        the setting

      • raw: string

        its value as text

      Returns any

      { ok, errors }, a refusal marked with its code