Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

BlockNode.js.flow 1.4 KiB

há 3 anos
1234567891011121314151617181920212223242526272829303132333435363738394041
  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
  9. * @emails oncall+draft_js
  10. */
  11. 'use strict';
  12. import type CharacterMetadata from "./CharacterMetadata";
  13. import type { DraftBlockType } from "./DraftBlockType";
  14. import type { DraftInlineStyle } from "./DraftInlineStyle";
  15. import type { List, Map } from "immutable";
  16. export type BlockNodeKey = string;
  17. export type BlockNodeConfig = {
  18. characterList?: List<CharacterMetadata>,
  19. data?: Map<any, any>,
  20. depth?: number,
  21. key?: BlockNodeKey,
  22. text?: string,
  23. type?: DraftBlockType,
  24. ...
  25. }; // https://github.com/facebook/draft-js/issues/1492
  26. // prettier-ignore
  27. export interface BlockNode {
  28. +findEntityRanges: (filterFn: (value: CharacterMetadata) => boolean, callback: (start: number, end: number) => void) => void,
  29. +findStyleRanges: (filterFn: (value: CharacterMetadata) => boolean, callback: (start: number, end: number) => void) => void,
  30. +getCharacterList: () => List<CharacterMetadata>,
  31. +getData: () => Map<any, any>,
  32. +getDepth: () => number,
  33. +getEntityAt: (offset: number) => ?string,
  34. +getInlineStyleAt: (offset: number) => DraftInlineStyle,
  35. +getKey: () => BlockNodeKey,
  36. +getLength: () => number,
  37. +getText: () => string,
  38. +getType: () => DraftBlockType,
  39. }