API reference

Interface Chunk<TData>

Represents a piece of text in any kind of ‘file’.

Its purpose is to enable generic algorithms to deal with text content of any type of ‘file’ that consists of many pieces of text (e.g. a DOM, PDF, …). Each Chunk represents one piece of text (Chunk.data). An object implementing this interface would typically have other attributes as well to map the chunk back to its position in the file (e.g. a Text node in the DOM).

Type parameters

  • TData

    Piece of text, typically string

Hierarchy

  • Chunk

Index

Properties

Methods

Properties

Readonly data

data: TData

The piece of text this chunk represents.

Methods

Optional equals

  • equals(otherChunk: Chunk<TData>): boolean
  • Parameters

    • otherChunk: Chunk<TData>

    Returns boolean