/** * A language the config editor can display and emit. Every editor instance has a primary language — * the one its value is written in — and may offer the other as an on-the-fly projection of it. * * @internal */ export type ConfigEditorLanguage = "json" | "yaml"; /** * Whether `text` is a value in `language` that can be projected into another language and back. * * Text the user is midway through breaking is not: re-reading it in another language could give it a * different meaning (`foo` is broken JSON but a valid YAML string), so switching language must leave * it alone rather than quietly turning it into something that parses. Neither is a comment-only YAML * document, whose projection would be empty — losing the comments. * * @internal */ export declare function isProjectable(text: string, language: ConfigEditorLanguage): boolean; /** * Converts text from one of the editor's languages into another. * * Unconvertible text is passed through verbatim rather than swallowed — unparseable text, and a * comment-only YAML document, whose projection would be empty. In the display direction that keeps * a language switch from silently discarding what is on screen; in the primary direction it hands * the caller the raw text, whose own validation is what reports the problem while the user is * mid-edit. * * @internal */ export declare function convertText(text: string, fromLanguage: ConfigEditorLanguage, toLanguage: ConfigEditorLanguage): string; /** * Re-formats the displayed text in its own language. * * YAML is re-formatted structurally — indentation and spacing are normalized while comments, blank * lines and scalar styles are kept — so a hand-annotated document is tidied, never stripped. * * Returns `undefined` when there is nothing to format — blank or unparseable input — so the caller * can disable the action instead of offering a no-op. * * @internal */ export declare function beautify(draft: string, language: ConfigEditorLanguage): string | undefined; //# sourceMappingURL=configEditorLanguage.d.ts.map