@builder.io/ai-utils 0.0.76 → 0.1.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 +3 -0
- package/package.json +1 -1
- package/src/codegen.ts +380 -0
- package/src/completion.ts +174 -0
- package/src/events.ts +444 -0
- package/src/mapping.ts +98 -0
- package/src/messages.ts +238 -0
- package/src/settings.ts +59 -0
- package/src/codegen.d.ts +0 -92
- package/src/codegen.js +0 -1
- package/src/completion.d.ts +0 -153
- package/src/completion.js +0 -1
- package/src/events.d.ts +0 -369
- package/src/events.js +0 -1
- package/src/index.js +0 -6
- package/src/mapping.d.ts +0 -86
- package/src/mapping.js +0 -1
- package/src/messages.d.ts +0 -144
- package/src/messages.js +0 -16
- package/src/settings.d.ts +0 -23
- package/src/settings.js +0 -31
- /package/src/{index.d.ts → index.ts} +0 -0
package/src/events.ts
ADDED
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import type { BuilderContent, BuilderElement } from "@builder.io/sdk";
|
|
2
|
+
import type { AssistantMessage } from "./messages.js";
|
|
3
|
+
import type { AssistantSettings } from "./settings.js";
|
|
4
|
+
|
|
5
|
+
export type BuilderAssistantEventHandler = (ev: BuilderAssistantEvent) => void;
|
|
6
|
+
|
|
7
|
+
export type BuilderAssistantEvent =
|
|
8
|
+
| AssistantCompletionResultEvent
|
|
9
|
+
| AssistantErrorEvent
|
|
10
|
+
| AssistantStreamErrorEvent
|
|
11
|
+
| AppCloseEvent
|
|
12
|
+
| AppMessagesClickEvent
|
|
13
|
+
| AppMessagesGenerationEvent
|
|
14
|
+
| AppMessageEditCustomInstructionsEvent
|
|
15
|
+
| AppPromptAbortEvent
|
|
16
|
+
| AppPromptFocusEvent
|
|
17
|
+
| AppPromptSubmitEvent
|
|
18
|
+
| AppReadyEvent
|
|
19
|
+
| AppSettingsSetEvent
|
|
20
|
+
| AppThreadNewEvent
|
|
21
|
+
| AssistantStatsEvent
|
|
22
|
+
| AssistantThemeEvent
|
|
23
|
+
| BuilderEditorAuthEvent
|
|
24
|
+
| BuilderEditorStateEvent
|
|
25
|
+
| ContentUpdateEvent
|
|
26
|
+
| ContentApplySnapshotEvent
|
|
27
|
+
| ModelUndoEvent
|
|
28
|
+
| ModelRedoEvent
|
|
29
|
+
| ResultEvent
|
|
30
|
+
| ThreadCreatedEvent
|
|
31
|
+
| ThreadMessageCompletedEvent
|
|
32
|
+
| ThreadMessageCreatedEvent
|
|
33
|
+
| ThreadMessageDeltaEvent
|
|
34
|
+
| ThreadMessageFeedbackEvent
|
|
35
|
+
| ThreadRunStepCreatedEvent
|
|
36
|
+
| ThreadRunStepDeltaEvent
|
|
37
|
+
| AppAcceptChangeEvent
|
|
38
|
+
| AppAcceptRejectEvent
|
|
39
|
+
| AssistantTrackEvent
|
|
40
|
+
| AssistantEditorAuthMessage
|
|
41
|
+
| AppAttachmentTemplateEvent
|
|
42
|
+
| ThreadMessageRetryEvent
|
|
43
|
+
| AppFigmaImportEvent
|
|
44
|
+
| AppWebImportEvent
|
|
45
|
+
| AppAiTemplatesEvent;
|
|
46
|
+
|
|
47
|
+
export interface AssistantCompletionResultEvent {
|
|
48
|
+
type: "assistant.result";
|
|
49
|
+
data: {
|
|
50
|
+
content?: BuilderContent;
|
|
51
|
+
stats?: AssistantStats;
|
|
52
|
+
};
|
|
53
|
+
resolveId?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface AssistantError {
|
|
57
|
+
message: string;
|
|
58
|
+
status?: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface AssistantErrorEvent {
|
|
62
|
+
type: "assistant.error";
|
|
63
|
+
data: AssistantError;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface AssistantStreamErrorEvent {
|
|
67
|
+
type: "assistant.stream.error";
|
|
68
|
+
data: AssistantError;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface AppFigmaImportEvent {
|
|
72
|
+
type: "assistant.app.figmaImport";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface AppWebImportEvent {
|
|
76
|
+
type: "assistant.app.webImport";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface AppAiTemplatesEvent {
|
|
80
|
+
type: "assistant.app.aiTemplates";
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface AssistantTrackEvent {
|
|
84
|
+
type: "assistant.track";
|
|
85
|
+
data: {
|
|
86
|
+
name: string;
|
|
87
|
+
properties: Record<string, any>;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface AssistantThemeEvent {
|
|
92
|
+
type: "assistant.app.theme.update";
|
|
93
|
+
data: {
|
|
94
|
+
theme: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface AppCloseEvent {
|
|
99
|
+
type: "assistant.app.close";
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface AppMessagesClickEvent {
|
|
103
|
+
type: "assistant.app.messages.click";
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface AppAcceptChangeEvent {
|
|
107
|
+
type: "assistant.app.change.accept";
|
|
108
|
+
}
|
|
109
|
+
export interface AppAcceptRejectEvent {
|
|
110
|
+
type: "assistant.app.change.reject";
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface AppMessageEditCustomInstructionsEvent {
|
|
114
|
+
type: "assistant.app.messages.editCustomInstructions";
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface AppAttachmentTemplateEvent {
|
|
118
|
+
type: "assistant.app.attachment.template";
|
|
119
|
+
data: {
|
|
120
|
+
id: number;
|
|
121
|
+
name: string;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface AppMessagesGenerationEvent {
|
|
126
|
+
type: "assistant.app.messages.generation";
|
|
127
|
+
data: {
|
|
128
|
+
state: GenerationState;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* idle: no messages are being generated or queued to be generated
|
|
134
|
+
*
|
|
135
|
+
* queued: messages have been sent to the LLM, but no response has been received yet
|
|
136
|
+
*
|
|
137
|
+
* generating: messages are actively being generated and streaming back to the UI
|
|
138
|
+
*/
|
|
139
|
+
export type GenerationState = "idle" | "queued" | "generating";
|
|
140
|
+
|
|
141
|
+
export interface AppPromptAbortEvent {
|
|
142
|
+
type: "assistant.app.prompt.abort";
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface AppPromptFocusEvent {
|
|
146
|
+
type: "assistant.app.prompt.focus";
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface AppPromptSubmitEvent {
|
|
150
|
+
type: "assistant.app.prompt.submit";
|
|
151
|
+
data: {
|
|
152
|
+
prompt: string;
|
|
153
|
+
attachments: any[];
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface AppReadyEvent {
|
|
158
|
+
type: "assistant.app.ready";
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface AppSettingsSetEvent {
|
|
162
|
+
type: "assistant.app.settings.set";
|
|
163
|
+
data: Partial<AssistantSettings>;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface AppThreadNewEvent {
|
|
167
|
+
type: "assistant.app.thread.new";
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface AssistantEditorAuthMessage {
|
|
171
|
+
type: "assistant.editor.auth.update";
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface BuilderEditorAuthEvent extends AwaitResultEvent {
|
|
175
|
+
type: "assistant.editor.auth";
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface BuilderEditorStateEvent extends AwaitResultEvent {
|
|
179
|
+
type: "assistant.editor.state";
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface AwaitResultEvent {
|
|
183
|
+
resolveId?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface ResultEvent {
|
|
187
|
+
type: "assistant.result";
|
|
188
|
+
resolveId: string;
|
|
189
|
+
data: any;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface ContentCreatePatch {
|
|
193
|
+
parentId: string;
|
|
194
|
+
insertBeforeId: string;
|
|
195
|
+
element: BuilderElement;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface ContentApplySnapshot {
|
|
199
|
+
/**
|
|
200
|
+
* The id of the BuilderContent to apply the snapshot to
|
|
201
|
+
*/
|
|
202
|
+
id: string;
|
|
203
|
+
/**
|
|
204
|
+
* Each snapshot can be either a full BuilderContent or individual BuilderElements.
|
|
205
|
+
* Order matters, as the snapshots will be applied in the order they are listed.
|
|
206
|
+
* The builder app will handle the logic of applying the snapshots in the correct order
|
|
207
|
+
* and to the right content/elements.
|
|
208
|
+
*/
|
|
209
|
+
snapshots: (BuilderElement | BuilderContent)[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface ContentApplySnapshotEvent {
|
|
213
|
+
type: "assistant.content.applysnapshot";
|
|
214
|
+
data: ContentApplySnapshot;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface ContentUpdateEvent {
|
|
218
|
+
type: "assistant.content.update";
|
|
219
|
+
data: ContentUpdatePatch[];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export type ContentUpdatePatch = ContentTsUpdateComponentPatch;
|
|
223
|
+
|
|
224
|
+
interface ContentPatchBase {
|
|
225
|
+
id: string;
|
|
226
|
+
nodeId?: string;
|
|
227
|
+
builderId?: string;
|
|
228
|
+
description?: string;
|
|
229
|
+
value: string;
|
|
230
|
+
displayValue?: string;
|
|
231
|
+
ts: number;
|
|
232
|
+
/**
|
|
233
|
+
* A change value is considered incomplete until we also parsed it's closing xml tag.
|
|
234
|
+
*/
|
|
235
|
+
incomplete?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* If there was an error applying the patch, this will contain the error message.
|
|
238
|
+
*/
|
|
239
|
+
error?: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface ContentTsUpdateComponentPatch extends ContentPatchBase {
|
|
243
|
+
type: "update_component";
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export interface AssistantStatsEvent {
|
|
247
|
+
type: "assistant.stats";
|
|
248
|
+
data: AssistantStats;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface AssistantStats {
|
|
252
|
+
/**
|
|
253
|
+
* The unique id of the thread (not the openai threadId)
|
|
254
|
+
*/
|
|
255
|
+
threadId: string;
|
|
256
|
+
/**
|
|
257
|
+
* The unique id of the completion, which is a combination of the user's prompt and assistant's response.
|
|
258
|
+
*/
|
|
259
|
+
completionId: string;
|
|
260
|
+
/**
|
|
261
|
+
* The model id used to generate this completion.
|
|
262
|
+
*/
|
|
263
|
+
modelId: string;
|
|
264
|
+
/**
|
|
265
|
+
* The assistant's response message.
|
|
266
|
+
*/
|
|
267
|
+
assistantMessage: string;
|
|
268
|
+
/**
|
|
269
|
+
* The user's prompt message.
|
|
270
|
+
*/
|
|
271
|
+
userMessage: string;
|
|
272
|
+
/**
|
|
273
|
+
* The index within the thread the assistant message is.
|
|
274
|
+
* For a first assistant message, the index will be 1 (the user message is index 0).
|
|
275
|
+
* For a second assistant message, the index will be 3 (the user message is index 2), and so on.
|
|
276
|
+
*/
|
|
277
|
+
assistantMessageIndex: number;
|
|
278
|
+
/**
|
|
279
|
+
* The timestamp (Date.now()) of when the user first submitted their prompt.
|
|
280
|
+
*/
|
|
281
|
+
userPromptMs: number;
|
|
282
|
+
/**
|
|
283
|
+
* The timestamp of the first assistant chunk in the response.
|
|
284
|
+
*/
|
|
285
|
+
firstChunkMs: number;
|
|
286
|
+
/**
|
|
287
|
+
* The timestamp of the last assistant chunk in the response.
|
|
288
|
+
*/
|
|
289
|
+
lastChunkMs: number;
|
|
290
|
+
/**
|
|
291
|
+
* The total number of chunks in the assistant's streamed response.
|
|
292
|
+
*/
|
|
293
|
+
chunkCount: number;
|
|
294
|
+
/**
|
|
295
|
+
* The total number of characters in the generated prompt sent to the LLM.
|
|
296
|
+
*/
|
|
297
|
+
promptLength: number;
|
|
298
|
+
/**
|
|
299
|
+
* The total number of characters in the assistant's response.
|
|
300
|
+
*/
|
|
301
|
+
completionLength: number;
|
|
302
|
+
/**
|
|
303
|
+
* If the user provided custom instructions for the prompt.
|
|
304
|
+
*/
|
|
305
|
+
hasCustomInstructions: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* The deployed version.
|
|
308
|
+
*/
|
|
309
|
+
version: string;
|
|
310
|
+
/**
|
|
311
|
+
* Error message if there was one.
|
|
312
|
+
*/
|
|
313
|
+
errorMessage?: string;
|
|
314
|
+
/**
|
|
315
|
+
* Input tokens
|
|
316
|
+
*/
|
|
317
|
+
inputTokens?: number;
|
|
318
|
+
/**
|
|
319
|
+
* Output tokens
|
|
320
|
+
*/
|
|
321
|
+
outputTokens?: number;
|
|
322
|
+
/**
|
|
323
|
+
* Output tokens
|
|
324
|
+
*/
|
|
325
|
+
completionCost?: number;
|
|
326
|
+
/**
|
|
327
|
+
* Number of streamed snapshots
|
|
328
|
+
*/
|
|
329
|
+
streamedSnapshots?: number;
|
|
330
|
+
/**
|
|
331
|
+
* Number of cached input tokens
|
|
332
|
+
*/
|
|
333
|
+
cacheInputTokens?: number;
|
|
334
|
+
/**
|
|
335
|
+
* Number of cached created tokens
|
|
336
|
+
*/
|
|
337
|
+
cacheCreatedTokens?: number;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export interface ModelUndoEvent {
|
|
341
|
+
type: "assistant.model.undo";
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface ModelRedoEvent {
|
|
345
|
+
type: "assistant.model.redo";
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export interface BuilderModel {
|
|
349
|
+
name?: string;
|
|
350
|
+
friendlyName?: string;
|
|
351
|
+
description?: string;
|
|
352
|
+
type?: string;
|
|
353
|
+
fields?: BuilderModelField[];
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export interface BuilderModelField {
|
|
357
|
+
name?: string;
|
|
358
|
+
type?: string;
|
|
359
|
+
description?: string;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export interface ThreadMessageFeedbackEvent {
|
|
363
|
+
type: "assistant.thread.message.feedback";
|
|
364
|
+
data: CompletionResponseFeedback;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface CompletionResponseFeedback {
|
|
368
|
+
userId: string;
|
|
369
|
+
builderUserId?: string;
|
|
370
|
+
builderEmail?: string;
|
|
371
|
+
responseId?: string;
|
|
372
|
+
frontendUrl: string | undefined;
|
|
373
|
+
frontendCommitId: string | undefined;
|
|
374
|
+
backendDomain?: string;
|
|
375
|
+
backendCommitId: string | undefined;
|
|
376
|
+
feedbackText: string;
|
|
377
|
+
sentiment?: "positive" | "negative";
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export interface ThreadCreatedEvent {
|
|
381
|
+
type: "assistant.thread.created";
|
|
382
|
+
data: ThreadCreated;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export interface ThreadCreated {
|
|
386
|
+
platformId: string;
|
|
387
|
+
threadId: string;
|
|
388
|
+
vectorStoreId: string;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export interface ThreadMessageCreatedEvent {
|
|
392
|
+
type: "assistant.thread.message.created";
|
|
393
|
+
data: ThreadMessageCreated;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export interface ThreadMessageCreated {
|
|
397
|
+
id: string;
|
|
398
|
+
responseId: string;
|
|
399
|
+
threadId: string;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export interface ThreadMessageDeltaEvent {
|
|
403
|
+
type: "assistant.thread.message.delta";
|
|
404
|
+
data: ThreadMessageDelta;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export interface ThreadMessageDelta {
|
|
408
|
+
id: string;
|
|
409
|
+
text: string;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export interface ThreadMessageCompletedEvent {
|
|
413
|
+
type: "assistant.thread.message.completed";
|
|
414
|
+
data: ThreadMessageCompleted;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface ThreadMessageRetryEvent {
|
|
418
|
+
type: "assistant.thread.message.retry";
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export interface ThreadMessageCompleted extends AssistantMessage {
|
|
422
|
+
platformId: string;
|
|
423
|
+
threadId: string;
|
|
424
|
+
commitId?: string;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export interface ThreadRunStepDeltaEvent {
|
|
428
|
+
type: "assistant.thread.run.step.delta";
|
|
429
|
+
data: ThreadMessageStepDelta;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export interface ThreadMessageStepDelta {
|
|
433
|
+
delta: any;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export interface ThreadRunStepCreatedEvent {
|
|
437
|
+
type: "assistant.thread.run.step.created";
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export type DeepPartial<T> = T extends object
|
|
441
|
+
? {
|
|
442
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
443
|
+
}
|
|
444
|
+
: T;
|
package/src/mapping.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { ESMImport } from "./codegen";
|
|
2
|
+
|
|
3
|
+
export interface RawFigmaJson {
|
|
4
|
+
documents: any[];
|
|
5
|
+
document?: any;
|
|
6
|
+
components?: Record<string, any>;
|
|
7
|
+
styles?: Record<string, any>;
|
|
8
|
+
componentSets?: Record<string, any>;
|
|
9
|
+
schemaVersion?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface UserContext {
|
|
13
|
+
client: string;
|
|
14
|
+
clientVersion: string;
|
|
15
|
+
nodeVersion: string;
|
|
16
|
+
systemPlatform: string;
|
|
17
|
+
frameworks: string[];
|
|
18
|
+
systemEOL: string;
|
|
19
|
+
systemArch: string;
|
|
20
|
+
systemShell?: string;
|
|
21
|
+
inGitRepo?: boolean;
|
|
22
|
+
[key: string]: string | string[] | boolean | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type ExportType = "default" | "named";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Gets the latest component mappings for a space
|
|
29
|
+
*/
|
|
30
|
+
export interface FigmaMappingsData {
|
|
31
|
+
id: string;
|
|
32
|
+
figmaBuilderLinks: FigmaBuilderLink[];
|
|
33
|
+
framework: string;
|
|
34
|
+
version?: number;
|
|
35
|
+
createdDate?: string; // ISO string timestamp or unix timestamp
|
|
36
|
+
local: boolean;
|
|
37
|
+
userEmail?: string;
|
|
38
|
+
remoteUrl?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface FigmaBuilderLink {
|
|
42
|
+
builderName: string;
|
|
43
|
+
figmaName: string;
|
|
44
|
+
figmaKey: string;
|
|
45
|
+
figmaUrl?: string;
|
|
46
|
+
inputMapper?: string;
|
|
47
|
+
originalInputMapper?: string;
|
|
48
|
+
exportType?: ExportType;
|
|
49
|
+
importName?: string;
|
|
50
|
+
importPath?: string;
|
|
51
|
+
source: string;
|
|
52
|
+
loc?: string;
|
|
53
|
+
imports?: ESMImport[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface FigmaMapperFile {
|
|
57
|
+
filePath: string;
|
|
58
|
+
content: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface PublishedMapping {
|
|
62
|
+
figmaBuilderLinks: FigmaBuilderLink[];
|
|
63
|
+
mapperFiles: FigmaMapperFile[];
|
|
64
|
+
|
|
65
|
+
// Meta data
|
|
66
|
+
remoteUrl?: string;
|
|
67
|
+
defaultBranch?: string;
|
|
68
|
+
currentBranch?: string;
|
|
69
|
+
commit?: string;
|
|
70
|
+
spaceKind?: string;
|
|
71
|
+
|
|
72
|
+
userContext?: UserContext;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface FigmaComponentInfo {
|
|
76
|
+
documentName: string;
|
|
77
|
+
key: string;
|
|
78
|
+
tree?: string;
|
|
79
|
+
jsx?: string;
|
|
80
|
+
type: string;
|
|
81
|
+
name: string;
|
|
82
|
+
exportJson?: any;
|
|
83
|
+
inputs: FigmaComponentInput[];
|
|
84
|
+
description: string;
|
|
85
|
+
documentationLinks: string[];
|
|
86
|
+
instanceId: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface FigmaComponentInput {
|
|
90
|
+
id: string;
|
|
91
|
+
name: string;
|
|
92
|
+
value?: any;
|
|
93
|
+
type: string;
|
|
94
|
+
baseType: "text" | "variant" | "boolean" | "slot";
|
|
95
|
+
variantOptions?: string[];
|
|
96
|
+
isDefault: boolean;
|
|
97
|
+
ref?: string;
|
|
98
|
+
}
|