Skip to Content
DocumentationAPI Reference2DCodeClassesClass: CodeSignalContext<TOwner>

@revideo/2d


@revideo/2d / code / CodeSignalContext

Class: CodeSignalContext<TOwner>

Defined in: 2d/src/lib/code/CodeSignal.ts:67 

Extends

Type Parameters

TOwner

TOwner

Implements

Constructors

Constructor

new CodeSignalContext<TOwner>(initial, owner, highlighter?): CodeSignalContext<TOwner>

Defined in: 2d/src/lib/code/CodeSignal.ts:73 

Parameters

initial

PossibleCodeScope

owner

TOwner

highlighter?

SignalValue<CodeHighlighter<unknown> | null>

Returns

CodeSignalContext<TOwner>

Overrides

SignalContext<PossibleCodeScope, CodeScope, TOwner>.constructor

Properties

current

protected current: SignalValue<PossibleCodeScope> | undefined

Defined in: core/lib/signals/SignalContext.d.ts:27

Inherited from

SignalContext.current


dependencies

protected dependencies: Set<Subscribable<void, EventHandler<void>>>

Defined in: core/lib/signals/DependencyContext.d.ts:20

Inherited from

FiltersSignalContext.dependencies


event

protected event: FlagDispatcher

Defined in: core/lib/signals/DependencyContext.d.ts:21

Inherited from

FiltersSignalContext.event


extensions

protected extensions: SignalExtensions<PossibleCodeScope, CodeScope>

Defined in: core/lib/signals/SignalContext.d.ts:26

Inherited from

SignalContext.extensions


invokable

protected readonly invokable: any

Defined in: core/lib/signals/DependencyContext.d.ts:19

Inherited from

FiltersSignalContext.invokable


last

protected last: CodeScope | undefined

Defined in: core/lib/signals/SignalContext.d.ts:28

Inherited from

SignalContext.last


markDirty

protected markDirty: () => void

Defined in: core/lib/signals/DependencyContext.d.ts:22

Returns

void

Inherited from

SignalContext.markDirty


owner

protected owner: TOwner

Defined in: core/lib/signals/DependencyContext.d.ts:11

Inherited from

SignalContext.owner


parser

protected parser: (value) => CodeScope

Defined in: core/lib/signals/SignalContext.d.ts:25

Parameters

value

PossibleCodeScope

Returns

CodeScope

Inherited from

SignalContext.parser


tweening

protected tweening: boolean

Defined in: core/lib/signals/SignalContext.d.ts:29

Inherited from

FiltersSignalContext.tweening


collectionSet

protected static collectionSet: Set<DependencyContext<any>>

Defined in: core/lib/signals/DependencyContext.d.ts:12

Inherited from

SignalContext.collectionSet


collectionStack

protected static collectionStack: DependencyContext<any>[]

Defined in: core/lib/signals/DependencyContext.d.ts:13

Inherited from

SignalContext.collectionStack


promises

protected static promises: PromiseHandle<any>[]

Defined in: core/lib/signals/DependencyContext.d.ts:14

Inherited from

SignalContext.promises

Methods

append()

Call Signature

append(code): TOwner

Defined in: 2d/src/lib/code/CodeSignal.ts:130 

Parameters
code

string

Returns

TOwner

Implementation of

CodeSignalHelpers.append

Call Signature

append(code, duration): ThreadGenerator

Defined in: 2d/src/lib/code/CodeSignal.ts:131 

Parameters
code

string

duration

number

Returns

ThreadGenerator

Implementation of

CodeSignalHelpers.append

Call Signature

append(duration?): TagGenerator

Defined in: 2d/src/lib/code/CodeSignal.ts:132 

Parameters
duration?

number

Returns

TagGenerator

Implementation of

CodeSignalHelpers.append


clearDependencies()

protected clearDependencies(): void

Defined in: core/lib/signals/DependencyContext.d.ts:27

Returns

void

Inherited from

SignalContext.clearDependencies


collect()

protected collect(): void

Defined in: core/lib/signals/DependencyContext.d.ts:28

Returns

void

Inherited from

SignalContext.collect


createQueue()

protected createQueue(defaultTimingFunction, defaultInterpolationFunction): SignalGenerator<PossibleCodeScope, CodeScope>

Defined in: core/lib/signals/SignalContext.d.ts:38

Parameters

defaultTimingFunction

TimingFunction

defaultInterpolationFunction

InterpolationFunction<CodeScope>

Returns

SignalGenerator<PossibleCodeScope, CodeScope>

Inherited from

SignalContext.createQueue


dispose()

dispose(): void

Defined in: core/lib/signals/SignalContext.d.ts:41

Returns

void

Inherited from

SignalContext.dispose


edit()

edit(duration?): TagGenerator

Defined in: 2d/src/lib/code/CodeSignal.ts:125 

Parameters

duration?

number = 0.6

Returns

TagGenerator

Implementation of

CodeSignalHelpers.edit


finishCollecting()

protected finishCollecting(): void

Defined in: core/lib/signals/DependencyContext.d.ts:26

Returns

void

Inherited from

SignalContext.finishCollecting


get()

get(): CodeScope

Defined in: core/lib/signals/SignalContext.d.ts:35

Returns

CodeScope

Inherited from

SignalContext.get


getInitial()

getInitial(): SignalValue<PossibleCodeScope> | undefined

Defined in: core/lib/signals/SignalContext.d.ts:90

Get the initial value of this signal.

Returns

SignalValue<PossibleCodeScope> | undefined

Inherited from

SignalContext.getInitial


getter()

getter(): CodeScope

Defined in: core/lib/signals/SignalContext.d.ts:36

Returns

CodeScope

Inherited from

SignalContext.getter


insert()

Call Signature

insert(point, code): TOwner

Defined in: 2d/src/lib/code/CodeSignal.ts:178 

Parameters
point

CodePoint

code

string

Returns

TOwner

Implementation of

CodeSignalHelpers.insert

Call Signature

insert(point, code, duration): ThreadGenerator

Defined in: 2d/src/lib/code/CodeSignal.ts:179 

Parameters
point

CodePoint

code

string

duration

number

Returns

ThreadGenerator

Implementation of

CodeSignalHelpers.insert


invoke()

protected invoke(value?, duration?, timingFunction?, interpolationFunction?): CodeScope | TOwner | SignalGenerator<PossibleCodeScope, CodeScope>

Defined in: core/lib/signals/SignalContext.d.ts:37

Parameters

value?

typeof DEFAULT | SignalValue<PossibleCodeScope>

duration?

number

timingFunction?

TimingFunction

interpolationFunction?

InterpolationFunction<CodeScope, any[]>

Returns

CodeScope | TOwner | SignalGenerator<PossibleCodeScope, CodeScope>

Inherited from

SignalContext.invoke


isInitial()

isInitial(): boolean

Defined in: core/lib/signals/SignalContext.d.ts:86

Check if the signal is currently using its initial value.

Returns

boolean

Example

const signal = createSignal(0); signal.isInitial(); // true signal(5); signal.isInitial(); // false signal(DEFAULT); signal.isInitial(); // true

Inherited from

SignalContext.isInitial


isTweening()

isTweening(): boolean

Defined in: core/lib/signals/SignalContext.d.ts:118

Is the signal undergoing a tween?

Returns

boolean

Inherited from

SignalContext.isTweening


parse()

parse(value): CodeScope

Defined in: 2d/src/lib/code/CodeSignal.ts:308 

Parameters

value

PossibleCodeScope

Returns

CodeScope

Overrides

SignalContext.parse


prepend()

Call Signature

prepend(code): TOwner

Defined in: 2d/src/lib/code/CodeSignal.ts:154 

Parameters
code

string

Returns

TOwner

Implementation of

CodeSignalHelpers.prepend

Call Signature

prepend(code, duration): ThreadGenerator

Defined in: 2d/src/lib/code/CodeSignal.ts:155 

Parameters
code

string

duration

number

Returns

ThreadGenerator

Implementation of

CodeSignalHelpers.prepend

Call Signature

prepend(duration?): TagGenerator

Defined in: 2d/src/lib/code/CodeSignal.ts:156 

Parameters
duration?

number

Returns

TagGenerator

Implementation of

CodeSignalHelpers.prepend


raw()

raw(): SignalValue<PossibleCodeScope> | undefined

Defined in: core/lib/signals/SignalContext.d.ts:114

Get the raw value of this signal.

Returns

SignalValue<PossibleCodeScope> | undefined

Remarks

If the signal was provided with a factory function, the function itself will be returned, without invoking it.

This method can be used to create copies of signals.

Example

const a = createSignal(2); const b = createSignal(() => a); // b() == 2 const bClone = createSignal(b.raw()); // bClone() == 2 a(4); // b() == 4 // bClone() == 4

Inherited from

SignalContext.raw


remove()

Call Signature

remove(range): TOwner

Defined in: 2d/src/lib/code/CodeSignal.ts:192 

Parameters
range

CodeRange

Returns

TOwner

Implementation of

CodeSignalHelpers.remove

Call Signature

remove(range, duration): ThreadGenerator

Defined in: 2d/src/lib/code/CodeSignal.ts:193 

Parameters
range

CodeRange

duration

number

Returns

ThreadGenerator

Implementation of

CodeSignalHelpers.remove


replace()

Call Signature

replace(range, code): TOwner

Defined in: 2d/src/lib/code/CodeSignal.ts:198 

Parameters
range

CodeRange

code

string

Returns

TOwner

Implementation of

CodeSignalHelpers.replace

Call Signature

replace(range, code, duration): ThreadGenerator

Defined in: 2d/src/lib/code/CodeSignal.ts:199 

Parameters
range

CodeRange

code

string

duration

number

Returns

ThreadGenerator

Implementation of

CodeSignalHelpers.replace


reset()

reset(): TOwner

Defined in: core/lib/signals/SignalContext.d.ts:54

Reset the signal to its initial value (if one has been set).

Returns

TOwner

Example

const signal = createSignal(7); signal.reset(); // same as: signal(7);

Inherited from

SignalContext.reset


save()

save(): TOwner

Defined in: core/lib/signals/SignalContext.d.ts:69

Compute the current value of the signal and immediately set it.

Returns

TOwner

Remarks

This method can be used to stop the signal from updating while keeping its current value.

Example

signal.save(); // same as: signal(signal());

Inherited from

SignalContext.save


set()

set(value): TOwner

Defined in: core/lib/signals/SignalContext.d.ts:33

Parameters

value

typeof DEFAULT | SignalValue<PossibleCodeScope>

Returns

TOwner

Inherited from

SignalContext.set


setter()

setter(value): TOwner

Defined in: core/lib/signals/SignalContext.d.ts:34

Parameters

value

typeof DEFAULT | SignalValue<PossibleCodeScope>

Returns

TOwner

Inherited from

SignalContext.setter


startCollecting()

protected startCollecting(): void

Defined in: core/lib/signals/DependencyContext.d.ts:25

Returns

void

Inherited from

SignalContext.startCollecting


toPromise()

toPromise(): Promise<CodeSignalContext<TOwner>>

Defined in: core/lib/signals/DependencyContext.d.ts:30

Returns

Promise<CodeSignalContext<TOwner>>

Inherited from

SignalContext.toPromise


toSignal()

toSignal(): CodeSignal<TOwner>

Defined in: 2d/src/lib/code/CodeSignal.ts:312 

Returns

CodeSignal<TOwner>

Overrides

SignalContext.toSignal


tween()

protected tween(value, duration, timingFunction, interpolationFunction): ThreadGenerator

Defined in: core/lib/signals/SignalContext.d.ts:39

Parameters

value

typeof DEFAULT | SignalValue<PossibleCodeScope>

duration

number

timingFunction

TimingFunction

interpolationFunction

InterpolationFunction<CodeScope>

Returns

ThreadGenerator

Inherited from

SignalContext.tween


tweener()

tweener(value, duration, timingFunction): ThreadGenerator

Defined in: 2d/src/lib/code/CodeSignal.ts:99 

Parameters

value

SignalValue<PossibleCodeScope>

duration

number

timingFunction

TimingFunction

Returns

ThreadGenerator

Overrides

SignalContext.tweener


collectPromise()

Call Signature

static collectPromise<T>(promise): PromiseHandle<T | null>

Defined in: core/lib/signals/DependencyContext.d.ts:15

Type Parameters
T

T

Parameters
promise

Promise<T>

Returns

PromiseHandle<T | null>

Inherited from

SignalContext.collectPromise

Call Signature

static collectPromise<T>(promise, initialValue): PromiseHandle<T>

Defined in: core/lib/signals/DependencyContext.d.ts:16

Type Parameters
T

T

Parameters
promise

Promise<T>

initialValue

T

Returns

PromiseHandle<T>

Inherited from

SignalContext.collectPromise


consumePromises()

static consumePromises(): Promise<PromiseHandle<any>[]>

Defined in: core/lib/signals/DependencyContext.d.ts:18

Returns

Promise<PromiseHandle<any>[]>

Inherited from

SignalContext.consumePromises


hasPromises()

static hasPromises(): boolean

Defined in: core/lib/signals/DependencyContext.d.ts:17

Returns

boolean

Inherited from

SignalContext.hasPromises

© 2026 Haven Technologies, Inc.
Class: CodeSignalContext<TOwner> – Revideo