@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/extractor.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ declare type Static<T extends TSchema> = T extends {
|
|
|
54
54
|
optional: true;
|
|
55
55
|
} ? (T["static"] | undefined) : T["static"];
|
|
56
56
|
|
|
57
|
-
declare type StaticFunction<TInputs extends TObject, TOutput extends TSchema> = (...args: Array<Static<TInputs>[string]>) => Promise<Static<TOutput
|
|
57
|
+
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>;
|
|
58
58
|
|
|
59
59
|
declare type StaticObject<T extends TProperties> = {
|
|
60
60
|
[K in RequiredKeys<T>]: Static<T[K]>;
|
|
@@ -71,7 +71,6 @@ declare type StaticUnion<T extends Array<TSchema>> = {
|
|
|
71
71
|
declare type TAnyLogic = TExec | TObject | TRecord<any, any> | TInterface | TType | TArray<any> | TString | TNumber | TBoolean | TUnknown | TUndefined | TUnion<any> | TFunction<any, any> | TVoid;
|
|
72
72
|
|
|
73
73
|
declare interface TArguments<TType = any> {
|
|
74
|
-
name?: string;
|
|
75
74
|
build?: (arg: unknown) => unknown;
|
|
76
75
|
customizable?: boolean;
|
|
77
76
|
default?: TType;
|
|
@@ -86,6 +85,7 @@ declare interface TArguments<TType = any> {
|
|
|
86
85
|
example?: unknown;
|
|
87
86
|
format?: "date-time" | "email" | "color";
|
|
88
87
|
multiple?: boolean;
|
|
88
|
+
name?: string;
|
|
89
89
|
optional?: boolean;
|
|
90
90
|
options?: {
|
|
91
91
|
format?: (arg: TType) => TType;
|
|
@@ -101,14 +101,14 @@ declare interface TArguments<TType = any> {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
declare interface TArray<T extends TSchema = TSchema> {
|
|
104
|
-
type: EVarType.array;
|
|
105
104
|
items: T;
|
|
106
105
|
static: Array<Static<T>>;
|
|
106
|
+
type: EVarType.array;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
declare interface TBoolean {
|
|
110
|
-
type: EVarType.boolean;
|
|
111
110
|
static: boolean;
|
|
111
|
+
type: EVarType.boolean;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
declare type TEnum<TEnumType> = Array<TEnumType> | Record<string, TEnumType>;
|
|
@@ -174,72 +174,72 @@ declare type TExportType = {
|
|
|
174
174
|
type: string | Record<string, TExportType>;
|
|
175
175
|
};
|
|
176
176
|
|
|
177
|
-
declare interface TFunction<TInputs extends TObject = TObject, TOutput extends TSchema = TUnknown> {
|
|
178
|
-
type: EVarType.function;
|
|
177
|
+
declare interface TFunction<TInputs extends TObject = TObject, TOutput extends TSchema = TUnknown, TPromise extends boolean = false> {
|
|
179
178
|
inputs: TInputs;
|
|
180
179
|
output: TOutput;
|
|
181
|
-
static: StaticFunction<TInputs, TOutput>;
|
|
180
|
+
static: StaticFunction<TInputs, TOutput, TPromise>;
|
|
181
|
+
type: EVarType.function;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
declare interface TInterface<T = unknown> {
|
|
185
|
-
type: EVarType.interface;
|
|
186
185
|
class?: new (...args: any) => T;
|
|
187
186
|
className: string;
|
|
188
187
|
static: T;
|
|
188
|
+
type: EVarType.interface;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
declare interface TNumber {
|
|
192
|
-
type: EVarType.number;
|
|
193
192
|
static: number;
|
|
193
|
+
type: EVarType.number;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
declare interface TObject<T extends TProperties = TProperties> {
|
|
197
|
-
type: EVarType.object;
|
|
198
197
|
properties: T;
|
|
199
198
|
static: StaticObject<T>;
|
|
199
|
+
type: EVarType.object;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
declare type TProperties = Record<string, TSchema>;
|
|
203
203
|
|
|
204
204
|
declare interface TRecord<TKey extends TString | TNumber = TString, TValue extends TSchema = TSchema> {
|
|
205
|
-
type: EVarType.record;
|
|
206
205
|
key: TKey;
|
|
207
206
|
static: StaticRecord<TKey, TValue>;
|
|
207
|
+
type: EVarType.record;
|
|
208
208
|
value: TValue;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
declare type TSchema<TLogic extends TAnyLogic = TAnyLogic> = TArguments & TLogic;
|
|
212
212
|
|
|
213
213
|
declare interface TString {
|
|
214
|
-
type: EVarType.string;
|
|
215
214
|
static: string;
|
|
215
|
+
type: EVarType.string;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
declare interface TType<T extends TSchema = TSchema> {
|
|
219
|
-
type: EVarType.type;
|
|
220
219
|
static: T;
|
|
221
220
|
target: Array<string>;
|
|
221
|
+
type: EVarType.type;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
declare interface TUndefined {
|
|
225
|
-
type: EVarType.undefined;
|
|
226
225
|
static: undefined;
|
|
226
|
+
type: EVarType.undefined;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
declare interface TUnion<T extends Array<TSchema> = Array<TSchema>> {
|
|
230
|
-
type: EVarType.union;
|
|
231
230
|
elements: T;
|
|
232
231
|
static: StaticUnion<T>;
|
|
232
|
+
type: EVarType.union;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
declare interface TUnknown {
|
|
236
|
-
type: EVarType.unknown;
|
|
237
236
|
static: unknown;
|
|
237
|
+
type: EVarType.unknown;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
declare interface TVoid {
|
|
241
|
-
type: EVarType.void;
|
|
242
241
|
static: void;
|
|
242
|
+
type: EVarType.void;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
export { }
|