Skip to content

API reference

Functions

createEditor

Source
createEditor(options: CreateEditorOptions) => ReturnType<typeof lexicalEditor>

Exported from: @nexload-sdk/payload-editor

Public function exported by @nexload-sdk/payload-editor.

defineEditorPreset

Source
defineEditorPreset(options: DefineEditorPresetOptions) => EditorPreset

Exported from: @nexload-sdk/payload-editor

Public function exported by @nexload-sdk/payload-editor.

Classes

PayloadEditorConfigError

Source
class PayloadEditorConfigError

Exported from: @nexload-sdk/payload-editor

Public classe exported by @nexload-sdk/payload-editor.

Interfaces

DefineEditorPresetOptions

Source
interface DefineEditorPresetOptions { readonly features: Readonly<EditorFeatureConfig> }

Exported from: @nexload-sdk/payload-editor

Public interface exported by @nexload-sdk/payload-editor.

EditorFeatureConfig

Source
interface EditorFeatureConfig {
  paragraph?: FeatureOption
  heading?: FeatureOption<HeadingOptions>
  bold?: FeatureOption
  italic?: FeatureOption
  underline?: FeatureOption
  strikethrough?: FeatureOption
  inlineCode?: FeatureOption
  link?: FeatureOption<LinkOptions>
  unorderedList?: FeatureOption
  orderedList?: FeatureOption
  blockquote?: FeatureOption
  horizontalRule?: FeatureOption
  upload?: FeatureOption<UploadOptions>
  relationship?: FeatureOption<RelationshipOptions>
  inlineToolbar?: FeatureOption
  fixedToolbar?: FeatureOption
}

Exported from: @nexload-sdk/payload-editor

Public interface exported by @nexload-sdk/payload-editor.

EditorPreset

Source
interface EditorPreset {
  readonly [editorPresetBrand]: true
  readonly features: Readonly<EditorFeatureConfig>
}

Exported from: @nexload-sdk/payload-editor

Public interface exported by @nexload-sdk/payload-editor.

HeadingOptions

Source
interface HeadingOptions { sizes?: readonly HeadingSize[] }

Exported from: @nexload-sdk/payload-editor

Public interface exported by @nexload-sdk/payload-editor.

LinkOptions

Source
interface LinkOptions extends RelationalOptions<CollectionSlug> { autoLink?: boolean }

Exported from: @nexload-sdk/payload-editor

Public interface exported by @nexload-sdk/payload-editor.

Types

CreateEditorOptions

Source
type CreateEditorOptions = CommonEditorOptions & (
  | {
    readonly preset: EditorPresetName | EditorPreset
    readonly features?: Readonly<EditorFeatureConfig>
  }
  | {
    readonly preset?: never
    readonly features: Readonly<EditorFeatureConfig>
  }
);

Exported from: @nexload-sdk/payload-editor

Public type exported by @nexload-sdk/payload-editor.

EditorPresetName

Source
type EditorPresetName
  = | "compact"
    | "standard"
    | "structured-content"
    | "article"
    | "product-description";

Exported from: @nexload-sdk/payload-editor

Public type exported by @nexload-sdk/payload-editor.

FeatureOption

Source
type FeatureOption<TOptions = never> = [TOptions] extends [never]
  ? boolean
  : boolean | Readonly<TOptions>;

Exported from: @nexload-sdk/payload-editor

Public type exported by @nexload-sdk/payload-editor.

HeadingSize

Source
type HeadingSize = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";

Exported from: @nexload-sdk/payload-editor

Public type exported by @nexload-sdk/payload-editor.

NativeEditorFeature

Source
type NativeEditorFeature = FeatureProviderServer<any, any, any>;

Exported from: @nexload-sdk/payload-editor

Public type exported by @nexload-sdk/payload-editor.

PayloadEditorConfigErrorCode

Source
type PayloadEditorConfigErrorCode
  = | "PAYLOAD_EDITOR_DEFINITION_REQUIRED"
    | "PAYLOAD_EDITOR_UNKNOWN_PRESET"
    | "PAYLOAD_EDITOR_UNKNOWN_FEATURE"
    | "PAYLOAD_EDITOR_INVALID_FEATURE_OPTIONS"
    | "PAYLOAD_EDITOR_INVALID_HEADING_SIZES"
    | "PAYLOAD_EDITOR_INVALID_COLLECTIONS"
    | "PAYLOAD_EDITOR_INVALID_MAX_DEPTH"
    | "PAYLOAD_EDITOR_INVALID_EXTENSION"
    | "PAYLOAD_EDITOR_DUPLICATE_FEATURE";

Exported from: @nexload-sdk/payload-editor

Public type exported by @nexload-sdk/payload-editor.

RelationshipOptions

Source
type RelationshipOptions = RelationalOptions<CollectionSlug>;

Exported from: @nexload-sdk/payload-editor

Public type exported by @nexload-sdk/payload-editor.

UploadOptions

Source
type UploadOptions = RelationalOptions<UploadCollectionSlug>;

Exported from: @nexload-sdk/payload-editor

Public type exported by @nexload-sdk/payload-editor.

createEditor(options) validates and merges one definition, creates managed feature providers in deterministic order, appends native extensions, and returns Payload’s Lexical editor provider.

defineEditorPreset(options) validates and snapshots a reusable feature definition. Only presets created by this function or built-in preset names are accepted.

PayloadEditorConfigError extends TypeError with stable code, exact path, and optional hint.

The root exports the option, preset, feature, heading, link, upload, relationship, and native-provider types. EditorPresetName is the five-name built-in union. FeatureOption<T> represents boolean | options.

  • PAYLOAD_EDITOR_DEFINITION_REQUIRED
  • PAYLOAD_EDITOR_UNKNOWN_PRESET
  • PAYLOAD_EDITOR_UNKNOWN_FEATURE
  • PAYLOAD_EDITOR_INVALID_FEATURE_OPTIONS
  • PAYLOAD_EDITOR_INVALID_HEADING_SIZES
  • PAYLOAD_EDITOR_INVALID_COLLECTIONS
  • PAYLOAD_EDITOR_INVALID_MAX_DEPTH
  • PAYLOAD_EDITOR_INVALID_EXTENSION
  • PAYLOAD_EDITOR_DUPLICATE_FEATURE

All are configuration-time errors. Do not expose their messages directly as end-user content.

See the root entrypoint for the live export surface.