TextSelection Interface
A text selection or cursor range expressed as UTF-16 code-unit offsets.
To use, import via @fluidframework/react/alpha.
For more information about our API support guarantees, see here.
This type is "input," meaning that code outside of the library defining it should not read from it. Future versions of this type may add optional members or make typing of members more general.
Signature
export interface TextSelection
Remarks
These match the selectionStart / selectionEnd properties of an HTML <input> / <textarea>, and the offsets used to index into a JavaScript string. A collapsed cursor has start === end.
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| end | Alpha | readonly | number | UTF-16 offset of the end of the selection. |
| start | Alpha | readonly | number | UTF-16 offset of the start of the selection. |
Property Details
end
UTF-16 offset of the end of the selection.
For more information about our API support guarantees, see here.
Signature
readonly end: number;
Type: number
start
UTF-16 offset of the start of the selection.
For more information about our API support guarantees, see here.
Signature
readonly start: number;
Type: number