@animaapp/anima-sdk 0.25.0 → 0.27.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/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +1237 -1197
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare class Anima {
|
|
|
15
15
|
protected get headers(): Record<string, string>;
|
|
16
16
|
generateCode(params: GetCodeParams, handler?: GetCodeHandler, signal?: AbortSignal): Promise<AnimaSDKResult>;
|
|
17
17
|
generateCodeFromWebsite(params: GetCodeFromWebsiteParams, handler?: GetCodeFromWebsiteHandler, signal?: AbortSignal): Promise<AnimaSDKResult>;
|
|
18
|
+
discoverSubpages(params: DiscoverSubpagesParams, signal?: AbortSignal): Promise<DiscoverSubpagesResult>;
|
|
18
19
|
/**
|
|
19
20
|
* Generates code from a text prompt using AI.
|
|
20
21
|
*
|
|
@@ -66,6 +67,11 @@ export declare type AnimaSDKResult = BaseResult & {
|
|
|
66
67
|
name: string;
|
|
67
68
|
url: string;
|
|
68
69
|
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Image-mode only.
|
|
72
|
+
*/
|
|
73
|
+
viewport?: ImageToCodeViewport;
|
|
74
|
+
viewportReason?: string;
|
|
69
75
|
};
|
|
70
76
|
|
|
71
77
|
export declare type AssetsStorage = {
|
|
@@ -125,7 +131,7 @@ export declare class CodegenError extends Error {
|
|
|
125
131
|
detail?: unknown;
|
|
126
132
|
constructor({ name, reason, status, detail, }: {
|
|
127
133
|
name: string;
|
|
128
|
-
reason: CommonApiError | GetCodeFromFigmaErrorReason | CodegenRouteErrorReason | SDKErrorReason | GetCodeFromWebsiteErrorReason | GetCodeFromPromptErrorReason;
|
|
134
|
+
reason: CommonApiError | GetCodeFromFigmaErrorReason | CodegenRouteErrorReason | SDKErrorReason | GetCodeFromWebsiteErrorReason | DiscoverSubpagesErrorReason | GetCodeFromPromptErrorReason;
|
|
129
135
|
status?: number;
|
|
130
136
|
detail?: unknown;
|
|
131
137
|
});
|
|
@@ -280,6 +286,19 @@ export declare const createLink2CodeResponseEventStream: (anima: Anima, params:
|
|
|
280
286
|
*/
|
|
281
287
|
export declare const createLink2CodeStream: (anima: Anima, params: GetLink2CodeParams) => ReadableStream<StreamL2CMessage>;
|
|
282
288
|
|
|
289
|
+
/**
|
|
290
|
+
* Errors from website subpage discovery.
|
|
291
|
+
*/
|
|
292
|
+
export declare type DiscoverSubpagesErrorReason = "Subpage discovery requires a paid plan" | "Website subpage discovery timed out after 10 seconds" | "Failed to discover website subpages";
|
|
293
|
+
|
|
294
|
+
export declare type DiscoverSubpagesParams = {
|
|
295
|
+
url: string;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export declare type DiscoverSubpagesResult = {
|
|
299
|
+
subpages: WebsiteSubpage[];
|
|
300
|
+
};
|
|
301
|
+
|
|
283
302
|
export declare class ExpiredFigmaToken extends Error {
|
|
284
303
|
constructor();
|
|
285
304
|
}
|
|
@@ -457,6 +476,7 @@ export declare type GetCodeFromWebsiteParams = {
|
|
|
457
476
|
}>;
|
|
458
477
|
dsId?: string;
|
|
459
478
|
htmlOptimizations?: GetCodeFromWebsiteHTMLOptimizations;
|
|
479
|
+
subpages?: WebsiteSubpage[];
|
|
460
480
|
experimental_useNewReactEngine?: boolean;
|
|
461
481
|
};
|
|
462
482
|
|
|
@@ -534,6 +554,8 @@ export declare const getRelatedScreenFiles: ({ files, screenPath, }: {
|
|
|
534
554
|
screenPath?: string;
|
|
535
555
|
}) => AnimaFiles;
|
|
536
556
|
|
|
557
|
+
export declare type ImageToCodeViewport = "desktop" | "mobile" | "tablet";
|
|
558
|
+
|
|
537
559
|
declare type InvalidNodeForCodegenReason = "Selected node is a page with multiple children" | "Selected node is a page with no valid children" | "There is no node with the given id" | "Selected node type is not supported";
|
|
538
560
|
|
|
539
561
|
/**
|
|
@@ -877,4 +899,8 @@ declare type ValidateNodeForCodegenResult = {
|
|
|
877
899
|
|
|
878
900
|
export declare const validateSettings: (obj: unknown) => CodegenSettings;
|
|
879
901
|
|
|
902
|
+
export declare type WebsiteSubpage = {
|
|
903
|
+
url: string;
|
|
904
|
+
};
|
|
905
|
+
|
|
880
906
|
export { }
|