1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-12 18:24:03 +02:00

docs: Convert Point API to use TypeScript method signatures

This commit is contained in:
Sunny Hirai
2021-06-06 12:44:40 -07:00
parent a0a976ff57
commit 198b82c97c

View File

@@ -18,31 +18,31 @@ interface Point {
### Retrieval methods
#### `Point.compare(point: Point, another: Point): -1 | 0 | 1`
#### `Point.compare(point: Point, another: Point) => -1 | 0 | 1`
Compare a `point` to `another`, returning an integer indicating whether the point was before, at or after the other.
### Check methods
#### `Point.isAfter(point: Point, another: Point): boolean`
#### `Point.isAfter(point: Point, another: Point) => boolean`
Check if a `point` is after `another`.
#### `Point.isBefore(point: Point, another: Point): boolean`
#### `Point.isBefore(point: Point, another: Point) => boolean`
Check if a `point` is before `another`.
#### `Point.equals(point: Point, another: Point): boolean`
#### `Point.equals(point: Point, another: Point) => boolean`
Check if a `point` is exactly equal to `another`.
#### `Point.isPoint(value: any): value is Point`
#### `Point.isPoint(value: any) => value is Point`
Check if a `value` implements the `Point` interface.
### Transform methods
#### `Point.transform(point: Point, op: Operation, options?): Point | null`
#### `Point.transform(point: Point, op: Operation, options?) => Point | null`
Transform a `point` by an `op`.