UNPKG

2.69 kBTypeScriptView Raw
1import { Bounds, ElementBuilder, Environment, Option, Maybe } from '@glimmer/interfaces';
2import { Stack } from '@glimmer/util';
3import { AttrNamespace, SimpleComment, SimpleElement, SimpleNode, SimpleText } from '@simple-dom/interface';
4import { CursorImpl } from '../bounds';
5import { CURSOR_STACK, NewElementBuilder, RemoteLiveBlock } from './element-builder';
6export declare const SERIALIZATION_FIRST_NODE_STRING = "%+b:0%";
7export declare function isSerializationFirstNode(node: SimpleNode): boolean;
8export declare class RehydratingCursor extends CursorImpl {
9 readonly startingBlockDepth: number;
10 candidate: Option<SimpleNode>;
11 openBlockDepth: number;
12 injectedOmittedNode: boolean;
13 constructor(element: SimpleElement, nextSibling: Option<SimpleNode>, startingBlockDepth: number);
14}
15export declare class RehydrateBuilder extends NewElementBuilder implements ElementBuilder {
16 private unmatchedAttributes;
17 [CURSOR_STACK]: Stack<RehydratingCursor>;
18 blockDepth: number;
19 startingBlockOffset: number;
20 constructor(env: Environment, parentNode: SimpleElement, nextSibling: Option<SimpleNode>);
21 get currentCursor(): Option<RehydratingCursor>;
22 get candidate(): Option<SimpleNode>;
23 set candidate(node: Option<SimpleNode>);
24 disableRehydration(nextSibling: Option<SimpleNode>): void;
25 enableRehydration(candidate: Option<SimpleNode>): void;
26 pushElement(
27 /** called from parent constructor before we initialize this */
28 this: RehydrateBuilder | (NewElementBuilder & Partial<Pick<RehydrateBuilder, 'blockDepth' | 'candidate'>>), element: SimpleElement, nextSibling?: Maybe<SimpleNode>): void;
29 private clearMismatch;
30 __openBlock(): void;
31 __closeBlock(): void;
32 __appendNode(node: SimpleNode): SimpleNode;
33 __appendHTML(html: string): Bounds;
34 protected remove(node: SimpleNode): Option<SimpleNode>;
35 private markerBounds;
36 __appendText(string: string): SimpleText;
37 __appendComment(string: string): SimpleComment;
38 __openElement(tag: string): SimpleElement;
39 __setAttribute(name: string, value: string, namespace: Option<AttrNamespace>): void;
40 __setProperty(name: string, value: string): void;
41 __flushElement(parent: SimpleElement, constructing: SimpleElement): void;
42 willCloseElement(): void;
43 getMarker(element: HTMLElement, guid: string): Option<SimpleNode>;
44 __pushRemoteElement(element: SimpleElement, cursorId: string, insertBefore: Maybe<SimpleNode>): Option<RemoteLiveBlock>;
45 didAppendBounds(bounds: Bounds): Bounds;
46}
47export declare function rehydrationBuilder(env: Environment, cursor: CursorImpl): ElementBuilder;
48//# sourceMappingURL=rehydrate-builder.d.ts.map
\No newline at end of file