Reference·JavaScript · @bimworks/dsleditorJavaScript

DslEditorOptions

Interface in @bimworks/dsleditor.

API catalogue · @bimworks/dsleditor · Interface

TypeScript#
interface DslEditorOptions

Members#

Member Kind Description
address Property 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 Property The accessible name; default " editor".
autoHeight Property 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.
clientIdentity Property What the editor's requests say the client is (the X-BIMworks-Client header): the identity of the page's BIM.works client (clientFactory.getClientIdentity()…
fetch Property The fetch to use for the language services, e.g. to add headers or route through the application's backend.
language Property The language; default "bql".
lineNumbers Property false hides the line numbers.
models Property 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 se…
monacoOptions Property Further Monaco editor options (IStandaloneEditorConstructionOptions), applied over the defaults.
onChange Property After every change of the text.
onError Property When a request to the language services fails. Without it, the first failure is logged with console.warn.
onStatus Property Whenever the status changes.
placeholder Property Shown while the editor is empty.
readOnly Property
theme Property "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 …
token Property 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 Property The initial text.

address#

TypeScript#
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#

TypeScript#
ariaLabel?: string

The accessible name; default " editor".

autoHeight#

TypeScript#
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.

clientIdentity#

TypeScript#
clientIdentity?: { header: () => string; withPart?: (name: string, version?: string | null) => { header: () => string } }

What the editor's requests say the client is (the X-BIMworks-Client header): the identity of the page's BIM.works client (clientFactory.getClientIdentity() of @sascom/jsclient), which then names the editor in its parts. Without it the editor sends its own (sdk="dsleditor").

fetch#

TypeScript#
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#

TypeScript#
language?: DslLanguage

The language; default "bql".

lineNumbers#

TypeScript#
lineNumbers?: boolean

false hides the line numbers.

models#

TypeScript#
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#

TypeScript#
monacoOptions?: Record<string, unknown>

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

onChange#

TypeScript#
onChange?: (value: string) => void

After every change of the text.

onError#

TypeScript#
onError?: (error: DslServiceError) => void

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

onStatus#

TypeScript#
onStatus?: (status: DslEditorStatus) => void

Whenever the status changes.

placeholder#

TypeScript#
placeholder?: string

Shown while the editor is empty.

readOnly#

TypeScript#
readOnly?: boolean

theme#

TypeScript#
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#

TypeScript#
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#

TypeScript#
value?: string

The initial text.