Skip to content

Instantly share code, notes, and snippets.

@gustav1105
Created February 17, 2020 04:47
Show Gist options
  • Save gustav1105/d36ceb1a1033f746d6d6d4adf144028a to your computer and use it in GitHub Desktop.
Save gustav1105/d36ceb1a1033f746d6d6d4adf144028a to your computer and use it in GitHub Desktop.
type-definitions-draft-utils-plugins
declare module "draft-js-plugins-utils" {
import { EditorState, DraftEntityType, EntityInstance } from "draft-js";
function createLinkAtSelection(
editorState: EditorState,
url: string
): EditorState;
function getCurrentEntityKey(editorState: EditorState): string | null;
function getCurrentEntity(editorState: EditorState): EntityInstance;
function hasEntity(
editorState: EditorState,
entityType: DraftEntityType
): boolean;
//@ts-ignore
declare const _default = {
createLinkAtSelection,
getCurrentEntityKey,
getCurrentEntity,
hasEntity
};
export default _default;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment