UNPKG

svelte-ast-print

Version:

Serialize Svelte AST nodes into stringified syntax. A.k.a parse in reverse.

85 lines 2.15 kB
/** * Printers related to Svelte **tag**-like related AST nodes only. * @module svelte-ast-print/template/tag */ import type { AST as SV } from "svelte/compiler"; import type { PrintOptions } from "../_internal/option.js"; import { type Result } from "../_internal/shared.js"; /** * @since 1.0.0 * @__NO_SIDE_EFFECTS__ */ export declare function printTag(n: SV.Tag, opts?: Partial<PrintOptions>): Result<SV.Tag>; /** * @see {@link https://svelte.dev/docs/svelte/@attach} * * @example pattern * ```svelte * {@attach expression} * ``` * * @since 1.1.0 * @__NO_SIDE_EFFECTS__ */ export declare function printAttachTag(n: SV.AttachTag, opts?: Partial<PrintOptions>): Result<SV.AttachTag>; /** * @see {@link https://svelte.dev/docs/svelte/@const} * * @example pattern * ```svelte * {@const assignment} * ``` * * @since 1.0.0 * @__NO_SIDE_EFFECTS__ */ export declare function printConstTag(n: SV.ConstTag, opts?: Partial<PrintOptions>): Result<SV.ConstTag>; /** * @see {@link https://svelte.dev/docs/svelte/@debug} * * @example pattern * ```svelte * {@debug identifiers} * ``` * * @since 1.0.0 * @__NO_SIDE_EFFECTS__ */ export declare function printDebugTag(n: SV.DebugTag, opts?: Partial<PrintOptions>): Result<SV.DebugTag>; /** * @see {@link https://svelte.dev/docs/svelte/basic-markup#Text-expressions} * * @example pattern * ```svelte * {expression} * ``` * * @since 1.0.0 * @__NO_SIDE_EFFECTS__ */ export declare function printExpressionTag(n: SV.ExpressionTag, opts?: Partial<PrintOptions>): Result<SV.ExpressionTag>; /** * @see {@link https://svelte.dev/docs/svelte/@html} * * @example pattern * ```svelte * {@html expression} * ``` * * @since 1.0.0 * @__NO_SIDE_EFFECTS__ */ export declare function printHtmlTag(n: SV.HtmlTag, opts?: Partial<PrintOptions>): Result<SV.HtmlTag>; /** * @see {@link https://svelte.dev/docs/svelte/@render} * * @example pattern * ```svelte * {@render expression} * ``` * * @since 1.0.0 * @__NO_SIDE_EFFECTS__ */ export declare function printRenderTag(n: SV.RenderTag, opts?: Partial<PrintOptions>): Result<SV.RenderTag>; //# sourceMappingURL=tag.d.ts.map