Skip to content

DescriptionContext

Overview

API Context for description plugins.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class DescriptionContext

import { DescriptionContext } from 'scenerystack/joist';

Instance Methods

get( tandemID : string ) : PhetioObject | null

createDerivedProperty( dependencies : TReadOnlyProperty<unknown>[], derivation : ( ...args: unknown[] ) => unknown ) : TReadOnlyProperty<unknown>

addListener( emitter : TReadOnlyEmitter<unknown[]>, listener : TEmitterListener<unknown[]> )

removeListener( emitter : TEmitter<unknown[]>, listener : TEmitterListener<unknown[]> )

nodeSet( node : Node, property : keyof Node, value : unknown )

propertySet( property : TProperty<unknown>, value : unknown )

createCallbackTimer( options? : CallbackTimerOptions ) : CallbackTimer

createUtterance( options? : UtteranceOptions ) : Utterance

createNode( options? : NodeOptions ) : Node

Creates a Node through the context.

TODO: Consider making the tagName required for this context? See https://github.com/phetsims/joist/issues/941

dispose()

Static Methods

startupComplete()

registerStrings( strings : DescriptionStrings ) : DescriptionStrings

registerLogic( logic : DescriptionLogic ) : DescriptionLogic

externalLoad( str : string ) : Promise<Error | null>

Type DescriptionLogic

import type { DescriptionLogic } from 'scenerystack/joist';

Type DescriptionStrings

import type { DescriptionStrings } from 'scenerystack/joist';

Class ExternalLoadError

import { ExternalLoadError } from 'scenerystack/joist';

Constructor

new ExternalLoadError( error : Error, dataURI : string )

Instance Methods

Instance Properties

line : number

(readonly)

column : number

(readonly)

Source Code

See the source for DescriptionContext.ts in the joist repository.