NabuInit
The options of an editor: the extensions to load, an initial snapshot, files, placeholders, readonly, language, Tab behaviour, keymap and
command confirmation. Accepted by new Nabu(init), by createEditor and the preset factories, and by createPersistedEditor.
Related guide: Your first editor →
Definition
import type { NabuInit } from '@aionbuilders/nabu';interface NabuInit {
commandConfirm?: CommandConfirmOptions;
extensions?: Extension[];
files?: FilesConfig;
keymap?: Record<string, string[]>;
lang?: string;
placeholders?: PlaceholdersOption;
platform?: 'mac' | 'other';
readonly?: boolean;
snapshot?: Uint8Array<ArrayBufferLike>;
spellcheck?: boolean;
tab?: 'focus' | 'stay' | 'indent';
tabDefault?: 'focus' | 'stay' | 'indent';
tabHint?: string | false;
}Properties
| Property | Type | Description |
|---|---|---|
commandConfirmoptional | CommandConfirmOptions | Confirmation of commands asked by a
key press (ADR 017 lot 2): |
extensionsoptional | Extension[] | n/a |
filesoptional | FilesConfig | n/a |
keymapoptional | Record<string, string[]> | Replaces the keyboard shortcuts of commands (ADR 017): |
langoptional | string | Language of the content, a BCP 47 tag ( |
placeholdersoptional | PlaceholdersOption | Hint text of empty blocks.
|
platformoptional | 'mac' | 'other' | Which platform's conventions |
readonlyoptional | boolean | Show the document without letting the user change it (default |
snapshotoptional | Uint8Array<ArrayBufferLike> | n/a |
spellcheckoptional | boolean | Browser spellcheck on the editor (default |
taboptional | 'focus' | 'stay' | 'indent' | What Tab / Shift+Tab do in a plain text block, where no block handles them
structurally (list indent, code indentation and region titles keep their own meaning, whatever this says; P-41).
|
tabDefaultoptional | 'focus' | 'stay' | 'indent' | The mode used when |
tabHintoptional | string | false | Text announced on the editor root ( |
Source: src/lib/blocks/nabu.svelte.js:45