inspector/manifestText#

Interfaces#

TextOptions#

Defined in: editor/src/inspector/manifestText.ts:78

How a text shows a manifest: with or without its styling (graphical), and in the complete form (every default written out) or the minimal one.

Properties#

includeStyling#

readonly includeStyling: boolean

Defined in: editor/src/inspector/manifestText.ts:79

minimal#

readonly minimal: boolean

Defined in: editor/src/inspector/manifestText.ts:80

Functions#

applyText()#

applyText(store, block, format, text, options): Applied

Defined in: editor/src/inspector/manifestText.ts:150

Read text in format and dispatch ONE set replacing the block’s manifest with the value read, its IDs made bare (withHeldIds; the store completes it). On acceptance the read document is patched with the manifest the store now holds, as options show it (it may differ in order, completed defaults or styles), so the text keeps the user’s comments; on refusal nothing is dispatched or the store’s single problem is returned. A text whose complete form equals the current manifest dispatches nothing and is no refusal: the store refuses a set that changes nothing.

Parameters#

store#

Store

block#

string

format#

"yaml" | "json" | "toml"

text#

string

options#

TextOptions

Returns#

Applied


follow()#

follow(source, manifest, options): Applied

Defined in: editor/src/inspector/manifestText.ts:192

The text after the manifest changed: the document patched in place with the manifest as options show it, so its comments survive.

Parameters#

source#

Source

manifest#

Json

options#

TextOptions

Returns#

Applied


manifestOf()#

manifestOf(block): Json

Defined in: editor/src/inspector/manifestText.ts:63

A block’s manifest as the JSON value its text shows, the value a manifest file writes (core’s manifestFileValue): every ID written #id and the full @context, the format’s terms and every prefix the statements use, which core does not hold. The manifest’s type leaves meta free (unknown), so its JSON is checked, once per manifest; a manifest holding anything else throws a TypeError.

Parameters#

block#

Block

Returns#

Json


manifestText()#

manifestText(manifest, format, options): Result<Text>

Defined in: editor/src/inspector/manifestText.ts:97

The text of a block’s manifest in format.

Parameters#

manifest#

Json

format#

"yaml" | "json" | "toml"

options#

TextOptions

Returns#

Result<Text>