Trevixal API
    Preparing search index...

    Interface CodeLanguageSelectOptions

    interface CodeLanguageSelectOptions {
        blockOptions?: boolean;
        canRun?: (language: string | null) => boolean;
        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,
            language: string | null,
        ) => boolean | Promise<boolean>;
        onRun?: () => void;
        plainLabel?: string;
    }
    Index
    blockOptions?: boolean

    Add the block's options to the bar: numbered lines, wrapped lines, a folded block, lines picked out and a title. The block's attributes hold them; a host draws them (codeBlockLines in extension-code-highlight).

    canRun?: (language: string | null) => boolean
    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, language: string | null) => 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. The block's language comes too, for a copy that depends on it (a terminal session's leaves its prompts out).

    onRun?: () => void

    Run the block's code. With this, a Run button shows on the blocks canRun accepts, by their language.

    plainLabel?: string

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