DslEditorOptions
Interface in @bimworks/dsleditor.
API catalogue · @bimworks/dsleditor · Interface
interface DslEditorOptionsMembers#
| 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#
address: stringThe 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#
ariaLabel?: stringThe accessible name; default "
autoHeight#
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#
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#
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#
language?: DslLanguageThe language; default "bql".
lineNumbers#
lineNumbers?: booleanfalse hides the line numbers.
models#
models?: (string)[] | () => (string)[] | null | undefined | nullThe 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#
monacoOptions?: Record<string, unknown>Further Monaco editor options (IStandaloneEditorConstructionOptions), applied over the defaults.
onChange#
onChange?: (value: string) => voidAfter every change of the text.
onError#
onError?: (error: DslServiceError) => voidWhen a request to the language services fails. Without it, the first failure is logged with console.warn.
onStatus#
onStatus?: (status: DslEditorStatus) => voidWhenever the status changes.
placeholder#
placeholder?: stringShown while the editor is empty.
readOnly#
readOnly?: booleantheme#
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#
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#
value?: stringThe initial text.