Skip to content

Facet<Input, Output>

Unofficial

Import:

import type { Facet } from '@codemirror/state';

Signature:

export interface Facet<Input, Output>

Methods

MethodReturnsDescription
compute(deps, get)ExtensionCreate an extension that computes a value for the facet from a state.
computeN(deps, get)ExtensionCreate an extension that computes zero or more values for this facet from a state.
from(field)ExtensionShorthand method for registering a facet source with a state field as input.
from(field, get)ExtensionShorthand method for registering a facet source with a state field as input, using a getter function.
of(value)ExtensionReturns an extension that adds the given value to this facet.

Links to this page: