@lexriver/dome 1.5.10 → 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.
- package/out/{AnimatedArray.d.ts → src/AnimatedArray.d.mts} +29 -29
- package/out/{AnimatedArray.js → src/AnimatedArray.mjs} +52 -51
- package/out/{AnimatedTable.d.ts → src/AnimatedTable.d.mts} +38 -38
- package/out/{AnimatedTable.js → src/AnimatedTable.mjs} +88 -91
- package/out/{AnimatedText.d.ts → src/AnimatedText.d.mts} +13 -13
- package/out/{AnimatedText.js → src/AnimatedText.mjs} +24 -24
- package/out/{Animation.d.ts → src/Animation.d.mts} +4 -4
- package/out/{temp-test.d.ts → src/Animation.mjs} +1 -1
- package/out/{Dome.d.ts → src/Dome.d.mts} +9 -9
- package/out/{Dome.js → src/Dome.mjs} +291 -295
- package/out/{DomeComponent.d.ts → src/DomeComponent.d.mts} +22 -19
- package/out/{DomeComponent.js → src/DomeComponent.mjs} +47 -44
- package/out/{DomeManipulator.d.ts → src/DomeManipulator.d.mts} +48 -48
- package/out/{DomeManipulator.js → src/DomeManipulator.mjs} +329 -329
- package/out/src/DomeRouter.console-test.d.mts +1 -0
- package/out/{DomeRouter.console-test.js → src/DomeRouter.console-test.mjs} +44 -44
- package/out/{DomeRouter.d.ts → src/DomeRouter.d.mts} +30 -30
- package/out/{DomeRouter.js → src/DomeRouter.mjs} +236 -237
- package/out/{LongestCommonSubsequence.d.ts → src/LongestCommonSubsequence.d.mts} +15 -15
- package/out/{LongestCommonSubsequence.js → src/LongestCommonSubsequence.mjs} +164 -164
- package/out/src/index.d.mts +11 -0
- package/out/src/index.mjs +11 -0
- package/out/src/temp-test.d.mts +1 -0
- package/out/{temp-test.js → src/temp-test.mjs} +20 -20
- package/out/vitest.config.d.ts +2 -0
- package/out/vitest.config.js +9 -0
- package/package.json +16 -14
- package/src/{AnimatedArray.ts → AnimatedArray.mts} +3 -3
- package/src/{AnimatedTable.ts → AnimatedTable.mts} +6 -6
- package/src/{AnimatedText.ts → AnimatedText.mts} +4 -4
- package/src/{Dome.ts → Dome.mts} +7 -11
- package/src/{DomeComponent.ts → DomeComponent.mts} +3 -3
- package/src/{DomeManipulator.ts → DomeManipulator.mts} +5 -5
- package/src/{DomeRouter.ts → DomeRouter.mts} +3 -3
- package/src/index.mts +12 -0
- package/src/{temp-test.ts → temp-test.mts} +1 -1
- package/tsconfig.json +57 -60
- package/vitest.config.ts +10 -0
- package/jest.config.js +0 -22
- package/out/Animation.js +0 -0
- package/out/DomeRouter.console-test.d.ts +0 -0
- package/out/index.d.ts +0 -12
- package/out/index.js +0 -14
- package/src/index.ts +0 -14
- /package/src/{Animation.ts → Animation.mts} +0 -0
- /package/src/{DomeRouter.console-test.ts → DomeRouter.console-test.mts} +0 -0
- /package/src/{LongestCommonSubsequence.ts → LongestCommonSubsequence.mts} +0 -0
|
@@ -1,237 +1,236 @@
|
|
|
1
|
-
import { DomeManipulator } from "./DomeManipulator";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
await
|
|
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
|
-
historyUrls.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
console.log('
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return window.location.pathname
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
*
|
|
109
|
-
* example: /get-product/
|
|
110
|
-
* example: /
|
|
111
|
-
* example: /articles, /articles,
|
|
112
|
-
*
|
|
113
|
-
* @param
|
|
114
|
-
* @param
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
let
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*
|
|
150
|
-
* :quantity
|
|
151
|
-
* :quantity<
|
|
152
|
-
* :quantity<
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* @param
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
//
|
|
162
|
-
// :
|
|
163
|
-
// :
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
let
|
|
191
|
-
|
|
192
|
-
//
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
let
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
let
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
|
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
|
+
}
|