mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-18 23:20:31 +00:00
Merge pull request #30053 from sgreav/master
[Slate] Correct definition for KeyUtils
This commit is contained in:
Vendored
+5
-5
@@ -1,4 +1,4 @@
|
||||
// Type definitions for slate 0.42
|
||||
// Type definitions for slate 0.43
|
||||
// Project: https://github.com/ianstormtaylor/slate
|
||||
// Definitions by: Andy Kent <https://github.com/andykent>
|
||||
// Jamie Talbot <https://github.com/majelbstoat>
|
||||
@@ -1478,10 +1478,10 @@ export class SlateError extends Error {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface KeyUtils {
|
||||
create(key: string): string;
|
||||
setGenerator(func: () => any): void;
|
||||
resetGenerator(): void;
|
||||
export namespace KeyUtils {
|
||||
function create(key?: string): string;
|
||||
function setGenerator(func: () => any): void;
|
||||
function resetGenerator(): void;
|
||||
}
|
||||
|
||||
export type useMemoization = () => void;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Value, Data, BlockJSON, Document, Editor, Change } from "slate";
|
||||
import { Value, Data, BlockJSON, Document, Editor, Change, KeyUtils } from "slate";
|
||||
|
||||
const data = Data.create({ foo: "bar " });
|
||||
const value = Value.create({ data });
|
||||
@@ -58,3 +58,7 @@ editor.command("testCommand");
|
||||
editor.query("testQuery");
|
||||
editor.run("testCommand");
|
||||
editor.event("mouseDown", new Event("mouseDown"));
|
||||
|
||||
KeyUtils.setGenerator(() => "Test");
|
||||
KeyUtils.create();
|
||||
KeyUtils.resetGenerator();
|
||||
|
||||
Reference in New Issue
Block a user