Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

RichTextUtils.js.flow 1.6 KiB

3 лет назад
123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @format
  8. * @flow strict-local
  9. * @emails oncall+draft_js
  10. */
  11. import type ContentState from "./ContentState";
  12. import type { DraftBlockType } from "./DraftBlockType";
  13. import type { DraftEditorCommand } from "./DraftEditorCommand";
  14. import type EditorState from "./EditorState";
  15. import type SelectionState from "./SelectionState";
  16. import type URI from "fbjs/lib/URI";
  17. export type DataObjectForLink = {
  18. url: string,
  19. ...
  20. };
  21. export type RichTextUtils = {
  22. currentBlockContainsLink: (editorState: EditorState) => boolean,
  23. getCurrentBlockType: (editorState: EditorState) => DraftBlockType,
  24. getDataObjectForLinkURL: (uri: URI) => DataObjectForLink,
  25. handleKeyCommand: (editorState: EditorState, command: DraftEditorCommand | string) => ?EditorState,
  26. insertSoftNewline: (editorState: EditorState) => EditorState,
  27. onBackspace: (editorState: EditorState) => ?EditorState,
  28. onDelete: (editorState: EditorState) => ?EditorState,
  29. onTab: (event: SyntheticKeyboardEvent<>, editorState: EditorState, maxDepth: number) => EditorState,
  30. toggleBlockType: (editorState: EditorState, blockType: DraftBlockType) => EditorState,
  31. toggleCode: (editorState: EditorState) => EditorState,
  32. toggleInlineStyle: (editorState: EditorState, inlineStyle: string) => EditorState,
  33. toggleLink: (editorState: EditorState, targetSelection: SelectionState, entityKey: ?string) => EditorState,
  34. tryToRemoveBlockStyle: (editorState: EditorState) => ?ContentState,
  35. ...
  36. };