@animaapp/anima-sdk 0.3.4 → 0.3.5
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/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +199 -186
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -118,16 +118,13 @@ export declare const createCodegenResponseEventStream: (anima: Anima, params: Ge
|
|
|
118
118
|
export declare const createCodegenStream: (anima: Anima, params: GetCodeParams) => ReadableStream<StreamCodgenMessage>;
|
|
119
119
|
|
|
120
120
|
export declare type FigmaApiError = {
|
|
121
|
-
cause
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
cause: {
|
|
122
|
+
message?: string;
|
|
123
|
+
body: {
|
|
124
|
+
err: string;
|
|
125
|
+
status: number;
|
|
125
126
|
};
|
|
126
127
|
};
|
|
127
|
-
body?: {
|
|
128
|
-
status?: number;
|
|
129
|
-
reason?: string;
|
|
130
|
-
};
|
|
131
128
|
};
|
|
132
129
|
|
|
133
130
|
export declare type FigmaApiErrorType = "FigmaTokenIssue" | "RateLimitExceeded" | "NotFound" | "UnknownFigmaApiException";
|
|
@@ -142,9 +139,10 @@ export declare type FigmaPage = {
|
|
|
142
139
|
export declare class FigmaTokenIssue extends Error {
|
|
143
140
|
fileKey: string;
|
|
144
141
|
reason: string;
|
|
145
|
-
constructor({ fileKey, reason }: {
|
|
142
|
+
constructor({ fileKey, reason, cause, }: {
|
|
146
143
|
fileKey: string;
|
|
147
144
|
reason: string;
|
|
145
|
+
cause?: unknown;
|
|
148
146
|
});
|
|
149
147
|
}
|
|
150
148
|
|
|
@@ -246,8 +244,6 @@ export declare const getRelatedScreenFiles: ({ files, screenPath, }: {
|
|
|
246
244
|
screenPath?: string;
|
|
247
245
|
}) => AnimaFiles;
|
|
248
246
|
|
|
249
|
-
export declare const handleFigmaApiError: (error: FigmaApiError, fileKey: string) => never;
|
|
250
|
-
|
|
251
247
|
declare type InvalidNodeForCodegenReason = "Selected node is a page with multiple children" | "There is no node with the given id" | "Selected node type is not supported";
|
|
252
248
|
|
|
253
249
|
export declare const isFigmaTokenIssue: (error: Error) => boolean;
|
|
@@ -267,15 +263,17 @@ export declare const isValidFigmaUrl: (figmaLink: string) => [hasCorrectPrefix:
|
|
|
267
263
|
|
|
268
264
|
export declare class NotFound extends Error {
|
|
269
265
|
fileKey: string;
|
|
270
|
-
constructor({ fileKey }: {
|
|
266
|
+
constructor({ fileKey, cause }: {
|
|
271
267
|
fileKey: string;
|
|
268
|
+
cause?: unknown;
|
|
272
269
|
});
|
|
273
270
|
}
|
|
274
271
|
|
|
275
272
|
export declare class RateLimitExceeded extends Error {
|
|
276
273
|
fileKey: string;
|
|
277
|
-
constructor({ fileKey }: {
|
|
274
|
+
constructor({ fileKey, cause }: {
|
|
278
275
|
fileKey: string;
|
|
276
|
+
cause?: unknown;
|
|
279
277
|
});
|
|
280
278
|
}
|
|
281
279
|
|
|
@@ -370,4 +368,6 @@ declare type ValidateNodeForCodegenResult = {
|
|
|
370
368
|
|
|
371
369
|
export declare const validateSettings: (obj: unknown) => CodegenSettings;
|
|
372
370
|
|
|
371
|
+
export declare const wrapFigmaApiError: (error: FigmaApiError, fileKey: string) => Error;
|
|
372
|
+
|
|
373
373
|
export { }
|