mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Update definitions for slate - Text and Editor (#37514)
* Add marks property missing from Text Add return type to editor.withoutSaving and editor.withoutMerging per https://docs.slatejs.org/slate-core/commands#miscellaneous-commands * Lint fixes * Tests * Formatting * Change from List<Mark> to Set<Mark>
This commit is contained in:
parent
8002c111c6
commit
34dddd92f9
7
types/slate/index.d.ts
vendored
7
types/slate/index.d.ts
vendored
@ -303,7 +303,7 @@ export interface TextProperties {
|
||||
object?: "text";
|
||||
key?: string;
|
||||
text?: string;
|
||||
marks?: Immutable.List<Mark> | Mark[];
|
||||
marks?: Immutable.Set<Mark> | Mark[];
|
||||
}
|
||||
|
||||
export interface TextJSON {
|
||||
@ -325,6 +325,7 @@ export class Text extends Immutable.Record({}) {
|
||||
key: string;
|
||||
|
||||
readonly text: string;
|
||||
readonly marks: Immutable.Set<Mark> | null;
|
||||
|
||||
static create(properties?: TextProperties | TextJSON | Text | string): Text;
|
||||
static createList(
|
||||
@ -1817,8 +1818,8 @@ export class Editor implements Controller {
|
||||
wrapNodeByPath(path: Immutable.List<number>, parent: Block | Document | Inline | Text): Editor;
|
||||
normalize(): Editor;
|
||||
withoutNormalizing(fn: () => void): Editor;
|
||||
withoutSaving(fn: () => void): void;
|
||||
withoutMerging(fn: () => void): void;
|
||||
withoutSaving(fn: () => void): Editor;
|
||||
withoutMerging(fn: () => void): Editor;
|
||||
redo(): Editor;
|
||||
undo(): Editor;
|
||||
save(operation: Operation): void;
|
||||
|
||||
@ -477,11 +477,10 @@ editor
|
||||
properties: {},
|
||||
newProperties: {},
|
||||
data: Data.create({})
|
||||
});
|
||||
|
||||
editor.withoutMerging(() => { /* noop */ });
|
||||
editor.withoutNormalizing(() => { /* noop */ });
|
||||
editor.withoutSaving(() => { /* noop */ });
|
||||
})
|
||||
.withoutMerging(() => { /* noop */ })
|
||||
.withoutNormalizing(() => { /* noop */ })
|
||||
.withoutSaving(() => { /* noop */ });
|
||||
|
||||
KeyUtils.setGenerator(() => "Test");
|
||||
KeyUtils.create();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user