@animaapp/anima-sdk-react 0.6.30 → 0.6.32

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.d.ts CHANGED
@@ -6,6 +6,37 @@ import { GetFileResponse } from '@figma/rest-api-spec';
6
6
  import { GetLink2CodeParams } from '@animaapp/anima-sdk';
7
7
  import { ProgressMessage } from '@animaapp/anima-sdk';
8
8
 
9
+ export declare type CodegenState = {
10
+ status: Status;
11
+ error: CodegenError | null;
12
+ result: AnimaSDKResult | null;
13
+ progressMessages: ProgressMessage[];
14
+ tasks: {
15
+ fetchDesign: {
16
+ status: TaskStatus;
17
+ };
18
+ codeGeneration: {
19
+ status: TaskStatus;
20
+ progress: number;
21
+ };
22
+ uploadAssets: {
23
+ status: TaskStatus;
24
+ };
25
+ };
26
+ jobSessionId: string | null;
27
+ jobStatus: Record<string, any>;
28
+ };
29
+
30
+ export declare const createJob: <T extends UseAnimaParams = UseAnimaParams>(url: string, method: string, params: T, stateUpdated: (state: CodegenState) => void) => Promise<{
31
+ result: null;
32
+ error: CodegenError;
33
+ } | {
34
+ result: AnimaSDKResult | null;
35
+ error: null;
36
+ }>;
37
+
38
+ export declare const initialProgress: CodegenState;
39
+
9
40
  declare type LocalAssetsStorage = {
10
41
  strategy: "local";
11
42
  path: string;
@@ -30,20 +61,20 @@ export declare const useAnimaCodegen: ({ url, method, }: {
30
61
  result: AnimaSDKResult | null;
31
62
  error: null;
32
63
  }>;
33
- status: Status;
64
+ status: "idle" | "pending" | "success" | "aborted" | "error";
34
65
  progressMessages: ProgressMessage[];
35
66
  jobSessionId: string | null;
36
67
  jobStatus: Record<string, any>;
37
68
  tasks: {
38
69
  fetchDesign: {
39
- status: TaskStatus;
70
+ status: "pending" | "running" | "finished";
40
71
  };
41
72
  codeGeneration: {
42
- status: TaskStatus;
73
+ status: "pending" | "running" | "finished";
43
74
  progress: number;
44
75
  };
45
76
  uploadAssets: {
46
- status: TaskStatus;
77
+ status: "pending" | "running" | "finished";
47
78
  };
48
79
  };
49
80
  error: CodegenError | null;