@glimmer/interfaces
- Version 0.84.2
- Published
- 73 kB
- 1 dependency
- MIT license
Install
npm i @glimmer/interfaces
yarn add @glimmer/interfaces
pnpm add @glimmer/interfaces
Overview
Overview not available.
Index
Variables
Interfaces
Enums
Op
- AppendDocumentFragment
- AppendHTML
- AppendNode
- AppendSafeHTML
- AppendText
- AssertSame
- BeginComponentTransaction
- BindDynamicScope
- BindEvalScope
- CaptureArgs
- ChildScope
- CloseElement
- Comment
- CommitComponentTransaction
- CompileBlock
- ComponentAttr
- Concat
- Constant
- ConstantReference
- ContentType
- CreateComponent
- Curry
- Debugger
- DidCreateElement
- DidRenderLayout
- Dup
- DynamicAttr
- DynamicContentType
- DynamicHelper
- DynamicModifier
- Enter
- EnterList
- Exit
- ExitList
- Fetch
- FlushElement
- GetBlock
- GetComponentLayout
- GetComponentSelf
- GetComponentTagName
- GetDynamicVar
- GetProperty
- GetVariable
- HasBlock
- HasBlockParams
- Helper
- IfInline
- InvokeComponentLayout
- InvokeYield
- Iterate
- JumpEq
- JumpIf
- JumpUnless
- Load
- Log
- Main
- Modifier
- Not
- OpenDynamicElement
- OpenElement
- Pop
- PopArgs
- PopDynamicScope
- PopRemoteElement
- PopScope
- PopulateLayout
- PrepareArgs
- Primitive
- PrimitiveReference
- PushArgs
- PushBlockScope
- PushComponentDefinition
- PushDynamicComponentInstance
- PushDynamicScope
- PushEmptyArgs
- PushRemoteElement
- PushSymbolTable
- PutComponentOperations
- RegisterComponentDestructor
- ReifyU32
- ResolveCurriedComponent
- ResolveDynamicComponent
- ResolveMaybeLocal
- RootScope
- SetBlock
- SetBlocks
- SetNamedVariables
- SetupForEval
- SetVariable
- Size
- SpreadBlock
- StaticAttr
- StaticComponentAttr
- Text
- ToBoolean
- VirtualRootScope
SexpOpcodes
- Append
- AttrSplat
- Block
- Call
- CloseElement
- Comment
- Component
- ComponentAttr
- Concat
- Curry
- Debugger
- DynamicArg
- DynamicAttr
- Each
- FlushElement
- GetContextualFreeStart
- GetDynamicVar
- GetEnd
- GetFreeAsComponentHead
- GetFreeAsComponentOrHelperHead
- GetFreeAsComponentOrHelperHeadOrThisFallback
- GetFreeAsDeprecatedHelperHeadOrThisFallback
- GetFreeAsHelperHead
- GetFreeAsHelperHeadOrThisFallback
- GetFreeAsModifierHead
- GetLooseFreeEnd
- GetLooseFreeStart
- GetStart
- GetStrictFree
- GetSymbol
- GetTemplateSymbol
- HasBlock
- HasBlockParams
- If
- IfInline
- InElement
- InvokeComponent
- Let
- Log
- Modifier
- Not
- OpenElement
- OpenElementWithSplat
- StaticArg
- StaticAttr
- StaticComponentAttr
- StrictBlock
- StrictModifier
- TrustingAppend
- TrustingComponentAttr
- TrustingDynamicAttr
- Undefined
- With
- WithDynamicVars
- Yield
Type Aliases
- Argument
- Attribute
- AttrOp
- Block
- BlockValue
- BuilderOp
- BuilderOpcode
- CompilableBlock
- CompilerBuffer
- ComponentDefinitionState
- ComponentInstanceState
- ComponentInstanceWithCreate
- ConstantPool
- CoreSyntax
- CursorStackSymbol
- Destroyable
- Destructor
- DictValue
- ElementParameter
- EMPTY_ARRAY
- EncoderOperands
- Expression
- ExpressionSexpOpcode
- ExpressionSexpOpcodeMap
- FIXME
- Get
- GetContextualFreeOp
- HandleResult
- HelperDefinitionState
- HighLevelBuilderOp
- HighLevelBuilderOperand
- HighLevelOp
- HighLevelResolutionOp
- JsonValue
- LabelOp
- Maybe
- ModifierDefinitionState
- ModifierInstanceState
- NodeToken
- OkHandle
- Operand
- Option
- Owner
- Present
- PresentArray
- Recast
- RenderNodeType
- ResolveComponentOp
- ResolveComponentOrHelperOp
- ResolveFreeOp
- ResolveHelperOp
- ResolveLocalOp
- ResolveModifierOp
- ResolveOptionalComponentOrHelperOp
- ResolveOptionalHelperOp
- ResolveTemplateLocalOp
- RichIteratorResult
- ScopeBlock
- ScopeSlot
- SerializedBlock
- SerializedInlineBlock
- SerializedStdlib
- SerializedTemplateBlock
- SerializedTemplateBlockJSON
- SexpOpcode
- SexpSyntax
- SingleBuilderOperand
- StartLabelsOp
- Statement
- StatementSexpOpcode
- StatementSexpOpcodeMap
- STDLibName
- StopLabelsOp
- SymbolTable
- Syntax
- SyntaxWithInternal
- Template
- TemplateFactory
- TemplateJavascript
- TemplateReference
- TransactionSymbol
- TupleExpression
- TupleSyntax
- YieldTo
Namespaces
Expressions
- BooleanValue
- Concat
- Curry
- Expression
- Get
- GetContextualFree
- GetDynamicVar
- GetFree
- GetFreeAsComponentHead
- GetFreeAsComponentOrHelperHead
- GetFreeAsComponentOrHelperHeadOrThisFallback
- GetFreeAsDeprecatedHelperHeadOrThisFallback
- GetFreeAsHelperHead
- GetFreeAsHelperHeadOrThisFallback
- GetFreeAsModifierHead
- GetPath
- GetPathContextualFree
- GetPathFree
- GetPathFreeAsComponentHead
- GetPathFreeAsComponentOrHelperHead
- GetPathFreeAsComponentOrHelperHeadOrThisFallback
- GetPathFreeAsDeprecatedHelperHeadOrThisFallback
- GetPathFreeAsHelperHead
- GetPathFreeAsHelperHeadOrThisFallback
- GetPathFreeAsModifierHead
- GetPathStrictFree
- GetPathSymbol
- GetPathTemplateSymbol
- GetStrictFree
- GetSymbol
- GetTemplateSymbol
- GetVar
- HasBlock
- HasBlockParams
- Hash
- Helper
- IfInline
- Log
- Not
- NullValue
- NumberValue
- Params
- Path
- StringValue
- TupleExpression
- Undefined
- Value
Statements
- AnyDynamicAttr
- AnyStaticAttr
- Append
- Argument
- Attribute
- AttrSplat
- Block
- Blocks
- CloseElement
- Comment
- Component
- ComponentAttr
- ComponentFeature
- Debugger
- DynamicArg
- DynamicAttr
- Each
- ElementParameter
- Expression
- FlushElement
- Hash
- If
- InElement
- InvokeComponent
- Let
- Modifier
- OpenElement
- OpenElementWithSplat
- Params
- Path
- Statement
- StaticArg
- StaticAttr
- StaticComponentAttr
- TrustingAppend
- TrustingComponentAttr
- TrustingDynamicAttr
- With
- WithDynamicVars
- Yield
WireFormat
- Argument
- Attribute
- AttrOp
- CoreSyntax
- ElementParameter
- Expression
- ExpressionSexpOpcode
- ExpressionSexpOpcodeMap
- Get
- GetContextualFreeOp
- JsonArray
- JsonObject
- JsonValue
- SerializedBlock
- SerializedInlineBlock
- SerializedTemplate
- SerializedTemplateBlock
- SerializedTemplateBlockJSON
- SerializedTemplateWithLazyBlock
- SexpOpcode
- SexpOpcodeMap
- SexpOpcodes
- SexpSyntax
- Statement
- StatementSexpOpcode
- StatementSexpOpcodeMap
- Syntax
- SyntaxWithInternal
- TemplateJavascript
- TemplateReference
- TupleExpression
- TupleSyntax
- VariableResolutionContext
- WellKnownAttrName
- WellKnownTagName
- YieldTo
WireFormat.Expressions
- BooleanValue
- Concat
- Curry
- Expression
- Get
- GetContextualFree
- GetDynamicVar
- GetFree
- GetFreeAsComponentHead
- GetFreeAsComponentOrHelperHead
- GetFreeAsComponentOrHelperHeadOrThisFallback
- GetFreeAsDeprecatedHelperHeadOrThisFallback
- GetFreeAsHelperHead
- GetFreeAsHelperHeadOrThisFallback
- GetFreeAsModifierHead
- GetPath
- GetPathContextualFree
- GetPathFree
- GetPathFreeAsComponentHead
- GetPathFreeAsComponentOrHelperHead
- GetPathFreeAsComponentOrHelperHeadOrThisFallback
- GetPathFreeAsDeprecatedHelperHeadOrThisFallback
- GetPathFreeAsHelperHead
- GetPathFreeAsHelperHeadOrThisFallback
- GetPathFreeAsModifierHead
- GetPathStrictFree
- GetPathSymbol
- GetPathTemplateSymbol
- GetStrictFree
- GetSymbol
- GetTemplateSymbol
- GetVar
- HasBlock
- HasBlockParams
- Hash
- Helper
- IfInline
- Log
- Not
- NullValue
- NumberValue
- Params
- Path
- StringValue
- TupleExpression
- Undefined
- Value
WireFormat.Statements
- AnyDynamicAttr
- AnyStaticAttr
- Append
- Argument
- Attribute
- AttrSplat
- Block
- Blocks
- CloseElement
- Comment
- Component
- ComponentAttr
- ComponentFeature
- Debugger
- DynamicArg
- DynamicAttr
- Each
- ElementParameter
- Expression
- FlushElement
- Hash
- If
- InElement
- InvokeComponent
- Let
- Modifier
- OpenElement
- OpenElementWithSplat
- Params
- Path
- Statement
- StaticArg
- StaticAttr
- StaticComponentAttr
- TrustingAppend
- TrustingComponentAttr
- TrustingDynamicAttr
- With
- WithDynamicVars
- Yield
Variables
variable CAPABILITIES
const CAPABILITIES: Symbol;
variable CAPTURED_ARGS
const CAPTURED_ARGS: Symbol;
variable CURSOR_STACK
const CURSOR_STACK: Symbol;
variable TransactionSymbol
const TransactionSymbol: Symbol;
Interfaces
interface ArgsOptions
interface ArgsOptions extends SimpleArgsOptions {}
interface Arguments
interface Arguments {}
property named
named: Record<string, unknown>;
property positional
positional: readonly unknown[];
interface AttributeCursor
interface AttributeCursor {}
interface AttributeOperation
interface AttributeOperation {}
interface BlockArguments
interface BlockArguments {}
interface BlockOperand
interface BlockOperand {}
interface BlockSymbolTable
interface BlockSymbolTable {}
property parameters
parameters: number[];
interface BlockWithContext
interface BlockWithContext {}
property block
readonly block: SerializedInlineBlock;
property containingLayout
readonly containingLayout: LayoutWithContext;
interface Bounds
interface Bounds {}
method firstNode
firstNode: () => SimpleNode;
method lastNode
lastNode: () => SimpleNode;
method parentElement
parentElement: () => SimpleElement;
interface Capabilities
interface Capabilities {}
property [CAPABILITIES]
[CAPABILITIES]: true;
interface CapturedArguments
interface CapturedArguments {}
property [CAPTURED_ARGS]
[CAPTURED_ARGS]: true;
property named
named: CapturedNamedArguments;
property positional
positional: CapturedPositionalArguments;
interface CapturedBlockArguments
interface CapturedBlockArguments {}
interface CapturedNamedArguments
interface CapturedNamedArguments {}
property [CAPTURED_ARGS]
[CAPTURED_ARGS]: true;
index signature
[key: string]: Reference;
interface CapturedPositionalArguments
interface CapturedPositionalArguments extends Array<Reference> {}
property [CAPTURED_ARGS]
[CAPTURED_ARGS]: true;
interface CapturedRenderNode
interface CapturedRenderNode {}
property args
args: Arguments;
property bounds
bounds: null | { parentElement: SimpleElement; firstNode: SimpleNode; lastNode: SimpleNode;};
property children
children: CapturedRenderNode[];
property id
id: string;
property instance
instance: unknown;
property name
name: string;
property template
template: string | null;
property type
type: RenderNodeType;
interface CompilableProgram
interface CompilableProgram extends CompilableTemplate<ProgramSymbolTable> {}
property moduleName
moduleName: string;
interface CompilableTemplate
interface CompilableTemplate<S extends SymbolTable = SymbolTable> {}
property symbolTable
symbolTable: S;
method compile
compile: (context: CompileTimeCompilationContext) => HandleResult;
interface CompilerArtifacts
interface CompilerArtifacts {}
interface CompileTimeArtifacts
interface CompileTimeArtifacts {}
interface CompileTimeCompilationContext
interface CompileTimeCompilationContext {}
interface CompileTimeComponent
interface CompileTimeComponent {}
property capabilities
capabilities: InternalComponentCapability;
property compilable
compilable: Option<CompilableProgram>;
property handle
handle: number;
interface CompileTimeConstants
interface CompileTimeConstants {}
Constants are interned values that are referenced as numbers in the program. The constant pool is a part of the program, and is always transmitted together with the program.
interface CompileTimeHeap
interface CompileTimeHeap extends OpcodeHeap {}
property offset
offset: number;
method capture
capture: (offset?: number) => SerializedHeap;
method finishMalloc
finishMalloc: (handle: number, scopeSize: number) => void;
method getaddr
getaddr: (handle: number) => number;
method getbyaddr
getbyaddr: (address: number) => number;
method malloc
malloc: () => number;
method push
push: (name: Op, op1?: number, op2?: number, op3?: number) => void;
method setbyaddr
setbyaddr: (address: number, value: number) => void;
method sizeof
sizeof: (handle: number) => number;
interface CompileTimeResolver
interface CompileTimeResolver<O extends Owner = Owner> {}
method lookupBuiltInHelper
lookupBuiltInHelper: (name: string) => Option<HelperDefinitionState>;
method lookupBuiltInModifier
lookupBuiltInModifier: (name: string) => Option<ModifierDefinitionState>;
method lookupComponent
lookupComponent: (name: string, owner: O) => Option<ResolvedComponentDefinition>;
method lookupHelper
lookupHelper: (name: string, owner: O) => Option<HelperDefinitionState>;
method lookupModifier
lookupModifier: (name: string, owner: O) => Option<ModifierDefinitionState>;
interface ComponentCapabilities
interface ComponentCapabilities extends Capabilities {}
property asyncLifeCycleCallbacks
asyncLifeCycleCallbacks: boolean;
property destructor
destructor: boolean;
property updateHook
updateHook: boolean;
interface ComponentCapabilitiesVersions
interface ComponentCapabilitiesVersions {}
interface ComponentDefinition
interface ComponentDefinition< D extends ComponentDefinitionState = ComponentDefinitionState, I = ComponentInstanceState, M extends InternalComponentManager<I, D> = InternalComponentManager<I, D>> {}
property capabilities
capabilities: InternalComponentCapability;
property compilable
compilable: CompilableProgram | null;
property handle
handle: number;
property manager
manager: M;
property resolvedName
resolvedName: string | null;
property state
state: D;
interface ComponentInstance
interface ComponentInstance< D extends ComponentDefinitionState = ComponentDefinitionState, I = ComponentInstanceState, M extends InternalComponentManager<I, D> = InternalComponentManager<I, D>> {}
property capabilities
capabilities: InternalComponentCapability;
property definition
definition: ComponentDefinition<D, I>;
property handle
handle: number;
property lookup
lookup: Record<string, ScopeSlot> | null;
property manager
manager: M;
property state
state: I;
property table
table: ProgramSymbolTable;
interface ComponentManager
interface ComponentManager<ComponentStateBucket> {}
property capabilities
capabilities: ComponentCapabilities;
method createComponent
createComponent: (factory: object, args: Arguments) => ComponentStateBucket;
method getContext
getContext: (instance: ComponentStateBucket) => unknown;
interface ComponentManagerWithAsyncLifeCycleCallbacks
interface ComponentManagerWithAsyncLifeCycleCallbacks<ComponentStateBucket> extends ComponentManager<ComponentStateBucket> {}
method didCreateComponent
didCreateComponent: (instance: ComponentStateBucket) => void;
interface ComponentManagerWithAsyncUpdateHook
interface ComponentManagerWithAsyncUpdateHook<ComponentStateBucket> extends ComponentManagerWithAsyncLifeCycleCallbacks<ComponentStateBucket>, ComponentManagerWithUpdateHook<ComponentStateBucket> {}
method didUpdateComponent
didUpdateComponent: (instance: ComponentStateBucket) => void;
interface ComponentManagerWithDestructors
interface ComponentManagerWithDestructors<ComponentStateBucket> extends ComponentManager<ComponentStateBucket> {}
method destroyComponent
destroyComponent: (instance: ComponentStateBucket) => void;
interface ComponentManagerWithUpdateHook
interface ComponentManagerWithUpdateHook<ComponentStateBucket> extends ComponentManager<ComponentStateBucket> {}
method updateComponent
updateComponent: (instance: ComponentStateBucket, args: Arguments) => void;
interface ContainingMetadata
interface ContainingMetadata {}
property evalSymbols
evalSymbols: Option<string[]>;
property isStrictMode
isStrictMode: boolean;
property moduleName
moduleName: string;
property owner
owner: Owner | null;
property scopeValues
scopeValues: unknown[] | null;
property size
size: number;
property upvars
upvars: Option<string[]>;
interface Cursor
interface Cursor {}
property element
readonly element: SimpleElement;
property nextSibling
readonly nextSibling: Option<SimpleNode>;
interface CustomRenderNode
interface CustomRenderNode extends RenderNode {}
property bucket
bucket: object;
interface DebugRenderTree
interface DebugRenderTree<Bucket extends object = object> {}
method begin
begin: () => void;
method capture
capture: () => CapturedRenderNode[];
method commit
commit: () => void;
method create
create: (state: Bucket, node: RenderNode) => void;
method didRender
didRender: (state: Bucket, bounds: Bounds) => void;
method update
update: (state: Bucket) => void;
method willDestroy
willDestroy: (state: Bucket) => void;
interface Dict
interface Dict<T = unknown> {}
index signature
[key: string]: T;
interface DOMStack
interface DOMStack {}
method appendComment
appendComment: (string: string) => SimpleComment;
method appendDynamicFragment
appendDynamicFragment: (value: SimpleDocumentFragment) => void;
method appendDynamicHTML
appendDynamicHTML: (value: string) => void;
method appendDynamicNode
appendDynamicNode: (value: SimpleNode) => void;
method appendDynamicText
appendDynamicText: (value: string) => SimpleText;
method appendText
appendText: (string: string) => SimpleText;
method closeElement
closeElement: () => Option<ModifierInstance[]>;
method flushElement
flushElement: (modifiers: Option<ModifierInstance[]>) => void;
method openElement
openElement: (tag: string, _operations?: ElementOperations) => SimpleElement;
method popElement
popElement: () => void;
method popRemoteElement
popRemoteElement: () => void;
method pushRemoteElement
pushRemoteElement: ( element: SimpleElement, guid: string, insertBefore: Maybe<SimpleNode>) => Option<RemoteLiveBlock>;
method setDynamicAttribute
setDynamicAttribute: ( name: string, value: unknown, isTrusting: boolean, namespace: Option<string>) => AttributeOperation;
method setStaticAttribute
setStaticAttribute: ( name: string, value: string, namespace: Option<string>) => void;
interface DynamicScope
interface DynamicScope {}
interface ElementBuilder
interface ElementBuilder extends Cursor, DOMStack, TreeOperations {}
property [CURSOR_STACK]
[CURSOR_STACK]: Stack<Cursor>;
property constructing
constructing: Option<SimpleElement>;
property dom
dom: GlimmerTreeConstruction;
property element
element: SimpleElement;
property hasBlocks
hasBlocks: boolean;
property nextSibling
nextSibling: Option<SimpleNode>;
property updateOperations
updateOperations: GlimmerTreeChanges;
method debugBlocks
debugBlocks: () => LiveBlock[];
method didAppendBounds
didAppendBounds: (bounds: Bounds) => void;
method popBlock
popBlock: () => LiveBlock;
method pushBlockList
pushBlockList: (list: Bounds[]) => LiveBlock;
method pushSimpleBlock
pushSimpleBlock: () => LiveBlock;
method pushUpdatableBlock
pushUpdatableBlock: () => UpdatableBlock;
interface ElementOperations
interface ElementOperations {}
method setAttribute
setAttribute: ( name: string, value: Reference, trusting: boolean, namespace: Option<string>) => void;
method setStaticAttribute
setStaticAttribute: ( name: string, value: string, namespace: Option<string>) => void;
interface Encoder
interface Encoder {}
The Encoder receives a stream of opcodes from the syntax compiler and turns them into a binary program.
method commit
commit: (size: number) => HandleResult;
Finalize the current compilation unit, add a
(Return)
, and push the opcodes from the buffer into the program. At this point, some of the opcodes might still be placeholders, such as in the case of recursively compiled templates.Parameter compiler
Parameter size
method error
error: (error: EncoderError) => void;
method label
label: (name: string) => void;
Mark the current position with a label name. This label name can be used by any other opcode in this label block.
Parameter name
Parameter index
method push
push: ( constants: CompileTimeConstants, opcode: BuilderOpcode, ...args: SingleBuilderOperand[]) => void;
Push a syscall into the program with up to three optional operands.
Parameter opcode
Parameter args
up to three operands, formatted as { type: "type", value: value }
method startLabels
startLabels: () => void;
Start a new labels block. A labels block is a scope for labels that can be referred to before they are declared. For example, when compiling an
if
, theJumpUnless
opcode occurs before the target label. To accommodate this use-case ergonomically, theEncoder
allows a syntax to create a labels block and then refer to labels that have not yet been declared. Once the block is complete, a second pass replaces the label names with offsets.The pattern is:
encoder.reserve(Op.JumpUnless);encoder.target(encoder.pos, 'ELSE');The
reserve
method creates a placeholder opcode with space for a target in the future, and thetarget
method registers the blank operand position to be replaced with an offset toELSE
, once it's known.
method stopLabels
stopLabels: () => void;
Finish the current labels block and replace label names with offsets, now that all of the offsets are known.
interface EncoderError
interface EncoderError {}
interface Environment
interface Environment {}
property [TransactionSymbol]
[TransactionSymbol]: Option<Transaction>;
property debugRenderTree
debugRenderTree?: DebugRenderTree;
property isInteractive
isInteractive: boolean;
method begin
begin: () => void;
method commit
commit: () => void;
method didCreate
didCreate: (component: ComponentInstanceWithCreate) => void;
method didUpdate
didUpdate: (component: ComponentInstanceWithCreate) => void;
method getAppendOperations
getAppendOperations: () => GlimmerTreeConstruction;
method getDOM
getDOM: () => GlimmerTreeChanges;
method scheduleInstallModifier
scheduleInstallModifier: (modifier: ModifierInstance) => void;
method scheduleUpdateModifier
scheduleUpdateModifier: (modifier: ModifierInstance) => void;
interface EnvironmentOptions
interface EnvironmentOptions {}
property appendOperations
appendOperations?: GlimmerTreeConstruction;
property document
document?: SimpleDocument;
property updateOperations
updateOperations?: GlimmerTreeChanges;
interface ErrHandle
interface ErrHandle {}
interface EvalSymbolsOperand
interface EvalSymbolsOperand {}
interface ExceptionHandler
interface ExceptionHandler {}
method handleException
handleException: () => void;
interface GlimmerDOMOperations
interface GlimmerDOMOperations {}
method createComment
createComment: (data: string) => SimpleComment;
method createElement
createElement: (tag: string, context?: SimpleElement) => SimpleElement;
method createTextNode
createTextNode: (text: string) => SimpleText;
method insertBefore
insertBefore: ( parent: SimpleElement, node: SimpleNode, reference: SimpleNode) => void;
method insertHTMLBefore
insertHTMLBefore: ( parent: SimpleElement, nextSibling: SimpleNode, html: string) => Bounds;
interface GlimmerTreeChanges
interface GlimmerTreeChanges extends GlimmerDOMOperations {}
method insertAfter
insertAfter: ( element: SimpleElement, node: SimpleNode, reference: SimpleNode) => void;
method removeAttribute
removeAttribute: (element: SimpleElement, name: string) => void;
method setAttribute
setAttribute: (element: SimpleElement, name: string, value: string) => void;
interface GlimmerTreeConstruction
interface GlimmerTreeConstruction extends GlimmerDOMOperations {}
method setAttribute
setAttribute: ( element: SimpleElement, name: string, value: string, namespace?: Namespace) => void;
interface Helper
interface Helper<O extends Owner = Owner> {}
call signature
( args: CapturedArguments, owner: O | undefined, dynamicScope?: DynamicScope): Reference;
interface HelperCapabilities
interface HelperCapabilities extends Capabilities {}
property hasDestroyable
hasDestroyable: boolean;
property hasScheduledEffect
hasScheduledEffect: boolean;
property hasValue
hasValue: boolean;
interface HelperCapabilitiesVersions
interface HelperCapabilitiesVersions {}
property '3.23'
'3.23': { hasValue?: boolean; hasDestroyable?: boolean;};
interface HelperManager
interface HelperManager<HelperStateBucket> {}
property capabilities
capabilities: HelperCapabilities;
method createHelper
createHelper: (definition: object, args: Arguments) => HelperStateBucket;
method getDebugName
getDebugName: (definition: object) => string;
interface HelperManagerWithDestroyable
interface HelperManagerWithDestroyable<HelperStateBucket> extends HelperManager<HelperStateBucket> {}
method getDestroyable
getDestroyable: (bucket: HelperStateBucket) => object;
interface HelperManagerWithValue
interface HelperManagerWithValue<HelperStateBucket> extends HelperManager<HelperStateBucket> {}
method getValue
getValue: (bucket: HelperStateBucket) => unknown;
interface InstructionEncoder
interface InstructionEncoder {}
interface InternalComponentCapabilities
interface InternalComponentCapabilities {}
Describes the capabilities of a particular component. The capabilities are provided to the Glimmer compiler and VM via the ComponentDefinition, which includes a ComponentCapabilities record.
Certain features in the VM come with some overhead, so the compiler and runtime use this information to skip unnecessary work for component types that don't need it.
For example, a component that is template-only (i.e., it does not have an associated JavaScript class to instantiate) can skip invoking component manager hooks related to lifecycle events by setting the
elementHook
capability tofalse
.
property attributeHook
attributeHook: boolean;
Whether to call the
didSplatAttributes
hook on the component manager.
property createArgs
createArgs: boolean;
Whether a reified
Arguments
object will get passed to the component manager'screate
hook. If a particular component does not access passed arguments from JavaScript (via thethis.args
property in Glimmer.js, for example), this flag can be set tofalse
to avoid the work of instantiating extra data structures to expose the arguments to JavaScript.
property createCaller
createCaller: boolean;
Whether the component needs the caller component
property createInstance
createInstance: boolean;
Whether there is a component instance to create. If this is false, the component is a "template only component"
property dynamicLayout
dynamicLayout: boolean;
Whether a component's template is static across all instances of that component, or can vary per instance. This should usually be
false
except for cases of backwards-compatibility.
property dynamicScope
dynamicScope: boolean;
Whether the component needs an additional dynamic scope frame.
property dynamicTag
dynamicTag: boolean;
Whether a "wrapped" component's root element can change after being rendered. This flag is only used by the WrappedBuilder and should be
false
except for cases of backwards-compatibility.
property elementHook
elementHook: boolean;
Whether to call the
didCreateElement
hook on the component manager.
property hasSubOwner
hasSubOwner: boolean;
Whether or not the component pushes an owner onto the owner stack. This is used for engines.
property prepareArgs
prepareArgs: boolean;
Setting the
prepareArgs
flag to true enables theprepareArgs
hook on the component manager, which would otherwise not be called.The component manager's
prepareArgs
hook allows it to programmatically add or remove positional and named arguments for a component before the component is invoked. This flag should usually befalse
except for cases of backwards-compatibility.
property updateHook
updateHook: boolean;
Whether the component manager has an update hook.
property willDestroy
willDestroy: boolean;
Whether or not the component has a
willDestroy
hook that should fire prior to the component being removed from the DOM.
property wrapped
wrapped: boolean;
interface InternalComponentManager
interface InternalComponentManager< TComponentStateBucket = unknown, TComponentDefinition = object> {}
method getCapabilities
getCapabilities: (state: TComponentDefinition) => InternalComponentCapabilities;
method getDebugName
getDebugName: (state: TComponentDefinition) => string;
method getDestroyable
getDestroyable: (state: TComponentStateBucket) => Option<Destroyable>;
method getSelf
getSelf: (state: TComponentStateBucket) => Reference;
interface InternalHelperManager
interface InternalHelperManager<TOwner extends Owner> {}
method getDelegateFor
getDelegateFor: (owner: TOwner | undefined) => HelperManager<unknown>;
method getHelper
getHelper: (definition: HelperDefinitionState) => Helper;
interface InternalModifierManager
interface InternalModifierManager< TModifierInstanceState = ModifierInstanceState, TModifierDefinitionState extends ModifierDefinitionState = ModifierDefinitionState> {}
method create
create: ( owner: Owner, element: SimpleElement, state: TModifierDefinitionState, args: CapturedArguments) => TModifierInstanceState;
method getDebugName
getDebugName: (Modifier: TModifierDefinitionState) => string;
method getDestroyable
getDestroyable: (modifier: TModifierInstanceState) => Destroyable | null;
method getTag
getTag: (modifier: TModifierInstanceState) => UpdatableTag | null;
method install
install: (modifier: TModifierInstanceState) => void;
method update
update: (modifier: TModifierInstanceState) => void;
interface Invocation
interface Invocation {}
property handle
handle: number;
property symbolTable
symbolTable: ProgramSymbolTable;
interface IsStrictModeOperand
interface IsStrictModeOperand {}
interface JsonArray
interface JsonArray extends Array<JsonValue> {}
interface JsonObject
interface JsonObject extends Dict<JsonValue> {}
interface LabelOperand
interface LabelOperand {}
interface LayoutOperand
interface LayoutOperand {}
interface LayoutWithContext
interface LayoutWithContext {}
property block
readonly block: SerializedTemplateBlock;
property id
readonly id: string;
property isStrictMode
readonly isStrictMode: boolean;
property moduleName
readonly moduleName: string;
property owner
readonly owner: Owner | null;
property scope
readonly scope: (() => unknown[]) | undefined | null;
interface LiveBlock
interface LiveBlock extends Bounds {}
method closeElement
closeElement: () => void;
method didAppendBounds
didAppendBounds: (bounds: Bounds) => void;
method didAppendNode
didAppendNode: (node: SimpleNode) => void;
method finalize
finalize: (stack: ElementBuilder) => void;
method openElement
openElement: (element: SimpleElement) => void;
interface ModifierCapabilities
interface ModifierCapabilities extends Capabilities {}
property disableAutoTracking
disableAutoTracking: boolean;
interface ModifierCapabilitiesVersions
interface ModifierCapabilitiesVersions {}
property '3.22'
'3.22': { disableAutoTracking?: boolean;};
interface ModifierDefinition
interface ModifierDefinition< I = unknown, D extends ModifierDefinitionState = ModifierDefinitionState> {}
property manager
manager: InternalModifierManager<I, D>;
property resolvedName
resolvedName: string | null;
property state
state: ModifierDefinitionState;
interface ModifierInstance
interface ModifierInstance {}
property definition
definition: ModifierDefinition;
property manager
manager: InternalModifierManager;
property state
state: ModifierInstanceState;
interface ModifierManager
interface ModifierManager<ModifierStateBucket> {}
property capabilities
capabilities: ModifierCapabilities;
method createModifier
createModifier: (factory: unknown, args: Arguments) => ModifierStateBucket;
method destroyModifier
destroyModifier: (instance: ModifierStateBucket, args: Arguments) => void;
method installModifier
installModifier: ( instance: ModifierStateBucket, element: Element, args: Arguments) => void;
method updateModifier
updateModifier: (instance: ModifierStateBucket, args: Arguments) => void;
interface NamedArguments
interface NamedArguments {}
interface NamedBlocks
interface NamedBlocks {}
interface NodeTokens
interface NodeTokens {}
method reify
reify: (token: NodeToken) => SimpleNode;
interface NonSmallIntOperand
interface NonSmallIntOperand {}
interface OpcodeHeap
interface OpcodeHeap {}
method getbyaddr
getbyaddr: (address: number) => number;
interface PartialScope
interface PartialScope extends Scope {}
method bindEvalScope
bindEvalScope: (scope: Option<Dict<ScopeSlot>>) => void;
interface PositionalArguments
interface PositionalArguments {}
interface PreparedArguments
interface PreparedArguments {}
property named
named: Dict<Reference>;
property positional
positional: ReadonlyArray<Reference>;
interface ProgramSymbolTable
interface ProgramSymbolTable {}
interface RemoteLiveBlock
interface RemoteLiveBlock extends SimpleLiveBlock {}
interface RenderNode
interface RenderNode {}
interface RenderResult
interface RenderResult extends Bounds, ExceptionHandler {}
interface ResolutionTimeConstants
interface ResolutionTimeConstants {}
Resolution happens when components are first loaded, either via the resolver or via looking them up in template scope.
property defaultTemplate
defaultTemplate: Template;
method component
component: { ( definitionState: ComponentDefinitionState, owner: object, isOptional?: false ): ComponentDefinition; ( definitionState: object, owner: object, isOptional?: boolean ): ComponentDefinition< object, unknown, InternalComponentManager<unknown, object> >;};
method helper
helper: { ( definitionState: HelperDefinitionState, resolvedName: string | null, isOptional: true ): number | null; (definitionState: object, resolvedName?: string): number;};
method modifier
modifier: { ( definitionState: ModifierDefinitionState, resolvedName: string | null, isOptional: true ): number | null; (definitionState: object, resolvedName?: string): number;};
method resolvedComponent
resolvedComponent: ( definitionState: ResolvedComponentDefinition, resolvedName: string) => ComponentDefinition;
interface ResolvedComponentDefinition
interface ResolvedComponentDefinition< D = ComponentDefinitionState, I = ComponentInstanceState, M extends InternalComponentManager<I, D> = InternalComponentManager<I, D>> {}
interface ResolvedLayout
interface ResolvedLayout {}
property capabilities
capabilities: InternalComponentCapabilities;
property compilable
compilable: Option<CompilableProgram>;
property handle
handle: number;
interface RuntimeArtifacts
interface RuntimeArtifacts {}
interface RuntimeConstants
interface RuntimeConstants {}
interface RuntimeContext
interface RuntimeContext {}
The Runtime is the set of static structures that contain the compiled code and any host configuration.
The contents of the Runtime do not change as the VM executes, unlike the VM state.
interface RuntimeHeap
interface RuntimeHeap extends OpcodeHeap {}
interface RuntimeOp
interface RuntimeOp {}
interface RuntimeProgram
interface RuntimeProgram {}
interface RuntimeResolver
interface RuntimeResolver<O extends Owner = Owner> {}
method lookupComponent
lookupComponent: (name: string, owner: O) => Option<ResolvedComponentDefinition>;
interface Scope
interface Scope {}
property owner
readonly owner: Owner;
property slots
readonly slots: Array<ScopeSlot>;
method bind
bind: (symbol: number, value: ScopeSlot) => void;
method bindBlock
bindBlock: (symbol: number, value: ScopeBlock) => void;
method bindEvalScope
bindEvalScope: (map: Option<Dict<ScopeSlot>>) => void;
method bindPartialMap
bindPartialMap: (map: Dict<Reference>) => void;
method bindSelf
bindSelf: (self: Reference) => void;
method bindSymbol
bindSymbol: (symbol: number, value: Reference) => void;
method child
child: () => Scope;
method getBlock
getBlock: (symbol: number) => ScopeBlock;
method getEvalScope
getEvalScope: () => Option<Dict<ScopeSlot>>;
method getPartialMap
getPartialMap: () => Option<Dict<Reference>>;
method getSelf
getSelf: () => Reference;
method getSymbol
getSymbol: (symbol: number) => Reference;
interface SerializedHeap
interface SerializedHeap {}
interface SerializedTemplate
interface SerializedTemplate {}
A JSON object that the compiled Template was serialized into.
property block
block: SerializedTemplateBlock;
property id
id?: Option<string>;
property moduleName
moduleName: string;
interface SerializedTemplateWithLazyBlock
interface SerializedTemplateWithLazyBlock {}
A JSON object containing the SerializedTemplateBlock as JSON and TemplateMeta.
property block
block: SerializedTemplateBlockJSON;
property id
id?: Option<string>;
property isStrictMode
isStrictMode: boolean;
property moduleName
moduleName: string;
property scope
scope: (() => unknown[]) | undefined | null;
interface SexpOpcodeMap
interface SexpOpcodeMap extends ExpressionSexpOpcodeMap, StatementSexpOpcodeMap {}
interface SimpleArgsOptions
interface SimpleArgsOptions {}
property atNames
atNames: boolean;
property named
named: Option<WireFormat.Core.Hash>;
property positional
positional: Option<WireFormat.Core.Params>;
interface SimpleLiveBlock
interface SimpleLiveBlock extends LiveBlock {}
method firstNode
firstNode: () => SimpleNode;
method lastNode
lastNode: () => SimpleNode;
method parentElement
parentElement: () => SimpleElement;
interface SpecTreeConstruction
interface SpecTreeConstruction {}
method appendComment
appendComment: (text: string) => NodeToken;
method appendText
appendText: (text: string) => NodeToken;
method appendTo
appendTo: (parent: SimpleElement | SimpleDocumentFragment) => NodeTokens;
method closeElement
closeElement: () => void;
method openElement
openElement: (name: string, ns?: Namespace) => NodeToken;
method setAttribute
setAttribute: (name: string, value: string, namespace?: Namespace) => void;
interface Stack
interface Stack<T> {}
interface STDLib
interface STDLib {}
property 'cautious-append'
'cautious-append': number;
property 'cautious-non-dynamic-append'
'cautious-non-dynamic-append': number;
property 'trusting-append'
'trusting-append': number;
property 'trusting-non-dynamic-append'
'trusting-non-dynamic-append': number;
property main
main: number;
interface StdLibOperand
interface StdLibOperand {}
interface SymbolTableOperand
interface SymbolTableOperand {}
interface TemplateCompilationContext
interface TemplateCompilationContext {}
Options for compiling a specific template. This carries along the static information associated with the entire template when compiling blocks nested inside of it.
interface TemplateError
interface TemplateError {}
interface TemplateIterator
interface TemplateIterator {}
interface TemplateOk
interface TemplateOk {}
Environment specific template.
property moduleName
moduleName: string;
Module name associated with the template, used for debugging purposes
property result
result: 'ok';
method asLayout
asLayout: () => CompilableProgram;
method asWrappedLayout
asWrappedLayout: () => CompilableProgram;
interface Transaction
interface Transaction {}
interface TreeOperations
interface TreeOperations {}
interface Unique
interface Unique<T> {}
property 'Unique [id=ada0f31f-27f7-4ab0-bc03-0005387c9d5f]'
'Unique [id=ada0f31f-27f7-4ab0-bc03-0005387c9d5f]': T;
interface UpdatableBlock
interface UpdatableBlock extends SimpleLiveBlock {}
method reset
reset: (env: Environment) => SimpleNode;
interface UpdatingOpcode
interface UpdatingOpcode {}
method evaluate
evaluate: (vm: UpdatingVM) => void;
interface UpdatingVM
interface UpdatingVM {}
property alwaysRevalidate
alwaysRevalidate: boolean;
property dom
dom: GlimmerTreeChanges;
property env
env: Environment;
method execute
execute: (opcodes: UpdatingOpcode[], handler: ExceptionHandler) => void;
method goto
goto: (index: number) => void;
method throw
throw: () => void;
method try
try: (ops: UpdatingOpcode[], handler: ExceptionHandler | null) => void;
interface VM
interface VM<O extends Owner = Owner> {}
This is used in the Glimmer Embedding API. In particular, embeddings provide helpers through the
CompileTimeLookup
interface, and the helpers they provide implement theHelper
interface, which is a function that takes aVM
as a parameter.
property env
env: Environment;
method associateDestroyable
associateDestroyable: (child: Destroyable) => void;
method dynamicScope
dynamicScope: () => DynamicScope;
method getOwner
getOwner: () => O;
method getSelf
getSelf: () => Reference;
interface VMArguments
interface VMArguments {}
property length
length: number;
property named
named: NamedArguments;
property positional
positional: PositionalArguments;
method at
at: (pos: number) => Reference;
method capture
capture: () => CapturedArguments;
interface WithAttributeHook
interface WithAttributeHook<ComponentInstanceState> extends InternalComponentManager<ComponentInstanceState> {}
method didSplatAttributes
didSplatAttributes: ( component: ComponentInstanceState, element: ComponentInstanceState, operations: ElementOperations) => void;
interface WithCreateInstance
interface WithCreateInstance< ComponentInstanceState = unknown, ComponentDefinitionState = unknown, O extends Owner = Owner> extends InternalComponentManager< ComponentInstanceState, ComponentDefinitionState > {}
method create
create: ( owner: O, state: ComponentDefinitionState, args: Option<VMArguments>, env: Environment, dynamicScope: Option<DynamicScope>, caller: Reference, hasDefaultBlock: boolean) => ComponentInstanceState;
method didCreate
didCreate: (state: ComponentInstanceState) => void;
method didRenderLayout
didRenderLayout: (state: ComponentInstanceState, bounds: Bounds) => void;
method didUpdate
didUpdate: (state: ComponentInstanceState) => void;
method didUpdateLayout
didUpdateLayout: (state: ComponentInstanceState, bounds: Bounds) => void;
interface WithCustomDebugRenderTree
interface WithCustomDebugRenderTree< ComponentInstanceState = unknown, ComponentDefinitionState = unknown> extends InternalComponentManager< ComponentInstanceState, ComponentDefinitionState > {}
method getDebugCustomRenderTree
getDebugCustomRenderTree: ( definition: ComponentDefinitionState, state: ComponentInstanceState, args: CapturedArguments, template?: string) => CustomRenderNode[];
interface WithDynamicLayout
interface WithDynamicLayout< I = ComponentInstanceState, R extends RuntimeResolver = RuntimeResolver> extends InternalComponentManager<I> {}
method getDynamicLayout
getDynamicLayout: (component: I, resolver: R) => CompilableProgram | null;
interface WithDynamicTagName
interface WithDynamicTagName<ComponentInstanceState> extends InternalComponentManager<ComponentInstanceState> {}
method getTagName
getTagName: (component: ComponentInstanceState) => Option<string>;
interface WithElementHook
interface WithElementHook<ComponentInstanceState> extends InternalComponentManager<ComponentInstanceState> {}
method didCreateElement
didCreateElement: ( component: ComponentInstanceState, element: SimpleElement, operations: ElementOperations) => void;
interface WithPrepareArgs
interface WithPrepareArgs< ComponentInstanceState = unknown, ComponentDefinitionState = unknown> extends InternalComponentManager< ComponentInstanceState, ComponentDefinitionState > {}
method prepareArgs
prepareArgs: ( state: ComponentDefinitionState, args: VMArguments) => Option<PreparedArguments>;