Trevixal API
    Preparing search index...

    Interface CodeLanguageSelectOptions

    interface CodeLanguageSelectOptions {
        container?: HTMLElement;
        copyLabels?: { copied?: string; failed?: string; idle?: string };
        detect?: (code: string) => string | null;
        hint?: string | false;
        languages: readonly CodeLanguageOption[];
        nodeName?: string;
        onCopy?: (code: string) => boolean | Promise<boolean>;
        plainLabel?: string;
    }
    Index
    container?: HTMLElement

    Where the floating control is appended. Defaults to the view's parent, which must be a positioned ancestor of the surface.

    copyLabels?: { copied?: string; failed?: string; idle?: string }

    Labels for the copy button, overridable for localization.

    detect?: (code: string) => string | null

    Guess the language of a block that names none, from its text. Supply detectLanguage from @trevixal/extension-code-highlight; keeping it an option means this package needs no dependency on that one.

    The guess is shown as a suggestion. The block's own attribute always wins, and nothing is written to the document until the user picks.

    hint?: string | false

    The keyboard hint shown beside the picker: by default, that Enter adds a line and Mod-Enter leaves the block. A string replaces it; false drops it. Hidden on its own over a block too narrow to hold it.

    languages: readonly CodeLanguageOption[]
    nodeName?: string

    Node type carrying the language attribute (default "codeBlock").

    onCopy?: (code: string) => boolean | Promise<boolean>

    Copy the block's code. Supplying this adds a Copy button to the bar; it reports "Copied" or "Failed" for a moment from the returned result.

    plainLabel?: string

    Label for the "no highlighting" entry (default "Plain text").