Skip to content

EffectsHost

Defined in: packages/core/src/effects-host.ts:56

The contract between core and an effects implementation.

The effects API may change in minor releases (D-A3).

PropertyModifierTypeDescriptionDefined in
apiVersionreadonly1Protocol version; bumped on a breaking change to this interface. :::caution[Experimental] This API should not be used in production and may be trimmed from a public release. :::packages/core/src/effects-host.ts:58

attach(map, layers): EffectsAttachment

Defined in: packages/core/src/effects-host.ts:68

Attach effects to a live map whose style already contains the static layers. Must never throw for an unsupported environment: it declares absence (warns once, leaves the static layer visible) instead.

ParameterType
mapmaplibregl.Map
layersEffectLayerRef[]

EffectsAttachment


lower(effect, layer): Record<string, unknown> | null | undefined

Defined in: packages/core/src/effects-host.ts:74

The export lowering for one effect: the layer spec the emitted style should carry, or null when the layer doesn’t export (it is dropped). undefined means “unknown type — ship the layer as authored”.

ParameterType
effectEffectBlock
layerRecord<string, unknown>

Record<string, unknown> | null | undefined


types(): string[]

Defined in: packages/core/src/effects-host.ts:60

Registered effect types, for messages.

string[]


validate(effect): EffectIssue[]

Defined in: packages/core/src/effects-host.ts:62

Validate a block’s type and params. An empty array means valid.

ParameterType
effectEffectBlock

EffectIssue[]