MCPcopy
hub / github.com/udecode/plate / createPlatePlugin

Function createPlatePlugin

packages/core/src/react/plugin/createPlatePlugin.ts:43–57  ·  view source on GitHub ↗
(
  config:
    | ((editor: PlateEditor) => PlatePluginConfig<K, O, A, T, S>)
    | PlatePluginConfig<K, O, A, T, S> = {}
)

Source from the content-addressed store, hash-verified

41>;
42
43export const createPlatePlugin = <
44 K extends string = any,
45 O = {},
46 A = {},
47 T = {},
48 S = {},
49>(
50 config:
51 | ((editor: PlateEditor) => PlatePluginConfig<K, O, A, T, S>)
52 | PlatePluginConfig<K, O, A, T, S> = {}
53): PlatePlugin<PluginConfig<K, O, A, T, S>> => {
54 const plugin = createSlatePlugin(config as any);
55
56 return toPlatePlugin(plugin as any) as any;
57};
58
59/**
60 * Explicitly typed version of `createPlatePlugin`.

Callers 15

getPluginFunction · 0.90
Plate.slow.tsxFile · 0.90
getParagraphPluginFunction · 0.90
getBoldPluginFunction · 0.90
shortcuts.spec.tsxFile · 0.90

Calls 2

createSlatePluginFunction · 0.90
toPlatePluginFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…