forked from prezly/slate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLists.ts
57 lines (56 loc) · 2.11 KB
/
Lists.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import {
canDeleteBackward,
decreaseDepth,
decreaseListItemDepth,
getListItemsInRange,
getListsInRange,
getListType,
getNestedList,
getParentList,
getParentListItem,
increaseDepth,
increaseListItemDepth,
isCursorAtStartOfListItem,
isCursorInEmptyListItem,
isList,
isListItem,
isListItemText,
listItemContainsText,
moveListItemsToAnotherList,
moveListToListItem,
setListType,
splitListItem,
unwrapList,
wrapInList,
} from './lib';
import type { ListsOptions } from './types';
/**
* Creates an API adapter with functions bound to passed options.
*/
export function Lists(options: ListsOptions) {
return {
canDeleteBackward: canDeleteBackward.bind(null, options),
decreaseDepth: decreaseDepth.bind(null, options),
decreaseListItemDepth: decreaseListItemDepth.bind(null, options),
getListItemsInRange: getListItemsInRange.bind(null, options),
getListsInRange: getListsInRange.bind(null, options),
getListType: getListType.bind(null, options),
getNestedList: getNestedList.bind(null, options),
getParentList: getParentList.bind(null, options),
getParentListItem: getParentListItem.bind(null, options),
increaseDepth: increaseDepth.bind(null, options),
increaseListItemDepth: increaseListItemDepth.bind(null, options),
isCursorAtStartOfListItem: isCursorAtStartOfListItem.bind(null, options),
isCursorInEmptyListItem: isCursorInEmptyListItem.bind(null, options),
isList: isList.bind(null, options),
isListItem: isListItem.bind(null, options),
isListItemText: isListItemText.bind(null, options),
listItemContainsText: listItemContainsText.bind(null, options),
moveListItemsToAnotherList: moveListItemsToAnotherList.bind(null, options),
moveListToListItem: moveListToListItem.bind(null, options),
setListType: setListType.bind(null, options),
splitListItem: splitListItem.bind(null, options),
unwrapList: unwrapList.bind(null, options),
wrapInList: wrapInList.bind(null, options),
};
}