import Bounds, { Cursor, DestroyableBounds } from './bounds'; import { DOMChanges, DOMTreeConstruction } from './dom/helper'; import { Option, Destroyable, LinkedList, LinkedListNode } from '@glimmer/util'; import { Environment } from './environment'; import { VM } from './vm'; import { PathReference } from '@glimmer/reference'; import * as Simple from './dom/interfaces'; export interface FirstNode { firstNode(): Option; } export interface LastNode { lastNode(): Option; } export interface ElementOperations { addStaticAttribute(element: Simple.Element, name: string, value: string): void; addStaticAttributeNS(element: Simple.Element, namespace: string, name: string, value: string): void; addDynamicAttribute(element: Simple.Element, name: string, value: PathReference, isTrusting: boolean): void; addDynamicAttributeNS(element: Simple.Element, namespace: string, name: string, value: PathReference, isTrusting: boolean): void; flush(element: Simple.Element, vm: VM): void; } export declare class Fragment implements Bounds { private bounds; constructor(bounds: Bounds); parentElement(): Simple.Element; firstNode(): Option; lastNode(): Option; update(bounds: Bounds): void; } export declare class ElementStack implements Cursor { nextSibling: Option; dom: DOMTreeConstruction; updateOperations: DOMChanges; constructing: Option; operations: Option; element: Simple.Element; env: Environment; private elementStack; private nextSiblingStack; private blockStack; private defaultOperations; static forInitialRender(env: Environment, parentNode: Simple.Element, nextSibling: Option): ElementStack; static resume(env: Environment, tracker: Tracker, nextSibling: Option): ElementStack; constructor(env: Environment, parentNode: Simple.Element, nextSibling: Option); expectConstructing(method: string): Simple.Element; expectOperations(method: string): ElementOperations; block(): Tracker; popElement(): Option; pushSimpleBlock(): Tracker; pushUpdatableBlock(): UpdatableTracker; private pushBlockTracker(tracker, isRemote?); pushBlockList(list: LinkedList): Tracker; popBlock(): Tracker; openElement(tag: string, operations?: ElementOperations): Simple.Element; flushElement(): void; pushRemoteElement(element: Simple.Element): void; popRemoteElement(): void; private pushElement(element); newDestroyable(d: Destroyable): void; newBounds(bounds: Bounds): void; appendText(string: string): Simple.Text; appendComment(string: string): Simple.Comment; setStaticAttribute(name: string, value: string): void; setStaticAttributeNS(namespace: string, name: string, value: string): void; setDynamicAttribute(name: string, reference: PathReference, isTrusting: boolean): void; setDynamicAttributeNS(namespace: string, name: string, reference: PathReference, isTrusting: boolean): void; closeElement(): void; } export interface Tracker extends DestroyableBounds { openElement(element: Simple.Element): void; closeElement(): void; newNode(node: Simple.Node): void; newBounds(bounds: Bounds): void; newDestroyable(d: Destroyable): void; finalize(stack: ElementStack): void; } export declare class SimpleBlockTracker implements Tracker { private parent; protected first: Option; protected last: Option; protected destroyables: Option; protected nesting: number; constructor(parent: Simple.Element); destroy(): void; parentElement(): Simple.Element; firstNode(): Option; lastNode(): Option; openElement(element: Element): void; closeElement(): void; newNode(node: Node): void; newBounds(bounds: Bounds): void; newDestroyable(d: Destroyable): void; finalize(stack: ElementStack): void; } export interface UpdatableTracker extends Tracker { reset(env: Environment): Option; } export declare class UpdatableBlockTracker extends SimpleBlockTracker implements UpdatableTracker { reset(env: Environment): Option; }