inspector/formats.svelte#

Variables#

FORMAT_LABELS#

const FORMAT_LABELS: { readonly [format in Format]: string }

Defined in: editor/src/inspector/formats.svelte.ts:29

The word of each format, on its radio button and in its messages.

Functions#

isLoaded()#

isLoaded(format): boolean

Defined in: editor/src/inspector/formats.svelte.ts:79

Whether format can be written and read now, without waiting.

Parameters#

format#

"yaml" | "json" | "toml"

Returns#

boolean


loadCodec()#

loadCodec(format): Promise<Codec>

Defined in: editor/src/inspector/formats.svelte.ts:87

Load the codec of format (once; JSON is already there). A failed import rejects, and the next call tries again.

Parameters#

format#

"yaml" | "json" | "toml"

Returns#

Promise<Codec>


locateText()#

locateText(format, text, path): Lines | null

Defined in: editor/src/inspector/formats.svelte.ts:136

The lines of text in format holding the value at path of the manifest file it shows; null where the text holds none.

Parameters#

format#

"yaml" | "json" | "toml"

text#

string

path#

readonly PathSegment[]

Returns#

Lines | null

Throws#

when the format’s codec has not been loaded (loadCodec).


readText()#

readText(format, text): Result<Read>

Defined in: editor/src/inspector/formats.svelte.ts:126

The manifest value of text in format, or why it cannot be read.

Parameters#

format#

"yaml" | "json" | "toml"

text#

string

Returns#

Result<Read>

Throws#

when the format’s codec has not been loaded (loadCodec).


writeText()#

writeText(format, value): Result<Text>

Defined in: editor/src/inspector/formats.svelte.ts:117

The text of value in format, freshly written.

Parameters#

format#

"yaml" | "json" | "toml"

value#

Json

Returns#

Result<Text>

Throws#

when the format’s codec has not been loaded (loadCodec).

References#

Codec#

Re-exports Codec


Format#

Re-exports Format


FORMATS#

Re-exports FORMATS


Read#

Re-exports Read


Source#

Re-exports Source


Text#

Re-exports Text