@lexriver/dome 1.5.11 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/out/{AnimatedArray.d.ts → src/AnimatedArray.d.mts} +29 -29
  2. package/out/{AnimatedArray.js → src/AnimatedArray.mjs} +52 -51
  3. package/out/{AnimatedTable.d.ts → src/AnimatedTable.d.mts} +38 -38
  4. package/out/{AnimatedTable.js → src/AnimatedTable.mjs} +88 -91
  5. package/out/{AnimatedText.d.ts → src/AnimatedText.d.mts} +13 -13
  6. package/out/{AnimatedText.js → src/AnimatedText.mjs} +24 -24
  7. package/out/{Animation.d.ts → src/Animation.d.mts} +4 -4
  8. package/out/{temp-test.d.ts → src/Animation.mjs} +1 -1
  9. package/out/{Dome.d.ts → src/Dome.d.mts} +9 -9
  10. package/out/{Dome.js → src/Dome.mjs} +291 -295
  11. package/out/{DomeComponent.d.ts → src/DomeComponent.d.mts} +22 -19
  12. package/out/{DomeComponent.js → src/DomeComponent.mjs} +47 -44
  13. package/out/{DomeManipulator.d.ts → src/DomeManipulator.d.mts} +48 -48
  14. package/out/{DomeManipulator.js → src/DomeManipulator.mjs} +329 -329
  15. package/out/src/DomeRouter.console-test.d.mts +1 -0
  16. package/out/{DomeRouter.console-test.js → src/DomeRouter.console-test.mjs} +44 -44
  17. package/out/{DomeRouter.d.ts → src/DomeRouter.d.mts} +30 -30
  18. package/out/{DomeRouter.js → src/DomeRouter.mjs} +236 -237
  19. package/out/{LongestCommonSubsequence.d.ts → src/LongestCommonSubsequence.d.mts} +15 -15
  20. package/out/{LongestCommonSubsequence.js → src/LongestCommonSubsequence.mjs} +164 -164
  21. package/out/src/index.d.mts +11 -0
  22. package/out/src/index.mjs +11 -0
  23. package/out/src/temp-test.d.mts +1 -0
  24. package/out/{temp-test.js → src/temp-test.mjs} +20 -20
  25. package/out/vitest.config.d.ts +2 -0
  26. package/out/vitest.config.js +9 -0
  27. package/package.json +16 -14
  28. package/src/{AnimatedArray.ts → AnimatedArray.mts} +3 -3
  29. package/src/{AnimatedTable.ts → AnimatedTable.mts} +6 -6
  30. package/src/{AnimatedText.ts → AnimatedText.mts} +4 -4
  31. package/src/{Dome.ts → Dome.mts} +7 -11
  32. package/src/{DomeComponent.ts → DomeComponent.mts} +3 -3
  33. package/src/{DomeManipulator.ts → DomeManipulator.mts} +5 -5
  34. package/src/{DomeRouter.ts → DomeRouter.mts} +3 -3
  35. package/src/index.mts +12 -0
  36. package/src/{temp-test.ts → temp-test.mts} +1 -1
  37. package/tsconfig.json +57 -60
  38. package/vitest.config.ts +10 -0
  39. package/jest.config.js +0 -22
  40. package/out/Animation.js +0 -0
  41. package/out/DomeRouter.console-test.d.ts +0 -0
  42. package/out/index.d.ts +0 -12
  43. package/out/index.js +0 -14
  44. package/src/index.ts +0 -14
  45. /package/src/{Animation.ts → Animation.mts} +0 -0
  46. /package/src/{DomeRouter.console-test.ts → DomeRouter.console-test.mts} +0 -0
  47. /package/src/{LongestCommonSubsequence.ts → LongestCommonSubsequence.mts} +0 -0
@@ -1,237 +1,236 @@
1
- import { DomeManipulator } from "./DomeManipulator";
2
- const filename = '[DomeRouter]';
3
- export var DomeRouter;
4
- (function (DomeRouter) {
5
- const historyUrls = [];
6
- const scrollPositionByUrl = new Map();
7
- DomeRouter.maxHistoryUrlsCount = 20;
8
- const allRoutes = [];
9
- let onNotFoundAction = undefined;
10
- window.addEventListener('popstate', async (e) => {
11
- // on go back/forward
12
- //console.log(filename, 'window.popstate event', e, 'historyUrls=', historyUrls)
13
- const url = window.location.pathname;
14
- await executeAsync(url, getScrollPositionForUrl(url));
15
- await DomeManipulator.scrollToAsync({
16
- pxFromTop: getScrollPositionForUrl(window.location.pathname)
17
- });
18
- });
19
- function getScrollPositionForUrl(url) {
20
- return scrollPositionByUrl.get(url) ?? 0;
21
- }
22
- function saveScrollPositionForUrl(url) {
23
- scrollPositionByUrl.set(url, DomeManipulator.getCurrentScrollPosition());
24
- }
25
- function saveScrollPositionForCurrentUrl() {
26
- scrollPositionByUrl.set(getCurrentUrl(), DomeManipulator.getCurrentScrollPosition());
27
- }
28
- function navigate(url) {
29
- addUrlToHistory(getCurrentUrl());
30
- saveScrollPositionForCurrentUrl();
31
- window.history.pushState(null, '', url);
32
- executeAsync(url, 0);
33
- DomeManipulator.scrollToTop();
34
- // historyUrls.push()
35
- }
36
- DomeRouter.navigate = navigate;
37
- function goBack() {
38
- window.history.go(-1);
39
- }
40
- DomeRouter.goBack = goBack;
41
- function goForward() {
42
- window.history.go(+1);
43
- }
44
- DomeRouter.goForward = goForward;
45
- function changeUrl(url) {
46
- window.history.replaceState(null, '', url);
47
- // if(historyUrls.length>0){
48
- // historyUrls[historyUrls.length-1].url = url
49
- // }
50
- }
51
- DomeRouter.changeUrl = changeUrl;
52
- function addUrlToHistory(url) {
53
- historyUrls.push({ url, scroll: 0 });
54
- while (historyUrls.length > DomeRouter.maxHistoryUrlsCount) {
55
- historyUrls.shift();
56
- }
57
- // save scroll position to previous url
58
- if (historyUrls.length > 1) {
59
- historyUrls[historyUrls.length - 2].scroll = DomeManipulator.getCurrentScrollPosition();
60
- }
61
- // console.log('adding url to history', url)
62
- // console.log('historyUrls=', historyUrls)
63
- }
64
- function getCurrentUrl() {
65
- return window.location.pathname;
66
- // return historyUrls.length>0?historyUrls[historyUrls.length-1]:window.location.pathname
67
- }
68
- DomeRouter.getCurrentUrl = getCurrentUrl;
69
- /**
70
- * get previous page url navigated by router
71
- * @param previousPageIndex 0=previousPage, 1=previousPage-1, etc
72
- */
73
- function getPreviousPageUrl(previousPageIndex = 0) {
74
- //if(historyUrls.length==0) return undefined
75
- let index = historyUrls.length - 2 - previousPageIndex;
76
- if (index >= 0 && index < historyUrls.length)
77
- return historyUrls[index].url;
78
- return undefined;
79
- }
80
- DomeRouter.getPreviousPageUrl = getPreviousPageUrl;
81
- // export function reloadCurrentPage(addToHistory:boolean = false){
82
- // const url = window.location.pathname
83
- // if(addToHistory) addUrlToHistory(url)
84
- // executeAsync(url, getScrollPositionForUrl(url)) // TODO: check
85
- // }
86
- function resolveUrl(url = window.location.pathname, addToHistory = true) {
87
- if (addToHistory)
88
- addUrlToHistory(window.location.pathname);
89
- executeAsync(url, getScrollPositionForUrl(url));
90
- }
91
- DomeRouter.resolveUrl = resolveUrl;
92
- function onRoute(route, exactMatch, action) {
93
- if (route[0] !== '/')
94
- throw new Error('Please provide correct route. route=' + route);
95
- let routeSlices = getRouteSlices(route);
96
- allRoutes.push({ routeSlices, exactMatch, action });
97
- }
98
- DomeRouter.onRoute = onRoute;
99
- function getRouteSlices(route) {
100
- //return route.split('/').filter(x => x.length>0).map(x => decodeURIComponent(x))
101
- return route.split('/').map(x => decodeURIComponent(x));
102
- }
103
- function onNotFound(action) {
104
- onNotFoundAction = action;
105
- }
106
- DomeRouter.onNotFound = onNotFound;
107
- /**
108
- * Check if url matched route.
109
- * example: /get-product/445345, /get-product/:productId, true ==> Map([productId:445345])
110
- * example: /get-product/123, /another-route, true ==> undefined
111
- * example: /articles, /articles, true ==> Map()
112
- * example: /articles/some-article, /articles, false ==> Map()
113
- * @param url
114
- * @param route
115
- * @param exactMatch
116
- */
117
- function checkUrlMatchRouteAndGetParameters(url, route, exactMatch = true) {
118
- // this function is purely for export
119
- const urlSlices = getRouteSlices(url);
120
- const routeSlices = getRouteSlices(route);
121
- if (exactMatch && routeSlices.length !== urlSlices.length)
122
- return undefined;
123
- // all routeSlices must match for !exactMatch
124
- //const extractedParameters = new Map<string,string>()
125
- const extractedParameters = {};
126
- for (let i = 0; i < routeSlices.length; i++) {
127
- let cRouteSlice = routeSlices[i];
128
- let cUrlSlice = urlSlices[i]; // could be undefined
129
- //console.info('\t\t cRouteSlice=', cRouteSlice, 'cUrlSlice=', cUrlSlice)
130
- if (cRouteSlice.startsWith(':')) {
131
- // we have a param name
132
- if (cUrlSlice === undefined) {
133
- return undefined;
134
- }
135
- const [name, value] = parseToNameAndValue(cRouteSlice, cUrlSlice);
136
- extractedParameters[name] = value;
137
- }
138
- else {
139
- // no param name
140
- if (cRouteSlice !== cUrlSlice) {
141
- return undefined;
142
- }
143
- }
144
- }
145
- return extractedParameters;
146
- }
147
- DomeRouter.checkUrlMatchRouteAndGetParameters = checkUrlMatchRouteAndGetParameters;
148
- /**
149
- * parse name with type or without type
150
- * :quantity
151
- * :quantity<number>
152
- * :quantity<float>
153
- * :quantity<int>
154
- *
155
- * @param name string that starts with `:`
156
- * @param value string that contains value
157
- */
158
- function parseToNameAndValue(name, value) {
159
- if (!name)
160
- throw new Error('no name');
161
- // parse name with type
162
- // :quantity<number>
163
- // :lat<float>
164
- // :count<int>
165
- const haveMatch = name.match(/:(.+)<(.+)>/);
166
- if (haveMatch) {
167
- const paramName = haveMatch[1];
168
- const paramType = haveMatch[2].toLowerCase();
169
- if (paramType == 'int') {
170
- return [paramName, parseInt(value)];
171
- }
172
- else if (paramType == 'float') {
173
- return [paramName, parseFloat(value)];
174
- }
175
- else if (paramType == 'number') {
176
- return [paramName, Number(value)];
177
- }
178
- else {
179
- return [paramName, value];
180
- }
181
- }
182
- else {
183
- return [name.substring(1), value];
184
- }
185
- }
186
- async function executeAsync(url = window.location.pathname, scrollToPosition) {
187
- //const url = window.location.pathname
188
- const urlSlices = getRouteSlices(url);
189
- // urlSlices = show, category, 345
190
- let countOfFoundRoutes = 0;
191
- for (let route of allRoutes) {
192
- //console.info('\t route=', route.routeSlices, route.exactMatch)
193
- // route.routeSlices = show, category, :categoryId
194
- if (route.exactMatch && route.routeSlices.length != urlSlices.length)
195
- continue;
196
- // all routeSlices must match for !exactMatch
197
- let matched = true;
198
- //let extractedParameters = new Map<string,string>()
199
- const extractedParameters = {};
200
- for (let i = 0; i < route.routeSlices.length; i++) {
201
- let cRouteSlice = route.routeSlices[i];
202
- let cUrlSlice = urlSlices[i]; // could be undefined
203
- //console.info('\t\t cRouteSlice=', cRouteSlice, 'cUrlSlice=', cUrlSlice)
204
- if (cRouteSlice && typeof cRouteSlice === 'string' && cRouteSlice.startsWith(':')) {
205
- // we have a param name
206
- if (cUrlSlice === undefined) {
207
- matched = false;
208
- continue;
209
- }
210
- // we have some variable, save it
211
- const [name, value] = parseToNameAndValue(cRouteSlice, cUrlSlice);
212
- extractedParameters[name] = value;
213
- }
214
- else {
215
- // no param name
216
- if (cRouteSlice !== cUrlSlice) {
217
- matched = false;
218
- continue;
219
- }
220
- }
221
- }
222
- if (matched) {
223
- countOfFoundRoutes++;
224
- //console.log('DomeRouter', 'executeAsync', url, route, extractedParameters)
225
- await route.action(extractedParameters, url, async () => {
226
- await DomeManipulator.scrollToAsync({
227
- pxFromTop: scrollToPosition
228
- });
229
- });
230
- }
231
- }
232
- if (countOfFoundRoutes == 0 && onNotFoundAction) {
233
- //console.log('DomeRouter', 'onNotFoundAction()')
234
- onNotFoundAction();
235
- }
236
- }
237
- })(DomeRouter || (DomeRouter = {}));
1
+ import { DomeManipulator } from "./DomeManipulator.mjs";
2
+ export var DomeRouter;
3
+ (function (DomeRouter) {
4
+ const historyUrls = [];
5
+ const scrollPositionByUrl = new Map();
6
+ DomeRouter.maxHistoryUrlsCount = 20;
7
+ const allRoutes = [];
8
+ let onNotFoundAction = undefined;
9
+ window.addEventListener('popstate', async (e) => {
10
+ // on go back/forward
11
+ //console.log(filename, 'window.popstate event', e, 'historyUrls=', historyUrls)
12
+ const url = window.location.pathname;
13
+ await executeAsync(url, getScrollPositionForUrl(url));
14
+ await DomeManipulator.scrollToAsync({
15
+ pxFromTop: getScrollPositionForUrl(window.location.pathname)
16
+ });
17
+ });
18
+ function getScrollPositionForUrl(url) {
19
+ return scrollPositionByUrl.get(url) ?? 0;
20
+ }
21
+ function saveScrollPositionForUrl(url) {
22
+ scrollPositionByUrl.set(url, DomeManipulator.getCurrentScrollPosition());
23
+ }
24
+ function saveScrollPositionForCurrentUrl() {
25
+ scrollPositionByUrl.set(getCurrentUrl(), DomeManipulator.getCurrentScrollPosition());
26
+ }
27
+ function navigate(url) {
28
+ addUrlToHistory(getCurrentUrl());
29
+ saveScrollPositionForCurrentUrl();
30
+ window.history.pushState(null, '', url);
31
+ executeAsync(url, 0);
32
+ DomeManipulator.scrollToTop();
33
+ // historyUrls.push()
34
+ }
35
+ DomeRouter.navigate = navigate;
36
+ function goBack() {
37
+ window.history.go(-1);
38
+ }
39
+ DomeRouter.goBack = goBack;
40
+ function goForward() {
41
+ window.history.go(+1);
42
+ }
43
+ DomeRouter.goForward = goForward;
44
+ function changeUrl(url) {
45
+ window.history.replaceState(null, '', url);
46
+ // if(historyUrls.length>0){
47
+ // historyUrls[historyUrls.length-1].url = url
48
+ // }
49
+ }
50
+ DomeRouter.changeUrl = changeUrl;
51
+ function addUrlToHistory(url) {
52
+ historyUrls.push({ url, scroll: 0 });
53
+ while (historyUrls.length > DomeRouter.maxHistoryUrlsCount) {
54
+ historyUrls.shift();
55
+ }
56
+ // save scroll position to previous url
57
+ if (historyUrls.length > 1) {
58
+ historyUrls[historyUrls.length - 2].scroll = DomeManipulator.getCurrentScrollPosition();
59
+ }
60
+ // console.log('adding url to history', url)
61
+ // console.log('historyUrls=', historyUrls)
62
+ }
63
+ function getCurrentUrl() {
64
+ return window.location.pathname;
65
+ // return historyUrls.length>0?historyUrls[historyUrls.length-1]:window.location.pathname
66
+ }
67
+ DomeRouter.getCurrentUrl = getCurrentUrl;
68
+ /**
69
+ * get previous page url navigated by router
70
+ * @param previousPageIndex 0=previousPage, 1=previousPage-1, etc
71
+ */
72
+ function getPreviousPageUrl(previousPageIndex = 0) {
73
+ //if(historyUrls.length==0) return undefined
74
+ let index = historyUrls.length - 2 - previousPageIndex;
75
+ if (index >= 0 && index < historyUrls.length)
76
+ return historyUrls[index].url;
77
+ return undefined;
78
+ }
79
+ DomeRouter.getPreviousPageUrl = getPreviousPageUrl;
80
+ // export function reloadCurrentPage(addToHistory:boolean = false){
81
+ // const url = window.location.pathname
82
+ // if(addToHistory) addUrlToHistory(url)
83
+ // executeAsync(url, getScrollPositionForUrl(url)) // TODO: check
84
+ // }
85
+ function resolveUrl(url = window.location.pathname, addToHistory = true) {
86
+ if (addToHistory)
87
+ addUrlToHistory(window.location.pathname);
88
+ executeAsync(url, getScrollPositionForUrl(url));
89
+ }
90
+ DomeRouter.resolveUrl = resolveUrl;
91
+ function onRoute(route, exactMatch, action) {
92
+ if (route[0] !== '/')
93
+ throw new Error('Please provide correct route. route=' + route);
94
+ let routeSlices = getRouteSlices(route);
95
+ allRoutes.push({ routeSlices, exactMatch, action });
96
+ }
97
+ DomeRouter.onRoute = onRoute;
98
+ function getRouteSlices(route) {
99
+ //return route.split('/').filter(x => x.length>0).map(x => decodeURIComponent(x))
100
+ return route.split('/').map(x => decodeURIComponent(x));
101
+ }
102
+ function onNotFound(action) {
103
+ onNotFoundAction = action;
104
+ }
105
+ DomeRouter.onNotFound = onNotFound;
106
+ /**
107
+ * Check if url matched route.
108
+ * example: /get-product/445345, /get-product/:productId, true ==> Map([productId:445345])
109
+ * example: /get-product/123, /another-route, true ==> undefined
110
+ * example: /articles, /articles, true ==> Map()
111
+ * example: /articles/some-article, /articles, false ==> Map()
112
+ * @param url
113
+ * @param route
114
+ * @param exactMatch
115
+ */
116
+ function checkUrlMatchRouteAndGetParameters(url, route, exactMatch = true) {
117
+ // this function is purely for export
118
+ const urlSlices = getRouteSlices(url);
119
+ const routeSlices = getRouteSlices(route);
120
+ if (exactMatch && routeSlices.length !== urlSlices.length)
121
+ return undefined;
122
+ // all routeSlices must match for !exactMatch
123
+ //const extractedParameters = new Map<string,string>()
124
+ const extractedParameters = {};
125
+ for (let i = 0; i < routeSlices.length; i++) {
126
+ let cRouteSlice = routeSlices[i];
127
+ let cUrlSlice = urlSlices[i]; // could be undefined
128
+ //console.info('\t\t cRouteSlice=', cRouteSlice, 'cUrlSlice=', cUrlSlice)
129
+ if (cRouteSlice.startsWith(':')) {
130
+ // we have a param name
131
+ if (cUrlSlice === undefined) {
132
+ return undefined;
133
+ }
134
+ const [name, value] = parseToNameAndValue(cRouteSlice, cUrlSlice);
135
+ extractedParameters[name] = value;
136
+ }
137
+ else {
138
+ // no param name
139
+ if (cRouteSlice !== cUrlSlice) {
140
+ return undefined;
141
+ }
142
+ }
143
+ }
144
+ return extractedParameters;
145
+ }
146
+ DomeRouter.checkUrlMatchRouteAndGetParameters = checkUrlMatchRouteAndGetParameters;
147
+ /**
148
+ * parse name with type or without type
149
+ * :quantity
150
+ * :quantity<number>
151
+ * :quantity<float>
152
+ * :quantity<int>
153
+ *
154
+ * @param name string that starts with `:`
155
+ * @param value string that contains value
156
+ */
157
+ function parseToNameAndValue(name, value) {
158
+ if (!name)
159
+ throw new Error('no name');
160
+ // parse name with type
161
+ // :quantity<number>
162
+ // :lat<float>
163
+ // :count<int>
164
+ const haveMatch = name.match(/:(.+)<(.+)>/);
165
+ if (haveMatch) {
166
+ const paramName = haveMatch[1];
167
+ const paramType = haveMatch[2].toLowerCase();
168
+ if (paramType == 'int') {
169
+ return [paramName, parseInt(value)];
170
+ }
171
+ else if (paramType == 'float') {
172
+ return [paramName, parseFloat(value)];
173
+ }
174
+ else if (paramType == 'number') {
175
+ return [paramName, Number(value)];
176
+ }
177
+ else {
178
+ return [paramName, value];
179
+ }
180
+ }
181
+ else {
182
+ return [name.substring(1), value];
183
+ }
184
+ }
185
+ async function executeAsync(url = window.location.pathname, scrollToPosition) {
186
+ //const url = window.location.pathname
187
+ const urlSlices = getRouteSlices(url);
188
+ // urlSlices = show, category, 345
189
+ let countOfFoundRoutes = 0;
190
+ for (let route of allRoutes) {
191
+ //console.info('\t route=', route.routeSlices, route.exactMatch)
192
+ // route.routeSlices = show, category, :categoryId
193
+ if (route.exactMatch && route.routeSlices.length != urlSlices.length)
194
+ continue;
195
+ // all routeSlices must match for !exactMatch
196
+ let matched = true;
197
+ //let extractedParameters = new Map<string,string>()
198
+ const extractedParameters = {};
199
+ for (let i = 0; i < route.routeSlices.length; i++) {
200
+ let cRouteSlice = route.routeSlices[i];
201
+ let cUrlSlice = urlSlices[i]; // could be undefined
202
+ //console.info('\t\t cRouteSlice=', cRouteSlice, 'cUrlSlice=', cUrlSlice)
203
+ if (cRouteSlice && typeof cRouteSlice === 'string' && cRouteSlice.startsWith(':')) {
204
+ // we have a param name
205
+ if (cUrlSlice === undefined) {
206
+ matched = false;
207
+ continue;
208
+ }
209
+ // we have some variable, save it
210
+ const [name, value] = parseToNameAndValue(cRouteSlice, cUrlSlice);
211
+ extractedParameters[name] = value;
212
+ }
213
+ else {
214
+ // no param name
215
+ if (cRouteSlice !== cUrlSlice) {
216
+ matched = false;
217
+ continue;
218
+ }
219
+ }
220
+ }
221
+ if (matched) {
222
+ countOfFoundRoutes++;
223
+ //console.log('DomeRouter', 'executeAsync', url, route, extractedParameters)
224
+ await route.action(extractedParameters, url, async () => {
225
+ await DomeManipulator.scrollToAsync({
226
+ pxFromTop: scrollToPosition
227
+ });
228
+ });
229
+ }
230
+ }
231
+ if (countOfFoundRoutes == 0 && onNotFoundAction) {
232
+ //console.log('DomeRouter', 'onNotFoundAction()')
233
+ onNotFoundAction();
234
+ }
235
+ }
236
+ })(DomeRouter || (DomeRouter = {}));
@@ -1,15 +1,15 @@
1
- export declare module LongestCommonSubsequence {
2
- function getLongestCommonSubsequence(set1: string[], set2: string[]): string[];
3
- function getPatch({ oldArray, newArray, onRemove, onAdd }: {
4
- oldArray: string[];
5
- newArray: string[];
6
- onRemove: (index: number, item: string) => void;
7
- onAdd: (index: number, item: string) => void;
8
- }): number;
9
- function getPatchOrdered({ oldArray, newArray, onRemove, onAdd }: {
10
- oldArray: string[];
11
- newArray: string[];
12
- onRemove: (index: number, item: string) => void;
13
- onAdd: (index: number, item: string) => void;
14
- }): number;
15
- }
1
+ export declare namespace LongestCommonSubsequence {
2
+ function getLongestCommonSubsequence(set1: string[], set2: string[]): string[];
3
+ function getPatch({ oldArray, newArray, onRemove, onAdd }: {
4
+ oldArray: string[];
5
+ newArray: string[];
6
+ onRemove: (index: number, item: string) => void;
7
+ onAdd: (index: number, item: string) => void;
8
+ }): number;
9
+ function getPatchOrdered({ oldArray, newArray, onRemove, onAdd }: {
10
+ oldArray: string[];
11
+ newArray: string[];
12
+ onRemove: (index: number, item: string) => void;
13
+ onAdd: (index: number, item: string) => void;
14
+ }): number;
15
+ }