BIM.works SDKs - v3.0.0-b.115
    Preparing search index...

    Interface DslEditorOptions

    interface DslEditorOptions {
        address: string;
        ariaLabel?: string;
        autoHeight?: boolean | { maxLines?: number; minLines?: number };
        fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
        language?: DslLanguage;
        lineNumbers?: boolean;
        models?: string[] | (() => string[] | null | undefined) | null;
        monacoOptions?: Record<string, unknown>;
        onChange?: (value: string) => void;
        onError?: (error: DslServiceError) => void;
        onStatus?: (status: DslEditorStatus) => void;
        placeholder?: string;
        readOnly?: boolean;
        theme?: string;
        token?: DslToken | (() => DslToken | Promise<DslToken>);
        value?: string;
    }
    Index

    Properties

    address: string

    The BIM.works instance, e.g. "https://my.bim.works". A relative address ("/") is resolved against the page, for an application that proxies the instance.

    ariaLabel?: string

    The accessible name; default " editor".

    autoHeight?: boolean | { maxLines?: number; minLines?: number }

    Grow with the text between minLines and maxLines (default: true, 3 to 30 lines), or false to fill the container, which then needs a height.

    fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

    The fetch to use for the language services, e.g. to add headers or route through the application's backend.

    language?: DslLanguage

    The language; default "bql".

    lineNumbers?: boolean

    false hides the line numbers.

    models?: string[] | (() => string[] | null | undefined) | null

    The version uuids of the models the text is written for, or a function giving them (asked at every completion). Completion then also proposes the property set, property, quantity set and quantity names those models use, as far as the token may read them; at most 50 count.

    monacoOptions?: Record<string, unknown>

    Further Monaco editor options (IStandaloneEditorConstructionOptions), applied over the defaults.

    onChange?: (value: string) => void

    After every change of the text.

    onError?: (error: DslServiceError) => void

    When a request to the language services fails. Without it, the first failure is logged with console.warn.

    onStatus?: (status: DslEditorStatus) => void

    Whenever the status changes.

    placeholder?: string

    Shown while the editor is empty.

    readOnly?: boolean
    theme?: string

    "light" (default) or "dark", or a theme defined on getMonaco(). Monaco has one theme per page, so this sets it for every editor on the page; leave it out to keep the page's current theme.

    token?: DslToken | (() => DslToken | Promise<DslToken>)

    The token, or a function giving it (or a promise of it). A function is asked before every request, so a refreshed token is picked up.

    value?: string

    The initial text.