@luna-park/plugin 1.1.0 → 1.2.1
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 +6 -6
- package/bin/preview.js +1 -1
- package/dist/chunk-rCEYsGS8.cjs +1 -0
- package/dist/dist-BUZt4gnZ.js +421 -0
- package/dist/dist-BkSFkjuo.cjs +5 -0
- package/dist/extractor.cjs +9 -11
- package/dist/extractor.d.ts +17 -17
- package/dist/extractor.js +483 -548
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +760 -262
- package/dist/index.js +2961 -23
- package/dist/plugin.css +2 -0
- package/dist/preview.cjs +1 -1
- package/dist/preview.js +27 -37
- package/package.json +19 -17
- package/dist/index-4fa4mAH8.cjs +0 -5
- package/dist/index-QMG2c0JW.js +0 -394
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,220 @@
|
|
|
1
|
+
import { CDatabase } from './modules/database/lib/Database';
|
|
1
2
|
import { Component } from 'vue';
|
|
3
|
+
import { ComputedRef } from 'vue';
|
|
4
|
+
import { Cron } from 'lite-cron';
|
|
2
5
|
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
-
import {
|
|
6
|
+
import { default as LSettingsStoryWrapper } from './components/LSettingsStoryWrapper.vue';
|
|
7
|
+
|
|
8
|
+
declare namespace Anchor {
|
|
9
|
+
export {
|
|
10
|
+
EAnchorDirection,
|
|
11
|
+
ANCHOR_PADDING,
|
|
12
|
+
IAnchor,
|
|
13
|
+
CAnchor,
|
|
14
|
+
ISingleAnchor,
|
|
15
|
+
CSingleAnchor,
|
|
16
|
+
INodeAnchor,
|
|
17
|
+
CNodeAnchor
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare const ANCHOR_PADDING = 43;
|
|
22
|
+
|
|
23
|
+
declare abstract class CAnchor implements IAnchor {
|
|
24
|
+
connections: Array<Wire.CWire>;
|
|
25
|
+
dbAnchor: TDBAnchor;
|
|
26
|
+
padding?: number;
|
|
27
|
+
protected constructor(anchor: IAnchor);
|
|
28
|
+
abstract getLocation(): TVector;
|
|
29
|
+
abstract getPadding(): number;
|
|
30
|
+
get schema(): TSchema;
|
|
31
|
+
get schemaRaw(): TSchema;
|
|
32
|
+
get toSchema(): TSchema;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare class CDynamicVariable {
|
|
36
|
+
_dynamic: boolean;
|
|
37
|
+
type: EDynamicVariableType;
|
|
38
|
+
value: unknown;
|
|
39
|
+
token: string;
|
|
40
|
+
access: Array<string>;
|
|
41
|
+
target?: {
|
|
42
|
+
invert: boolean;
|
|
43
|
+
operation: EDynamicVariableOperation;
|
|
44
|
+
variable?: CDynamicVariable;
|
|
45
|
+
};
|
|
46
|
+
constructor({ type, access, target, token, value }?: Partial<TDynamicVariable>);
|
|
47
|
+
getComputed(component: TFileComponent, options?: {
|
|
48
|
+
context?: TLayoutContext;
|
|
49
|
+
stackId?: string;
|
|
50
|
+
}): ComputedRef<CLayoutValue | TReturnValue>;
|
|
51
|
+
getValue(component: TFileComponent, options?: {
|
|
52
|
+
base?: boolean;
|
|
53
|
+
context?: TLayoutContext;
|
|
54
|
+
stackId?: string;
|
|
55
|
+
}): TReturnValue;
|
|
56
|
+
getRawValue(): unknown;
|
|
57
|
+
toJSON(): unknown;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare class CLayoutValue {
|
|
61
|
+
id: string;
|
|
62
|
+
child: Array<string>;
|
|
63
|
+
component: TFileComponent;
|
|
64
|
+
type?: ELayoutValueType;
|
|
65
|
+
baseType?: ELayoutValueType;
|
|
66
|
+
stackId: string;
|
|
67
|
+
context: TLayoutContext;
|
|
68
|
+
constructor(access: Array<string>, component: TFileComponent, options?: {
|
|
69
|
+
context?: TLayoutContext;
|
|
70
|
+
stackId?: string;
|
|
71
|
+
});
|
|
72
|
+
get value(): unknown;
|
|
73
|
+
set value(value: unknown);
|
|
74
|
+
get schema(): TSchema;
|
|
75
|
+
get baseSchema(): TSchema;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare class CNode {
|
|
79
|
+
id: string;
|
|
80
|
+
dbNode: TGeneratedNode;
|
|
81
|
+
element?: HTMLElement;
|
|
82
|
+
invert: boolean;
|
|
83
|
+
parent?: TAnyLogic;
|
|
84
|
+
config: {
|
|
85
|
+
animate: boolean;
|
|
86
|
+
processing: boolean;
|
|
87
|
+
};
|
|
88
|
+
inputs: Record<string, Anchor.CNodeAnchor>;
|
|
89
|
+
outputs: Record<string, Anchor.CNodeAnchor>;
|
|
90
|
+
private cache;
|
|
91
|
+
private _location;
|
|
92
|
+
_data: TNodeData;
|
|
93
|
+
constructor(node: TNode_2);
|
|
94
|
+
get orderedInputs(): Anchor.CNodeAnchor[];
|
|
95
|
+
get orderedOutputs(): Anchor.CNodeAnchor[];
|
|
96
|
+
set location(location: TVector);
|
|
97
|
+
get location(): TVector;
|
|
98
|
+
getSafeInputs(): Record<string, CNodeAnchor>;
|
|
99
|
+
getSafeOutputs(): Record<string, CNodeAnchor>;
|
|
100
|
+
set data(data: Record<string, unknown>);
|
|
101
|
+
get data(): TNodeData;
|
|
102
|
+
reset(): void;
|
|
103
|
+
setLocation(location: TVector): CNode;
|
|
104
|
+
getAnchorLocation(anchor: Anchor.CNodeAnchor): CVector;
|
|
105
|
+
getRelativeAnchorLocation(anchor: Anchor.CNodeAnchor): CVector;
|
|
106
|
+
getRelativeAnchorLocation_internal(anchor: Anchor.CNodeAnchor): CVector;
|
|
107
|
+
getLocation(): CVector;
|
|
108
|
+
private getLocation_internal;
|
|
109
|
+
getSize(): CVector;
|
|
110
|
+
private getSize_internal;
|
|
111
|
+
execute(outputKey: string, stack?: TStack): MaybePromise<void>;
|
|
112
|
+
getInput(inputKey: string, stack?: TStack): unknown;
|
|
113
|
+
setOutput(outputKey: string, value: unknown, stack?: TStack): void;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
declare class CNodeAnchor extends CAnchor implements INodeAnchor {
|
|
117
|
+
key: string;
|
|
118
|
+
index: number;
|
|
119
|
+
node: Node_2.CNode;
|
|
120
|
+
direction: EAnchorDirection;
|
|
121
|
+
value: unknown;
|
|
122
|
+
element?: HTMLElement;
|
|
123
|
+
cache: {
|
|
124
|
+
preview?: unknown;
|
|
125
|
+
relativeLocation?: CVector;
|
|
126
|
+
};
|
|
127
|
+
constructor(anchor: INodeAnchor);
|
|
128
|
+
get schema(): TSchema;
|
|
129
|
+
get toSchema(): TSchema;
|
|
130
|
+
get schemaRaw(): TSchema;
|
|
131
|
+
getLocation(): CVector;
|
|
132
|
+
getRelativeLocation(): CVector;
|
|
133
|
+
resetCache(): void;
|
|
134
|
+
getPadding(): number;
|
|
135
|
+
isDisabled(): boolean;
|
|
136
|
+
errorMessage(): string | undefined;
|
|
137
|
+
setValue(value: string | number | boolean): void;
|
|
138
|
+
resetValue(): void;
|
|
139
|
+
}
|
|
4
140
|
|
|
5
141
|
declare type Component_2 = {
|
|
6
142
|
name: string;
|
|
7
143
|
};
|
|
8
144
|
|
|
145
|
+
declare class CPathPoint {
|
|
146
|
+
direction: CVector;
|
|
147
|
+
location: CVector;
|
|
148
|
+
constructor({ direction, location }: {
|
|
149
|
+
direction: TVector;
|
|
150
|
+
location: TVector;
|
|
151
|
+
});
|
|
152
|
+
move(offset: TVector, config?: {
|
|
153
|
+
reverse: boolean;
|
|
154
|
+
}): CPathPoint;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
declare function create({ from, temp, to }: {
|
|
158
|
+
from: Anchor.CAnchor;
|
|
159
|
+
temp: boolean;
|
|
160
|
+
to: Anchor.CAnchor;
|
|
161
|
+
}): CWire;
|
|
162
|
+
|
|
163
|
+
declare function create_2(dbNode: TLogicNode, { origin }?: {
|
|
164
|
+
origin?: TNode_2;
|
|
165
|
+
}): CNode;
|
|
166
|
+
|
|
167
|
+
declare class CSingleAnchor extends CAnchor implements ISingleAnchor {
|
|
168
|
+
location: TVector;
|
|
169
|
+
constructor(anchor: ISingleAnchor);
|
|
170
|
+
getLocation(): TVector;
|
|
171
|
+
getPadding(): number;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
declare class CVector {
|
|
175
|
+
x: number;
|
|
176
|
+
y: number;
|
|
177
|
+
constructor(vector: TVector);
|
|
178
|
+
setX(x: number): CVector;
|
|
179
|
+
setY(y: number): CVector;
|
|
180
|
+
clone(): CVector;
|
|
181
|
+
add(vector: TVector): CVector;
|
|
182
|
+
sub(vector: TVector): CVector;
|
|
183
|
+
mul(number: number): CVector;
|
|
184
|
+
div(number: number): CVector;
|
|
185
|
+
round(): CVector;
|
|
186
|
+
addX(x: number): CVector;
|
|
187
|
+
addY(y: number): CVector;
|
|
188
|
+
normalize(): CVector;
|
|
189
|
+
isNearlyEqual(vector: TVector): boolean;
|
|
190
|
+
getPointString(): string;
|
|
191
|
+
getMagnitude(): number;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
declare class CWire {
|
|
195
|
+
id: string;
|
|
196
|
+
from: Anchor.CAnchor;
|
|
197
|
+
to: Anchor.CAnchor;
|
|
198
|
+
animate: boolean;
|
|
199
|
+
temp: boolean;
|
|
200
|
+
constructor(wire: TWire);
|
|
201
|
+
get type(): TSchema | (TUnknown & TArguments<unknown>);
|
|
202
|
+
get toType(): TSchema;
|
|
203
|
+
getPoints(): string;
|
|
204
|
+
registerRibbon(path: Path): void;
|
|
205
|
+
getBoundingBox(): TRect;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
declare type DeepPartial<T> = {
|
|
209
|
+
[K in keyof T]?: T[K] extends Array<unknown> ? Array<DeepPartial<T[K][number]>> : T[K] extends Record<string, unknown> ? DeepPartial<T[K]> : T[K];
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
declare enum EAnchorDirection {
|
|
213
|
+
input = "input",
|
|
214
|
+
output = "output",
|
|
215
|
+
none = "none"
|
|
216
|
+
}
|
|
217
|
+
|
|
9
218
|
declare enum EComponentPreview {
|
|
10
219
|
Compact = "compact",
|
|
11
220
|
Stretch = "stretch",
|
|
@@ -37,7 +246,12 @@ declare enum EDynamicVariableType {
|
|
|
37
246
|
Token = "token"
|
|
38
247
|
}
|
|
39
248
|
|
|
40
|
-
declare enum
|
|
249
|
+
declare enum EElementTemplate {
|
|
250
|
+
If = "if",
|
|
251
|
+
For = "for"
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export declare enum EElementType {
|
|
41
255
|
Script = "script",
|
|
42
256
|
Standalone = "standalone",
|
|
43
257
|
Folder = "folder",
|
|
@@ -65,6 +279,17 @@ declare enum EHistoryMode {
|
|
|
65
279
|
Memory = "memory"
|
|
66
280
|
}
|
|
67
281
|
|
|
282
|
+
export declare enum EInjectionKey {
|
|
283
|
+
ViteImport = "viteImport",
|
|
284
|
+
VitePlugin = "vitePlugin",
|
|
285
|
+
AppImport = "appImport",
|
|
286
|
+
AppBody = "appBody",
|
|
287
|
+
AppSetup = "appSetup",
|
|
288
|
+
Style = "style",
|
|
289
|
+
ServerImport = "serverImport",
|
|
290
|
+
ServerBody = "serverBody"
|
|
291
|
+
}
|
|
292
|
+
|
|
68
293
|
declare enum ELayoutElement {
|
|
69
294
|
input = "input",
|
|
70
295
|
div = "div",
|
|
@@ -76,7 +301,30 @@ declare enum ELayoutElement {
|
|
|
76
301
|
slot = "slot",
|
|
77
302
|
template = "template",
|
|
78
303
|
variable = "variable",
|
|
79
|
-
|
|
304
|
+
link = "link"
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
declare enum ELayoutEvent {
|
|
308
|
+
click = "click",
|
|
309
|
+
keydown = "keydown",
|
|
310
|
+
mouseenter = "mouseenter",
|
|
311
|
+
mouseleave = "mouseleave",
|
|
312
|
+
mousedown = "mousedown",
|
|
313
|
+
mouseup = "mouseup",
|
|
314
|
+
mousemove = "mousemove",
|
|
315
|
+
wheel = "wheel"
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
declare enum ELayoutValueType {
|
|
319
|
+
variable = "variable",
|
|
320
|
+
property = "property",
|
|
321
|
+
attribute = "attribute",
|
|
322
|
+
context = "context",
|
|
323
|
+
computed = "computed",
|
|
324
|
+
event = "event",
|
|
325
|
+
file = "file",
|
|
326
|
+
model = "model",
|
|
327
|
+
logic = "logic"
|
|
80
328
|
}
|
|
81
329
|
|
|
82
330
|
declare enum ELogicMode {
|
|
@@ -116,12 +364,6 @@ declare enum EStoreType {
|
|
|
116
364
|
Local = "local"
|
|
117
365
|
}
|
|
118
366
|
|
|
119
|
-
declare enum EThemeMode {
|
|
120
|
-
Dark = "dark",
|
|
121
|
-
Light = "light",
|
|
122
|
-
Auto = "auto"
|
|
123
|
-
}
|
|
124
|
-
|
|
125
367
|
export declare enum ETokenType {
|
|
126
368
|
Color = "color",
|
|
127
369
|
FontSize = "font-size",
|
|
@@ -148,19 +390,45 @@ export declare enum EVarType {
|
|
|
148
390
|
void = "void"
|
|
149
391
|
}
|
|
150
392
|
|
|
393
|
+
declare function from(wire: TWire): CWire;
|
|
394
|
+
|
|
395
|
+
declare function from_2(node: TNode_2): CNode;
|
|
396
|
+
|
|
151
397
|
export declare function getPluginParam<T>(target: TOption<TEnv, T>, env: Partial<TEnv>): Promise<T>;
|
|
152
398
|
|
|
399
|
+
declare interface IAnchor {
|
|
400
|
+
connections?: Array<Wire.CWire>;
|
|
401
|
+
dbAnchor: TDBAnchor;
|
|
402
|
+
padding?: number;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
declare interface INodeAnchor extends IAnchor {
|
|
406
|
+
index: number;
|
|
407
|
+
direction: EAnchorDirection;
|
|
408
|
+
element?: HTMLElement;
|
|
409
|
+
key: string;
|
|
410
|
+
node: Node_2.CNode;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
declare interface ISingleAnchor extends IAnchor {
|
|
414
|
+
location: TVector;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export declare function loadPlugin<TConfig extends TSchema, TInternal>(plugin: TPlugin<TConfig, TInternal>, env: Partial<TEnv>): Promise<TBasePlugin<TConfig, TInternal>>;
|
|
418
|
+
|
|
153
419
|
export declare const LogicType: {
|
|
154
|
-
type: <T extends TSchema>(target: Array<string>, args?: TArguments) => TType<T>;
|
|
155
420
|
array: <T extends TSchema, TArgs extends TArguments<Array<T>>>(items: T, args?: TArgs) => TArray<T> & TArgs;
|
|
156
421
|
boolean: <TArgs extends TArguments<boolean>>(args?: TArgs) => TBoolean & TArgs;
|
|
157
422
|
exec: (args?: TArguments) => TExec;
|
|
158
|
-
function: <TInputs extends TObject, TOutput extends TSchema = TUndefined>(inputs?: TInputs, output?: TOutput, args?: TArguments
|
|
423
|
+
function: <TInputs extends TObject, TOutput extends TSchema = TUndefined, TPromise extends boolean = false>(inputs?: TInputs, output?: TOutput, args?: TArguments & {
|
|
424
|
+
promise?: TPromise;
|
|
425
|
+
}) => TFunction<TInputs, TOutput, TPromise>;
|
|
159
426
|
interface: <T, TArgs extends TArguments<T> = TArguments<T>>(interfaceClass: (new (...args: any) => T) | string, args?: TArgs) => TInterface<T> & TArgs;
|
|
160
427
|
number: <TArgs extends TArguments<number>>(args?: TArgs) => TNumber & TArgs;
|
|
161
428
|
object: <T extends TProperties, TArgs extends TArguments<object>>(properties?: T, args?: TArgs) => TObject<T> & TArgs;
|
|
162
|
-
record: <TKey extends TString | TNumber, TValue extends TSchema = TSchema<
|
|
429
|
+
record: <TKey extends TString | TNumber, TValue extends TSchema = TSchema<TAnyLogic_2>>(key: TKey, value: TValue, args?: TArguments) => TRecord<TKey, TValue>;
|
|
163
430
|
string: <TArgs extends TArguments<string>>(args?: TArgs) => TString & TArgs;
|
|
431
|
+
type: <T extends TSchema>(target: Array<string>, args?: TArguments) => TType<T>;
|
|
164
432
|
undefined: (args?: TArguments) => TUndefined;
|
|
165
433
|
union: <T extends Array<TSchema>>(elements: T, args?: TArguments) => TUnion<T>;
|
|
166
434
|
unknown: <TArgs extends TArguments<unknown>>(args?: TArgs) => TUnknown & TArgs;
|
|
@@ -175,27 +443,56 @@ export declare const LogicUtil: {
|
|
|
175
443
|
required(target: TObject): TObject;
|
|
176
444
|
};
|
|
177
445
|
|
|
446
|
+
export { LSettingsStoryWrapper }
|
|
447
|
+
|
|
448
|
+
export declare function makeComponent<TProps extends Record<string, TSchema>>(component: TComponent<TProps>): TComponent<TProps>;
|
|
449
|
+
|
|
178
450
|
export declare function makeLogicNode<TInputs extends TNodeInterfaceDescriptor, TOutputs extends TNodeInterfaceDescriptor, TConfig extends TNodeConfigDescriptor>(node: TNodeDescriptor<TInputs, TOutputs, TConfig>): TLogicNode;
|
|
179
451
|
|
|
452
|
+
declare function makePath(start: CPathPoint, end: CPathPoint): Path;
|
|
453
|
+
|
|
180
454
|
export declare function makePlugin<TConfig extends TSchema, TInternal>(plugin: TPlugin<TConfig, TInternal>): TPlugin<TConfig, TInternal>;
|
|
181
455
|
|
|
456
|
+
declare type MaybePromise<T> = T | Promise<T>;
|
|
457
|
+
|
|
182
458
|
declare type MethodsFrom<TInterface extends TNodeInterfaceDescriptor> = {
|
|
183
|
-
[TKey in keyof TInterface]: () =>
|
|
459
|
+
[TKey in keyof TInterface]: (() => MaybePromise<Static<TInterface[TKey]>>) | {
|
|
460
|
+
async: () => Promise<Static<TInterface[TKey]>>;
|
|
461
|
+
sync: () => MaybePromise<Static<TInterface[TKey]>>;
|
|
462
|
+
};
|
|
184
463
|
};
|
|
185
464
|
|
|
465
|
+
declare namespace Node_2 {
|
|
466
|
+
export {
|
|
467
|
+
from_2 as from,
|
|
468
|
+
create_2 as create,
|
|
469
|
+
NODE_WIDTH,
|
|
470
|
+
TNode_2 as TNode,
|
|
471
|
+
CNode
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
declare const NODE_WIDTH = 10;
|
|
476
|
+
|
|
186
477
|
declare type OptionalKeys<T extends TProperties> = {
|
|
187
478
|
[K in keyof T]: T[K] extends {
|
|
188
479
|
optional: true;
|
|
189
480
|
} ? K : never;
|
|
190
481
|
}[keyof T];
|
|
191
482
|
|
|
483
|
+
declare type Path = Array<CPathPoint>;
|
|
484
|
+
|
|
485
|
+
declare function pathToString(path: Path, config?: {
|
|
486
|
+
smoothing: boolean;
|
|
487
|
+
}): string;
|
|
488
|
+
|
|
192
489
|
declare type RequiredKeys<T extends TProperties> = Exclude<keyof T, OptionalKeys<T>>;
|
|
193
490
|
|
|
194
|
-
declare type Static<T extends TSchema> = T extends {
|
|
491
|
+
export declare type Static<T extends TSchema> = T extends {
|
|
195
492
|
optional: true;
|
|
196
493
|
} ? (T["static"] | undefined) : T["static"];
|
|
197
494
|
|
|
198
|
-
declare type StaticFunction<TInputs extends TObject, TOutput extends TSchema> = (...args: Array<Static<TInputs>[string]>) => Promise<Static<TOutput
|
|
495
|
+
declare type StaticFunction<TInputs extends TObject, TOutput extends TSchema, TPromise extends boolean = false> = TPromise extends true ? (...args: Array<Static<TInputs>[string]>) => Promise<Static<TOutput>> : (...args: Array<Static<TInputs>[string]>) => Static<TOutput>;
|
|
199
496
|
|
|
200
497
|
declare type StaticObject<T extends TProperties> = {
|
|
201
498
|
[K in RequiredKeys<T>]: Static<T[K]>;
|
|
@@ -216,9 +513,22 @@ declare type StaticUnion<T extends Array<TSchema>> = {
|
|
|
216
513
|
[K in keyof T]: Static<T[K]>;
|
|
217
514
|
}[number];
|
|
218
515
|
|
|
219
|
-
declare type
|
|
516
|
+
declare type TAnchor<TExport extends boolean = false> = TExport extends true ? TSchema : {
|
|
517
|
+
id: string;
|
|
518
|
+
parent?: TLogic<TExport>;
|
|
519
|
+
schema: TSchema;
|
|
520
|
+
};
|
|
220
521
|
|
|
221
|
-
declare type TAnyLogic
|
|
522
|
+
export declare type TAnyLogic<TExport extends boolean = false> = TLogic<TExport> | TLogicMain<TExport>;
|
|
523
|
+
|
|
524
|
+
declare type TAnyLogic_2 = TExec | TObject | TRecord<any, any> | TInterface | TType | TArray<any> | TString | TNumber | TBoolean | TUnknown | TUndefined | TUnion<any> | TFunction<any, any> | TVoid;
|
|
525
|
+
|
|
526
|
+
export declare type TApplication<TExport extends boolean = false> = {
|
|
527
|
+
name: string;
|
|
528
|
+
config: TApplicationConfig;
|
|
529
|
+
tree: TFile<TExport>;
|
|
530
|
+
version: number;
|
|
531
|
+
};
|
|
222
532
|
|
|
223
533
|
declare type TApplicationConfig = {
|
|
224
534
|
backend: {
|
|
@@ -245,21 +555,6 @@ declare type TApplicationConfig = {
|
|
|
245
555
|
types: TExportNodeResult["types"];
|
|
246
556
|
}>;
|
|
247
557
|
palette: {
|
|
248
|
-
content: string;
|
|
249
|
-
forceTheme: boolean;
|
|
250
|
-
inject: {
|
|
251
|
-
css: string;
|
|
252
|
-
head: string;
|
|
253
|
-
html: string;
|
|
254
|
-
js: string;
|
|
255
|
-
};
|
|
256
|
-
length: {
|
|
257
|
-
border: number;
|
|
258
|
-
radius: number;
|
|
259
|
-
};
|
|
260
|
-
matchEditor: boolean;
|
|
261
|
-
primary: string;
|
|
262
|
-
theme: EThemeMode;
|
|
263
558
|
tokens: {
|
|
264
559
|
colors: Array<{
|
|
265
560
|
id: string;
|
|
@@ -277,10 +572,16 @@ declare type TApplicationConfig = {
|
|
|
277
572
|
value: string;
|
|
278
573
|
}>;
|
|
279
574
|
};
|
|
575
|
+
inject: {
|
|
576
|
+
html: string;
|
|
577
|
+
css: string;
|
|
578
|
+
js: string;
|
|
579
|
+
head: string;
|
|
580
|
+
};
|
|
280
581
|
};
|
|
281
582
|
plugins: Record<string, {
|
|
282
583
|
config?: unknown;
|
|
283
|
-
|
|
584
|
+
internals?: unknown;
|
|
284
585
|
target: string;
|
|
285
586
|
}>;
|
|
286
587
|
state: {
|
|
@@ -297,14 +598,7 @@ declare type TApplicationConfig = {
|
|
|
297
598
|
};
|
|
298
599
|
};
|
|
299
600
|
|
|
300
|
-
declare type TApplicationExport = {
|
|
301
|
-
name: string;
|
|
302
|
-
config: TApplicationConfig;
|
|
303
|
-
tree: TFileExport;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
601
|
declare interface TArguments<TType = any> {
|
|
307
|
-
name?: string;
|
|
308
602
|
build?: (arg: unknown) => unknown;
|
|
309
603
|
customizable?: boolean;
|
|
310
604
|
default?: TType;
|
|
@@ -319,6 +613,7 @@ declare interface TArguments<TType = any> {
|
|
|
319
613
|
example?: unknown;
|
|
320
614
|
format?: "date-time" | "email" | "color";
|
|
321
615
|
multiple?: boolean;
|
|
616
|
+
name?: string;
|
|
322
617
|
optional?: boolean;
|
|
323
618
|
options?: {
|
|
324
619
|
format?: (arg: TType) => TType;
|
|
@@ -334,26 +629,91 @@ declare interface TArguments<TType = any> {
|
|
|
334
629
|
}
|
|
335
630
|
|
|
336
631
|
declare interface TArray<T extends TSchema = TSchema> {
|
|
337
|
-
type: EVarType.array;
|
|
338
632
|
items: T;
|
|
339
633
|
static: Array<Static<T>>;
|
|
634
|
+
type: EVarType.array;
|
|
340
635
|
}
|
|
341
636
|
|
|
637
|
+
declare type TBaseDynamicVariable = {
|
|
638
|
+
type: EDynamicVariableType;
|
|
639
|
+
_dynamic: true;
|
|
640
|
+
access: Array<string>;
|
|
641
|
+
target: {
|
|
642
|
+
invert?: boolean;
|
|
643
|
+
operation: EDynamicVariableOperation;
|
|
644
|
+
variable?: TDynamicVariable;
|
|
645
|
+
};
|
|
646
|
+
token: string;
|
|
647
|
+
value: unknown;
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
export declare type TBasePlugin<TConfig extends TSchema = TSchema, TInternals = unknown> = {
|
|
651
|
+
build?: {
|
|
652
|
+
backImports?: Array<{
|
|
653
|
+
name: string;
|
|
654
|
+
version?: string;
|
|
655
|
+
}>;
|
|
656
|
+
frontImports?: Array<{
|
|
657
|
+
name: string;
|
|
658
|
+
version?: string;
|
|
659
|
+
}>;
|
|
660
|
+
injections?: Partial<Record<EInjectionKey, string>>;
|
|
661
|
+
};
|
|
662
|
+
color?: string;
|
|
663
|
+
config?: TConfig;
|
|
664
|
+
dependencies?: Array<{
|
|
665
|
+
id: string;
|
|
666
|
+
name: string;
|
|
667
|
+
target: string;
|
|
668
|
+
}>;
|
|
669
|
+
description?: string;
|
|
670
|
+
editor?: {
|
|
671
|
+
components?: Array<TComponent>;
|
|
672
|
+
interfaces?: Array<TInterface_2>;
|
|
673
|
+
nodes?: Array<TLogicNode>;
|
|
674
|
+
templates?: Array<TTemplate>;
|
|
675
|
+
tokens?: Array<TToken>;
|
|
676
|
+
wrapper?: TComponent & {
|
|
677
|
+
attributes?: Record<string, unknown>;
|
|
678
|
+
};
|
|
679
|
+
};
|
|
680
|
+
icon: string;
|
|
681
|
+
id: string;
|
|
682
|
+
inject?: {
|
|
683
|
+
css?: string;
|
|
684
|
+
js?: string;
|
|
685
|
+
};
|
|
686
|
+
interface?: Component;
|
|
687
|
+
internals?: TInternals;
|
|
688
|
+
lifecycle?: {
|
|
689
|
+
mount?: (env: TEnv<TConfig, TInternals>) => Promise<void> | void;
|
|
690
|
+
unmount?: (env: TEnv<TConfig, TInternals>) => Promise<void> | void;
|
|
691
|
+
update?: (env: TEnv<TConfig, TInternals>) => Promise<void> | void;
|
|
692
|
+
};
|
|
693
|
+
name: string;
|
|
694
|
+
settings?: Array<{
|
|
695
|
+
component: Component;
|
|
696
|
+
icon?: IconDefinition | string;
|
|
697
|
+
label: string;
|
|
698
|
+
}>;
|
|
699
|
+
};
|
|
700
|
+
|
|
342
701
|
declare interface TBoolean {
|
|
343
|
-
type: EVarType.boolean;
|
|
344
702
|
static: boolean;
|
|
703
|
+
type: EVarType.boolean;
|
|
345
704
|
}
|
|
346
705
|
|
|
347
|
-
declare type
|
|
706
|
+
declare type TCanvas = {
|
|
348
707
|
location: TVector;
|
|
349
708
|
zoom: number;
|
|
350
709
|
};
|
|
351
710
|
|
|
352
|
-
export declare type TComponent<TProps extends Record<string, TSchema> = Record<string, TSchema
|
|
711
|
+
export declare type TComponent<TProps extends Record<string, TSchema> = Record<string, TSchema>, TInternals = unknown> = {
|
|
353
712
|
build?: {
|
|
354
|
-
|
|
713
|
+
imports?: Array<{
|
|
714
|
+
default?: boolean;
|
|
715
|
+
from: string;
|
|
355
716
|
name: string;
|
|
356
|
-
target: string;
|
|
357
717
|
}>;
|
|
358
718
|
name?: string;
|
|
359
719
|
};
|
|
@@ -363,27 +723,21 @@ export declare type TComponent<TProps extends Record<string, TSchema> = Record<s
|
|
|
363
723
|
link?: string;
|
|
364
724
|
};
|
|
365
725
|
emits?: Record<string, TSchema>;
|
|
726
|
+
icon?: IconDefinition | string;
|
|
727
|
+
internals?: TInternals;
|
|
366
728
|
models?: Record<string, TSchema>;
|
|
367
729
|
name: string;
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
type: EElementType.Component;
|
|
375
|
-
collapsed?: boolean;
|
|
376
|
-
layout: TLayoutSchemaExport;
|
|
377
|
-
logics: Record<string, TLogicExport | TMainLogicExport>;
|
|
378
|
-
options: TComponentOptions;
|
|
379
|
-
state: TStateExport;
|
|
380
|
-
values: {
|
|
381
|
-
computed: Record<string, TValueExport>;
|
|
382
|
-
events: Record<string, TValueExport>;
|
|
383
|
-
model?: TSchema;
|
|
384
|
-
properties: Record<string, TValueExport>;
|
|
385
|
-
variables: Record<string, TValueExport>;
|
|
730
|
+
preview?: {
|
|
731
|
+
properties?: Partial<{
|
|
732
|
+
[TKey in keyof TProps]: Static<TProps[TKey]>;
|
|
733
|
+
}>;
|
|
734
|
+
slots?: Record<string, string>;
|
|
735
|
+
style?: string;
|
|
386
736
|
};
|
|
737
|
+
properties?: TProps;
|
|
738
|
+
slots?: Record<string, TSlot> | ((attributes: StaticOfProps<TProps> & {
|
|
739
|
+
internals: TInternals;
|
|
740
|
+
}) => Record<string, TSlot>);
|
|
387
741
|
};
|
|
388
742
|
|
|
389
743
|
declare type TComponentOptions = {
|
|
@@ -393,32 +747,9 @@ declare type TComponentOptions = {
|
|
|
393
747
|
previewSize: string;
|
|
394
748
|
};
|
|
395
749
|
|
|
396
|
-
declare type
|
|
397
|
-
|
|
398
|
-
type: EElementType.Config;
|
|
399
|
-
content: unknown;
|
|
400
|
-
display: EConfigDisplay;
|
|
750
|
+
declare type TDBAnchor = {
|
|
751
|
+
id?: string;
|
|
401
752
|
schema: TSchema;
|
|
402
|
-
scope: ELogicScope;
|
|
403
|
-
state: TStateExport;
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
declare type TCronExport = {
|
|
407
|
-
name: string;
|
|
408
|
-
type: EElementType.Cron;
|
|
409
|
-
active: boolean;
|
|
410
|
-
editorTrigger: boolean;
|
|
411
|
-
logics: Record<string, TLogicExport | TMainLogicExport>;
|
|
412
|
-
state: TStateExport;
|
|
413
|
-
time: string;
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
declare type TDatabaseExport = {
|
|
417
|
-
name: string;
|
|
418
|
-
type: EElementType.Database;
|
|
419
|
-
data: Array<Record<string, unknown>>;
|
|
420
|
-
schema: TSchema<TObject>;
|
|
421
|
-
state: TStateExport;
|
|
422
753
|
};
|
|
423
754
|
|
|
424
755
|
declare type TDocumentation = {
|
|
@@ -434,29 +765,22 @@ declare type TDocumentation = {
|
|
|
434
765
|
}>;
|
|
435
766
|
}>;
|
|
436
767
|
parameters?: Array<{
|
|
437
|
-
name: string;
|
|
438
768
|
description: string;
|
|
769
|
+
name: string;
|
|
439
770
|
}>;
|
|
440
771
|
};
|
|
441
772
|
|
|
442
|
-
declare type TDynamicVariable =
|
|
443
|
-
type: EDynamicVariableType;
|
|
444
|
-
access: Array<string>;
|
|
445
|
-
target: {
|
|
446
|
-
invert?: boolean;
|
|
447
|
-
operation: EDynamicVariableOperation;
|
|
448
|
-
variable?: TDynamicVariable;
|
|
449
|
-
};
|
|
450
|
-
token: string;
|
|
451
|
-
value: unknown;
|
|
452
|
-
};
|
|
773
|
+
declare type TDynamicVariable<TExport extends boolean = false> = (TExport extends true ? TBaseDynamicVariable : CDynamicVariable) | unknown;
|
|
453
774
|
|
|
454
775
|
declare type TEnum<TEnumType> = Array<TEnumType> | Record<string, TEnumType>;
|
|
455
776
|
|
|
456
|
-
declare type TEnv<TConfig extends TSchema = TSchema,
|
|
457
|
-
|
|
777
|
+
declare type TEnv<TConfig extends TSchema = TSchema, TInternals = unknown> = {
|
|
778
|
+
addFile: (file: DeepPartial<TFile<true>> & {
|
|
779
|
+
type: EElementType;
|
|
780
|
+
}, parentId?: string) => TFile;
|
|
781
|
+
app: TApplication;
|
|
458
782
|
config: Static<TConfig>;
|
|
459
|
-
|
|
783
|
+
internals: TInternals;
|
|
460
784
|
mode: "build" | "editor";
|
|
461
785
|
};
|
|
462
786
|
|
|
@@ -480,71 +804,263 @@ declare type TExportNodeResult = {
|
|
|
480
804
|
types: Record<string, TSchema>;
|
|
481
805
|
};
|
|
482
806
|
|
|
483
|
-
export declare type
|
|
807
|
+
export declare type TFile<TExport extends boolean = false> = (TFolder<TExport> | TFileComponent<TExport> | TFileConfig<TExport> | TFileCron<TExport> | TFileDatabase<TExport> | TFileRoute<TExport> | TFileScript<TExport> | TFileStore<TExport> | TFileText<TExport> | TFileType<TExport> | TFileMedia<TExport>) & {
|
|
484
808
|
isEditing?: boolean;
|
|
485
809
|
};
|
|
486
810
|
|
|
487
|
-
declare type
|
|
811
|
+
declare type TFileBase<TExport extends boolean = false> = {
|
|
488
812
|
name: string;
|
|
813
|
+
state: TFileState;
|
|
814
|
+
} & (TExport extends false ? {
|
|
815
|
+
id: string;
|
|
816
|
+
parent?: TFolder<TExport>;
|
|
817
|
+
} : {});
|
|
818
|
+
|
|
819
|
+
export declare type TFileComponent<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
820
|
+
type: EElementType.Component;
|
|
821
|
+
collapsed?: boolean;
|
|
822
|
+
layout: TLayoutSchema<ELayoutElement, TExport>;
|
|
823
|
+
logics: Record<string, TLogic<TExport> | TLogicMain<TExport>>;
|
|
824
|
+
options: TComponentOptions;
|
|
825
|
+
values: {
|
|
826
|
+
computed: Record<string, TValue<TExport>>;
|
|
827
|
+
events: Record<string, TValue<TExport>>;
|
|
828
|
+
model?: TSchema;
|
|
829
|
+
properties: Record<string, TValue<TExport>>;
|
|
830
|
+
variables: Record<string, TValue<TExport>>;
|
|
831
|
+
};
|
|
832
|
+
} & (TExport extends false ? {
|
|
833
|
+
flat: Record<string, TLayoutSchema>;
|
|
834
|
+
} : {});
|
|
835
|
+
|
|
836
|
+
export declare type TFileConfig<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
837
|
+
type: EElementType.Config;
|
|
838
|
+
content: unknown;
|
|
839
|
+
display: EConfigDisplay;
|
|
840
|
+
schema: TSchema;
|
|
841
|
+
scope: ELogicScope;
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
export declare type TFileCron<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
845
|
+
type: EElementType.Cron;
|
|
846
|
+
active: boolean;
|
|
847
|
+
editorTrigger: boolean;
|
|
848
|
+
logics: Record<string, TAnyLogic<TExport>>;
|
|
849
|
+
time: string;
|
|
850
|
+
} & (TExport extends false ? {
|
|
851
|
+
cron?: Cron;
|
|
852
|
+
scope: ELogicScope.Backend;
|
|
853
|
+
} : {});
|
|
854
|
+
|
|
855
|
+
export declare type TFileDatabase<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
856
|
+
type: EElementType.Database;
|
|
857
|
+
data: Array<Record<string, unknown>>;
|
|
858
|
+
schema: TSchema<TObject>;
|
|
859
|
+
} & (TExport extends false ? {
|
|
860
|
+
db: CDatabase;
|
|
861
|
+
scope: ELogicScope.Backend;
|
|
862
|
+
} : {});
|
|
863
|
+
|
|
864
|
+
export declare type TFileMedia<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
865
|
+
type: EElementType.Media;
|
|
866
|
+
mimeType: string;
|
|
867
|
+
target: string;
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
export declare type TFileRoute<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
871
|
+
type: EElementType.Route;
|
|
872
|
+
dev?: boolean;
|
|
873
|
+
input: {
|
|
874
|
+
body: TSchema;
|
|
875
|
+
headers: TSchema;
|
|
876
|
+
query: TSchema;
|
|
877
|
+
};
|
|
878
|
+
logics: Record<string, TAnyLogic<TExport>>;
|
|
879
|
+
method: ERouteMethod;
|
|
880
|
+
output: TSchema;
|
|
881
|
+
path: string;
|
|
882
|
+
} & (TExport extends false ? {
|
|
883
|
+
scope: ELogicScope.Backend;
|
|
884
|
+
} : {});
|
|
885
|
+
|
|
886
|
+
export declare type TFileScript<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
887
|
+
type: EElementType.Script;
|
|
888
|
+
logics: Record<string, TAnyLogic<TExport>>;
|
|
889
|
+
options?: {
|
|
890
|
+
autoReload?: boolean;
|
|
891
|
+
};
|
|
892
|
+
scope: ELogicScope;
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
declare type TFileState = {
|
|
896
|
+
expand?: boolean;
|
|
897
|
+
isEditing?: boolean;
|
|
898
|
+
logic?: {
|
|
899
|
+
location: TVector;
|
|
900
|
+
zoom: number;
|
|
901
|
+
};
|
|
902
|
+
opened?: boolean;
|
|
903
|
+
panel?: string;
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
export declare type TFileStore<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
907
|
+
type: EElementType.Store;
|
|
908
|
+
default: unknown;
|
|
909
|
+
logics: Record<string, TLogic<TExport>>;
|
|
910
|
+
options: TStoreOptions;
|
|
911
|
+
schema: TSchema;
|
|
912
|
+
} & (TExport extends false ? {
|
|
913
|
+
proxy: TSchema;
|
|
914
|
+
scope: ELogicScope.Frontend;
|
|
915
|
+
} : {});
|
|
916
|
+
|
|
917
|
+
export declare type TFileText<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
918
|
+
type: EElementType.Text;
|
|
919
|
+
blocks: Array<{
|
|
920
|
+
content: string;
|
|
921
|
+
key: string;
|
|
922
|
+
}>;
|
|
923
|
+
} & (TExport extends false ? {
|
|
924
|
+
scope: ELogicScope.Frontend;
|
|
925
|
+
} : {});
|
|
926
|
+
|
|
927
|
+
export declare type TFileType<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
928
|
+
name: string;
|
|
929
|
+
type: EElementType.Type;
|
|
930
|
+
schemas: Record<string, TSchema>;
|
|
931
|
+
} & (TExport extends false ? {
|
|
932
|
+
scope: ELogicScope.Shared;
|
|
933
|
+
} : {});
|
|
934
|
+
|
|
935
|
+
export declare type TFolder<TExport extends boolean = false> = TFileBase<TExport> & {
|
|
489
936
|
type: EElementType.Folder;
|
|
490
|
-
children: Record<string,
|
|
937
|
+
children: Record<string, TFile<TExport>>;
|
|
491
938
|
color?: string;
|
|
492
939
|
};
|
|
493
940
|
|
|
494
|
-
declare interface TFunction<TInputs extends TObject = TObject, TOutput extends TSchema = TUnknown> {
|
|
495
|
-
type: EVarType.function;
|
|
941
|
+
declare interface TFunction<TInputs extends TObject = TObject, TOutput extends TSchema = TUnknown, TPromise extends boolean = false> {
|
|
496
942
|
inputs: TInputs;
|
|
497
943
|
output: TOutput;
|
|
498
|
-
static: StaticFunction<TInputs, TOutput>;
|
|
944
|
+
static: StaticFunction<TInputs, TOutput, TPromise>;
|
|
945
|
+
type: EVarType.function;
|
|
499
946
|
}
|
|
500
947
|
|
|
501
|
-
declare type
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
948
|
+
declare type TGeneratedNode<TLogic extends TLogicNode = TLogicNode> = TLogic & {
|
|
949
|
+
node?: CNode;
|
|
950
|
+
origin: TLogic;
|
|
951
|
+
proxy: any;
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
declare type TGraph<TExport extends boolean = false> = {
|
|
955
|
+
canvas: TCanvas;
|
|
956
|
+
nodes: Record<string, TNode<TExport>>;
|
|
957
|
+
wires: Record<string, TWire_2<TExport>>;
|
|
505
958
|
};
|
|
506
959
|
|
|
507
960
|
declare interface TInterface<T = unknown> {
|
|
508
|
-
type: EVarType.interface;
|
|
509
961
|
class?: new (...args: any) => T;
|
|
510
962
|
className: string;
|
|
511
963
|
static: T;
|
|
964
|
+
type: EVarType.interface;
|
|
512
965
|
}
|
|
513
966
|
|
|
514
|
-
declare type
|
|
515
|
-
|
|
967
|
+
declare type TInterface_2 = {
|
|
968
|
+
arguments?: Array<TSchema>;
|
|
969
|
+
class?: new (...args: Array<unknown>) => unknown;
|
|
970
|
+
methods?: Array<{
|
|
971
|
+
name: string;
|
|
972
|
+
parameters?: Array<TSchema>;
|
|
973
|
+
return: TSchema;
|
|
974
|
+
}>;
|
|
516
975
|
name: string;
|
|
517
|
-
children: Array<TLayoutSchemaExport>;
|
|
518
|
-
classes: Array<TDynamicVariable>;
|
|
519
|
-
content?: Record<string, unknown>;
|
|
520
|
-
element: ELayoutElement;
|
|
521
|
-
events: Array<string>;
|
|
522
|
-
model?: Array<string>;
|
|
523
|
-
properties: Record<string, TDynamicVariable>;
|
|
524
|
-
style: Record<"base" | string, Record<"default" | "hover", Record<string, Record<string, TDynamicVariable>> & {
|
|
525
|
-
collapsed?: boolean;
|
|
526
|
-
}>>;
|
|
527
|
-
tag?: string;
|
|
528
976
|
};
|
|
529
977
|
|
|
530
|
-
declare type
|
|
531
|
-
|
|
978
|
+
declare type TLayoutContentType<TElement extends ELayoutElement, TExport extends boolean = false> = TElement extends ELayoutElement.variable ? {
|
|
979
|
+
var: CDynamicVariable | unknown;
|
|
980
|
+
} : TElement extends ELayoutElement.component ? {
|
|
981
|
+
id: string;
|
|
982
|
+
slot: boolean;
|
|
983
|
+
slots: Record<string, TLayoutSchema<TElement, TExport>>;
|
|
984
|
+
} : TElement extends ELayoutElement.customText ? {
|
|
985
|
+
text: TTextBlock;
|
|
986
|
+
variables: Array<string>;
|
|
987
|
+
} : TElement extends ELayoutElement.customHtml ? {
|
|
988
|
+
html: string;
|
|
989
|
+
variables: Array<string>;
|
|
990
|
+
} : TElement extends ELayoutElement.template ? {
|
|
991
|
+
preview: string;
|
|
992
|
+
template: EElementTemplate;
|
|
993
|
+
var: CDynamicVariable | unknown;
|
|
994
|
+
} : TElement extends ELayoutElement.package ? {
|
|
995
|
+
slot: boolean;
|
|
996
|
+
slots: Record<string, TLayoutSchema<TElement, TExport>>;
|
|
997
|
+
target: Array<string>;
|
|
998
|
+
} : Record<string, unknown>;
|
|
999
|
+
|
|
1000
|
+
declare type TLayoutContext = Record<string, TLayoutContextVariable>;
|
|
1001
|
+
|
|
1002
|
+
declare type TLayoutContextVariable = {
|
|
1003
|
+
schema: TSchema;
|
|
1004
|
+
value: unknown;
|
|
1005
|
+
};
|
|
1006
|
+
|
|
1007
|
+
declare type TLayoutSchema<TElement extends ELayoutElement = ELayoutElement, TExport extends boolean = false> = {
|
|
1008
|
+
[TInnerElement in TElement]: {
|
|
1009
|
+
id: string;
|
|
1010
|
+
name: string;
|
|
1011
|
+
children: Array<TLayoutSchema<ELayoutElement, TExport>>;
|
|
1012
|
+
classes: Array<TDynamicVariable<TExport>>;
|
|
1013
|
+
collapsed?: boolean;
|
|
1014
|
+
component: TFileComponent<TExport>;
|
|
1015
|
+
content: TLayoutContentType<TInnerElement>;
|
|
1016
|
+
element: TInnerElement;
|
|
1017
|
+
events: Array<ELayoutEvent | string>;
|
|
1018
|
+
model?: Array<string>;
|
|
1019
|
+
properties: Record<string, TDynamicVariable<TExport>>;
|
|
1020
|
+
style: Record<"base" | string, Record<"default" | "hover", Record<string, Record<string, TDynamicVariable<TExport>>> & {
|
|
1021
|
+
collapsed?: boolean;
|
|
1022
|
+
}>>;
|
|
1023
|
+
tag?: string;
|
|
1024
|
+
};
|
|
1025
|
+
}[TElement] & (TExport extends false ? {
|
|
1026
|
+
parent?: TLayoutSchema<ELayoutElement, TExport>;
|
|
1027
|
+
} : {});
|
|
1028
|
+
|
|
1029
|
+
export declare type TLogic<TExport extends boolean = false> = TLogicBase<TExport> & {
|
|
532
1030
|
type: EElementType.Logic | EElementType.Standalone;
|
|
1031
|
+
async: boolean;
|
|
533
1032
|
code?: string;
|
|
534
1033
|
export: boolean;
|
|
535
|
-
|
|
536
|
-
inputs: Record<string, TAnchorExport>;
|
|
1034
|
+
inputs: Record<string, TAnchor<TExport>>;
|
|
537
1035
|
mode: ELogicMode;
|
|
538
|
-
outputs: Record<string,
|
|
1036
|
+
outputs: Record<string, TAnchor<TExport>>;
|
|
539
1037
|
packages?: Array<string>;
|
|
1038
|
+
} & (TExport extends false ? {
|
|
1039
|
+
id: string;
|
|
1040
|
+
} : {});
|
|
1041
|
+
|
|
1042
|
+
declare type TLogicBase<TExport extends boolean = false> = {
|
|
1043
|
+
name: string;
|
|
1044
|
+
type: EElementType;
|
|
1045
|
+
graph: TGraph<TExport>;
|
|
540
1046
|
values: {
|
|
541
|
-
variables: Record<string,
|
|
1047
|
+
variables: Record<string, TValue<TExport>>;
|
|
542
1048
|
};
|
|
543
|
-
}
|
|
1049
|
+
} & (TExport extends false ? {
|
|
1050
|
+
id: string;
|
|
1051
|
+
db: Record<string, TLogicNode>;
|
|
1052
|
+
isEditing?: boolean;
|
|
1053
|
+
parent: TFile<TExport>;
|
|
1054
|
+
} : {});
|
|
1055
|
+
|
|
1056
|
+
export declare type TLogicMain<TExport extends boolean = false> = TLogicBase<TExport> & {
|
|
1057
|
+
name: "Main";
|
|
1058
|
+
type: EElementType.MainLogic;
|
|
1059
|
+
} & (TExport extends false ? {
|
|
1060
|
+
id: "main";
|
|
1061
|
+
} : {});
|
|
544
1062
|
|
|
545
1063
|
export declare type TLogicNode = {
|
|
546
|
-
name: string;
|
|
547
|
-
type?: ELogicType;
|
|
548
1064
|
build?: {
|
|
549
1065
|
define?: Array<{
|
|
550
1066
|
id: (data: {
|
|
@@ -584,27 +1100,32 @@ export declare type TLogicNode = {
|
|
|
584
1100
|
};
|
|
585
1101
|
inputs: TNodeInterfaceDescriptor;
|
|
586
1102
|
methods: Record<string, () => unknown>;
|
|
1103
|
+
name: string;
|
|
587
1104
|
outputs: TNodeInterfaceDescriptor;
|
|
1105
|
+
type?: ELogicType;
|
|
588
1106
|
};
|
|
589
1107
|
|
|
590
|
-
declare type
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
1108
|
+
declare type TMethodsOf<TInputs extends TNodeInterfaceDescriptor, TOutputs extends TNodeInterfaceDescriptor> = MethodsFrom<TOnlyExecOf<TInputs>> & MethodsFrom<TOnlyVarsOf<TOutputs>>;
|
|
1109
|
+
|
|
1110
|
+
declare type TNode<TExport extends boolean = false> = TExport extends true ? {
|
|
1111
|
+
data?: Record<string, unknown>;
|
|
1112
|
+
internal?: {
|
|
1113
|
+
inputs?: Record<string, unknown>;
|
|
1114
|
+
outputs?: Record<string, unknown>;
|
|
596
1115
|
};
|
|
597
|
-
|
|
1116
|
+
location: TVector;
|
|
1117
|
+
logic: string;
|
|
1118
|
+
} : CNode;
|
|
598
1119
|
|
|
599
|
-
declare type
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
1120
|
+
declare type TNode_2 = {
|
|
1121
|
+
id: string;
|
|
1122
|
+
inputs: Record<string, Anchor.CNodeAnchor>;
|
|
1123
|
+
outputs: Record<string, Anchor.CNodeAnchor>;
|
|
1124
|
+
data?: object;
|
|
1125
|
+
dbNode: TGeneratedNode;
|
|
1126
|
+
location: TVector;
|
|
604
1127
|
};
|
|
605
1128
|
|
|
606
|
-
declare type TMethodsOf<TInputs extends TNodeInterfaceDescriptor, TOutputs extends TNodeInterfaceDescriptor> = MethodsFrom<TOnlyExecOf<TInputs>> & MethodsFrom<TOnlyVarsOf<TOutputs>>;
|
|
607
|
-
|
|
608
1129
|
declare type TNodeConfigDescriptor = Record<string, TSchema>;
|
|
609
1130
|
|
|
610
1131
|
declare type TNodeConfigSchema<TConfig extends TNodeConfigDescriptor> = {
|
|
@@ -613,6 +1134,16 @@ declare type TNodeConfigSchema<TConfig extends TNodeConfigDescriptor> = {
|
|
|
613
1134
|
[TKey in keyof TConfig]: Static<TConfig[TKey]>;
|
|
614
1135
|
};
|
|
615
1136
|
|
|
1137
|
+
declare type TNodeData = {
|
|
1138
|
+
config?: Record<string, unknown>;
|
|
1139
|
+
multiple?: {
|
|
1140
|
+
isArray?: boolean;
|
|
1141
|
+
number: number;
|
|
1142
|
+
};
|
|
1143
|
+
optionals?: Record<string, boolean>;
|
|
1144
|
+
size?: TVector;
|
|
1145
|
+
} & Record<string, unknown>;
|
|
1146
|
+
|
|
616
1147
|
declare type TNodeDescriptor<TInputs extends TNodeInterfaceDescriptor, TOutputs extends TNodeInterfaceDescriptor, TConfig extends TNodeConfigDescriptor> = TNodeGenerated<TInputs, TOutputs, TConfig> & ThisType<{
|
|
617
1148
|
[TKey in keyof TOnlyExecOf<TOutputs>]: (stack?: unknown) => Promise<void>;
|
|
618
1149
|
} & {
|
|
@@ -632,7 +1163,6 @@ declare type TNodeDescriptor<TInputs extends TNodeInterfaceDescriptor, TOutputs
|
|
|
632
1163
|
}>;
|
|
633
1164
|
|
|
634
1165
|
declare type TNodeDisplay = {
|
|
635
|
-
name?: string;
|
|
636
1166
|
altSearch?: string;
|
|
637
1167
|
config?: {
|
|
638
1168
|
back?: string | IconDefinition;
|
|
@@ -660,6 +1190,7 @@ declare type TNodeDisplay = {
|
|
|
660
1190
|
data?: Record<string, unknown>;
|
|
661
1191
|
inspector?: string;
|
|
662
1192
|
interface?: Component_2 | string;
|
|
1193
|
+
name?: string;
|
|
663
1194
|
priority?: number;
|
|
664
1195
|
};
|
|
665
1196
|
|
|
@@ -678,19 +1209,7 @@ declare type TNodeDynamics<TInputs extends TNodeInterfaceDescriptor, TOutputs ex
|
|
|
678
1209
|
}) => Partial<TNodeInterfaceDescriptor>;
|
|
679
1210
|
};
|
|
680
1211
|
|
|
681
|
-
declare type TNodeExport = {
|
|
682
|
-
data?: Record<string, unknown>;
|
|
683
|
-
internal?: {
|
|
684
|
-
inputs?: Record<string, unknown>;
|
|
685
|
-
outputs?: Record<string, unknown>;
|
|
686
|
-
};
|
|
687
|
-
location: TVector;
|
|
688
|
-
logic: string;
|
|
689
|
-
};
|
|
690
|
-
|
|
691
1212
|
declare type TNodeGenerated<TInputs extends TNodeInterfaceDescriptor, TOutputs extends TNodeInterfaceDescriptor, TConfig extends TNodeConfigDescriptor> = {
|
|
692
|
-
name?: string;
|
|
693
|
-
type?: ELogicType;
|
|
694
1213
|
build?: {
|
|
695
1214
|
define?: Array<{
|
|
696
1215
|
id: (data: {
|
|
@@ -719,7 +1238,9 @@ declare type TNodeGenerated<TInputs extends TNodeInterfaceDescriptor, TOutputs e
|
|
|
719
1238
|
dynamics?: TNodeDynamics<TInputs, TOutputs, TConfig>;
|
|
720
1239
|
inputs: TInputs;
|
|
721
1240
|
methods: Partial<TMethodsOf<TInputs, TOutputs>>;
|
|
1241
|
+
name?: string;
|
|
722
1242
|
outputs: TOutputs;
|
|
1243
|
+
type?: ELogicType;
|
|
723
1244
|
};
|
|
724
1245
|
|
|
725
1246
|
declare type TNodeInterfaceDescriptor = Record<string, TSchema>;
|
|
@@ -737,14 +1258,14 @@ declare type TNodeOptionals<TInputs extends TNodeInterfaceDescriptor, TOutputs e
|
|
|
737
1258
|
};
|
|
738
1259
|
|
|
739
1260
|
declare interface TNumber {
|
|
740
|
-
type: EVarType.number;
|
|
741
1261
|
static: number;
|
|
1262
|
+
type: EVarType.number;
|
|
742
1263
|
}
|
|
743
1264
|
|
|
744
1265
|
declare interface TObject<T extends TProperties = TProperties> {
|
|
745
|
-
type: EVarType.object;
|
|
746
1266
|
properties: T;
|
|
747
1267
|
static: StaticObject<T>;
|
|
1268
|
+
type: EVarType.object;
|
|
748
1269
|
}
|
|
749
1270
|
|
|
750
1271
|
declare type TOnlyExecOf<TNodeInterfaceDescriptor> = {
|
|
@@ -755,96 +1276,57 @@ declare type TOnlyVarsOf<TNodeInterfaceDescriptor> = {
|
|
|
755
1276
|
[TAnchor in keyof TNodeInterfaceDescriptor as TNodeInterfaceDescriptor[TAnchor] extends TExec ? never : TAnchor]: TNodeInterfaceDescriptor[TAnchor];
|
|
756
1277
|
};
|
|
757
1278
|
|
|
758
|
-
declare type TOption<TParams = unknown, TResult = unknown> = TResult | ((env: TParams) => Promise<TResult> | TResult
|
|
1279
|
+
declare type TOption<TParams = unknown, TResult = unknown> = TResult | ((env: TParams) => Promise<TResult> | TResult);
|
|
759
1280
|
|
|
760
|
-
export declare type TPlugin<TConfig extends TSchema = TSchema, TInternal = unknown> = {
|
|
761
|
-
build?: {
|
|
762
|
-
|
|
763
|
-
name: string;
|
|
764
|
-
version?: string;
|
|
765
|
-
}>>;
|
|
766
|
-
plugins?: TOption<TEnv<TConfig, TInternal>, Array<PluginOption>>;
|
|
1281
|
+
export declare type TPlugin<TConfig extends TSchema = TSchema, TInternal = unknown, TBase extends TBasePlugin<TConfig, TInternal> = TBasePlugin<TConfig, TInternal>> = Omit<TBase, "build" | "editor" | "inject"> & {
|
|
1282
|
+
[TCategory in "build" | "editor" | "inject"]?: {
|
|
1283
|
+
[TKey in keyof NonNullable<TBase[TCategory]>]: TOption<TEnv<TConfig, TInternal>, NonNullable<TBase[TCategory]>[TKey]>;
|
|
767
1284
|
};
|
|
768
|
-
config?: TConfig;
|
|
769
|
-
dependencies?: Array<{
|
|
770
|
-
id: string;
|
|
771
|
-
name: string;
|
|
772
|
-
target: string;
|
|
773
|
-
}>;
|
|
774
|
-
description?: string;
|
|
775
|
-
editor?: {
|
|
776
|
-
components?: TOption<TEnv<TConfig, TInternal>, Array<TComponent>>;
|
|
777
|
-
nodes?: TOption<TEnv<TConfig, TInternal>, Array<TLogicNode>>;
|
|
778
|
-
templates?: TOption<TEnv<TConfig, TInternal>, Array<TTemplate>>;
|
|
779
|
-
tokens?: TOption<TEnv<TConfig, TInternal>, Array<TToken>>;
|
|
780
|
-
wrapper?: TOption<TEnv<TConfig, TInternal>, TComponent>;
|
|
781
|
-
};
|
|
782
|
-
icon: string;
|
|
783
|
-
id: string;
|
|
784
|
-
inject?: {
|
|
785
|
-
css?: TOption<TEnv<TConfig, TInternal>, string>;
|
|
786
|
-
js?: TOption<TEnv<TConfig, TInternal>, string>;
|
|
787
|
-
};
|
|
788
|
-
interface?: Component;
|
|
789
|
-
internal?: TInternal;
|
|
790
|
-
lifecycle?: {
|
|
791
|
-
mount?: (env: TEnv<TConfig, TInternal>) => Promise<void> | void;
|
|
792
|
-
unmount?: (env: TEnv<TConfig, TInternal>) => Promise<void> | void;
|
|
793
|
-
update?: (env: TEnv<TConfig, TInternal>) => Promise<void> | void;
|
|
794
|
-
};
|
|
795
|
-
name: string;
|
|
796
1285
|
};
|
|
797
1286
|
|
|
798
1287
|
declare type TProperties = Record<string, TSchema>;
|
|
799
1288
|
|
|
1289
|
+
export declare type TProxyPlugin<TConfig extends TSchema = TSchema, TInternal = unknown, TBase extends TBasePlugin<TConfig, TInternal> = TBasePlugin<TConfig, TInternal>> = Omit<TBase, "build" | "editor" | "inject"> & {
|
|
1290
|
+
[TCategory in "build" | "editor" | "inject"]?: {
|
|
1291
|
+
[TKey in keyof NonNullable<TBase[TCategory]>]: Promise<NonNullable<TBase[TCategory]>[TKey]>;
|
|
1292
|
+
};
|
|
1293
|
+
};
|
|
1294
|
+
|
|
800
1295
|
declare interface TRecord<TKey extends TString | TNumber = TString, TValue extends TSchema = TSchema> {
|
|
801
|
-
type: EVarType.record;
|
|
802
1296
|
key: TKey;
|
|
803
1297
|
static: StaticRecord<TKey, TValue>;
|
|
1298
|
+
type: EVarType.record;
|
|
804
1299
|
value: TValue;
|
|
805
1300
|
}
|
|
806
1301
|
|
|
807
|
-
declare type
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
body: TSchema;
|
|
813
|
-
headers: TSchema;
|
|
814
|
-
query: TSchema;
|
|
815
|
-
};
|
|
816
|
-
logics: Record<string, TLogicExport | TMainLogicExport>;
|
|
817
|
-
method: ERouteMethod;
|
|
818
|
-
output: TSchema;
|
|
819
|
-
path: string;
|
|
820
|
-
state: TStateExport;
|
|
1302
|
+
declare type TRect = {
|
|
1303
|
+
height: number;
|
|
1304
|
+
width: number;
|
|
1305
|
+
x: number;
|
|
1306
|
+
y: number;
|
|
821
1307
|
};
|
|
822
1308
|
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
name: string;
|
|
827
|
-
type: EElementType.Script;
|
|
828
|
-
logics: Record<string, TLogicExport | TMainLogicExport>;
|
|
829
|
-
options?: {
|
|
830
|
-
autoReload?: boolean;
|
|
831
|
-
};
|
|
832
|
-
scope: ELogicScope;
|
|
833
|
-
state: TStateExport;
|
|
1309
|
+
declare type TReturnValue = {
|
|
1310
|
+
schema: TSchema;
|
|
1311
|
+
value: unknown;
|
|
834
1312
|
};
|
|
835
1313
|
|
|
1314
|
+
export declare type TSchema<TLogic extends TAnyLogic_2 = TAnyLogic_2> = TArguments & TLogic;
|
|
1315
|
+
|
|
836
1316
|
export declare type TSlot = TSchema<TObject> | TSchema<TVoid>;
|
|
837
1317
|
|
|
838
|
-
declare type
|
|
1318
|
+
declare type TStack = {
|
|
1319
|
+
id: string;
|
|
1320
|
+
config?: Record<string, unknown>;
|
|
1321
|
+
context: object;
|
|
1322
|
+
parent?: TStackParent;
|
|
1323
|
+
variables: Record<string, unknown>;
|
|
1324
|
+
};
|
|
839
1325
|
|
|
840
|
-
declare type
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
logics: Record<string, TLogicExport>;
|
|
845
|
-
options: TStoreOptions;
|
|
846
|
-
schema: TSchema;
|
|
847
|
-
state: TStateExport;
|
|
1326
|
+
declare type TStackParent = {
|
|
1327
|
+
logic?: TLogic;
|
|
1328
|
+
node?: CNode;
|
|
1329
|
+
stack: TStack;
|
|
848
1330
|
};
|
|
849
1331
|
|
|
850
1332
|
declare type TStoreOptions = {
|
|
@@ -852,24 +1334,19 @@ declare type TStoreOptions = {
|
|
|
852
1334
|
};
|
|
853
1335
|
|
|
854
1336
|
declare interface TString {
|
|
855
|
-
type: EVarType.string;
|
|
856
1337
|
static: string;
|
|
1338
|
+
type: EVarType.string;
|
|
857
1339
|
}
|
|
858
1340
|
|
|
859
1341
|
export declare type TTemplate = {
|
|
860
1342
|
name: string;
|
|
861
1343
|
preview?: string;
|
|
862
|
-
template:
|
|
1344
|
+
template: TFile<true>;
|
|
863
1345
|
};
|
|
864
1346
|
|
|
865
|
-
declare type
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
blocks: Array<{
|
|
869
|
-
content: string;
|
|
870
|
-
key: string;
|
|
871
|
-
}>;
|
|
872
|
-
state: TStateExport;
|
|
1347
|
+
declare type TTextBlock = {
|
|
1348
|
+
content: string;
|
|
1349
|
+
key: string;
|
|
873
1350
|
};
|
|
874
1351
|
|
|
875
1352
|
export declare type TToken = {
|
|
@@ -880,35 +1357,33 @@ export declare type TToken = {
|
|
|
880
1357
|
};
|
|
881
1358
|
|
|
882
1359
|
declare interface TType<T extends TSchema = TSchema> {
|
|
883
|
-
type: EVarType.type;
|
|
884
1360
|
static: T;
|
|
885
1361
|
target: Array<string>;
|
|
1362
|
+
type: EVarType.type;
|
|
886
1363
|
}
|
|
887
1364
|
|
|
888
|
-
declare type TTypeExport = {
|
|
889
|
-
name: string;
|
|
890
|
-
type: EElementType.Type;
|
|
891
|
-
schemas: Record<string, TSchema>;
|
|
892
|
-
state: TStateExport;
|
|
893
|
-
};
|
|
894
|
-
|
|
895
1365
|
declare interface TUndefined {
|
|
896
|
-
type: EVarType.undefined;
|
|
897
1366
|
static: undefined;
|
|
1367
|
+
type: EVarType.undefined;
|
|
898
1368
|
}
|
|
899
1369
|
|
|
900
1370
|
declare interface TUnion<T extends Array<TSchema> = Array<TSchema>> {
|
|
901
|
-
type: EVarType.union;
|
|
902
1371
|
elements: T;
|
|
903
1372
|
static: StaticUnion<T>;
|
|
1373
|
+
type: EVarType.union;
|
|
904
1374
|
}
|
|
905
1375
|
|
|
906
1376
|
declare interface TUnknown {
|
|
907
|
-
type: EVarType.unknown;
|
|
908
1377
|
static: unknown;
|
|
1378
|
+
type: EVarType.unknown;
|
|
909
1379
|
}
|
|
910
1380
|
|
|
911
|
-
declare type
|
|
1381
|
+
declare type TValue<TExport extends boolean = false> = TExport extends false ? {
|
|
1382
|
+
id: string;
|
|
1383
|
+
isEditing?: boolean;
|
|
1384
|
+
parent?: TLogic<TExport>;
|
|
1385
|
+
schema: TSchema;
|
|
1386
|
+
} : TSchema;
|
|
912
1387
|
|
|
913
1388
|
declare type TVector = {
|
|
914
1389
|
x: number;
|
|
@@ -916,11 +1391,18 @@ declare type TVector = {
|
|
|
916
1391
|
};
|
|
917
1392
|
|
|
918
1393
|
declare interface TVoid {
|
|
919
|
-
type: EVarType.void;
|
|
920
1394
|
static: void;
|
|
1395
|
+
type: EVarType.void;
|
|
921
1396
|
}
|
|
922
1397
|
|
|
923
|
-
declare type
|
|
1398
|
+
declare type TWire = {
|
|
1399
|
+
id: string;
|
|
1400
|
+
from: Anchor.CAnchor;
|
|
1401
|
+
temp?: boolean;
|
|
1402
|
+
to: Anchor.CAnchor;
|
|
1403
|
+
};
|
|
1404
|
+
|
|
1405
|
+
declare type TWire_2<TExport extends boolean = false> = TExport extends true ? {
|
|
924
1406
|
from: {
|
|
925
1407
|
key: string;
|
|
926
1408
|
node: string;
|
|
@@ -929,6 +1411,22 @@ declare type TWireExport = {
|
|
|
929
1411
|
key: string;
|
|
930
1412
|
node: string;
|
|
931
1413
|
};
|
|
932
|
-
};
|
|
1414
|
+
} : CWire;
|
|
1415
|
+
|
|
1416
|
+
declare namespace Wire {
|
|
1417
|
+
export {
|
|
1418
|
+
from,
|
|
1419
|
+
create,
|
|
1420
|
+
makePath,
|
|
1421
|
+
pathToString,
|
|
1422
|
+
TWire,
|
|
1423
|
+
CPathPoint,
|
|
1424
|
+
Path,
|
|
1425
|
+
WIRE_PADDING,
|
|
1426
|
+
CWire
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
declare const WIRE_PADDING = 6;
|
|
933
1431
|
|
|
934
1432
|
export { }
|