datafolder 1.0.7 → 1.0.9
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/README.md +4 -1
- package/index.js +1 -1
- package/internal.md +5 -3
- package/package.json +7 -5
- package/scripts/airbnb.js +77 -72
- package/scripts/airbnb2.js +78 -73
- package/scripts/airbnb2_queries.js +181 -229
- package/scripts/airbnb_queries.js +214 -265
- package/scripts/convertBinFiles.js +47 -49
- package/scripts/downloadFile.js +41 -40
- package/scripts/express.js +44 -48
- package/scripts/fastify.js +71 -80
- package/scripts/flights.js +71 -75
- package/scripts/flights2.js +78 -81
- package/scripts/flights2_queries.js +417 -455
- package/scripts/flights_queries.js +381 -407
- package/src/QyAcl.d.ts +17 -0
- package/src/QyAcl.js +113 -116
- package/src/QyAclSaver.d.ts +4 -0
- package/src/QyAclSaver.js +3 -3
- package/src/QyAclSaver_Worker.d.ts +9 -0
- package/src/QyAclSaver_Worker.js +2 -4
- package/src/QyAclWriter.d.ts +5 -0
- package/src/QyBatch.d.ts +42 -0
- package/src/QyBatch.js +8 -8
- package/src/QyBinWriter.d.ts +15 -0
- package/src/QyCD.d.ts +37 -0
- package/src/QyCD.js +8 -6
- package/src/QyCache.d.ts +44 -0
- package/src/QyCache.js +65 -59
- package/src/QyCompressor.d.ts +9 -0
- package/src/QyCompressor.js +29 -29
- package/src/QyCompressor_Worker.d.ts +1 -0
- package/src/QyDB.d.ts +42 -0
- package/src/QyDB.js +13 -11
- package/src/QyDefaultOptions.d.ts +1 -0
- package/src/QyDefaultOptions.js +3 -0
- package/src/QyDir.d.ts +48 -0
- package/src/QyDir.js +41 -41
- package/src/QyFetch.d.ts +7 -0
- package/src/QyFetch.js +2 -3
- package/src/QyFile.d.ts +19 -0
- package/src/QyFile.js +35 -34
- package/src/QyFileContentUtils.d.ts +13 -0
- package/src/QyFileContentUtils.js +126 -126
- package/src/QyFileLogger.d.ts +11 -0
- package/src/QyIndex.d.ts +6 -0
- package/src/QyIndex.js +73 -75
- package/src/QyIndexPropTree.d.ts +7 -0
- package/src/QyIndexPropTree.js +24 -24
- package/src/QyIntersectNode.d.ts +7 -0
- package/src/QyIntersectNode.js +15 -15
- package/src/QyItem.d.ts +30 -0
- package/src/QyItem.js +32 -28
- package/src/QyJsonSaver.d.ts +6 -0
- package/src/QyKVData.d.ts +12 -0
- package/src/QyKVData.js +11 -10
- package/src/QyKVDataCleaner.d.ts +4 -0
- package/src/QyKVDataCleaner.js +1 -1
- package/src/QyKVDataCleaner_Worker.d.ts +13 -0
- package/src/QyKVDataCleaner_Worker.js +2 -4
- package/src/QyKVDataLoader.d.ts +9 -0
- package/src/QyKVDataLoader.js +11 -11
- package/src/QyKVDataSaver.d.ts +4 -0
- package/src/QyKVDataSaver.js +6 -6
- package/src/QyKVDataSaver_Worker.d.ts +13 -0
- package/src/QyKVDataSaver_Worker.js +7 -9
- package/src/QyLogFileSaver.d.ts +4 -0
- package/src/QyLogFileSaver.js +1 -1
- package/src/QyLogFileSaver_Worker.d.ts +8 -0
- package/src/QyLogFileSaver_Worker.js +2 -4
- package/src/QyLogger.d.ts +10 -0
- package/src/QyLogger.js +40 -40
- package/src/QyMessageWorker.d.ts +5 -0
- package/src/QyMessageWorker.js +7 -7
- package/src/QyMessager.d.ts +7 -0
- package/src/QyMessager.js +30 -27
- package/src/QyMessager_Run.d.ts +1 -0
- package/src/QyMessager_Run.js +11 -6
- package/src/QyMod.d.ts +1 -0
- package/src/QyMod.js +6 -6
- package/src/QyOpRunner.d.ts +10 -0
- package/src/QyOpRunner.js +39 -39
- package/src/QyQueue.d.ts +11 -0
- package/src/QySaver.d.ts +10 -0
- package/src/QySnapshotCompactor.d.ts +4 -0
- package/src/QySnapshotCompactor.js +1 -1
- package/src/QySnapshotCompactor_Worker.d.ts +11 -0
- package/src/QySnapshotCompactor_Worker.js +2 -4
- package/src/QySnapshotSaver.d.ts +4 -0
- package/src/QySnapshotSaver.js +1 -1
- package/src/QySnapshotSaver_Worker.d.ts +16 -0
- package/src/QySnapshotSaver_Worker.js +17 -16
- package/src/QySnapshots.d.ts +27 -0
- package/src/QySnapshots.js +3 -3
- package/src/QyStructure.d.ts +1 -0
- package/src/QyStructure.js +18 -18
- package/src/QyTrigger.d.ts +9 -0
- package/src/QyTrigger.js +30 -30
- package/src/QyUnionNode.d.ts +17 -0
- package/src/QyUnionNode.js +2 -2
- package/src/QyUtils.d.ts +53 -0
- package/src/QyUtils.js +140 -117
- package/src/QyWorker.d.ts +5 -0
- package/src/QyWorker.js +18 -18
- package/src/hackernews.d.ts +1 -0
- package/src/hackernews.js +59 -47
- package/src/rpc/getRpcFiles.js +1 -0
- package/src/simulate.d.ts +1 -0
- package/src/simulate2.d.ts +1 -0
- package/src/soc_pokec.d.ts +1 -0
- package/static/codemirror.bundle/editor.bundle.js +399 -184
- package/static/datafolderui/QyStyledElement.js +2 -2
- package/static/datafolderui/QyUIFolderViewer.js +97 -77
- package/static/datafolderui/QyUIUtils.js +4 -4
- package/static/datafolderui/code-mirror.js +7 -7
- package/static/datafolderui/display-tree.js +13 -10
- package/static/datafolderui/hscrpt.js +26 -7
- package/static/datafolderui/json-view.js +27 -0
- package/static/datafolderui/main-page.js +65 -37
- package/static/datafolderui/query-editor.js +8 -8
- package/static/datafolderui/rpc-editor.js +31 -0
- package/static/datafolderui/trigger-editor.js +9 -6
- package/static/datafolderui/QyUIFolderTree.js +0 -188
|
@@ -18,7 +18,11 @@ import {
|
|
|
18
18
|
QyKVDataCleaner as p
|
|
19
19
|
} from "./QyKVDataCleaner.js";
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
import {
|
|
22
|
+
logger as m
|
|
23
|
+
} from "./QyLogger.js";
|
|
24
|
+
|
|
25
|
+
export default class extends a {
|
|
22
26
|
constructor({
|
|
23
27
|
kvFolder: a,
|
|
24
28
|
options: s
|
|
@@ -103,7 +107,7 @@ class s extends a {
|
|
|
103
107
|
return e;
|
|
104
108
|
})(this)).prefixPM, delete (u = {
|
|
105
109
|
...s
|
|
106
|
-
}).keyValueMap, delete s.posMap, s.isOut = !0,
|
|
110
|
+
}).keyValueMap, delete s.posMap, s.isOut = !0, m.info("Sending snapshot " + s.snapshotNum)),
|
|
107
111
|
this.castParent("onSnapshotSavedChangeId", t, u);
|
|
108
112
|
}
|
|
109
113
|
}
|
|
@@ -124,22 +128,22 @@ function h(a, s, e, t) {
|
|
|
124
128
|
...l
|
|
125
129
|
};
|
|
126
130
|
}
|
|
127
|
-
let u = a.length,
|
|
131
|
+
let u = a.length, m;
|
|
128
132
|
if (0 < u) {
|
|
129
|
-
var
|
|
130
|
-
keyValueMap:
|
|
133
|
+
var S, y = e.keyToSnapshotMap, {
|
|
134
|
+
keyValueMap: d,
|
|
131
135
|
info: o,
|
|
132
136
|
snapshotNum: v
|
|
133
|
-
} =
|
|
134
|
-
for (
|
|
137
|
+
} = m = e.getMaxCombinedSnapshot(a);
|
|
138
|
+
for (S of a) if (m != S) {
|
|
135
139
|
var g, {
|
|
136
140
|
keyValueMap: M,
|
|
137
141
|
snapshotNum: f
|
|
138
|
-
} =
|
|
139
|
-
for (g in M)
|
|
140
|
-
e.delSnapshot(
|
|
142
|
+
} = S;
|
|
143
|
+
for (g in M) d[g] = M[g], y[g] = m;
|
|
144
|
+
e.delSnapshot(S), t.push(f);
|
|
141
145
|
}
|
|
142
|
-
p.push(e.saveKeyValueMap(
|
|
146
|
+
p.push(e.saveKeyValueMap(m)), h.push([ v, o.pMVersion ]), r.push(v, o.vLVersion),
|
|
143
147
|
n[v] = {
|
|
144
148
|
...o
|
|
145
149
|
};
|
|
@@ -166,8 +170,7 @@ function h(a, s, e, t) {
|
|
|
166
170
|
snapshotNum: s,
|
|
167
171
|
info: e
|
|
168
172
|
} = s;
|
|
169
|
-
return await a.saveSnapshotInfo(s, e),
|
|
170
|
-
{
|
|
173
|
+
return await a.saveSnapshotInfo(s, e), m.log("Created snapshot " + s), {
|
|
171
174
|
snapshotNum: s,
|
|
172
175
|
maxChangeId: e.maxChangeId
|
|
173
176
|
};
|
|
@@ -176,6 +179,4 @@ function h(a, s, e, t) {
|
|
|
176
179
|
saveMaxSnapshotInfoPromise: t,
|
|
177
180
|
outdates: o
|
|
178
181
|
};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export default s;
|
|
182
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare class QySnapshots {
|
|
2
|
+
constructor(snapshotFolder: any, options: any);
|
|
3
|
+
loadSnapshotInfos(): Promise<void>;
|
|
4
|
+
closeAllFDs(): void;
|
|
5
|
+
saveKeyValueMap(snapshot: any): Promise<any>;
|
|
6
|
+
addMaxSnapshot(maxSnapshot: any): void;
|
|
7
|
+
removeKey(key: any): true | undefined;
|
|
8
|
+
applyCmdObj(cmdObj: any, aclKeyValueMap: any, syncList: any): void;
|
|
9
|
+
getValueSync(key: any): any;
|
|
10
|
+
loadPartialPosMapBuffer(snapshot: any, prefix: any, buffer: any): void;
|
|
11
|
+
delSnapshot(snapshot: any): void;
|
|
12
|
+
calOutdates(): {
|
|
13
|
+
emptySnapshotNumList: never[];
|
|
14
|
+
combiningSnapshotList: never[];
|
|
15
|
+
pMCompactSnapshotList: never[];
|
|
16
|
+
vLCompactSnapshotList: never[];
|
|
17
|
+
};
|
|
18
|
+
getMaxCombinedSnapshot(snapshotList: any): any;
|
|
19
|
+
getPMFilePath(snapshot: any): string;
|
|
20
|
+
getVLFilePath(snapshot: any): string;
|
|
21
|
+
saveSnapshotInfo(snapshotNum: any, info: any): any;
|
|
22
|
+
savePosMap(snapshot: any, sortedKeyList: any): Promise<any>;
|
|
23
|
+
isEmptySnapshot(snapshot: any): boolean;
|
|
24
|
+
removeKeyFromSnapshot(snapshot: any, key: any): void;
|
|
25
|
+
}
|
|
26
|
+
export declare function iterPMBuffer(buffer: any, fun: any): void;
|
|
27
|
+
export declare function loadPrefixPMFile(prefixPMFilePath: any): Promise<{}>;
|
package/src/QySnapshots.js
CHANGED
|
@@ -224,7 +224,7 @@ class t {
|
|
|
224
224
|
} = n;
|
|
225
225
|
for (t in r) {
|
|
226
226
|
var u, f = r[t];
|
|
227
|
-
f.isOut || (100 == (u = D(f)) ? (this.delSnapshot(f), a.push(t)) : p < u ? (B(f) ? o : s).push(f) : Math.
|
|
227
|
+
f.isOut || (100 == (u = D(f)) ? (this.delSnapshot(f), a.push(t)) : p < u ? (B(f) ? o : s).push(f) : Math.floor(f.outdatedCount / f.info.totalCount * 100) > i ? e.push(f) : (u = this,
|
|
228
228
|
f.info.totalCount < u.options.minSnapshotKeyCount && B(f) && o.push(f)));
|
|
229
229
|
}
|
|
230
230
|
return 1 == o.length && D(o[0]) < p && (o.length = 0), 0 < e.length && P.log("pMCompacts:" + e.map(t => t.snapshotNum)),
|
|
@@ -263,7 +263,7 @@ class t {
|
|
|
263
263
|
outdatedCount: o,
|
|
264
264
|
totalCount: e
|
|
265
265
|
} = a;
|
|
266
|
-
return a.outdated = Math.
|
|
266
|
+
return a.outdated = Math.floor(100 * o / e) + "%", P.log("Saving snapshotInfo:" + t),
|
|
267
267
|
this.qyJsonSaver.saveToFile(a, t + ".json", !0);
|
|
268
268
|
}
|
|
269
269
|
savePosMap(t, a) {
|
|
@@ -376,7 +376,7 @@ function D(t) {
|
|
|
376
376
|
outdatedCount: t,
|
|
377
377
|
info: a
|
|
378
378
|
} = t, o = a.totalCount, t = t + a.outdatedCount;
|
|
379
|
-
return t == o ? 100 : Math.
|
|
379
|
+
return t == o ? 100 : Math.floor(t / o * 100);
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dumpStructure(parentFolderPath: any, dir: any): Promise<void>;
|
package/src/QyStructure.js
CHANGED
|
@@ -14,39 +14,39 @@ import {
|
|
|
14
14
|
} from "./QyUtils.js";
|
|
15
15
|
|
|
16
16
|
async function P(e, r) {
|
|
17
|
-
let
|
|
18
|
-
for (var
|
|
19
|
-
let e =
|
|
17
|
+
let i = {};
|
|
18
|
+
for (var o of r.subdirList) {
|
|
19
|
+
let e = o.name;
|
|
20
20
|
for (;r.getFile(e); ) e += "_d";
|
|
21
|
-
e = _(e),
|
|
22
|
-
x:
|
|
21
|
+
e = _(e), i[e] = {
|
|
22
|
+
x: o,
|
|
23
23
|
count: 0
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
await y(e);
|
|
27
|
-
var
|
|
27
|
+
var t, a = [], s = [];
|
|
28
28
|
let n = {};
|
|
29
|
-
for (
|
|
29
|
+
for (t of await w(e, {
|
|
30
30
|
withFileTypes: !0
|
|
31
31
|
})) {
|
|
32
|
-
var
|
|
33
|
-
|
|
32
|
+
var f = t.name;
|
|
33
|
+
t.isFile() ? a.push(f) : (s.push(f), n[f] = 1);
|
|
34
34
|
}
|
|
35
|
-
var
|
|
36
|
-
for (
|
|
37
|
-
|
|
35
|
+
var l, u, p, m, h, c = [];
|
|
36
|
+
for (l of s) i[l] || ((u = d((u = l) + "_d") || d(u.replace(/_d$/, ""))) ? (c.push(F(x(e, l), x(e, u))),
|
|
37
|
+
i[u].count = 1) : c.push(v(x(e, l), {
|
|
38
38
|
recursive: !0
|
|
39
39
|
})));
|
|
40
|
-
for (p of a) r.getFile(p) ||
|
|
41
|
-
await Promise.all(
|
|
42
|
-
for (m of r.fileList)
|
|
40
|
+
for (p of a) r.getFile(p) || c.push(v(x(e, p)));
|
|
41
|
+
await Promise.all(c), c.length = 0;
|
|
42
|
+
for (m of r.fileList) c.push(g(x(e, _(m.name)), m.contentAsText, {
|
|
43
43
|
flush: !0
|
|
44
44
|
}));
|
|
45
|
-
for (
|
|
45
|
+
for (h in await Promise.all(c), c.length = 0, i) c.push(P(x(e, h), i[h].x));
|
|
46
46
|
function d(e) {
|
|
47
|
-
return e && 0 ==
|
|
47
|
+
return e && 0 == i[e]?.count && !n[e] ? e : void 0;
|
|
48
48
|
}
|
|
49
|
-
await Promise.all(
|
|
49
|
+
await Promise.all(c);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function _(e) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class QyTriggerNode {
|
|
2
|
+
constructor(name: any, parent: any);
|
|
3
|
+
insertTrigger(triggerName: any, fileNamePath: any, propNamePathList: any, fun: any): void;
|
|
4
|
+
removeTrigger(triggerName: any, fileNamePath: any): boolean;
|
|
5
|
+
get isEmpty(): boolean;
|
|
6
|
+
removeEmptyNodes(): void;
|
|
7
|
+
checkTrigger(file: any, delta: any): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function updateTriggerNodes(rootDir: any, fileNamePath: any): void;
|
package/src/QyTrigger.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
-
isDeepStrictEqual as
|
|
2
|
+
isDeepStrictEqual as c
|
|
3
3
|
} from "node:util";
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
getValByNamePath as
|
|
6
|
+
getValByNamePath as p,
|
|
7
7
|
setValByNamePath as u
|
|
8
8
|
} from "./QyFileContentUtils.js";
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
isEmptyObj as e,
|
|
12
|
-
isMatchName as
|
|
12
|
+
isMatchName as g,
|
|
13
13
|
getMatchParam as d,
|
|
14
14
|
arrayLast as f,
|
|
15
|
-
propNameJoin as
|
|
15
|
+
propNameJoin as v
|
|
16
16
|
} from "./QyUtils.js";
|
|
17
17
|
|
|
18
|
-
let
|
|
18
|
+
let N = Array.isArray;
|
|
19
19
|
|
|
20
20
|
class h {
|
|
21
21
|
constructor(e, r) {
|
|
@@ -29,21 +29,21 @@ class h {
|
|
|
29
29
|
insertTrigger(e, r, t, a) {
|
|
30
30
|
let i = this;
|
|
31
31
|
for (var s of r) {
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
i =
|
|
32
|
+
g(s) && (s = "*");
|
|
33
|
+
var n = i.children;
|
|
34
|
+
i = n[s] || (n[s] = new h(s, i));
|
|
35
35
|
}
|
|
36
|
-
var
|
|
37
|
-
|
|
36
|
+
var o = i.triggerMap, l = o[e];
|
|
37
|
+
l ? Object.assign(l, {
|
|
38
38
|
triggerName: e,
|
|
39
39
|
fileNamePath: r,
|
|
40
40
|
propNamePathList: t,
|
|
41
41
|
fun: a
|
|
42
|
-
}) :
|
|
42
|
+
}) : o[e] = new m(e, r, t, a);
|
|
43
43
|
}
|
|
44
44
|
removeTrigger(e, r) {
|
|
45
45
|
let t = this;
|
|
46
|
-
for (var a of r) if (
|
|
46
|
+
for (var a of r) if (g(a) && (a = "*"), !(t = t.children[a])) return !1;
|
|
47
47
|
r = t.triggerMap;
|
|
48
48
|
return !!r[e] && (delete r[e], t.isEmpty && t.removeEmptyNodes(), !0);
|
|
49
49
|
}
|
|
@@ -82,32 +82,32 @@ class m {
|
|
|
82
82
|
triggerName: a,
|
|
83
83
|
fileNamePath: i,
|
|
84
84
|
propNamePathList: s,
|
|
85
|
-
fun:
|
|
86
|
-
} = this,
|
|
87
|
-
let
|
|
85
|
+
fun: n
|
|
86
|
+
} = this, o = e.fileContent;
|
|
87
|
+
let l;
|
|
88
88
|
for (t of s) {
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
oldValue:
|
|
89
|
+
var g = p(r.oldValue, t), f = p(r.newValue, t);
|
|
90
|
+
c(g, f) || (g = {
|
|
91
|
+
oldValue: g,
|
|
92
92
|
newValue: f
|
|
93
|
-
}, (
|
|
93
|
+
}, (N(f) || N(p(o, t))) && (g.isArrayDelta = !0), (l = l || {
|
|
94
94
|
_file: e,
|
|
95
|
-
_fileContent:
|
|
96
|
-
})[
|
|
95
|
+
_fileContent: o
|
|
96
|
+
})[v(t)] = g, u(l, t, g));
|
|
97
97
|
}
|
|
98
|
-
if (
|
|
98
|
+
if (l) {
|
|
99
99
|
var {
|
|
100
100
|
namePath: h,
|
|
101
101
|
qyCache: s
|
|
102
102
|
} = e;
|
|
103
103
|
for (let e = 0; e < h.length; ++e) {
|
|
104
104
|
var m = d(i[e]);
|
|
105
|
-
m && (
|
|
105
|
+
m && (l[m] = h[e]);
|
|
106
106
|
}
|
|
107
107
|
try {
|
|
108
|
-
|
|
108
|
+
n && n(l), s.emit(a, l);
|
|
109
109
|
} catch (e) {
|
|
110
|
-
logger.error(`Running trigger ${a} failed:`,
|
|
110
|
+
logger.error(`Running trigger ${a} failed:`, l, e);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -116,7 +116,7 @@ class m {
|
|
|
116
116
|
let t = [];
|
|
117
117
|
|
|
118
118
|
function y(e, r) {
|
|
119
|
-
return e ?
|
|
119
|
+
return e ? g(r) ? Object.values(e) : (e = e[r]) ? [ e ] : t : t;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
function r(e, a) {
|
|
@@ -124,13 +124,13 @@ function r(e, a) {
|
|
|
124
124
|
let r = [ e ], t = [];
|
|
125
125
|
for (let e = 0; e < a.length - 1; ++e) {
|
|
126
126
|
var i, s = a[e];
|
|
127
|
-
for (i of r) for (var
|
|
128
|
-
t.push(
|
|
127
|
+
for (i of r) for (var n of y(i.subdirMap, s)) i.setChildTriggerNodes(n),
|
|
128
|
+
t.push(n);
|
|
129
129
|
if (0 == t.length) return;
|
|
130
130
|
[ r, t ] = [ t, r ], t.length = 0;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
133
|
-
for (
|
|
132
|
+
var o, l = f(a);
|
|
133
|
+
for (o of r) for (var g of y(o.fileMap, l)) o.setChildTriggerNodes(g);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class QueryCounter {
|
|
2
|
+
constructor(limit: any, cursor?: number);
|
|
3
|
+
get isFull(): boolean;
|
|
4
|
+
encounterOne(fileName: any): true | undefined;
|
|
5
|
+
countOne(): true | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare class QyQueryNode {
|
|
8
|
+
constructor();
|
|
9
|
+
encounterOne(resultMap: any, fileName: any, queryCounter: any): true | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare class QyUnionNode extends QyQueryNode {
|
|
12
|
+
constructor(dir: any);
|
|
13
|
+
containsFile(fileName: any): boolean;
|
|
14
|
+
getFiles(queryCounter: any, resultMap?: {}): Generator<any, void, any>;
|
|
15
|
+
addNode(node: any): void;
|
|
16
|
+
addDir(dir: any): void;
|
|
17
|
+
}
|
package/src/QyUnionNode.js
CHANGED
package/src/QyUtils.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare const __dirname: string;
|
|
2
|
+
export declare const SpecialOperators: {
|
|
3
|
+
[k: string]: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const SpecialFilePaths: {
|
|
6
|
+
HiddenFolderName: string;
|
|
7
|
+
TriggerDirPath: string[];
|
|
8
|
+
RpcDirPath: string[];
|
|
9
|
+
IndexDirPath: string[];
|
|
10
|
+
IndexPropPathsFileName: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function isMatchName(name: any): any;
|
|
13
|
+
export declare function getMatchParam(name: any): any;
|
|
14
|
+
export declare function getSizeStr(size: number): string;
|
|
15
|
+
export declare function calHash(str: any, len?: number): string;
|
|
16
|
+
export declare const Hash_Key_Length: number;
|
|
17
|
+
export declare function getSubdirMapKey(fullPathHash: any): string;
|
|
18
|
+
export declare function getFileMapKey(fullPathHash: any): string;
|
|
19
|
+
export declare function getContentKey(fullPathHash: any): string;
|
|
20
|
+
export declare function getRandomStr(byteCount?: number): string;
|
|
21
|
+
export declare function arrayLast(array: any): any;
|
|
22
|
+
export declare function isEmptyObj(obj: any): boolean;
|
|
23
|
+
export declare function isNotNullObj(item: any): boolean;
|
|
24
|
+
export declare function isString(item: any): item is string;
|
|
25
|
+
export declare function isNumber(item: any): item is number;
|
|
26
|
+
export declare function isBoolean(item: any): item is boolean;
|
|
27
|
+
export declare function isFunction(item: any): boolean;
|
|
28
|
+
export declare function isSimpleType(item: any): boolean;
|
|
29
|
+
export declare function trimArrayTail(arr: any): any;
|
|
30
|
+
export declare function setPromise(operation: any): any;
|
|
31
|
+
export declare function toBuffer(data: any): Buffer<any>;
|
|
32
|
+
export declare function getSuffix(num: any): "s" | "";
|
|
33
|
+
export declare function ensureDir(dirPath: any): Promise<string | undefined>;
|
|
34
|
+
export declare function ensureParentDir(filePath: any): Promise<string | undefined>;
|
|
35
|
+
export declare function getSize(filePath: any): Promise<number | false>;
|
|
36
|
+
export declare function folderOrFileExists(folderPath: any): Promise<boolean>;
|
|
37
|
+
export declare function sleep(seconds: any, signal: any): Promise<boolean>;
|
|
38
|
+
export declare function lockExclusiveFilePath(exclusiveFilePath: any): Promise<void>;
|
|
39
|
+
export declare function unlockExclusiveFilePath(exclusiveFilePath: any): void;
|
|
40
|
+
export declare function fromSingleName(name: any): any;
|
|
41
|
+
export declare function toSingleName(list: any): any;
|
|
42
|
+
export declare function pathSplit(itemPath: any): any;
|
|
43
|
+
export declare function propNameSplit(propNameStr: any): any;
|
|
44
|
+
export declare function propNameJoin(propName: any): any;
|
|
45
|
+
export declare function randomInt(max: any, min?: number): number;
|
|
46
|
+
export declare function listToMap(list: any): {};
|
|
47
|
+
export declare function readBufferAsync(filePath: any, fileHandle: any, start: any, length: any): Promise<Buffer<ArrayBuffer> | undefined>;
|
|
48
|
+
export declare function memoryPercent(): number;
|
|
49
|
+
export declare function loadFileList(fileList: any, preloadCount?: number): AsyncGenerator<{
|
|
50
|
+
filePath: any;
|
|
51
|
+
bin: any;
|
|
52
|
+
}, void, unknown>;
|
|
53
|
+
export * as default from "./QyUtils.ts";
|