Skip to main content

Interface: TextPositionSelector

Defined in: src/types/models/annotation.ts:164

W3C TextPositionSelector extended for multi-format documents.

Remarks

Uses character offsets within the normalized text of a resource. The first character is position 0. Start is inclusive, end is exclusive.

Extended fields support different document formats:

  • pageNumber: For PDF, DOCX, EPUB (1-indexed)
  • sectionId: For HTML/Markdown/LaTeX headings
  • cellId: For Jupyter notebook cells
  • lineNumber/columnStart/columnEnd: For code in Markdown, LaTeX, Jupyter

See

W3C TextPositionSelector

Properties

cellId?

readonly optional cellId: string

Defined in: src/types/models/annotation.ts:176

Cell ID for Jupyter notebooks


columnEnd?

readonly optional columnEnd: number

Defined in: src/types/models/annotation.ts:182

Ending column for code spans - 0-indexed


columnStart?

readonly optional columnStart: number

Defined in: src/types/models/annotation.ts:180

Starting column for code spans - 0-indexed


end

readonly end: number

Defined in: src/types/models/annotation.ts:170

Ending character offset (exclusive)


lineNumber?

readonly optional lineNumber: number

Defined in: src/types/models/annotation.ts:178

Line number for code-based formats - 1-indexed


pageNumber?

readonly optional pageNumber: number

Defined in: src/types/models/annotation.ts:172

Page number for paginated formats (PDF, DOCX, EPUB) - 1-indexed


sectionId?

readonly optional sectionId: string

Defined in: src/types/models/annotation.ts:174

Section ID for structured documents (HTML heading id, Markdown heading slug)


start

readonly start: number

Defined in: src/types/models/annotation.ts:168

Starting character offset (inclusive)


type

readonly type: "TextPositionSelector"

Defined in: src/types/models/annotation.ts:166

Selector type identifier