mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
[@types/slate] Support nested plugin stacks on the "plugins" c… (#36349)
* fix: editor takes a recursively nested plugin stack as contructor argument * chore: formatting * refactor: remove obsolete list type. naming * fix: enforce a list as root data type. * Update index.d.ts
This commit is contained in:
committed by
Daniel Rosenwasser
parent
64175d87d6
commit
92c707eed0
Vendored
+4
-2
@@ -1131,9 +1131,11 @@ export interface Plugin {
|
||||
schema?: SchemaProperties;
|
||||
}
|
||||
|
||||
export interface Plugins extends Array<Plugin | Plugins> {}
|
||||
|
||||
export interface EditorProperties {
|
||||
onChange?: (change: { operations: Immutable.List<Operation>, value: Value }) => void;
|
||||
plugins?: Plugin[];
|
||||
onChange?: (change: { operations: Immutable.List<Operation>; value: Value }) => void;
|
||||
plugins?: Plugins;
|
||||
readOnly?: boolean;
|
||||
value?: Value;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ const plugin: Plugin = {
|
||||
schema: {...schema},
|
||||
};
|
||||
|
||||
const plugins = [plugin];
|
||||
const plugins = [plugin, [plugin, [plugin]]];
|
||||
|
||||
const editor = new Editor({ value, plugins });
|
||||
const point = Point.create({ key: "a", offset: 0 });
|
||||
|
||||
Reference in New Issue
Block a user