The core of any Sink Plugin is the PluginCustomTypes declaration. This object defines the unique identity and the data structures (Editor, Element, and Text) that the plugin will operate on. Every plugin must define these four properties:
Name: A string literal that uniquely identifies the type.Editor: The specific version of the Editor object the plugin uses. This must extend BaseEditor and can include additional properties (e.g., ReactEditor or custom properties like supportsAnchor: true).Element: The schema for the Element types used by the plugin.Text: The schema for the Text types used by the plugin.
type AnchorCustomTypes = {
Name: "Anchor"
Editor: BaseEditor & ReactEditor & { supportsAnchor: true }
Element: { type: "anchor"; href: string; children: { text: string }[] }
Text: { text: string }
}