@solidjs/html 2.0.0-rc.0 → 2.0.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,67 @@
1
+ import { Token } from "./tokenize.js";
2
+ export declare const ROOT_NODE = 0;
3
+ export declare const ELEMENT_NODE = 1;
4
+ export declare const COMPONENT_NODE = 2;
5
+ export declare const TEXT_NODE = 3;
6
+ export declare const EXPRESSION_NODE = 4;
7
+ export declare const BOOLEAN_PROP = 0;
8
+ export declare const STATIC_PROP = 1;
9
+ export declare const EXPRESSION_PROP = 2;
10
+ export declare const SPREAD_PROP = 3;
11
+ export type NodeType = typeof ROOT_NODE | typeof ELEMENT_NODE | typeof COMPONENT_NODE | typeof TEXT_NODE | typeof EXPRESSION_NODE;
12
+ export type PropType = typeof BOOLEAN_PROP | typeof STATIC_PROP | typeof EXPRESSION_PROP | typeof SPREAD_PROP;
13
+ export type ChildNode = ElementNode | TextNode | ExpressionNode | ComponentNode;
14
+ export interface RootNode {
15
+ type: typeof ROOT_NODE;
16
+ children: ChildNode[];
17
+ }
18
+ export interface ElementNode {
19
+ type: typeof ELEMENT_NODE;
20
+ name: string;
21
+ props: PropNode[];
22
+ children: ChildNode[];
23
+ template?: HTMLTemplateElement;
24
+ /**
25
+ * Element-claim contract target (`a[href]`, `form[action]`, or a spread
26
+ * that may carry those). Stamped at template build — before static props
27
+ * are filtered out — so clones can be claimed even when the attribute was
28
+ * baked into the template.
29
+ */
30
+ claim?: boolean;
31
+ }
32
+ export interface ComponentNode {
33
+ type: typeof COMPONENT_NODE;
34
+ name: string | number;
35
+ props: PropNode[];
36
+ children: ChildNode[];
37
+ }
38
+ export interface TextNode {
39
+ type: typeof TEXT_NODE;
40
+ value: string;
41
+ }
42
+ export interface ExpressionNode {
43
+ type: typeof EXPRESSION_NODE;
44
+ value: number;
45
+ }
46
+ export interface BooleanProp {
47
+ name: string;
48
+ type: typeof BOOLEAN_PROP;
49
+ value: boolean;
50
+ }
51
+ export interface StringProp {
52
+ name: string;
53
+ type: typeof STATIC_PROP;
54
+ value: string;
55
+ quote?: "'" | '"';
56
+ }
57
+ export interface ExpressionProp {
58
+ name: string;
59
+ type: typeof EXPRESSION_PROP;
60
+ value: number;
61
+ }
62
+ export interface SpreadProp {
63
+ type: typeof SPREAD_PROP;
64
+ value: number;
65
+ }
66
+ export type PropNode = BooleanProp | StringProp | ExpressionProp | SpreadProp;
67
+ export declare const parse: (tokens: Token[], voidElements: Set<string>) => RootNode;