Skip to content
QuireKit
Core docs
Alpha · evolving API
API and referenceView Markdown ↗

Extensions: configuration and capability contracts

Practical responsibilities from nodes/marks and commands to profiles, layout and selection.

Configuration and composition

Entry/hookResult or responsibilityConstraint
Extension.create(config)Behavior definitionNo schema node
Node.create() / Mark.create()Node/mark definitionNode content/group and mark restrictions enter one schema
.configure(options)Configured extensionAssemble per instance rather than mutating shared options
.extend(config)Extended definitionReplace intentionally; verify parent-hook invocation and ordering
addOptions()DefaultsOptions are not persistent document data
addStorage()Instance statePersist business attributes in schema where required
addExtensions()Child extensionsComposition point with unique schema owners
addAttributes() / addGlobalAttributes()AttributesDefine defaults, parsing, serialization and migration
addCommands()Raw command factoriesAugment Commands<ReturnType> for direct/chain/can modes
addKeyboardShortcuts()Key handlersUse the same commands and return handling results
addInputRules() / addPasteRules()RulesVerify schema and history behavior
addProseMirrorPlugins()PM pluginsUse the same @quirekit/pm identity

See custom behavior and the complete content extension.

Capability owners

HookConsumerWhat is not automatic
addViewAdapters()Core mount lifetimeSchema does not provide input/painting
addDocumentProfiles()Engine facet resolutionCore does not interpret Word fields or units
addLayoutProviders()View/EngineHTML CSS does not become Canvas layout
addSelectionAdapters()Structured selection and command targetsDrawing is not selection correctness
addDocx()Instance editor.docxJSON persistence does not establish DOCX round trips
addAccessibility()Accessibility ownerDrawing text does not provide accessible semantics
addAiCapabilities()AI coreFeatures supply facts and described commands, not model tools/prompts

Product UI hooks such as addRibbonItems require a consuming product registry. Pure Core does not create chrome from these declarations. See product plugins.

Profiles and providers

Profiles supply model-wide page, paragraph, table and drawing semantics. Each facet has one owner; missing facets use neutral defaults. A profile is distinct from a custom Node's layout provider.

@quirekit/core/document-profileMIT

Document-profile registration owned by an extension. A profile supplies document-model semantics (for example Word paragraph formatting or page sections) to a layout engine through named facets. Core treats the payload as opaque; the consuming engine validates its shape.

QuireDocumentProfileRegistrationts

Providers declare node types and capabilities and return products with source ranges and snapshot identity. Use public subpaths; an internal type name is not necessarily exported at the package root.

@quirekit/core/layout-providerMIT

Renderer-neutral provider registration owned by an extension.

QuireLayoutProviderRegistrationts
@quirekit/view-engine/layout-providerAGPL-3.0-only

Wraps one typed layout provider in renderer-neutral Core registration metadata. Core can diagnose provider ids and node ownership without opening the provider payload. View authority later verifies that the repeated metadata still agrees with the typed payload before execution. @param provider - Provider algorithm and its explicit capability declaration. @returns Core registration carrying the unchanged typed provider payload.

createQuireLayoutProviderRegistrationts

See complete source for measurement → child flow → retained regions and selection. layoutDependency: { kind: 'document' } is valid only for a concrete provider that reads no undeclared external mutable state, not as a general performance switch.

QuireKitQuireKit · Core, plugins and Classic docs