---
title: DslEditorOptions
summary: Interface in @bimworks/dsleditor.
order: 10
languages: [javascript]
sdk-package: JavaScript · @bimworks/dsleditor
---

# DslEditorOptions

[[page:reference/javascript/api|API catalogue]] · `@bimworks/dsleditor` · Interface

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
interface DslEditorOptions
````



## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-address-b73a147f4919|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. |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-arialabel-a4b170e2ff41|ariaLabel]] | Property | The accessible name; default " editor". |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-autoheight-9592addeebeb|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. |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-clientidentity-8092add6daa2|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()`… |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-fetch-95418f341d62|fetch]] | Property | The fetch to use for the language services, e.g. to add headers or route through the application's backend. |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-language-67550703e0dd|language]] | Property | The language; default "bql". |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-linenumbers-cb66506f8247|lineNumbers]] | Property | false hides the line numbers. |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-models-76948c48642f|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… |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-monacooptions-048a883c6a7a|monacoOptions]] | Property | Further Monaco editor options (IStandaloneEditorConstructionOptions), applied over the defaults. |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-onchange-fb6caf69b18b|onChange]] | Property | After every change of the text. |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-onerror-99688869aa90|onError]] | Property | When a request to the language services fails. Without it, the first failure is logged with console.warn. |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-onstatus-a4ab73906044|onStatus]] | Property | Whenever the status changes. |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-placeholder-a542820a0f7c|placeholder]] | Property | Shown while the editor is empty. |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-readonly-c2460b61016b|readOnly]] | Property |  |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-theme-62b56b7b7bd9|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 … |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-token-4b27631d9d68|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. |
| [[page:reference/javascript/bimworks-dsleditor/dsleditoroptions-6b74dd36#member-value-8a2f919a82bc|value]] | Property | The initial text. |

## `address` {#member-address-b73a147f4919}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
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` {#member-arialabel-a4b170e2ff41}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
ariaLabel?: string
````

The accessible name; default "<language> editor".

## `autoHeight` {#member-autoheight-9592addeebeb}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
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` {#member-clientidentity-8092add6daa2}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
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` {#member-fetch-95418f341d62}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
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` {#member-language-67550703e0dd}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
language?: DslLanguage
````

The language; default "bql".

## `lineNumbers` {#member-linenumbers-cb66506f8247}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
lineNumbers?: boolean
````

false hides the line numbers.

## `models` {#member-models-76948c48642f}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
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` {#member-monacooptions-048a883c6a7a}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
monacoOptions?: Record<string, unknown>
````

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

## `onChange` {#member-onchange-fb6caf69b18b}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
onChange?: (value: string) => void
````

After every change of the text.

## `onError` {#member-onerror-99688869aa90}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
onError?: (error: DslServiceError) => void
````

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

## `onStatus` {#member-onstatus-a4ab73906044}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
onStatus?: (status: DslEditorStatus) => void
````

Whenever the status changes.

## `placeholder` {#member-placeholder-a542820a0f7c}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
placeholder?: string
````

Shown while the editor is empty.

## `readOnly` {#member-readonly-c2460b61016b}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
readOnly?: boolean
````



## `theme` {#member-theme-62b56b7b7bd9}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
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` {#member-token-4b27631d9d68}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
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` {#member-value-8a2f919a82bc}

````typescript sdk=js sdk-namespace="@bimworks/dsleditor"
value?: string
````

The initial text.
