Low-level APIs

#CLObject

Component Like Object. Minimumm requirement for any object to be hosted by a template

interface CLObject 
{
    get rootNodes(): Node[];
    update(): void;
    destroy(): void;
    setMounted(mounted: boolean): void;
    readonly isSingleRoot?: boolean;
    readonly rootNode?: Node;
}

#destroy()

Notifies the object it can release held resources

destroy(): void;

#isSingleRoot

If present and if true, indicates this object will only ever have a single root node

readonly isSingleRoot?: boolean;

#rootNode

Returns the root node (if isSingleRoot is true)

readonly rootNode?: Node;

#rootNodes

Gets the root nodes of this object

get rootNodes(): Node[];

#setMounted()

Notifies the object is has been mounted or unmounted

setMounted(mounted: boolean): void;
  • mounted True when the object has been mounted, false when unmounted

#update()

Instructs the object to update its DOM

update(): void;

#DomTree

Implemented by all objects that manage a DOM tree.

interface DomTree extends CLObject
{
    rebind(): void;
}

#rebind()

Instructs the DomTree that the model property of the DomTree's context object has changed and that it should rebind to the new instance

rebind(): void;

#DomTreeConstructor

A function that creates a DomTree

type DomTreeConstructor = (DomTreeContext: any) => DomTree;

#DomTreeContext

Context object for DomTrees.

interface DomTreeContext
{
    get model(): object;
}

#model

The context's model object

get model(): object;

#HtmlString Class

Contains a HTML string

class HtmlString {
    static areEqual(a: any, b: any): boolean;
    constructor(html: string);
    html: string;
}

#areEqual() (static)

Compares two values and returns true if they are both HtmlString instances and both have the same inner html value.

static areEqual(a: any, b: any): boolean;
  • a The first value to compare

  • b The second value to compare

#constructor()

Constructs a new HtmlString object

constructor(html: string);
  • html The HTML string

#html

The HTML string

html: string;

#Style Class

Utility functions for working with CSS styles

class Style {
    static declare(css: string): void;
}

#declare() (static)

Declares a CSS style string to be added to the <head> block

static declare(css: string): void;
  • css The CSS string to be added

#TransitionHandler

Implemented by objects that handle transitions

type TransitionHandler = {
    enterNodes: (nodes: Node[]) => void;
    leaveNodes: (nodes: Node[]) => void;
    onWillEnter: () => void;
    onDidLeave: () => void;
    start: () => void;
    finish: () => void;
};

#enterNodes

Registers the nodes that will be transitioned in

enterNodes: (nodes: Node[]) => void;

#finish

Instructs the TranstitionHandler to cancel any pending transition and complete all callbacks.

finish: () => void;

#leaveNodes

Registers the nodes that will be transitioned out

leaveNodes: (nodes: Node[]) => void;

#onDidLeave

Registers callback to be invoked when leaving nodes can be removed

onDidLeave: () => void;

#onWillEnter

Registers a callback to be invoked when entry nodes should be added

onWillEnter: () => void;

#start

Instructs the TransitionHandler to start the transition

start: () => void;