@nxtedition/types 23.0.1 → 23.0.2
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/dist/app.d.ts +1 -12
- package/dist/common/block.d.ts +1 -1
- package/dist/rpc.d.ts +40 -0
- package/dist/rpc.js +505 -1
- package/dist/schema.json +3836 -0
- package/package.json +7 -3
package/dist/app.d.ts
CHANGED
|
@@ -13,18 +13,7 @@ export interface ElectronHubApi {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const isElectronHubApi: (input: unknown) => input is ElectronHubApi;
|
|
15
15
|
export declare const assertElectronHubApi: (input: unknown) => ElectronHubApi;
|
|
16
|
-
export declare const randomElectronHubApi: () =>
|
|
17
|
-
startDrag: never;
|
|
18
|
-
getWebdavPath: never;
|
|
19
|
-
showOpenDialog: never;
|
|
20
|
-
getCurrentVersion: never;
|
|
21
|
-
getLatestVersion: never;
|
|
22
|
-
triggerUpdate: never;
|
|
23
|
-
controlDownloadItem: never;
|
|
24
|
-
openInApp: never;
|
|
25
|
-
installDavinciPlugin: never;
|
|
26
|
-
clipboard: unknown;
|
|
27
|
-
};
|
|
16
|
+
export declare const randomElectronHubApi: () => ElectronHubApi;
|
|
28
17
|
export declare const assertGuardElectronHubApi: __AssertionGuard<ElectronHubApi>;
|
|
29
18
|
export declare const stringifyElectronHubApi: (input: ElectronHubApi) => string;
|
|
30
19
|
export declare const assertStringifyElectronHubApi: (input: unknown) => string;
|
package/dist/common/block.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare const assertStringifyBlock: (input: unknown) => string;
|
|
|
21
21
|
export type Blocks = Block[];
|
|
22
22
|
export declare const isBlocks: (input: unknown) => input is Blocks;
|
|
23
23
|
export declare const assertBlocks: (input: unknown) => Blocks;
|
|
24
|
-
export declare const randomBlocks: () =>
|
|
24
|
+
export declare const randomBlocks: () => any[];
|
|
25
25
|
export declare const assertGuardBlocks: __AssertionGuard<Blocks>;
|
|
26
26
|
export declare const stringifyBlocks: (input: Blocks) => string;
|
|
27
27
|
export declare const assertStringifyBlocks: (input: unknown) => string;
|
package/dist/rpc.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AssertionGuard as __AssertionGuard } from "typia";
|
|
1
2
|
export interface RpcMethods {
|
|
2
3
|
"media/applySubtitles": [
|
|
3
4
|
{
|
|
@@ -16,7 +17,46 @@ export interface RpcMethods {
|
|
|
16
17
|
},
|
|
17
18
|
string
|
|
18
19
|
];
|
|
20
|
+
"asset/export": [
|
|
21
|
+
{
|
|
22
|
+
assets: string[];
|
|
23
|
+
},
|
|
24
|
+
NxtExport
|
|
25
|
+
];
|
|
26
|
+
"asset/import": [
|
|
27
|
+
{
|
|
28
|
+
source?: NxtExport;
|
|
29
|
+
mode?: NxtImportMode;
|
|
30
|
+
selection?: string[];
|
|
31
|
+
},
|
|
32
|
+
string[]
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
export type NxtImportMode = "seed" | "clone";
|
|
36
|
+
export declare const isNxtImportMode: (input: unknown) => input is NxtImportMode;
|
|
37
|
+
export declare const assertNxtImportMode: (input: unknown) => NxtImportMode;
|
|
38
|
+
export declare const randomNxtImportMode: () => NxtImportMode;
|
|
39
|
+
export declare const assertGuardNxtImportMode: __AssertionGuard<NxtImportMode>;
|
|
40
|
+
export declare const stringifyNxtImportMode: (input: NxtImportMode) => string;
|
|
41
|
+
export declare const assertStringifyNxtImportMode: (input: unknown) => string;
|
|
42
|
+
export interface NxtExport {
|
|
43
|
+
version: number;
|
|
44
|
+
date: string;
|
|
45
|
+
root: string[];
|
|
46
|
+
assets: {
|
|
47
|
+
[assetId: string]: {
|
|
48
|
+
_children: string[];
|
|
49
|
+
[domain: string]: unknown;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
files?: string[];
|
|
19
53
|
}
|
|
54
|
+
export declare const isNxtExport: (input: unknown) => input is NxtExport;
|
|
55
|
+
export declare const assertNxtExport: (input: unknown) => NxtExport;
|
|
56
|
+
export declare const randomNxtExport: () => NxtExport;
|
|
57
|
+
export declare const assertGuardNxtExport: __AssertionGuard<NxtExport>;
|
|
58
|
+
export declare const stringifyNxtExport: (input: NxtExport) => string;
|
|
59
|
+
export declare const assertStringifyNxtExport: (input: unknown) => string;
|
|
20
60
|
type Source = string | {
|
|
21
61
|
id: string;
|
|
22
62
|
patches?: Record<string, unknown>;
|
package/dist/rpc.js
CHANGED
|
@@ -1 +1,505 @@
|
|
|
1
|
-
|
|
1
|
+
import __typia from "typia";
|
|
2
|
+
export const isNxtImportMode = input => {
|
|
3
|
+
return "seed" === input || "clone" === input;
|
|
4
|
+
};
|
|
5
|
+
export const assertNxtImportMode = (input, errorFactory) => {
|
|
6
|
+
const __is = input => {
|
|
7
|
+
return "seed" === input || "clone" === input;
|
|
8
|
+
};
|
|
9
|
+
if (false === __is(input))
|
|
10
|
+
((input, _path, _exceptionable = true) => {
|
|
11
|
+
const $guard = __typia.createAssert.guard;
|
|
12
|
+
return "seed" === input || "clone" === input || $guard(true, {
|
|
13
|
+
path: _path + "",
|
|
14
|
+
expected: "(\"clone\" | \"seed\")",
|
|
15
|
+
value: input
|
|
16
|
+
}, errorFactory);
|
|
17
|
+
})(input, "$input", true);
|
|
18
|
+
return input;
|
|
19
|
+
};
|
|
20
|
+
export const randomNxtImportMode = generator => {
|
|
21
|
+
const $pick = __typia.createRandom.pick;
|
|
22
|
+
return $pick([
|
|
23
|
+
() => "seed",
|
|
24
|
+
() => "clone"
|
|
25
|
+
])();
|
|
26
|
+
};
|
|
27
|
+
export const assertGuardNxtImportMode = (input, errorFactory) => {
|
|
28
|
+
const __is = input => {
|
|
29
|
+
return "seed" === input || "clone" === input;
|
|
30
|
+
};
|
|
31
|
+
if (false === __is(input))
|
|
32
|
+
((input, _path, _exceptionable = true) => {
|
|
33
|
+
const $guard = __typia.createAssertGuard.guard;
|
|
34
|
+
return "seed" === input || "clone" === input || $guard(true, {
|
|
35
|
+
path: _path + "",
|
|
36
|
+
expected: "(\"clone\" | \"seed\")",
|
|
37
|
+
value: input
|
|
38
|
+
}, errorFactory);
|
|
39
|
+
})(input, "$input", true);
|
|
40
|
+
};
|
|
41
|
+
export const stringifyNxtImportMode = input => {
|
|
42
|
+
const $string = __typia.json.createStringify.string;
|
|
43
|
+
const $throws = __typia.json.createStringify.throws;
|
|
44
|
+
return (() => {
|
|
45
|
+
if ("string" === typeof input)
|
|
46
|
+
return $string(input);
|
|
47
|
+
if ("string" === typeof input)
|
|
48
|
+
return "\"" + input + "\"";
|
|
49
|
+
$throws({
|
|
50
|
+
expected: "(\"clone\" | \"seed\")",
|
|
51
|
+
value: input
|
|
52
|
+
});
|
|
53
|
+
})();
|
|
54
|
+
};
|
|
55
|
+
export const assertStringifyNxtImportMode = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
56
|
+
const __is = input => {
|
|
57
|
+
return "seed" === input || "clone" === input;
|
|
58
|
+
};
|
|
59
|
+
if (false === __is(input))
|
|
60
|
+
((input, _path, _exceptionable = true) => {
|
|
61
|
+
const $guard = __typia.json.createAssertStringify.guard;
|
|
62
|
+
return "seed" === input || "clone" === input || $guard(true, {
|
|
63
|
+
path: _path + "",
|
|
64
|
+
expected: "(\"clone\" | \"seed\")",
|
|
65
|
+
value: input
|
|
66
|
+
}, errorFactory);
|
|
67
|
+
})(input, "$input", true);
|
|
68
|
+
return input;
|
|
69
|
+
}; const stringify = input => {
|
|
70
|
+
const $string = __typia.json.createAssertStringify.string;
|
|
71
|
+
const $throws = __typia.json.createAssertStringify.throws;
|
|
72
|
+
return (() => {
|
|
73
|
+
if ("string" === typeof input)
|
|
74
|
+
return $string(input);
|
|
75
|
+
if ("string" === typeof input)
|
|
76
|
+
return "\"" + input + "\"";
|
|
77
|
+
$throws({
|
|
78
|
+
expected: "(\"clone\" | \"seed\")",
|
|
79
|
+
value: input
|
|
80
|
+
});
|
|
81
|
+
})();
|
|
82
|
+
}; return stringify(assert(input, errorFactory)); };
|
|
83
|
+
export const isNxtExport = input => {
|
|
84
|
+
const $io0 = input => "number" === typeof input.version && "string" === typeof input.date && (Array.isArray(input.root) && input.root.every(elem => "string" === typeof elem)) && ("object" === typeof input.assets && null !== input.assets && false === Array.isArray(input.assets) && $io1(input.assets)) && (undefined === input.files || Array.isArray(input.files) && input.files.every(elem => "string" === typeof elem));
|
|
85
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
86
|
+
const value = input[key];
|
|
87
|
+
if (undefined === value)
|
|
88
|
+
return true;
|
|
89
|
+
return "object" === typeof value && null !== value && $io2(value);
|
|
90
|
+
});
|
|
91
|
+
const $io2 = input => Array.isArray(input._children) && input._children.every(elem => "string" === typeof elem) && Object.keys(input).every(key => {
|
|
92
|
+
if (["_children"].some(prop => key === prop))
|
|
93
|
+
return true;
|
|
94
|
+
const value = input[key];
|
|
95
|
+
if (undefined === value)
|
|
96
|
+
return true;
|
|
97
|
+
return true;
|
|
98
|
+
});
|
|
99
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
100
|
+
};
|
|
101
|
+
export const assertNxtExport = (input, errorFactory) => {
|
|
102
|
+
const __is = input => {
|
|
103
|
+
const $io0 = input => "number" === typeof input.version && "string" === typeof input.date && (Array.isArray(input.root) && input.root.every(elem => "string" === typeof elem)) && ("object" === typeof input.assets && null !== input.assets && false === Array.isArray(input.assets) && $io1(input.assets)) && (undefined === input.files || Array.isArray(input.files) && input.files.every(elem => "string" === typeof elem));
|
|
104
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
105
|
+
const value = input[key];
|
|
106
|
+
if (undefined === value)
|
|
107
|
+
return true;
|
|
108
|
+
return "object" === typeof value && null !== value && $io2(value);
|
|
109
|
+
});
|
|
110
|
+
const $io2 = input => Array.isArray(input._children) && input._children.every(elem => "string" === typeof elem) && Object.keys(input).every(key => {
|
|
111
|
+
if (["_children"].some(prop => key === prop))
|
|
112
|
+
return true;
|
|
113
|
+
const value = input[key];
|
|
114
|
+
if (undefined === value)
|
|
115
|
+
return true;
|
|
116
|
+
return true;
|
|
117
|
+
});
|
|
118
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
119
|
+
};
|
|
120
|
+
if (false === __is(input))
|
|
121
|
+
((input, _path, _exceptionable = true) => {
|
|
122
|
+
const $guard = __typia.createAssert.guard;
|
|
123
|
+
const $join = __typia.createAssert.join;
|
|
124
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.version || $guard(_exceptionable, {
|
|
125
|
+
path: _path + ".version",
|
|
126
|
+
expected: "number",
|
|
127
|
+
value: input.version
|
|
128
|
+
}, errorFactory)) && ("string" === typeof input.date || $guard(_exceptionable, {
|
|
129
|
+
path: _path + ".date",
|
|
130
|
+
expected: "string",
|
|
131
|
+
value: input.date
|
|
132
|
+
}, errorFactory)) && ((Array.isArray(input.root) || $guard(_exceptionable, {
|
|
133
|
+
path: _path + ".root",
|
|
134
|
+
expected: "Array<string>",
|
|
135
|
+
value: input.root
|
|
136
|
+
}, errorFactory)) && input.root.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
|
|
137
|
+
path: _path + ".root[" + _index1 + "]",
|
|
138
|
+
expected: "string",
|
|
139
|
+
value: elem
|
|
140
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
141
|
+
path: _path + ".root",
|
|
142
|
+
expected: "Array<string>",
|
|
143
|
+
value: input.root
|
|
144
|
+
}, errorFactory)) && (("object" === typeof input.assets && null !== input.assets && false === Array.isArray(input.assets) || $guard(_exceptionable, {
|
|
145
|
+
path: _path + ".assets",
|
|
146
|
+
expected: "__type",
|
|
147
|
+
value: input.assets
|
|
148
|
+
}, errorFactory)) && $ao1(input.assets, _path + ".assets", true && _exceptionable) || $guard(_exceptionable, {
|
|
149
|
+
path: _path + ".assets",
|
|
150
|
+
expected: "__type",
|
|
151
|
+
value: input.assets
|
|
152
|
+
}, errorFactory)) && (undefined === input.files || (Array.isArray(input.files) || $guard(_exceptionable, {
|
|
153
|
+
path: _path + ".files",
|
|
154
|
+
expected: "(Array<string> | undefined)",
|
|
155
|
+
value: input.files
|
|
156
|
+
}, errorFactory)) && input.files.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
|
|
157
|
+
path: _path + ".files[" + _index2 + "]",
|
|
158
|
+
expected: "string",
|
|
159
|
+
value: elem
|
|
160
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
161
|
+
path: _path + ".files",
|
|
162
|
+
expected: "(Array<string> | undefined)",
|
|
163
|
+
value: input.files
|
|
164
|
+
}, errorFactory));
|
|
165
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
166
|
+
const value = input[key];
|
|
167
|
+
if (undefined === value)
|
|
168
|
+
return true;
|
|
169
|
+
return ("object" === typeof value && null !== value || $guard(_exceptionable, {
|
|
170
|
+
path: _path + $join(key),
|
|
171
|
+
expected: "__type.o1",
|
|
172
|
+
value: value
|
|
173
|
+
}, errorFactory)) && $ao2(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
|
174
|
+
path: _path + $join(key),
|
|
175
|
+
expected: "__type.o1",
|
|
176
|
+
value: value
|
|
177
|
+
}, errorFactory);
|
|
178
|
+
});
|
|
179
|
+
const $ao2 = (input, _path, _exceptionable = true) => ((Array.isArray(input._children) || $guard(_exceptionable, {
|
|
180
|
+
path: _path + "._children",
|
|
181
|
+
expected: "Array<string>",
|
|
182
|
+
value: input._children
|
|
183
|
+
}, errorFactory)) && input._children.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
|
|
184
|
+
path: _path + "._children[" + _index3 + "]",
|
|
185
|
+
expected: "string",
|
|
186
|
+
value: elem
|
|
187
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
188
|
+
path: _path + "._children",
|
|
189
|
+
expected: "Array<string>",
|
|
190
|
+
value: input._children
|
|
191
|
+
}, errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
192
|
+
if (["_children"].some(prop => key === prop))
|
|
193
|
+
return true;
|
|
194
|
+
const value = input[key];
|
|
195
|
+
if (undefined === value)
|
|
196
|
+
return true;
|
|
197
|
+
return true;
|
|
198
|
+
}));
|
|
199
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
200
|
+
path: _path + "",
|
|
201
|
+
expected: "NxtExport",
|
|
202
|
+
value: input
|
|
203
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
204
|
+
path: _path + "",
|
|
205
|
+
expected: "NxtExport",
|
|
206
|
+
value: input
|
|
207
|
+
}, errorFactory);
|
|
208
|
+
})(input, "$input", true);
|
|
209
|
+
return input;
|
|
210
|
+
};
|
|
211
|
+
export const randomNxtExport = generator => {
|
|
212
|
+
const $generator = __typia.createRandom.generator;
|
|
213
|
+
const $pick = __typia.createRandom.pick;
|
|
214
|
+
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
215
|
+
version: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100),
|
|
216
|
+
date: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
217
|
+
root: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
218
|
+
assets: $ro1(_recursive, _recursive ? 1 + _depth : _depth),
|
|
219
|
+
files: $pick([
|
|
220
|
+
() => undefined,
|
|
221
|
+
() => (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
|
|
222
|
+
])()
|
|
223
|
+
});
|
|
224
|
+
const $ro1 = (_recursive = false, _depth = 0) => {
|
|
225
|
+
const output = {};
|
|
226
|
+
(generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = $ro2(_recursive, _recursive ? 1 + _depth : _depth), (generator?.integer ?? $generator.integer)(0, 3));
|
|
227
|
+
return output;
|
|
228
|
+
};
|
|
229
|
+
const $ro2 = (_recursive = false, _depth = 0) => {
|
|
230
|
+
const output = {
|
|
231
|
+
_children: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
|
|
232
|
+
};
|
|
233
|
+
(generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
|
|
234
|
+
return output;
|
|
235
|
+
};
|
|
236
|
+
return $ro0();
|
|
237
|
+
};
|
|
238
|
+
export const assertGuardNxtExport = (input, errorFactory) => {
|
|
239
|
+
const __is = input => {
|
|
240
|
+
const $io0 = input => "number" === typeof input.version && "string" === typeof input.date && (Array.isArray(input.root) && input.root.every(elem => "string" === typeof elem)) && ("object" === typeof input.assets && null !== input.assets && false === Array.isArray(input.assets) && $io1(input.assets)) && (undefined === input.files || Array.isArray(input.files) && input.files.every(elem => "string" === typeof elem));
|
|
241
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
242
|
+
const value = input[key];
|
|
243
|
+
if (undefined === value)
|
|
244
|
+
return true;
|
|
245
|
+
return "object" === typeof value && null !== value && $io2(value);
|
|
246
|
+
});
|
|
247
|
+
const $io2 = input => Array.isArray(input._children) && input._children.every(elem => "string" === typeof elem) && Object.keys(input).every(key => {
|
|
248
|
+
if (["_children"].some(prop => key === prop))
|
|
249
|
+
return true;
|
|
250
|
+
const value = input[key];
|
|
251
|
+
if (undefined === value)
|
|
252
|
+
return true;
|
|
253
|
+
return true;
|
|
254
|
+
});
|
|
255
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
256
|
+
};
|
|
257
|
+
if (false === __is(input))
|
|
258
|
+
((input, _path, _exceptionable = true) => {
|
|
259
|
+
const $guard = __typia.createAssertGuard.guard;
|
|
260
|
+
const $join = __typia.createAssertGuard.join;
|
|
261
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.version || $guard(_exceptionable, {
|
|
262
|
+
path: _path + ".version",
|
|
263
|
+
expected: "number",
|
|
264
|
+
value: input.version
|
|
265
|
+
}, errorFactory)) && ("string" === typeof input.date || $guard(_exceptionable, {
|
|
266
|
+
path: _path + ".date",
|
|
267
|
+
expected: "string",
|
|
268
|
+
value: input.date
|
|
269
|
+
}, errorFactory)) && ((Array.isArray(input.root) || $guard(_exceptionable, {
|
|
270
|
+
path: _path + ".root",
|
|
271
|
+
expected: "Array<string>",
|
|
272
|
+
value: input.root
|
|
273
|
+
}, errorFactory)) && input.root.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
|
|
274
|
+
path: _path + ".root[" + _index1 + "]",
|
|
275
|
+
expected: "string",
|
|
276
|
+
value: elem
|
|
277
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
278
|
+
path: _path + ".root",
|
|
279
|
+
expected: "Array<string>",
|
|
280
|
+
value: input.root
|
|
281
|
+
}, errorFactory)) && (("object" === typeof input.assets && null !== input.assets && false === Array.isArray(input.assets) || $guard(_exceptionable, {
|
|
282
|
+
path: _path + ".assets",
|
|
283
|
+
expected: "__type",
|
|
284
|
+
value: input.assets
|
|
285
|
+
}, errorFactory)) && $ao1(input.assets, _path + ".assets", true && _exceptionable) || $guard(_exceptionable, {
|
|
286
|
+
path: _path + ".assets",
|
|
287
|
+
expected: "__type",
|
|
288
|
+
value: input.assets
|
|
289
|
+
}, errorFactory)) && (undefined === input.files || (Array.isArray(input.files) || $guard(_exceptionable, {
|
|
290
|
+
path: _path + ".files",
|
|
291
|
+
expected: "(Array<string> | undefined)",
|
|
292
|
+
value: input.files
|
|
293
|
+
}, errorFactory)) && input.files.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
|
|
294
|
+
path: _path + ".files[" + _index2 + "]",
|
|
295
|
+
expected: "string",
|
|
296
|
+
value: elem
|
|
297
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
298
|
+
path: _path + ".files",
|
|
299
|
+
expected: "(Array<string> | undefined)",
|
|
300
|
+
value: input.files
|
|
301
|
+
}, errorFactory));
|
|
302
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
303
|
+
const value = input[key];
|
|
304
|
+
if (undefined === value)
|
|
305
|
+
return true;
|
|
306
|
+
return ("object" === typeof value && null !== value || $guard(_exceptionable, {
|
|
307
|
+
path: _path + $join(key),
|
|
308
|
+
expected: "__type.o1",
|
|
309
|
+
value: value
|
|
310
|
+
}, errorFactory)) && $ao2(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
|
311
|
+
path: _path + $join(key),
|
|
312
|
+
expected: "__type.o1",
|
|
313
|
+
value: value
|
|
314
|
+
}, errorFactory);
|
|
315
|
+
});
|
|
316
|
+
const $ao2 = (input, _path, _exceptionable = true) => ((Array.isArray(input._children) || $guard(_exceptionable, {
|
|
317
|
+
path: _path + "._children",
|
|
318
|
+
expected: "Array<string>",
|
|
319
|
+
value: input._children
|
|
320
|
+
}, errorFactory)) && input._children.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
|
|
321
|
+
path: _path + "._children[" + _index3 + "]",
|
|
322
|
+
expected: "string",
|
|
323
|
+
value: elem
|
|
324
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
325
|
+
path: _path + "._children",
|
|
326
|
+
expected: "Array<string>",
|
|
327
|
+
value: input._children
|
|
328
|
+
}, errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
329
|
+
if (["_children"].some(prop => key === prop))
|
|
330
|
+
return true;
|
|
331
|
+
const value = input[key];
|
|
332
|
+
if (undefined === value)
|
|
333
|
+
return true;
|
|
334
|
+
return true;
|
|
335
|
+
}));
|
|
336
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
337
|
+
path: _path + "",
|
|
338
|
+
expected: "NxtExport",
|
|
339
|
+
value: input
|
|
340
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
341
|
+
path: _path + "",
|
|
342
|
+
expected: "NxtExport",
|
|
343
|
+
value: input
|
|
344
|
+
}, errorFactory);
|
|
345
|
+
})(input, "$input", true);
|
|
346
|
+
};
|
|
347
|
+
export const stringifyNxtExport = input => {
|
|
348
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
349
|
+
const value = input[key];
|
|
350
|
+
if (undefined === value)
|
|
351
|
+
return true;
|
|
352
|
+
return "object" === typeof value && null !== value && $io2(value);
|
|
353
|
+
});
|
|
354
|
+
const $io2 = input => Array.isArray(input._children) && input._children.every(elem => "string" === typeof elem) && Object.keys(input).every(key => {
|
|
355
|
+
if (["_children"].some(prop => key === prop))
|
|
356
|
+
return true;
|
|
357
|
+
const value = input[key];
|
|
358
|
+
if (undefined === value)
|
|
359
|
+
return true;
|
|
360
|
+
return true;
|
|
361
|
+
});
|
|
362
|
+
const $string = __typia.json.createStringify.string;
|
|
363
|
+
const $tail = __typia.json.createStringify.tail;
|
|
364
|
+
const $so0 = input => `{${undefined === input.files ? "" : `"files":${undefined !== input.files ? `[${input.files.map(elem => $string(elem)).join(",")}]` : undefined},`}"version":${input.version},"date":${$string(input.date)},"root":${`[${input.root.map(elem => $string(elem)).join(",")}]`},"assets":${$so1(input.assets)}}`;
|
|
365
|
+
const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
366
|
+
return ""; return `${JSON.stringify(key)}:${$so2(value)}`; }).filter(str => "" !== str).join(",")}}`;
|
|
367
|
+
const $so2 = input => `{${$tail(`"_children":${`[${input._children.map(elem => $string(elem)).join(",")}]`},${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
368
|
+
return ""; if (["_children"].some(regular => regular === key))
|
|
369
|
+
return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}`)}}`;
|
|
370
|
+
return $so0(input);
|
|
371
|
+
};
|
|
372
|
+
export const assertStringifyNxtExport = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
373
|
+
const __is = input => {
|
|
374
|
+
const $io0 = input => "number" === typeof input.version && !Number.isNaN(input.version) && "string" === typeof input.date && (Array.isArray(input.root) && input.root.every(elem => "string" === typeof elem)) && ("object" === typeof input.assets && null !== input.assets && false === Array.isArray(input.assets) && $io1(input.assets)) && (undefined === input.files || Array.isArray(input.files) && input.files.every(elem => "string" === typeof elem));
|
|
375
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
376
|
+
const value = input[key];
|
|
377
|
+
if (undefined === value)
|
|
378
|
+
return true;
|
|
379
|
+
return "object" === typeof value && null !== value && $io2(value);
|
|
380
|
+
});
|
|
381
|
+
const $io2 = input => Array.isArray(input._children) && input._children.every(elem => "string" === typeof elem) && Object.keys(input).every(key => {
|
|
382
|
+
if (["_children"].some(prop => key === prop))
|
|
383
|
+
return true;
|
|
384
|
+
const value = input[key];
|
|
385
|
+
if (undefined === value)
|
|
386
|
+
return true;
|
|
387
|
+
return true;
|
|
388
|
+
});
|
|
389
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
390
|
+
};
|
|
391
|
+
if (false === __is(input))
|
|
392
|
+
((input, _path, _exceptionable = true) => {
|
|
393
|
+
const $guard = __typia.json.createAssertStringify.guard;
|
|
394
|
+
const $join = __typia.json.createAssertStringify.join;
|
|
395
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.version && !Number.isNaN(input.version) || $guard(_exceptionable, {
|
|
396
|
+
path: _path + ".version",
|
|
397
|
+
expected: "number",
|
|
398
|
+
value: input.version
|
|
399
|
+
}, errorFactory)) && ("string" === typeof input.date || $guard(_exceptionable, {
|
|
400
|
+
path: _path + ".date",
|
|
401
|
+
expected: "string",
|
|
402
|
+
value: input.date
|
|
403
|
+
}, errorFactory)) && ((Array.isArray(input.root) || $guard(_exceptionable, {
|
|
404
|
+
path: _path + ".root",
|
|
405
|
+
expected: "Array<string>",
|
|
406
|
+
value: input.root
|
|
407
|
+
}, errorFactory)) && input.root.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
|
|
408
|
+
path: _path + ".root[" + _index1 + "]",
|
|
409
|
+
expected: "string",
|
|
410
|
+
value: elem
|
|
411
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
412
|
+
path: _path + ".root",
|
|
413
|
+
expected: "Array<string>",
|
|
414
|
+
value: input.root
|
|
415
|
+
}, errorFactory)) && (("object" === typeof input.assets && null !== input.assets && false === Array.isArray(input.assets) || $guard(_exceptionable, {
|
|
416
|
+
path: _path + ".assets",
|
|
417
|
+
expected: "__type",
|
|
418
|
+
value: input.assets
|
|
419
|
+
}, errorFactory)) && $ao1(input.assets, _path + ".assets", true && _exceptionable) || $guard(_exceptionable, {
|
|
420
|
+
path: _path + ".assets",
|
|
421
|
+
expected: "__type",
|
|
422
|
+
value: input.assets
|
|
423
|
+
}, errorFactory)) && (undefined === input.files || (Array.isArray(input.files) || $guard(_exceptionable, {
|
|
424
|
+
path: _path + ".files",
|
|
425
|
+
expected: "(Array<string> | undefined)",
|
|
426
|
+
value: input.files
|
|
427
|
+
}, errorFactory)) && input.files.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
|
|
428
|
+
path: _path + ".files[" + _index2 + "]",
|
|
429
|
+
expected: "string",
|
|
430
|
+
value: elem
|
|
431
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
432
|
+
path: _path + ".files",
|
|
433
|
+
expected: "(Array<string> | undefined)",
|
|
434
|
+
value: input.files
|
|
435
|
+
}, errorFactory));
|
|
436
|
+
const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
437
|
+
const value = input[key];
|
|
438
|
+
if (undefined === value)
|
|
439
|
+
return true;
|
|
440
|
+
return ("object" === typeof value && null !== value || $guard(_exceptionable, {
|
|
441
|
+
path: _path + $join(key),
|
|
442
|
+
expected: "__type.o1",
|
|
443
|
+
value: value
|
|
444
|
+
}, errorFactory)) && $ao2(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
|
|
445
|
+
path: _path + $join(key),
|
|
446
|
+
expected: "__type.o1",
|
|
447
|
+
value: value
|
|
448
|
+
}, errorFactory);
|
|
449
|
+
});
|
|
450
|
+
const $ao2 = (input, _path, _exceptionable = true) => ((Array.isArray(input._children) || $guard(_exceptionable, {
|
|
451
|
+
path: _path + "._children",
|
|
452
|
+
expected: "Array<string>",
|
|
453
|
+
value: input._children
|
|
454
|
+
}, errorFactory)) && input._children.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
|
|
455
|
+
path: _path + "._children[" + _index3 + "]",
|
|
456
|
+
expected: "string",
|
|
457
|
+
value: elem
|
|
458
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
459
|
+
path: _path + "._children",
|
|
460
|
+
expected: "Array<string>",
|
|
461
|
+
value: input._children
|
|
462
|
+
}, errorFactory)) && (false === _exceptionable || Object.keys(input).every(key => {
|
|
463
|
+
if (["_children"].some(prop => key === prop))
|
|
464
|
+
return true;
|
|
465
|
+
const value = input[key];
|
|
466
|
+
if (undefined === value)
|
|
467
|
+
return true;
|
|
468
|
+
return true;
|
|
469
|
+
}));
|
|
470
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
471
|
+
path: _path + "",
|
|
472
|
+
expected: "NxtExport",
|
|
473
|
+
value: input
|
|
474
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
475
|
+
path: _path + "",
|
|
476
|
+
expected: "NxtExport",
|
|
477
|
+
value: input
|
|
478
|
+
}, errorFactory);
|
|
479
|
+
})(input, "$input", true);
|
|
480
|
+
return input;
|
|
481
|
+
}; const stringify = input => {
|
|
482
|
+
const $io1 = input => Object.keys(input).every(key => {
|
|
483
|
+
const value = input[key];
|
|
484
|
+
if (undefined === value)
|
|
485
|
+
return true;
|
|
486
|
+
return "object" === typeof value && null !== value && $io2(value);
|
|
487
|
+
});
|
|
488
|
+
const $io2 = input => Array.isArray(input._children) && input._children.every(elem => "string" === typeof elem) && Object.keys(input).every(key => {
|
|
489
|
+
if (["_children"].some(prop => key === prop))
|
|
490
|
+
return true;
|
|
491
|
+
const value = input[key];
|
|
492
|
+
if (undefined === value)
|
|
493
|
+
return true;
|
|
494
|
+
return true;
|
|
495
|
+
});
|
|
496
|
+
const $string = __typia.json.createAssertStringify.string;
|
|
497
|
+
const $tail = __typia.json.createAssertStringify.tail;
|
|
498
|
+
const $so0 = input => `{${undefined === input.files ? "" : `"files":${undefined !== input.files ? `[${input.files.map(elem => $string(elem)).join(",")}]` : undefined},`}"version":${input.version},"date":${$string(input.date)},"root":${`[${input.root.map(elem => $string(elem)).join(",")}]`},"assets":${$so1(input.assets)}}`;
|
|
499
|
+
const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
500
|
+
return ""; return `${JSON.stringify(key)}:${$so2(value)}`; }).filter(str => "" !== str).join(",")}}`;
|
|
501
|
+
const $so2 = input => `{${$tail(`"_children":${`[${input._children.map(elem => $string(elem)).join(",")}]`},${Object.entries(input).map(([key, value]) => { if (undefined === value)
|
|
502
|
+
return ""; if (["_children"].some(regular => regular === key))
|
|
503
|
+
return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}`)}}`;
|
|
504
|
+
return $so0(input);
|
|
505
|
+
}; return stringify(assert(input, errorFactory)); };
|