Skip to content

Facet.computeN method

Facet › computeN

Official

Create an extension that computes zero or more values for this facet from a state.

Signature:

computeN(deps: readonly ("doc" | "selection" | FacetReader<unknown> | StateField<unknown>)[], get: (state: EditorState) => readonly Input[]): Extension

Parameters:

ParameterTypeDescription
depsreadonly ("doc" | "selection" | FacetReader<unknown> | StateField<unknown>)[]The dependencies.
get(state: EditorState) => readonly Input[]The getter function.

Returns: ExtensionThe extension.