Update index.d.ts

Some newly added props in braft-editor were not in the definition
This commit is contained in:
theCuriousOne
2018-06-19 22:23:03 +02:00
committed by GitHub
parent df0b5c861d
commit eb439fbe44
+26 -5
View File
@@ -1,4 +1,4 @@
// Type definitions for braft-editor 1.1
// Type definitions for braft-editor 1.9.7
// Project: https://github.com/margox/braft#readme
// Definitions by: My Self <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -17,25 +17,44 @@ declare namespace BraftEditor {
editorState?: any;
contentFormat?: 'raw' | 'html';
initialContent?: string | null;
contentId?: string | number;
onChange?: (content: RawDraftContentState) => void;
onRawChange?: (content: RawDraftContentState) => void;
onHTMLChange?: (content: string) => void;
onTab?: (event: Event) => void;
onSave?: () => void;
onFocus?: () => void;
onBlur?: () => void;
controls?: string[];
excludeControls?: string[];
extendControls?: any[];
extendAtomics?: any[];
disabled?: boolean;
height?: number;
language?: string;
placeholder?: string;
viewWrapper?: string;
tabIndents?: number;
forceNewLine?: boolean;
textAlignOptions?: string[];
colors?: string[];
allowSetTextBackgroundColor?: boolean;
fontSizes?: number[];
lineHeights?: number[];
letterSpacings?: number[];
indents?: number[];
fontFamilies?: fontFamiliesRange[];
emojis?: string[];
pasteMode?: 'text' | '';
media?: { [key: string]: any };
imageControls?: any;
getContent?: (format?: string) => RawDraftContentState;
setContent?: (content: RawDraftContentState, format?: string) => void;
toggleSelectionBlockType?: (blockquote: string) => any;
toggleSelectionInlineStyle?: (style: string, stylesToBeRemoved?: string[]) => any;
insertMedias?: (medias: Array<{ type: string, name: string, url: string }>) => void;
insertText?: (text: string, replace?: boolean) => void;
insertMedias?: (medias: Array<{ type: string, name: string, url: string }>) => any;
insertText?: (text: string, replace?: boolean) => any;
insertHTML?: (htmlString: string) => any;
toggleSelectionLink?: (href: string, target: string) => void;
toggleSelectionAlignment?: (alignment: string) => any;
toggleSelectionColor?: (hexColor: string) => void;
@@ -50,10 +69,12 @@ declare namespace BraftEditor {
getDraftInstance?: () => any;
getMediaLibraryInstance?: () => any;
getSelectionInlineStyle?: () => any;
isEmpty?: () => boolean;
clear?: () => any;
undo?: () => any;
redo?: () => any;
focus?: () => void;
blur?: () => void;
focus?: () => any;
blur?: () => any;
}
}
declare class BraftEditor extends React.Component<BraftEditor.editorProps> { }