Skip to content

TextSelection

A range of text that represents a selection.

Properties

  • base_offset(int | None) –

    The offset at which the selection originates.

  • collapsed(bool | None) –

    Whether this range is empty (but still potentially placed inside the text).

  • directional(bool | None) –

    Whether this selection has disambiguated its base and extent.

  • end(int | None) –

    The next index after the characters in this range.

  • extent_offset(int | None) –

    The offset at which the selection terminates.

  • normalized(bool | None) –

    Whether the start of this range precedes the end.

  • selection(str | None) –

    The text string that is selected.

  • start(int | None) –

    The index of the first character in the range.

  • valid(bool | None) –

    Whether this range represents a valid position in the text.

Properties#

base_offset #

base_offset: int | None = None

The offset at which the selection originates.

collapsed #

collapsed: bool | None = None

Whether this range is empty (but still potentially placed inside the text).

directional #

directional: bool | None = None

Whether this selection has disambiguated its base and extent.

end #

end: int | None = None

The next index after the characters in this range.

extent_offset #

extent_offset: int | None = None

The offset at which the selection terminates.

normalized #

normalized: bool | None = None

Whether the start of this range precedes the end.

selection #

selection: str | None = None

The text string that is selected.

start #

start: int | None = None

The index of the first character in the range.

valid #

valid: bool | None = None

Whether this range represents a valid position in the text.