annotate.d.ts 748 B

123456789101112131415161718
  1. import { Attributes } from '../dom/attr';
  2. export interface Annotation {
  3. start: number;
  4. end: number;
  5. attrs: Attributes;
  6. }
  7. export interface AnnotatedItem {
  8. t: string;
  9. attrs: Attributes;
  10. annotations?: number[];
  11. }
  12. export declare function annotate(t: string, annotations: Annotation[], opt?: {
  13. offset?: number;
  14. includeAnnotationIndices?: boolean;
  15. }): (string | AnnotatedItem)[];
  16. export declare function findAnnotationsAtIndex(annotations: Annotation[], index: number): Annotation[];
  17. export declare function findAnnotationsBetweenIndexes(annotations: Annotation[], start: number, end: number): Annotation[];
  18. export declare function shiftAnnotations(annotations: Annotation[], index: number, offset: number): Annotation[];