prettier-plugin-embed
Version:
A configurable Prettier plugin to format embedded languages in JS/TS files.
73 lines (72 loc) • 3.05 kB
TypeScript
import { type AutocompleteStringList, type StringListToInterfaceKey } from "../utils.js";
declare const DEFAULT_COMMENTS: readonly ["html", "xhtml"];
type Comments = AutocompleteStringList<(typeof DEFAULT_COMMENTS)[number]>;
type DefaultCommentsHolder = StringListToInterfaceKey<typeof DEFAULT_COMMENTS>;
declare const DEFAULT_TAGS: readonly ["html", "xhtml"];
type Tags = AutocompleteStringList<(typeof DEFAULT_TAGS)[number]>;
type DefaultTagsHolder = StringListToInterfaceKey<typeof DEFAULT_TAGS>;
declare const HTML_PARSERS: readonly ["html", "vue", "angular", "lwc"];
type HtmlParser = (typeof HTML_PARSERS)[number];
declare const EMBEDDED_LANGUAGE_IDENTIFIERS: "embeddedHtmlIdentifiers";
declare const EMBEDDED_LANGUAGE_COMMENTS: "embeddedHtmlComments";
declare const EMBEDDED_LANGUAGE_TAGS: "embeddedHtmlTags";
declare const EMBEDDED_LANGUAGE_PARSER: "embeddedHtmlParser";
export declare const options: {
readonly embeddedHtmlIdentifiers: {
readonly category: "Embed";
readonly type: "string";
readonly array: true;
readonly default: [{
readonly value: ["html", "xhtml"];
}];
readonly description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded HTML language.";
readonly deprecated: "Please use `embeddedHtmlComments` or `embeddedHtmlTags`.";
};
readonly embeddedHtmlComments: {
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 HTML language.";
};
readonly embeddedHtmlTags: {
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 HTML language.";
};
readonly embeddedHtmlParser: {
category: string;
type: "choice";
default: "html";
description: string;
choices: {
value: "html" | "vue" | "angular" | "lwc";
description: string;
}[];
};
};
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 `embeddedHtmlComments` or `embeddedHtmlTags`.
*/
[EMBEDDED_LANGUAGE_IDENTIFIERS]?: (Comments[number] | Tags[number])[];
[EMBEDDED_LANGUAGE_COMMENTS]?: Comments;
[EMBEDDED_LANGUAGE_TAGS]?: Tags;
[EMBEDDED_LANGUAGE_PARSER]?: HtmlParser;
}
}
export {};