Skip to content

EffectsHost

Defined in: renderer/src/effects/EffectsHost.ts:23

Per-attachment-site holder for an EffectStack. Every scope (component, layer, scene, screen) carries its own EffectsHost exposed as .fx, so the user-facing API for adding / finding / fading effects is identical regardless of where the effect lives.

The underlying EffectStack is built lazily on first addEffect so sites that never use effects pay zero cost.

getContainer is a thunk because some sites (component scope) wire the host at construction time but the underlying display object may itself be created in the same constructor — the thunk removes “is this stable yet?” thinking. makeQueue is optional because some test setups omit a ProcessSystem; calling addEffect then throws a clear error.

new EffectsHost(getContainer, scope, makeQueue): EffectsHost

Defined in: renderer/src/effects/EffectsHost.ts:26

() => DisplayContainer

EffectScope

(() => ScopedProcessQueue) | undefined

EffectsHost

get size(): number

Defined in: renderer/src/effects/EffectsHost.ts:51

Number of attached effects on this host.

number

addEffect<H>(factory): H

Defined in: renderer/src/effects/EffectsHost.ts:36

Attach a visual effect. Returns a typed handle for fading, removal, intensity, and any per-effect extras the factory exposes.

H extends EffectHandle

EffectFactory<H>

H


destroy(): void

Defined in: renderer/src/effects/EffectsHost.ts:60

Internal

— torn down by the owning site (component/layer/scene/screen) before its container is destroyed, so user-assigned external filters survive the EffectStack teardown.

void


findEffect<H, O>(definition): H | null

Defined in: renderer/src/effects/EffectsHost.ts:44

Recover the handle for the first effect attached here whose underlying definition is definition. Returns null if no match exists.

H extends EffectHandle

O

EffectDefinition<H, O>

H | null

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/renderer.md.