mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
fix type of SchemaProperties.document.text (#35245)
according to docs at https://docs.slatejs.org/slate-core/schema#text can be either a RegExp or a function taking a string and returning a boolean
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
6bde72cd87
commit
967388ba23
Vendored
+1
-1
@@ -49,7 +49,7 @@ export interface Rules {
|
||||
}>;
|
||||
normalize?: (editor: Editor, error: SlateError) => void;
|
||||
parent?: ObjectAndType | ObjectAndType[];
|
||||
text?: RegExp;
|
||||
text?: RegExp | ((text: string) => boolean);
|
||||
}
|
||||
|
||||
export interface SchemaProperties {
|
||||
|
||||
@@ -74,7 +74,8 @@ const schema: SchemaProperties = {
|
||||
}
|
||||
}
|
||||
},
|
||||
marks: [{ type: 'bold' }, { type: t => ['bold', 'underline'].indexOf(t) !== -1 }]
|
||||
marks: [{ type: 'bold' }, { type: t => ['bold', 'underline'].indexOf(t) !== -1 }],
|
||||
text: /^Test$/
|
||||
},
|
||||
blocks: {
|
||||
image: {
|
||||
@@ -84,6 +85,14 @@ const schema: SchemaProperties = {
|
||||
},
|
||||
};
|
||||
|
||||
const schema2: SchemaProperties = {
|
||||
document: {
|
||||
text(text) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const pluginCommandName = 'plugin_command';
|
||||
const pluginQueryName = 'plugin_query';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user