@luna-park/plugin 1.3.0 → 1.4.0
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/bin/preview.js +50 -50
- package/dist/dist-hc-SHkAg.mjs +600 -0
- package/dist/extractor.d.mts +85 -0
- package/dist/extractor.mjs +611 -0
- package/dist/index-X3hhfmWd.d.mts +368 -0
- package/dist/index.d.mts +941 -0
- package/dist/index.mjs +887 -0
- package/dist/preview.d.mts +8 -0
- package/dist/preview.mjs +47 -0
- package/dist/style.css +8 -0
- package/package.json +35 -36
- package/dist/chunk-rCEYsGS8.cjs +0 -1
- package/dist/dist-BUZt4gnZ.js +0 -421
- package/dist/dist-BkSFkjuo.cjs +0 -5
- package/dist/extractor.cjs +0 -14
- package/dist/extractor.d.ts +0 -247
- package/dist/extractor.js +0 -512
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -1464
- package/dist/index.js +0 -2961
- package/dist/plugin.css +0 -2
- package/dist/preview.cjs +0 -1
- package/dist/preview.d.ts +0 -7
- package/dist/preview.js +0 -29
package/dist/extractor.d.ts
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { default as default_2 } from 'typescript';
|
|
2
|
-
import * as ts from 'typescript';
|
|
3
|
-
|
|
4
|
-
export declare class CTypeExport {
|
|
5
|
-
program: default_2.Program;
|
|
6
|
-
checker: default_2.TypeChecker;
|
|
7
|
-
index?: default_2.SourceFile;
|
|
8
|
-
private cache;
|
|
9
|
-
private result?;
|
|
10
|
-
constructor(program: default_2.Program);
|
|
11
|
-
get(target: string): TExportResult;
|
|
12
|
-
exportModule(module: default_2.Symbol): void;
|
|
13
|
-
exportComponent(name: string, type: default_2.Type): void;
|
|
14
|
-
exportFunction(name: string, signature: default_2.Signature): void;
|
|
15
|
-
extractType(type: default_2.Type, ctxNode?: default_2.Node): void;
|
|
16
|
-
typeToString(type: default_2.Type, flags?: number): string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare enum EVarType {
|
|
20
|
-
exec = "exec",
|
|
21
|
-
number = "number",
|
|
22
|
-
string = "string",
|
|
23
|
-
boolean = "boolean",
|
|
24
|
-
object = "object",
|
|
25
|
-
record = "record",
|
|
26
|
-
array = "array",
|
|
27
|
-
interface = "interface",
|
|
28
|
-
type = "type",
|
|
29
|
-
function = "function",
|
|
30
|
-
union = "union",
|
|
31
|
-
unknown = "unknown",
|
|
32
|
-
undefined = "undefined",
|
|
33
|
-
void = "void"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export declare function extractFile(filePath: string, target: string): Promise<void>;
|
|
37
|
-
|
|
38
|
-
export declare function generateNodes(exportResult: TExportResult, packageName?: string): TExportLogicResult;
|
|
39
|
-
|
|
40
|
-
export declare function getSourceFile(moduleName: string): {
|
|
41
|
-
program: ts.Program;
|
|
42
|
-
sourceFile: ts.SourceFile;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
declare type OptionalKeys<T extends TProperties> = {
|
|
46
|
-
[K in keyof T]: T[K] extends {
|
|
47
|
-
optional: true;
|
|
48
|
-
} ? K : never;
|
|
49
|
-
}[keyof T];
|
|
50
|
-
|
|
51
|
-
declare type RequiredKeys<T extends TProperties> = Exclude<keyof T, OptionalKeys<T>>;
|
|
52
|
-
|
|
53
|
-
declare type Static<T extends TSchema> = T extends {
|
|
54
|
-
optional: true;
|
|
55
|
-
} ? (T["static"] | undefined) : T["static"];
|
|
56
|
-
|
|
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
|
-
|
|
59
|
-
declare type StaticObject<T extends TProperties> = {
|
|
60
|
-
[K in RequiredKeys<T>]: Static<T[K]>;
|
|
61
|
-
} & {
|
|
62
|
-
[K in OptionalKeys<T>]?: Static<T[K]>;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
declare type StaticRecord<TKey extends TSchema, TValue extends TSchema> = Record<Static<TKey>, Static<TValue>>;
|
|
66
|
-
|
|
67
|
-
declare type StaticUnion<T extends Array<TSchema>> = {
|
|
68
|
-
[K in keyof T]: Static<T[K]>;
|
|
69
|
-
}[number];
|
|
70
|
-
|
|
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
|
-
|
|
73
|
-
declare interface TArguments<TType = unknown> {
|
|
74
|
-
build?: (arg: unknown) => unknown;
|
|
75
|
-
customizable?: boolean;
|
|
76
|
-
default?: TType | (() => TType);
|
|
77
|
-
defaultType?: TSchema;
|
|
78
|
-
description?: string;
|
|
79
|
-
dynamic?: ((arg: {
|
|
80
|
-
config: Record<string, unknown>;
|
|
81
|
-
inputs: Record<string, TSchema>;
|
|
82
|
-
outputs: Record<string, TSchema>;
|
|
83
|
-
}) => TSchema);
|
|
84
|
-
enum?: TEnum<TType>;
|
|
85
|
-
example?: unknown;
|
|
86
|
-
format?: "date-time" | "email" | "color";
|
|
87
|
-
multiple?: boolean;
|
|
88
|
-
name?: string;
|
|
89
|
-
optional?: boolean;
|
|
90
|
-
options?: {
|
|
91
|
-
access?: TSchema<TObject>;
|
|
92
|
-
format?: (arg: TType) => TType;
|
|
93
|
-
freeze?: boolean;
|
|
94
|
-
readonly?: boolean;
|
|
95
|
-
} & Record<string, unknown>;
|
|
96
|
-
parse?: (arg: unknown) => unknown;
|
|
97
|
-
placeholder?: string;
|
|
98
|
-
priority?: boolean;
|
|
99
|
-
promise?: boolean;
|
|
100
|
-
required?: boolean;
|
|
101
|
-
static?: unknown;
|
|
102
|
-
sub?: TSchema;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
declare interface TArray<T extends TSchema = TSchema> {
|
|
106
|
-
items: T;
|
|
107
|
-
static: Array<Static<T>>;
|
|
108
|
-
type: EVarType.array;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
declare interface TBoolean {
|
|
112
|
-
static: boolean;
|
|
113
|
-
type: EVarType.boolean;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
declare type TEnum<TEnumType> = Array<TEnumType> | Record<string, TEnumType>;
|
|
117
|
-
|
|
118
|
-
declare interface TExec {
|
|
119
|
-
type: EVarType.exec;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
declare type TExportComponent = {
|
|
123
|
-
emits?: Record<string, Array<TExportType>>;
|
|
124
|
-
models?: Record<string, TExportType>;
|
|
125
|
-
properties?: Record<string, TExportType>;
|
|
126
|
-
slots?: Record<string, TExportType>;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
declare type TExportFunction = {
|
|
130
|
-
description?: string;
|
|
131
|
-
parameters?: Array<{
|
|
132
|
-
default?: string;
|
|
133
|
-
description?: string;
|
|
134
|
-
name: string;
|
|
135
|
-
optional?: boolean;
|
|
136
|
-
type: string;
|
|
137
|
-
}>;
|
|
138
|
-
return: {
|
|
139
|
-
description?: string;
|
|
140
|
-
type: string;
|
|
141
|
-
};
|
|
142
|
-
type: string;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
declare type TExportLogicComponent = {
|
|
146
|
-
emits: Record<string, TSchema>;
|
|
147
|
-
models: Record<string, TSchema>;
|
|
148
|
-
properties: Record<string, TSchema>;
|
|
149
|
-
slots: Record<string, TSchema>;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
declare type TExportLogicResult = {
|
|
153
|
-
components: Record<string, TExportLogicComponent>;
|
|
154
|
-
functions: Record<string, TExportNodeFunction>;
|
|
155
|
-
types: Record<string, TSchema>;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
declare type TExportNodeFunction = {
|
|
159
|
-
description?: string;
|
|
160
|
-
name?: string;
|
|
161
|
-
parameters?: Array<TSchema>;
|
|
162
|
-
return?: TSchema;
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
declare type TExportResult = {
|
|
166
|
-
components: Record<string, TExportComponent>;
|
|
167
|
-
functions: Record<string, TExportFunction>;
|
|
168
|
-
types: Record<string, TExportType>;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
declare type TExportType = {
|
|
172
|
-
default?: string;
|
|
173
|
-
description?: string;
|
|
174
|
-
optional?: boolean;
|
|
175
|
-
properties?: Record<string, TExportType>;
|
|
176
|
-
type: string | Record<string, TExportType>;
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
declare interface TFunction<TInputs extends TObject = TObject, TOutput extends TSchema = TUnknown, TPromise extends boolean = false> {
|
|
180
|
-
inputs: TInputs;
|
|
181
|
-
output: TOutput;
|
|
182
|
-
static: StaticFunction<TInputs, TOutput, TPromise>;
|
|
183
|
-
type: EVarType.function;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
declare interface TInterface<T = unknown> {
|
|
187
|
-
class?: new (...args: any) => T;
|
|
188
|
-
className: string;
|
|
189
|
-
static: T;
|
|
190
|
-
type: EVarType.interface;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
declare interface TNumber {
|
|
194
|
-
static: number;
|
|
195
|
-
type: EVarType.number;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
declare interface TObject<T extends TProperties = TProperties> {
|
|
199
|
-
properties: T;
|
|
200
|
-
static: StaticObject<T>;
|
|
201
|
-
type: EVarType.object;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
declare type TProperties = Record<string, TSchema>;
|
|
205
|
-
|
|
206
|
-
declare interface TRecord<TKey extends TString | TNumber = TString, TValue extends TSchema = TSchema> {
|
|
207
|
-
key: TKey;
|
|
208
|
-
static: StaticRecord<TKey, TValue>;
|
|
209
|
-
type: EVarType.record;
|
|
210
|
-
value: TValue;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
declare type TSchema<TLogic extends TAnyLogic = TAnyLogic> = TArguments & TLogic;
|
|
214
|
-
|
|
215
|
-
declare interface TString {
|
|
216
|
-
static: string;
|
|
217
|
-
type: EVarType.string;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
declare interface TType<T extends TSchema = TSchema> {
|
|
221
|
-
static: T;
|
|
222
|
-
target: Array<string>;
|
|
223
|
-
type: EVarType.type;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
declare interface TUndefined {
|
|
227
|
-
static: undefined;
|
|
228
|
-
type: EVarType.undefined;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
declare interface TUnion<T extends Array<TSchema> = Array<TSchema>> {
|
|
232
|
-
elements: T;
|
|
233
|
-
static: StaticUnion<T>;
|
|
234
|
-
type: EVarType.union;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
declare interface TUnknown {
|
|
238
|
-
static: unknown;
|
|
239
|
-
type: EVarType.unknown;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
declare interface TVoid {
|
|
243
|
-
static: void;
|
|
244
|
-
type: EVarType.void;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export { }
|