UNPKG

3.27 kBTypeScriptView Raw
1import { SourceSlice } from '../../source/slice';
2import { SymbolTable } from '../../symbol-table';
3import { Args } from './args';
4import type { ComponentArg, ElementModifier, HtmlOrSplatAttr } from './attr-block';
5import type { CallFields } from './base';
6import type { ExpressionNode } from './expr';
7import type { NamedBlock, NamedBlocks } from './internal-node';
8import { BaseNodeFields } from './node';
9/**
10 * Content Nodes are allowed in content positions in templates. They correspond to behavior in the
11 * [Data][data] tokenization state in HTML.
12 *
13 * [data]: https://html.spec.whatwg.org/multipage/parsing.html#data-state
14 */
15export declare type ContentNode = HtmlText | HtmlComment | AppendContent | InvokeBlock | InvokeComponent | SimpleElement | GlimmerComment;
16declare const GlimmerComment_base: import("./node").TypedNodeConstructor<"GlimmerComment", {
17 text: SourceSlice;
18} & BaseNodeFields>;
19export declare class GlimmerComment extends GlimmerComment_base {
20}
21declare const HtmlText_base: import("./node").TypedNodeConstructor<"HtmlText", {
22 chars: string;
23} & BaseNodeFields>;
24export declare class HtmlText extends HtmlText_base {
25}
26declare const HtmlComment_base: import("./node").TypedNodeConstructor<"HtmlComment", {
27 text: SourceSlice;
28} & BaseNodeFields>;
29export declare class HtmlComment extends HtmlComment_base {
30}
31declare const AppendContent_base: import("./node").TypedNodeConstructor<"AppendContent", {
32 value: ExpressionNode;
33 trusting: boolean;
34 table: SymbolTable;
35} & BaseNodeFields>;
36export declare class AppendContent extends AppendContent_base {
37 get callee(): ExpressionNode;
38 get args(): Args;
39}
40declare const InvokeBlock_base: import("./node").TypedNodeConstructor<"InvokeBlock", CallFields & {
41 blocks: NamedBlocks;
42} & BaseNodeFields>;
43export declare class InvokeBlock extends InvokeBlock_base {
44}
45interface InvokeComponentFields {
46 callee: ExpressionNode;
47 blocks: NamedBlocks;
48 attrs: readonly HtmlOrSplatAttr[];
49 componentArgs: readonly ComponentArg[];
50 modifiers: readonly ElementModifier[];
51}
52declare const InvokeComponent_base: import("./node").TypedNodeConstructor<"InvokeComponent", InvokeComponentFields & BaseNodeFields>;
53/**
54 * Corresponds to a component invocation. When the content of a component invocation contains no
55 * named blocks, `blocks` contains a single named block named `"default"`. When a component
56 * invocation is self-closing, `blocks` is empty.
57 */
58export declare class InvokeComponent extends InvokeComponent_base {
59 get args(): Args;
60}
61interface SimpleElementOptions extends BaseNodeFields {
62 tag: SourceSlice;
63 body: readonly ContentNode[];
64 attrs: readonly HtmlOrSplatAttr[];
65 componentArgs: readonly ComponentArg[];
66 modifiers: readonly ElementModifier[];
67}
68declare const SimpleElement_base: import("./node").TypedNodeConstructor<"SimpleElement", SimpleElementOptions & BaseNodeFields>;
69/**
70 * Corresponds to a simple HTML element. The AST allows component arguments and modifiers to support
71 * future extensions.
72 */
73export declare class SimpleElement extends SimpleElement_base {
74 get args(): Args;
75}
76export declare type ElementNode = NamedBlock | InvokeComponent | SimpleElement;
77export {};
78//# sourceMappingURL=content.d.ts.map
\No newline at end of file