@luna-park/plugin 1.2.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 +702 -231
- package/dist/index.js +2961 -34
- package/dist/plugin.css +2 -0
- package/dist/preview.cjs +1 -1
- package/dist/preview.js +27 -37
- package/package.json +20 -18
- package/dist/index-CWrYVK_G.cjs +0 -5
- package/dist/index-Dv9uuje9.js +0 -410
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +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';
|
|
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
|
+
}
|
|
3
140
|
|
|
4
141
|
declare type Component_2 = {
|
|
5
142
|
name: string;
|
|
6
143
|
};
|
|
7
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
|
+
|
|
8
218
|
declare enum EComponentPreview {
|
|
9
219
|
Compact = "compact",
|
|
10
220
|
Stretch = "stretch",
|
|
@@ -36,7 +246,12 @@ declare enum EDynamicVariableType {
|
|
|
36
246
|
Token = "token"
|
|
37
247
|
}
|
|
38
248
|
|
|
39
|
-
declare enum
|
|
249
|
+
declare enum EElementTemplate {
|
|
250
|
+
If = "if",
|
|
251
|
+
For = "for"
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export declare enum EElementType {
|
|
40
255
|
Script = "script",
|
|
41
256
|
Standalone = "standalone",
|
|
42
257
|
Folder = "folder",
|
|
@@ -69,6 +284,7 @@ export declare enum EInjectionKey {
|
|
|
69
284
|
VitePlugin = "vitePlugin",
|
|
70
285
|
AppImport = "appImport",
|
|
71
286
|
AppBody = "appBody",
|
|
287
|
+
AppSetup = "appSetup",
|
|
72
288
|
Style = "style",
|
|
73
289
|
ServerImport = "serverImport",
|
|
74
290
|
ServerBody = "serverBody"
|
|
@@ -85,7 +301,30 @@ declare enum ELayoutElement {
|
|
|
85
301
|
slot = "slot",
|
|
86
302
|
template = "template",
|
|
87
303
|
variable = "variable",
|
|
88
|
-
|
|
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"
|
|
89
328
|
}
|
|
90
329
|
|
|
91
330
|
declare enum ELogicMode {
|
|
@@ -125,12 +364,6 @@ declare enum EStoreType {
|
|
|
125
364
|
Local = "local"
|
|
126
365
|
}
|
|
127
366
|
|
|
128
|
-
declare enum EThemeMode {
|
|
129
|
-
Dark = "dark",
|
|
130
|
-
Light = "light",
|
|
131
|
-
Auto = "auto"
|
|
132
|
-
}
|
|
133
|
-
|
|
134
367
|
export declare enum ETokenType {
|
|
135
368
|
Color = "color",
|
|
136
369
|
FontSize = "font-size",
|
|
@@ -157,21 +390,45 @@ export declare enum EVarType {
|
|
|
157
390
|
void = "void"
|
|
158
391
|
}
|
|
159
392
|
|
|
393
|
+
declare function from(wire: TWire): CWire;
|
|
394
|
+
|
|
395
|
+
declare function from_2(node: TNode_2): CNode;
|
|
396
|
+
|
|
160
397
|
export declare function getPluginParam<T>(target: TOption<TEnv, T>, env: Partial<TEnv>): Promise<T>;
|
|
161
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
|
+
|
|
162
417
|
export declare function loadPlugin<TConfig extends TSchema, TInternal>(plugin: TPlugin<TConfig, TInternal>, env: Partial<TEnv>): Promise<TBasePlugin<TConfig, TInternal>>;
|
|
163
418
|
|
|
164
419
|
export declare const LogicType: {
|
|
165
|
-
type: <T extends TSchema>(target: Array<string>, args?: TArguments) => TType<T>;
|
|
166
420
|
array: <T extends TSchema, TArgs extends TArguments<Array<T>>>(items: T, args?: TArgs) => TArray<T> & TArgs;
|
|
167
421
|
boolean: <TArgs extends TArguments<boolean>>(args?: TArgs) => TBoolean & TArgs;
|
|
168
422
|
exec: (args?: TArguments) => TExec;
|
|
169
|
-
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>;
|
|
170
426
|
interface: <T, TArgs extends TArguments<T> = TArguments<T>>(interfaceClass: (new (...args: any) => T) | string, args?: TArgs) => TInterface<T> & TArgs;
|
|
171
427
|
number: <TArgs extends TArguments<number>>(args?: TArgs) => TNumber & TArgs;
|
|
172
428
|
object: <T extends TProperties, TArgs extends TArguments<object>>(properties?: T, args?: TArgs) => TObject<T> & TArgs;
|
|
173
|
-
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>;
|
|
174
430
|
string: <TArgs extends TArguments<string>>(args?: TArgs) => TString & TArgs;
|
|
431
|
+
type: <T extends TSchema>(target: Array<string>, args?: TArguments) => TType<T>;
|
|
175
432
|
undefined: (args?: TArguments) => TUndefined;
|
|
176
433
|
union: <T extends Array<TSchema>>(elements: T, args?: TArguments) => TUnion<T>;
|
|
177
434
|
unknown: <TArgs extends TArguments<unknown>>(args?: TArgs) => TUnknown & TArgs;
|
|
@@ -186,27 +443,56 @@ export declare const LogicUtil: {
|
|
|
186
443
|
required(target: TObject): TObject;
|
|
187
444
|
};
|
|
188
445
|
|
|
446
|
+
export { LSettingsStoryWrapper }
|
|
447
|
+
|
|
448
|
+
export declare function makeComponent<TProps extends Record<string, TSchema>>(component: TComponent<TProps>): TComponent<TProps>;
|
|
449
|
+
|
|
189
450
|
export declare function makeLogicNode<TInputs extends TNodeInterfaceDescriptor, TOutputs extends TNodeInterfaceDescriptor, TConfig extends TNodeConfigDescriptor>(node: TNodeDescriptor<TInputs, TOutputs, TConfig>): TLogicNode;
|
|
190
451
|
|
|
452
|
+
declare function makePath(start: CPathPoint, end: CPathPoint): Path;
|
|
453
|
+
|
|
191
454
|
export declare function makePlugin<TConfig extends TSchema, TInternal>(plugin: TPlugin<TConfig, TInternal>): TPlugin<TConfig, TInternal>;
|
|
192
455
|
|
|
456
|
+
declare type MaybePromise<T> = T | Promise<T>;
|
|
457
|
+
|
|
193
458
|
declare type MethodsFrom<TInterface extends TNodeInterfaceDescriptor> = {
|
|
194
|
-
[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
|
+
};
|
|
195
463
|
};
|
|
196
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
|
+
|
|
197
477
|
declare type OptionalKeys<T extends TProperties> = {
|
|
198
478
|
[K in keyof T]: T[K] extends {
|
|
199
479
|
optional: true;
|
|
200
480
|
} ? K : never;
|
|
201
481
|
}[keyof T];
|
|
202
482
|
|
|
483
|
+
declare type Path = Array<CPathPoint>;
|
|
484
|
+
|
|
485
|
+
declare function pathToString(path: Path, config?: {
|
|
486
|
+
smoothing: boolean;
|
|
487
|
+
}): string;
|
|
488
|
+
|
|
203
489
|
declare type RequiredKeys<T extends TProperties> = Exclude<keyof T, OptionalKeys<T>>;
|
|
204
490
|
|
|
205
|
-
declare type Static<T extends TSchema> = T extends {
|
|
491
|
+
export declare type Static<T extends TSchema> = T extends {
|
|
206
492
|
optional: true;
|
|
207
493
|
} ? (T["static"] | undefined) : T["static"];
|
|
208
494
|
|
|
209
|
-
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>;
|
|
210
496
|
|
|
211
497
|
declare type StaticObject<T extends TProperties> = {
|
|
212
498
|
[K in RequiredKeys<T>]: Static<T[K]>;
|
|
@@ -227,9 +513,22 @@ declare type StaticUnion<T extends Array<TSchema>> = {
|
|
|
227
513
|
[K in keyof T]: Static<T[K]>;
|
|
228
514
|
}[number];
|
|
229
515
|
|
|
230
|
-
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
|
+
};
|
|
521
|
+
|
|
522
|
+
export declare type TAnyLogic<TExport extends boolean = false> = TLogic<TExport> | TLogicMain<TExport>;
|
|
231
523
|
|
|
232
|
-
declare type
|
|
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
|
+
};
|
|
233
532
|
|
|
234
533
|
declare type TApplicationConfig = {
|
|
235
534
|
backend: {
|
|
@@ -256,21 +555,6 @@ declare type TApplicationConfig = {
|
|
|
256
555
|
types: TExportNodeResult["types"];
|
|
257
556
|
}>;
|
|
258
557
|
palette: {
|
|
259
|
-
content: string;
|
|
260
|
-
forceTheme: boolean;
|
|
261
|
-
inject: {
|
|
262
|
-
css: string;
|
|
263
|
-
head: string;
|
|
264
|
-
html: string;
|
|
265
|
-
js: string;
|
|
266
|
-
};
|
|
267
|
-
length: {
|
|
268
|
-
border: number;
|
|
269
|
-
radius: number;
|
|
270
|
-
};
|
|
271
|
-
matchEditor: boolean;
|
|
272
|
-
primary: string;
|
|
273
|
-
theme: EThemeMode;
|
|
274
558
|
tokens: {
|
|
275
559
|
colors: Array<{
|
|
276
560
|
id: string;
|
|
@@ -288,10 +572,16 @@ declare type TApplicationConfig = {
|
|
|
288
572
|
value: string;
|
|
289
573
|
}>;
|
|
290
574
|
};
|
|
575
|
+
inject: {
|
|
576
|
+
html: string;
|
|
577
|
+
css: string;
|
|
578
|
+
js: string;
|
|
579
|
+
head: string;
|
|
580
|
+
};
|
|
291
581
|
};
|
|
292
582
|
plugins: Record<string, {
|
|
293
583
|
config?: unknown;
|
|
294
|
-
|
|
584
|
+
internals?: unknown;
|
|
295
585
|
target: string;
|
|
296
586
|
}>;
|
|
297
587
|
state: {
|
|
@@ -308,14 +598,7 @@ declare type TApplicationConfig = {
|
|
|
308
598
|
};
|
|
309
599
|
};
|
|
310
600
|
|
|
311
|
-
declare type TApplicationExport = {
|
|
312
|
-
name: string;
|
|
313
|
-
config: TApplicationConfig;
|
|
314
|
-
tree: TFileExport;
|
|
315
|
-
};
|
|
316
|
-
|
|
317
601
|
declare interface TArguments<TType = any> {
|
|
318
|
-
name?: string;
|
|
319
602
|
build?: (arg: unknown) => unknown;
|
|
320
603
|
customizable?: boolean;
|
|
321
604
|
default?: TType;
|
|
@@ -330,6 +613,7 @@ declare interface TArguments<TType = any> {
|
|
|
330
613
|
example?: unknown;
|
|
331
614
|
format?: "date-time" | "email" | "color";
|
|
332
615
|
multiple?: boolean;
|
|
616
|
+
name?: string;
|
|
333
617
|
optional?: boolean;
|
|
334
618
|
options?: {
|
|
335
619
|
format?: (arg: TType) => TType;
|
|
@@ -345,12 +629,25 @@ declare interface TArguments<TType = any> {
|
|
|
345
629
|
}
|
|
346
630
|
|
|
347
631
|
declare interface TArray<T extends TSchema = TSchema> {
|
|
348
|
-
type: EVarType.array;
|
|
349
632
|
items: T;
|
|
350
633
|
static: Array<Static<T>>;
|
|
634
|
+
type: EVarType.array;
|
|
351
635
|
}
|
|
352
636
|
|
|
353
|
-
|
|
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> = {
|
|
354
651
|
build?: {
|
|
355
652
|
backImports?: Array<{
|
|
356
653
|
name: string;
|
|
@@ -362,6 +659,7 @@ export declare type TBasePlugin<TConfig extends TSchema = TSchema, TInternal = u
|
|
|
362
659
|
}>;
|
|
363
660
|
injections?: Partial<Record<EInjectionKey, string>>;
|
|
364
661
|
};
|
|
662
|
+
color?: string;
|
|
365
663
|
config?: TConfig;
|
|
366
664
|
dependencies?: Array<{
|
|
367
665
|
id: string;
|
|
@@ -371,10 +669,13 @@ export declare type TBasePlugin<TConfig extends TSchema = TSchema, TInternal = u
|
|
|
371
669
|
description?: string;
|
|
372
670
|
editor?: {
|
|
373
671
|
components?: Array<TComponent>;
|
|
672
|
+
interfaces?: Array<TInterface_2>;
|
|
374
673
|
nodes?: Array<TLogicNode>;
|
|
375
674
|
templates?: Array<TTemplate>;
|
|
376
675
|
tokens?: Array<TToken>;
|
|
377
|
-
wrapper?: TComponent
|
|
676
|
+
wrapper?: TComponent & {
|
|
677
|
+
attributes?: Record<string, unknown>;
|
|
678
|
+
};
|
|
378
679
|
};
|
|
379
680
|
icon: string;
|
|
380
681
|
id: string;
|
|
@@ -383,30 +684,36 @@ export declare type TBasePlugin<TConfig extends TSchema = TSchema, TInternal = u
|
|
|
383
684
|
js?: string;
|
|
384
685
|
};
|
|
385
686
|
interface?: Component;
|
|
386
|
-
|
|
687
|
+
internals?: TInternals;
|
|
387
688
|
lifecycle?: {
|
|
388
|
-
mount?: (env: TEnv<TConfig,
|
|
389
|
-
unmount?: (env: TEnv<TConfig,
|
|
390
|
-
update?: (env: TEnv<TConfig,
|
|
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;
|
|
391
692
|
};
|
|
392
693
|
name: string;
|
|
694
|
+
settings?: Array<{
|
|
695
|
+
component: Component;
|
|
696
|
+
icon?: IconDefinition | string;
|
|
697
|
+
label: string;
|
|
698
|
+
}>;
|
|
393
699
|
};
|
|
394
700
|
|
|
395
701
|
declare interface TBoolean {
|
|
396
|
-
type: EVarType.boolean;
|
|
397
702
|
static: boolean;
|
|
703
|
+
type: EVarType.boolean;
|
|
398
704
|
}
|
|
399
705
|
|
|
400
|
-
declare type
|
|
706
|
+
declare type TCanvas = {
|
|
401
707
|
location: TVector;
|
|
402
708
|
zoom: number;
|
|
403
709
|
};
|
|
404
710
|
|
|
405
|
-
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> = {
|
|
406
712
|
build?: {
|
|
407
|
-
|
|
713
|
+
imports?: Array<{
|
|
714
|
+
default?: boolean;
|
|
715
|
+
from: string;
|
|
408
716
|
name: string;
|
|
409
|
-
target: string;
|
|
410
717
|
}>;
|
|
411
718
|
name?: string;
|
|
412
719
|
};
|
|
@@ -416,27 +723,21 @@ export declare type TComponent<TProps extends Record<string, TSchema> = Record<s
|
|
|
416
723
|
link?: string;
|
|
417
724
|
};
|
|
418
725
|
emits?: Record<string, TSchema>;
|
|
726
|
+
icon?: IconDefinition | string;
|
|
727
|
+
internals?: TInternals;
|
|
419
728
|
models?: Record<string, TSchema>;
|
|
420
729
|
name: string;
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
type: EElementType.Component;
|
|
428
|
-
collapsed?: boolean;
|
|
429
|
-
layout: TLayoutSchemaExport;
|
|
430
|
-
logics: Record<string, TLogicExport | TMainLogicExport>;
|
|
431
|
-
options: TComponentOptions;
|
|
432
|
-
state: TStateExport;
|
|
433
|
-
values: {
|
|
434
|
-
computed: Record<string, TValueExport>;
|
|
435
|
-
events: Record<string, TValueExport>;
|
|
436
|
-
model?: TSchema;
|
|
437
|
-
properties: Record<string, TValueExport>;
|
|
438
|
-
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;
|
|
439
736
|
};
|
|
737
|
+
properties?: TProps;
|
|
738
|
+
slots?: Record<string, TSlot> | ((attributes: StaticOfProps<TProps> & {
|
|
739
|
+
internals: TInternals;
|
|
740
|
+
}) => Record<string, TSlot>);
|
|
440
741
|
};
|
|
441
742
|
|
|
442
743
|
declare type TComponentOptions = {
|
|
@@ -446,32 +747,9 @@ declare type TComponentOptions = {
|
|
|
446
747
|
previewSize: string;
|
|
447
748
|
};
|
|
448
749
|
|
|
449
|
-
declare type
|
|
450
|
-
|
|
451
|
-
type: EElementType.Config;
|
|
452
|
-
content: unknown;
|
|
453
|
-
display: EConfigDisplay;
|
|
750
|
+
declare type TDBAnchor = {
|
|
751
|
+
id?: string;
|
|
454
752
|
schema: TSchema;
|
|
455
|
-
scope: ELogicScope;
|
|
456
|
-
state: TStateExport;
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
declare type TCronExport = {
|
|
460
|
-
name: string;
|
|
461
|
-
type: EElementType.Cron;
|
|
462
|
-
active: boolean;
|
|
463
|
-
editorTrigger: boolean;
|
|
464
|
-
logics: Record<string, TLogicExport | TMainLogicExport>;
|
|
465
|
-
state: TStateExport;
|
|
466
|
-
time: string;
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
declare type TDatabaseExport = {
|
|
470
|
-
name: string;
|
|
471
|
-
type: EElementType.Database;
|
|
472
|
-
data: Array<Record<string, unknown>>;
|
|
473
|
-
schema: TSchema<TObject>;
|
|
474
|
-
state: TStateExport;
|
|
475
753
|
};
|
|
476
754
|
|
|
477
755
|
declare type TDocumentation = {
|
|
@@ -487,29 +765,22 @@ declare type TDocumentation = {
|
|
|
487
765
|
}>;
|
|
488
766
|
}>;
|
|
489
767
|
parameters?: Array<{
|
|
490
|
-
name: string;
|
|
491
768
|
description: string;
|
|
769
|
+
name: string;
|
|
492
770
|
}>;
|
|
493
771
|
};
|
|
494
772
|
|
|
495
|
-
declare type TDynamicVariable =
|
|
496
|
-
type: EDynamicVariableType;
|
|
497
|
-
access: Array<string>;
|
|
498
|
-
target: {
|
|
499
|
-
invert?: boolean;
|
|
500
|
-
operation: EDynamicVariableOperation;
|
|
501
|
-
variable?: TDynamicVariable;
|
|
502
|
-
};
|
|
503
|
-
token: string;
|
|
504
|
-
value: unknown;
|
|
505
|
-
};
|
|
773
|
+
declare type TDynamicVariable<TExport extends boolean = false> = (TExport extends true ? TBaseDynamicVariable : CDynamicVariable) | unknown;
|
|
506
774
|
|
|
507
775
|
declare type TEnum<TEnumType> = Array<TEnumType> | Record<string, TEnumType>;
|
|
508
776
|
|
|
509
|
-
declare type TEnv<TConfig extends TSchema = TSchema,
|
|
510
|
-
|
|
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;
|
|
511
782
|
config: Static<TConfig>;
|
|
512
|
-
|
|
783
|
+
internals: TInternals;
|
|
513
784
|
mode: "build" | "editor";
|
|
514
785
|
};
|
|
515
786
|
|
|
@@ -533,71 +804,263 @@ declare type TExportNodeResult = {
|
|
|
533
804
|
types: Record<string, TSchema>;
|
|
534
805
|
};
|
|
535
806
|
|
|
536
|
-
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>) & {
|
|
808
|
+
isEditing?: boolean;
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
declare type TFileBase<TExport extends boolean = false> = {
|
|
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;
|
|
537
897
|
isEditing?: boolean;
|
|
898
|
+
logic?: {
|
|
899
|
+
location: TVector;
|
|
900
|
+
zoom: number;
|
|
901
|
+
};
|
|
902
|
+
opened?: boolean;
|
|
903
|
+
panel?: string;
|
|
538
904
|
};
|
|
539
905
|
|
|
540
|
-
declare type
|
|
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> & {
|
|
541
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> & {
|
|
542
936
|
type: EElementType.Folder;
|
|
543
|
-
children: Record<string,
|
|
937
|
+
children: Record<string, TFile<TExport>>;
|
|
544
938
|
color?: string;
|
|
545
939
|
};
|
|
546
940
|
|
|
547
|
-
declare interface TFunction<TInputs extends TObject = TObject, TOutput extends TSchema = TUnknown> {
|
|
548
|
-
type: EVarType.function;
|
|
941
|
+
declare interface TFunction<TInputs extends TObject = TObject, TOutput extends TSchema = TUnknown, TPromise extends boolean = false> {
|
|
549
942
|
inputs: TInputs;
|
|
550
943
|
output: TOutput;
|
|
551
|
-
static: StaticFunction<TInputs, TOutput>;
|
|
944
|
+
static: StaticFunction<TInputs, TOutput, TPromise>;
|
|
945
|
+
type: EVarType.function;
|
|
552
946
|
}
|
|
553
947
|
|
|
554
|
-
declare type
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
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>>;
|
|
558
958
|
};
|
|
559
959
|
|
|
560
960
|
declare interface TInterface<T = unknown> {
|
|
561
|
-
type: EVarType.interface;
|
|
562
961
|
class?: new (...args: any) => T;
|
|
563
962
|
className: string;
|
|
564
963
|
static: T;
|
|
964
|
+
type: EVarType.interface;
|
|
565
965
|
}
|
|
566
966
|
|
|
567
|
-
declare type
|
|
568
|
-
|
|
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
|
+
}>;
|
|
569
975
|
name: string;
|
|
570
|
-
children: Array<TLayoutSchemaExport>;
|
|
571
|
-
classes: Array<TDynamicVariable>;
|
|
572
|
-
content?: Record<string, unknown>;
|
|
573
|
-
element: ELayoutElement;
|
|
574
|
-
events: Array<string>;
|
|
575
|
-
model?: Array<string>;
|
|
576
|
-
properties: Record<string, TDynamicVariable>;
|
|
577
|
-
style: Record<"base" | string, Record<"default" | "hover", Record<string, Record<string, TDynamicVariable>> & {
|
|
578
|
-
collapsed?: boolean;
|
|
579
|
-
}>>;
|
|
580
|
-
tag?: string;
|
|
581
976
|
};
|
|
582
977
|
|
|
583
|
-
declare type
|
|
584
|
-
|
|
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> & {
|
|
585
1030
|
type: EElementType.Logic | EElementType.Standalone;
|
|
1031
|
+
async: boolean;
|
|
586
1032
|
code?: string;
|
|
587
1033
|
export: boolean;
|
|
588
|
-
|
|
589
|
-
inputs: Record<string, TAnchorExport>;
|
|
1034
|
+
inputs: Record<string, TAnchor<TExport>>;
|
|
590
1035
|
mode: ELogicMode;
|
|
591
|
-
outputs: Record<string,
|
|
1036
|
+
outputs: Record<string, TAnchor<TExport>>;
|
|
592
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>;
|
|
593
1046
|
values: {
|
|
594
|
-
variables: Record<string,
|
|
1047
|
+
variables: Record<string, TValue<TExport>>;
|
|
595
1048
|
};
|
|
596
|
-
}
|
|
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
|
+
} : {});
|
|
597
1062
|
|
|
598
1063
|
export declare type TLogicNode = {
|
|
599
|
-
name: string;
|
|
600
|
-
type?: ELogicType;
|
|
601
1064
|
build?: {
|
|
602
1065
|
define?: Array<{
|
|
603
1066
|
id: (data: {
|
|
@@ -637,27 +1100,32 @@ export declare type TLogicNode = {
|
|
|
637
1100
|
};
|
|
638
1101
|
inputs: TNodeInterfaceDescriptor;
|
|
639
1102
|
methods: Record<string, () => unknown>;
|
|
1103
|
+
name: string;
|
|
640
1104
|
outputs: TNodeInterfaceDescriptor;
|
|
1105
|
+
type?: ELogicType;
|
|
641
1106
|
};
|
|
642
1107
|
|
|
643
|
-
declare type
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
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>;
|
|
649
1115
|
};
|
|
650
|
-
|
|
1116
|
+
location: TVector;
|
|
1117
|
+
logic: string;
|
|
1118
|
+
} : CNode;
|
|
651
1119
|
|
|
652
|
-
declare type
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
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;
|
|
657
1127
|
};
|
|
658
1128
|
|
|
659
|
-
declare type TMethodsOf<TInputs extends TNodeInterfaceDescriptor, TOutputs extends TNodeInterfaceDescriptor> = MethodsFrom<TOnlyExecOf<TInputs>> & MethodsFrom<TOnlyVarsOf<TOutputs>>;
|
|
660
|
-
|
|
661
1129
|
declare type TNodeConfigDescriptor = Record<string, TSchema>;
|
|
662
1130
|
|
|
663
1131
|
declare type TNodeConfigSchema<TConfig extends TNodeConfigDescriptor> = {
|
|
@@ -666,6 +1134,16 @@ declare type TNodeConfigSchema<TConfig extends TNodeConfigDescriptor> = {
|
|
|
666
1134
|
[TKey in keyof TConfig]: Static<TConfig[TKey]>;
|
|
667
1135
|
};
|
|
668
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
|
+
|
|
669
1147
|
declare type TNodeDescriptor<TInputs extends TNodeInterfaceDescriptor, TOutputs extends TNodeInterfaceDescriptor, TConfig extends TNodeConfigDescriptor> = TNodeGenerated<TInputs, TOutputs, TConfig> & ThisType<{
|
|
670
1148
|
[TKey in keyof TOnlyExecOf<TOutputs>]: (stack?: unknown) => Promise<void>;
|
|
671
1149
|
} & {
|
|
@@ -685,7 +1163,6 @@ declare type TNodeDescriptor<TInputs extends TNodeInterfaceDescriptor, TOutputs
|
|
|
685
1163
|
}>;
|
|
686
1164
|
|
|
687
1165
|
declare type TNodeDisplay = {
|
|
688
|
-
name?: string;
|
|
689
1166
|
altSearch?: string;
|
|
690
1167
|
config?: {
|
|
691
1168
|
back?: string | IconDefinition;
|
|
@@ -713,6 +1190,7 @@ declare type TNodeDisplay = {
|
|
|
713
1190
|
data?: Record<string, unknown>;
|
|
714
1191
|
inspector?: string;
|
|
715
1192
|
interface?: Component_2 | string;
|
|
1193
|
+
name?: string;
|
|
716
1194
|
priority?: number;
|
|
717
1195
|
};
|
|
718
1196
|
|
|
@@ -731,19 +1209,7 @@ declare type TNodeDynamics<TInputs extends TNodeInterfaceDescriptor, TOutputs ex
|
|
|
731
1209
|
}) => Partial<TNodeInterfaceDescriptor>;
|
|
732
1210
|
};
|
|
733
1211
|
|
|
734
|
-
declare type TNodeExport = {
|
|
735
|
-
data?: Record<string, unknown>;
|
|
736
|
-
internal?: {
|
|
737
|
-
inputs?: Record<string, unknown>;
|
|
738
|
-
outputs?: Record<string, unknown>;
|
|
739
|
-
};
|
|
740
|
-
location: TVector;
|
|
741
|
-
logic: string;
|
|
742
|
-
};
|
|
743
|
-
|
|
744
1212
|
declare type TNodeGenerated<TInputs extends TNodeInterfaceDescriptor, TOutputs extends TNodeInterfaceDescriptor, TConfig extends TNodeConfigDescriptor> = {
|
|
745
|
-
name?: string;
|
|
746
|
-
type?: ELogicType;
|
|
747
1213
|
build?: {
|
|
748
1214
|
define?: Array<{
|
|
749
1215
|
id: (data: {
|
|
@@ -772,7 +1238,9 @@ declare type TNodeGenerated<TInputs extends TNodeInterfaceDescriptor, TOutputs e
|
|
|
772
1238
|
dynamics?: TNodeDynamics<TInputs, TOutputs, TConfig>;
|
|
773
1239
|
inputs: TInputs;
|
|
774
1240
|
methods: Partial<TMethodsOf<TInputs, TOutputs>>;
|
|
1241
|
+
name?: string;
|
|
775
1242
|
outputs: TOutputs;
|
|
1243
|
+
type?: ELogicType;
|
|
776
1244
|
};
|
|
777
1245
|
|
|
778
1246
|
declare type TNodeInterfaceDescriptor = Record<string, TSchema>;
|
|
@@ -790,14 +1258,14 @@ declare type TNodeOptionals<TInputs extends TNodeInterfaceDescriptor, TOutputs e
|
|
|
790
1258
|
};
|
|
791
1259
|
|
|
792
1260
|
declare interface TNumber {
|
|
793
|
-
type: EVarType.number;
|
|
794
1261
|
static: number;
|
|
1262
|
+
type: EVarType.number;
|
|
795
1263
|
}
|
|
796
1264
|
|
|
797
1265
|
declare interface TObject<T extends TProperties = TProperties> {
|
|
798
|
-
type: EVarType.object;
|
|
799
1266
|
properties: T;
|
|
800
1267
|
static: StaticObject<T>;
|
|
1268
|
+
type: EVarType.object;
|
|
801
1269
|
}
|
|
802
1270
|
|
|
803
1271
|
declare type TOnlyExecOf<TNodeInterfaceDescriptor> = {
|
|
@@ -825,53 +1293,40 @@ export declare type TProxyPlugin<TConfig extends TSchema = TSchema, TInternal =
|
|
|
825
1293
|
};
|
|
826
1294
|
|
|
827
1295
|
declare interface TRecord<TKey extends TString | TNumber = TString, TValue extends TSchema = TSchema> {
|
|
828
|
-
type: EVarType.record;
|
|
829
1296
|
key: TKey;
|
|
830
1297
|
static: StaticRecord<TKey, TValue>;
|
|
1298
|
+
type: EVarType.record;
|
|
831
1299
|
value: TValue;
|
|
832
1300
|
}
|
|
833
1301
|
|
|
834
|
-
declare type
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
body: TSchema;
|
|
840
|
-
headers: TSchema;
|
|
841
|
-
query: TSchema;
|
|
842
|
-
};
|
|
843
|
-
logics: Record<string, TLogicExport | TMainLogicExport>;
|
|
844
|
-
method: ERouteMethod;
|
|
845
|
-
output: TSchema;
|
|
846
|
-
path: string;
|
|
847
|
-
state: TStateExport;
|
|
1302
|
+
declare type TRect = {
|
|
1303
|
+
height: number;
|
|
1304
|
+
width: number;
|
|
1305
|
+
x: number;
|
|
1306
|
+
y: number;
|
|
848
1307
|
};
|
|
849
1308
|
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
name: string;
|
|
854
|
-
type: EElementType.Script;
|
|
855
|
-
logics: Record<string, TLogicExport | TMainLogicExport>;
|
|
856
|
-
options?: {
|
|
857
|
-
autoReload?: boolean;
|
|
858
|
-
};
|
|
859
|
-
scope: ELogicScope;
|
|
860
|
-
state: TStateExport;
|
|
1309
|
+
declare type TReturnValue = {
|
|
1310
|
+
schema: TSchema;
|
|
1311
|
+
value: unknown;
|
|
861
1312
|
};
|
|
862
1313
|
|
|
1314
|
+
export declare type TSchema<TLogic extends TAnyLogic_2 = TAnyLogic_2> = TArguments & TLogic;
|
|
1315
|
+
|
|
863
1316
|
export declare type TSlot = TSchema<TObject> | TSchema<TVoid>;
|
|
864
1317
|
|
|
865
|
-
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
|
+
};
|
|
866
1325
|
|
|
867
|
-
declare type
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
logics: Record<string, TLogicExport>;
|
|
872
|
-
options: TStoreOptions;
|
|
873
|
-
schema: TSchema;
|
|
874
|
-
state: TStateExport;
|
|
1326
|
+
declare type TStackParent = {
|
|
1327
|
+
logic?: TLogic;
|
|
1328
|
+
node?: CNode;
|
|
1329
|
+
stack: TStack;
|
|
875
1330
|
};
|
|
876
1331
|
|
|
877
1332
|
declare type TStoreOptions = {
|
|
@@ -879,24 +1334,19 @@ declare type TStoreOptions = {
|
|
|
879
1334
|
};
|
|
880
1335
|
|
|
881
1336
|
declare interface TString {
|
|
882
|
-
type: EVarType.string;
|
|
883
1337
|
static: string;
|
|
1338
|
+
type: EVarType.string;
|
|
884
1339
|
}
|
|
885
1340
|
|
|
886
1341
|
export declare type TTemplate = {
|
|
887
1342
|
name: string;
|
|
888
1343
|
preview?: string;
|
|
889
|
-
template:
|
|
1344
|
+
template: TFile<true>;
|
|
890
1345
|
};
|
|
891
1346
|
|
|
892
|
-
declare type
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
blocks: Array<{
|
|
896
|
-
content: string;
|
|
897
|
-
key: string;
|
|
898
|
-
}>;
|
|
899
|
-
state: TStateExport;
|
|
1347
|
+
declare type TTextBlock = {
|
|
1348
|
+
content: string;
|
|
1349
|
+
key: string;
|
|
900
1350
|
};
|
|
901
1351
|
|
|
902
1352
|
export declare type TToken = {
|
|
@@ -907,35 +1357,33 @@ export declare type TToken = {
|
|
|
907
1357
|
};
|
|
908
1358
|
|
|
909
1359
|
declare interface TType<T extends TSchema = TSchema> {
|
|
910
|
-
type: EVarType.type;
|
|
911
1360
|
static: T;
|
|
912
1361
|
target: Array<string>;
|
|
1362
|
+
type: EVarType.type;
|
|
913
1363
|
}
|
|
914
1364
|
|
|
915
|
-
declare type TTypeExport = {
|
|
916
|
-
name: string;
|
|
917
|
-
type: EElementType.Type;
|
|
918
|
-
schemas: Record<string, TSchema>;
|
|
919
|
-
state: TStateExport;
|
|
920
|
-
};
|
|
921
|
-
|
|
922
1365
|
declare interface TUndefined {
|
|
923
|
-
type: EVarType.undefined;
|
|
924
1366
|
static: undefined;
|
|
1367
|
+
type: EVarType.undefined;
|
|
925
1368
|
}
|
|
926
1369
|
|
|
927
1370
|
declare interface TUnion<T extends Array<TSchema> = Array<TSchema>> {
|
|
928
|
-
type: EVarType.union;
|
|
929
1371
|
elements: T;
|
|
930
1372
|
static: StaticUnion<T>;
|
|
1373
|
+
type: EVarType.union;
|
|
931
1374
|
}
|
|
932
1375
|
|
|
933
1376
|
declare interface TUnknown {
|
|
934
|
-
type: EVarType.unknown;
|
|
935
1377
|
static: unknown;
|
|
1378
|
+
type: EVarType.unknown;
|
|
936
1379
|
}
|
|
937
1380
|
|
|
938
|
-
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;
|
|
939
1387
|
|
|
940
1388
|
declare type TVector = {
|
|
941
1389
|
x: number;
|
|
@@ -943,11 +1391,18 @@ declare type TVector = {
|
|
|
943
1391
|
};
|
|
944
1392
|
|
|
945
1393
|
declare interface TVoid {
|
|
946
|
-
type: EVarType.void;
|
|
947
1394
|
static: void;
|
|
1395
|
+
type: EVarType.void;
|
|
948
1396
|
}
|
|
949
1397
|
|
|
950
|
-
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 ? {
|
|
951
1406
|
from: {
|
|
952
1407
|
key: string;
|
|
953
1408
|
node: string;
|
|
@@ -956,6 +1411,22 @@ declare type TWireExport = {
|
|
|
956
1411
|
key: string;
|
|
957
1412
|
node: string;
|
|
958
1413
|
};
|
|
959
|
-
};
|
|
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;
|
|
960
1431
|
|
|
961
1432
|
export { }
|