From db9eef7179516ba1342d5584082218f9f00ebd35 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Mon, 11 Jul 2016 15:43:58 -0700 Subject: [PATCH] update docs --- docs/reference/models/selection.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/reference/models/selection.md b/docs/reference/models/selection.md index 16f6b9838..6a29f1167 100644 --- a/docs/reference/models/selection.md +++ b/docs/reference/models/selection.md @@ -1,30 +1,36 @@ ### `Selection` +```js +import { Selection } from 'Slate' +``` + A selection in the document. Selections in Slate are modeled after the native [DOM Selection API](https://developer.mozilla.org/en-US/docs/Web/API/Selection), using terms like "anchor", "focus" and "collapsed". The "anchor" is the fixed point in a selection, and the "focus" is the non-fixed point, which may move when you move the cursor (eg. when pressing `Shift + Right Arrow`). Often times, you don't need to specifically know which point is the "anchor" and which is the "focus", and you just need to know which comes first and last in the document. For these cases, there are many convenience equivalent properties and methods referring to the "start" and "end" points. -- [Module](#module) - [Properties](#properties) - [`anchorKey`](#anchorkey-string) - [`anchorOffset`](#anchoroffset-number) - [`focusKey`](#focuskey-string) - [`focusOffset`](#focusoffset-number) + - [`isBackward`](#isbackward-boolean) + - [`isFocused`](#isfocused-boolean) - [Computed Properties](#computed-properties) + - [`endKey`](#endkey-string) + - [`endOffset`](#endoffset-number) + - [`isBlurred`](#isblurred-boolean) + - [`isCollapsed`](#iscollapsed-boolean) + - [`isExpanded`](#isExpanded-boolean) + - [`isForward`](#isForward-boolean) + - [`startKey`](#startkey-string) + - [`startOffset`](#startoffset-number) - [Checking Methods](#checking-methods) - [Transforming Methods](#transforming-methods) -### Module - -```js -import { Selection } from 'Slate' -``` - - ### Properties ```js