UNPKG

prettier-plugin-embed

Version:

A configurable Prettier plugin to format embedded languages in JS/TS files.

71 lines (70 loc) 3.13 kB
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js"; declare const DEFAULT_COMMENTS: readonly ["xml", "opml", "rss", "svg"]; type Comments = AutocompleteStringList<(typeof DEFAULT_COMMENTS)[number]>; type DefaultCommentsHolder = StringListToInterfaceKey<typeof DEFAULT_COMMENTS>; declare const DEFAULT_TAGS: readonly ["xml", "opml", "rss", "svg"]; type Tags = AutocompleteStringList<(typeof DEFAULT_TAGS)[number]>; type DefaultTagsHolder = StringListToInterfaceKey<typeof DEFAULT_TAGS>; declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedXmlIdentifiers"; declare const EMBEDDED_LANGUAGE_COMMENTS: "embeddedXmlComments"; declare const EMBEDDED_LANGUAGE_TAGS: "embeddedXmlTags"; export declare const options: { readonly embeddedXmlIdentifiers: { readonly category: "Embed"; readonly type: "string"; readonly array: true; readonly default: [{ readonly value: ["xml", "opml", "rss", "svg"]; }]; readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."; readonly deprecated: "Please use `embeddedXmlComments` or `embeddedXmlTags`."; }; readonly embeddedXmlComments: { readonly category: "Embed"; readonly type: "string"; readonly array: true; readonly default: [{ readonly value: ["9ff2b366e8ca4c97b9aed1a29b5b94ed"]; }]; readonly description: "Block comments that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."; }; readonly embeddedXmlTags: { readonly category: "Embed"; readonly type: "string"; readonly array: true; readonly default: [{ readonly value: ["9ff2b366e8ca4c97b9aed1a29b5b94ed"]; }]; readonly description: "Tags that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."; }; /** * @internal */ readonly __embeddedXmlFragmentRecoverIndex: { readonly category: "Embed"; readonly type: "int"; readonly array: true; readonly default: [{ readonly value: []; }]; readonly description: "This option is read only and is used internally as a workaround to support xml fragments"; }; }; type Options = typeof options; declare module "../types.js" { interface EmbeddedOptions extends Options { } interface EmbeddedDefaultCommentsHolder extends DefaultCommentsHolder { } interface EmbeddedDefaultTagsHolder extends DefaultTagsHolder { } interface PluginEmbedOptions { /** * @deprecated Please use `embeddedXmlComments` or `embeddedXmlTags`. */ [EMBEDDED_LANGUAGE_IDENTIFIERS]?: (Comments[number] | Tags[number])[]; [EMBEDDED_LANGUAGE_COMMENTS]?: Comments; [EMBEDDED_LANGUAGE_TAGS]?: Tags; } } export {};