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).
Properties
Section titled “Properties”| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
apiVersion | readonly | 1 | Protocol 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 |
Methods
Section titled “Methods”attach()
Section titled “attach()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
map | maplibregl.Map |
layers | EffectLayerRef[] |
Returns
Section titled “Returns”lower()
Section titled “lower()”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”.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
effect | EffectBlock |
layer | Record<string, unknown> |
Returns
Section titled “Returns”Record<string, unknown> | null | undefined
types()
Section titled “types()”types():
string[]
Defined in: packages/core/src/effects-host.ts:60
Registered effect types, for messages.
Returns
Section titled “Returns”string[]
validate()
Section titled “validate()”validate(
effect):EffectIssue[]
Defined in: packages/core/src/effects-host.ts:62
Validate a block’s type and params. An empty array means valid.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
effect | EffectBlock |