@animaapp/anima-sdk-react 0.12.0 → 0.13.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 +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -5
- package/dist/index.js +1013 -935
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { GetCodeFromWebsiteParams } from '@animaapp/anima-sdk';
|
|
|
7
7
|
import { GetCodeParams } from '@animaapp/anima-sdk';
|
|
8
8
|
import { GetFileResponse } from '@figma/rest-api-spec';
|
|
9
9
|
import { GetLink2CodeParams } from '@animaapp/anima-sdk';
|
|
10
|
+
import { JobType } from '@animaapp/anima-sdk';
|
|
10
11
|
import { JSX } from 'react/jsx-runtime';
|
|
11
12
|
import { ProgressMessage } from '@animaapp/anima-sdk';
|
|
12
13
|
import { ReactNode } from 'react';
|
|
@@ -15,11 +16,16 @@ export declare const AnimaSdkContext: Context<AnimaSdkContextType | null>;
|
|
|
15
16
|
|
|
16
17
|
declare type AnimaSdkContextType = {
|
|
17
18
|
createJob: <T extends UseAnimaParams = UseAnimaParams>(type: JobType, params: T) => Promise<void>;
|
|
19
|
+
attachJob: <T extends UseAnimaParams = UseAnimaParams>(sessionId: string, params: T) => Promise<void>;
|
|
18
20
|
job: Job;
|
|
19
21
|
figmaRestApi: FigmaRestApi;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
|
-
export declare function AnimaSdkProvider({ figmaRestApi, f2cUrl, l2cUrl, p2cUrl, children }: Props): JSX.Element;
|
|
24
|
+
export declare function AnimaSdkProvider({ figmaRestApi, f2cUrl, l2cUrl, p2cUrl, jobsUrl, children }: Props): JSX.Element;
|
|
25
|
+
|
|
26
|
+
export declare class AttachJobError extends Error {
|
|
27
|
+
constructor(message: string, cause: unknown);
|
|
28
|
+
}
|
|
23
29
|
|
|
24
30
|
export declare class CreateJobError extends Error {
|
|
25
31
|
constructor(message: string, cause: unknown);
|
|
@@ -56,8 +62,6 @@ declare type Job = {
|
|
|
56
62
|
progressMessages: ProgressMessage[];
|
|
57
63
|
};
|
|
58
64
|
|
|
59
|
-
declare type JobType = 'f2c' | 'l2c' | 'p2c';
|
|
60
|
-
|
|
61
65
|
declare type LocalAssetsStorage = {
|
|
62
66
|
strategy: "local";
|
|
63
67
|
path: string;
|
|
@@ -72,6 +76,7 @@ declare type Props = {
|
|
|
72
76
|
f2cUrl: string;
|
|
73
77
|
l2cUrl: string;
|
|
74
78
|
p2cUrl: string;
|
|
79
|
+
jobsUrl?: string;
|
|
75
80
|
children: ReactNode;
|
|
76
81
|
};
|
|
77
82
|
|
|
@@ -88,9 +93,9 @@ export declare const useAnimaCodegen: ({ url, method, }: {
|
|
|
88
93
|
}) => {
|
|
89
94
|
getCode: <T extends UseAnimaParams = UseAnimaParams>(params: T) => Promise<{
|
|
90
95
|
result: null;
|
|
91
|
-
error: CodegenError;
|
|
96
|
+
error: CodegenError | null;
|
|
92
97
|
} | {
|
|
93
|
-
result: AnimaSDKResult
|
|
98
|
+
result: AnimaSDKResult;
|
|
94
99
|
error: null;
|
|
95
100
|
}>;
|
|
96
101
|
status: "idle" | "pending" | "success" | "aborted" | "error";
|