This document is a work in progress draft of the Handlebars templating language specification.
namespace interface Host {
interface Meta {}
interface DynamicScope {
child(): DynamicScope;
}
}
The HostValue type represents any value representable in the host environment
interface Destroyable {
destroy(): void;
}
interface Reference {
value(): HostValue;
get(name: string): Reference;
}
interface Appendable {
type Host;
type State;
create(args: Args, dynamicScope: Self::Host::DynamicScope): Self::State;
self(state: Self::State): Reference;
invoke(appender: Appender);
getDestructor(state: Self::State): Destroyable;
}
interface Appender {
append(appendable: Appendable): void;
}
interface EvaluationRecord<Host> {
realm: Realm;
scope: Scope;
code: Code;
meta: Host::Meta;
}
interface Realm<Host> {
intrinsics: Host::Instrinsics;
globals: Reference;
meta: Host::RealmMeta;
appender: Host::Appender;
}
interface Scope {
parent: Option<Scope>;
createBinding(name: string): void;
initializeBinding(name: string, ref: Reference): void;
hasBinding(name: string): boolean;
getBindingReference(name: string): Reference;
bindSelf(ref: Reference): void;
getSelf(): Reference;
}