@series-inc/venus-sdk 2.2.1 → 2.4.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.
@@ -3,6 +3,64 @@ interface AnalyticsApi {
3
3
  trackFunnelStep(stepNumber: number, stepName: string, funnelName?: string): Promise<void>;
4
4
  }
5
5
 
6
+ interface RpcRequest {
7
+ type: 'rpc-request';
8
+ id: string;
9
+ method: string;
10
+ args?: any[];
11
+ }
12
+
13
+ interface RpcResponse {
14
+ type: 'rpc-response';
15
+ id: string;
16
+ method: string;
17
+ result?: any;
18
+ error?: {
19
+ message: string;
20
+ stack?: string;
21
+ };
22
+ }
23
+
24
+ interface RpcNotification {
25
+ type: 'rpc-notification';
26
+ id: string;
27
+ payload?: any;
28
+ }
29
+
30
+ type OnRequestCallback = (request: RpcRequest) => Promise<boolean>;
31
+ type OnResponseCallback = (response: RpcResponse) => Promise<boolean>;
32
+ type OnNotificationCallback = (notification: RpcNotification) => void;
33
+ interface RpcTransport {
34
+ onRequest(callback: OnRequestCallback): Subscription;
35
+ onResponse(callback: OnResponseCallback): Subscription;
36
+ onNotification(callback: OnNotificationCallback): Subscription;
37
+ sendRequest(request: RpcRequest): void;
38
+ sendResponse(response: RpcResponse): void;
39
+ }
40
+
41
+ interface Subscription {
42
+ unsubscribe: () => void;
43
+ }
44
+ declare class RpcClient {
45
+ private readonly pendingCalls;
46
+ private readonly notificationCallbacks;
47
+ private onResponseSub;
48
+ private onNotificationSub;
49
+ private transport;
50
+ start(transport: RpcTransport): void;
51
+ stop(): void;
52
+ onNotification<TPayload>(id: string, callback: (payload: TPayload) => void): Subscription;
53
+ callT<TArgs, TResult>(method: string, args: TArgs, timeout?: number): Promise<TResult>;
54
+ call<TResponse>(method: string, args?: any, timeout?: number): Promise<TResponse>;
55
+ private hasPendingCall;
56
+ private addPendingCall;
57
+ private removePendingCall;
58
+ private getPendingCall;
59
+ private generateId;
60
+ private handleRpcResponse;
61
+ private handleRpcNotification;
62
+ }
63
+
6
64
  interface NavigationStackInfo {
7
65
  isInStack: boolean;
8
66
  stackPosition: number;
@@ -26,6 +84,78 @@ interface NavigationApi {
26
84
  requestPopOrQuit(options?: QuitOptions): Promise<boolean>;
27
85
  }
28
86
 
87
+ type TimeIntervalTriggerInput = {
88
+ type: 'timeInterval';
89
+ seconds: number;
90
+ repeats?: boolean;
91
+ channelId?: string;
92
+ };
93
+ type DateTriggerInput = {
94
+ type: 'date';
95
+ date: string;
96
+ channelId?: string;
97
+ };
98
+ type CalendarTriggerInput = {
99
+ type: 'calendar';
100
+ year?: number;
101
+ month?: number;
102
+ day?: number;
103
+ hour?: number;
104
+ minute?: number;
105
+ second?: number;
106
+ repeats?: boolean;
107
+ channelId?: string;
108
+ };
109
+ type DailyTriggerInput = {
110
+ type: 'daily';
111
+ hour: number;
112
+ minute: number;
113
+ channelId?: string;
114
+ };
115
+ type WeeklyTriggerInput = {
116
+ type: 'weekly';
117
+ weekday: number;
118
+ hour: number;
119
+ minute: number;
120
+ channelId?: string;
121
+ };
122
+ type MonthlyTriggerInput = {
123
+ type: 'monthly';
124
+ day: number;
125
+ hour: number;
126
+ minute: number;
127
+ channelId?: string;
128
+ };
129
+ type YearlyTriggerInput = {
130
+ type: 'yearly';
131
+ month: number;
132
+ day: number;
133
+ hour: number;
134
+ minute: number;
135
+ channelId?: string;
136
+ };
137
+ type NotificationTriggerInput = null | TimeIntervalTriggerInput | DateTriggerInput | CalendarTriggerInput | DailyTriggerInput | WeeklyTriggerInput | MonthlyTriggerInput | YearlyTriggerInput;
138
+ interface ScheduleLocalNotificationOptions {
139
+ priority?: number;
140
+ groupId?: string;
141
+ payload?: Record<string, any>;
142
+ trigger?: NotificationTriggerInput;
143
+ }
144
+ interface ScheduleLocalNotification {
145
+ id: string;
146
+ title?: string | null;
147
+ body?: string | null;
148
+ payload?: Record<string, any>;
149
+ trigger?: NotificationTriggerInput;
150
+ }
151
+ interface NotificationsApi {
152
+ scheduleLocalNotification(title: string, body: string, options?: ScheduleLocalNotificationOptions): Promise<string | null>;
153
+ cancelLocalNotification(notificationId: string): Promise<boolean>;
154
+ getAllScheduledLocalNotifications(): Promise<ScheduleLocalNotification[]>;
155
+ isLocalNotificationsEnabled(): Promise<boolean>;
156
+ setLocalNotificationsEnabled(enabled: boolean): Promise<boolean>;
157
+ }
158
+
29
159
  interface ShowConfirmOptions {
30
160
  confirmText?: string;
31
161
  cancelText?: string;
@@ -184,12 +314,33 @@ interface LifecycleApi {
184
314
  onCleanup(callback: OnCleanupCallback): void;
185
315
  }
186
316
 
317
+ interface SharedAssetsApi {
318
+ loadCharactersBundle(): Promise<ArrayBuffer>;
319
+ loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
320
+ }
321
+
322
+ declare class RpcSharedAssetsApi implements SharedAssetsApi {
323
+ private readonly venusApi;
324
+ private readonly rpcClient;
325
+ constructor(rpcClient: RpcClient, venusApi: VenusAPI);
326
+ loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
327
+ loadCharactersBundle(): Promise<ArrayBuffer>;
328
+ }
329
+ interface LoadEmbeddedAssetsRequest {
330
+ assetKey: string;
331
+ }
332
+ interface LoadEmbeddedAssetsResponse {
333
+ base64Data: string;
334
+ }
335
+
187
336
  interface SpendCurrencyOptions {
188
337
  screenName?: string;
189
338
  }
190
339
  interface IapApi {
191
340
  getHardCurrencyBalance(): Promise<number>;
192
341
  spendCurrency(productId: string, amount: number, options?: SpendCurrencyOptions): Promise<void>;
342
+ openStore(): Promise<void>;
343
+ getCurrencyIcon(): Promise<LoadEmbeddedAssetsResponse>;
193
344
  }
194
345
 
195
346
  interface Avatar3dConfig {
@@ -624,13 +775,17 @@ interface VenusAPI {
624
775
  scheduleLocalNotifAsync(options: {
625
776
  title: string;
626
777
  body: string;
627
- timeFromNow: number;
778
+ timeFromNow?: number;
779
+ trigger?: NotificationTriggerInput;
780
+ priority?: number;
781
+ groupId?: string;
782
+ payload?: any;
628
783
  data?: any;
629
784
  sound?: string;
630
785
  badge?: number;
631
786
  }): Promise<string>;
632
787
  cancelLocalNotifAsync(notificationId: string): Promise<void>;
633
- getAllLocalNotifsAsync(): Promise<Array<any>>;
788
+ getAllLocalNotifsAsync(): Promise<ScheduleLocalNotification[]>;
634
789
  isLocalNotifEnabledAsync(): Promise<boolean>;
635
790
  setLocalNotifEnabledAsync(enabled: boolean): Promise<void>;
636
791
  showAvatar3dEditorAsync(options: {
@@ -681,12 +836,16 @@ interface VenusAPI {
681
836
  ai: AiApi;
682
837
  popups: PopupsApi;
683
838
  analytics: AnalyticsApi;
839
+ sharedAssets: SharedAssetsApi;
684
840
  }
685
841
 
686
842
  interface AdsApi {
843
+ /**
844
+ * @deprecated This is no longer needed. Do not use
845
+ */
687
846
  isRewardedAdReadyAsync(): Promise<boolean>;
688
847
  showRewardedAdAsync(): Promise<boolean>;
689
848
  showInterstitialAd(): Promise<boolean>;
690
849
  }
691
850
 
692
- export { type VenusConfig as $, type AnalyticsApi as A, type Avatar3dEdits as B, type CdnApi as C, type SubPath as D, type AiMessage as E, type FetchBlobOptions as F, type Asset as G, type HapticsApi as H, type IapApi as I, type Category as J, type Insets as K, type LifecycleApi as L, MockAvatarApi as M, type NavigationApi as N, type OnCleanupCallback as O, type PushAppOptions as P, type QuitOptions as Q, type RecipeRequirementResult as R, type ShowActionSheetOptions as S, type PostInfo as T, type VenusSimulationState as U, type VenusAPI as V, type VenusSimulationEffect as W, type VenusSimulationRecipe as X, type RecipeRequirementQuery as Y, type BatchRecipeRequirementsResult as Z, type VenusSimulationAPI as _, type NavigationStackInfo as a, type ActionSheetOption as a0, type PopupsApi as b, type ActionSheetItem as c, type ShowAlertOptions as d, type ShowConfirmOptions as e, type ShowToastOptions as f, type Profile as g, type AiApi as h, type AiChatCompletionRequest as i, type AiChatCompletionData as j, HapticFeedbackStyle as k, type OnShowCallback as l, type OnHideCallback as m, type OnPauseCallback as n, type OnPlayCallback as o, type OnQuitCallback as p, type OnResumeCallback as q, type PlayContext as r, type ShowContext as s, type VenusSimulationConfig as t, type SpendCurrencyOptions as u, type AdsApi as v, type Avatar3dApi as w, type AssetManifest as x, type Avatar3dConfig as y, type ShowEditorOptions as z };
851
+ export { MockAvatarApi as $, type AnalyticsApi as A, type RecipeRequirementResult as B, type SpendCurrencyOptions as C, type LoadEmbeddedAssetsResponse as D, type SharedAssetsApi as E, type AdsApi as F, type Avatar3dApi as G, type HapticsApi as H, type IapApi as I, type CdnApi as J, type AssetManifest as K, type LifecycleApi as L, type Avatar3dConfig as M, type NavigationApi as N, type OnCleanupCallback as O, type PushAppOptions as P, type QuitOptions as Q, type RpcRequest as R, type ScheduleLocalNotification as S, type ShowEditorOptions as T, type Avatar3dEdits as U, type VenusAPI as V, type SubPath as W, type FetchBlobOptions as X, type AiMessage as Y, type Asset as Z, type Category as _, type RpcResponse as a, type Insets as a0, type PostInfo as a1, type TimeIntervalTriggerInput as a2, type DateTriggerInput as a3, type CalendarTriggerInput as a4, type DailyTriggerInput as a5, type WeeklyTriggerInput as a6, type MonthlyTriggerInput as a7, type YearlyTriggerInput as a8, type NotificationTriggerInput as a9, type Subscription as aa, type OnRequestCallback as ab, type OnResponseCallback as ac, type OnNotificationCallback as ad, type RpcTransport as ae, RpcSharedAssetsApi as af, type LoadEmbeddedAssetsRequest as ag, type VenusSimulationState as ah, type VenusSimulationEffect as ai, type VenusSimulationRecipe as aj, type RecipeRequirementQuery as ak, type BatchRecipeRequirementsResult as al, type VenusSimulationAPI as am, type VenusConfig as an, type ActionSheetOption as ao, type RpcNotification as b, RpcClient as c, type NavigationStackInfo as d, type NotificationsApi as e, type ScheduleLocalNotificationOptions as f, type PopupsApi as g, type ActionSheetItem as h, type ShowActionSheetOptions as i, type ShowAlertOptions as j, type ShowConfirmOptions as k, type ShowToastOptions as l, type Profile as m, type AiApi as n, type AiChatCompletionRequest as o, type AiChatCompletionData as p, HapticFeedbackStyle as q, type OnShowCallback as r, type OnHideCallback as s, type OnPauseCallback as t, type OnPlayCallback as u, type OnQuitCallback as v, type OnResumeCallback as w, type PlayContext as x, type ShowContext as y, type VenusSimulationConfig as z };
@@ -3,6 +3,64 @@ interface AnalyticsApi {
3
3
  trackFunnelStep(stepNumber: number, stepName: string, funnelName?: string): Promise<void>;
4
4
  }
5
5
 
6
+ interface RpcRequest {
7
+ type: 'rpc-request';
8
+ id: string;
9
+ method: string;
10
+ args?: any[];
11
+ }
12
+
13
+ interface RpcResponse {
14
+ type: 'rpc-response';
15
+ id: string;
16
+ method: string;
17
+ result?: any;
18
+ error?: {
19
+ message: string;
20
+ stack?: string;
21
+ };
22
+ }
23
+
24
+ interface RpcNotification {
25
+ type: 'rpc-notification';
26
+ id: string;
27
+ payload?: any;
28
+ }
29
+
30
+ type OnRequestCallback = (request: RpcRequest) => Promise<boolean>;
31
+ type OnResponseCallback = (response: RpcResponse) => Promise<boolean>;
32
+ type OnNotificationCallback = (notification: RpcNotification) => void;
33
+ interface RpcTransport {
34
+ onRequest(callback: OnRequestCallback): Subscription;
35
+ onResponse(callback: OnResponseCallback): Subscription;
36
+ onNotification(callback: OnNotificationCallback): Subscription;
37
+ sendRequest(request: RpcRequest): void;
38
+ sendResponse(response: RpcResponse): void;
39
+ }
40
+
41
+ interface Subscription {
42
+ unsubscribe: () => void;
43
+ }
44
+ declare class RpcClient {
45
+ private readonly pendingCalls;
46
+ private readonly notificationCallbacks;
47
+ private onResponseSub;
48
+ private onNotificationSub;
49
+ private transport;
50
+ start(transport: RpcTransport): void;
51
+ stop(): void;
52
+ onNotification<TPayload>(id: string, callback: (payload: TPayload) => void): Subscription;
53
+ callT<TArgs, TResult>(method: string, args: TArgs, timeout?: number): Promise<TResult>;
54
+ call<TResponse>(method: string, args?: any, timeout?: number): Promise<TResponse>;
55
+ private hasPendingCall;
56
+ private addPendingCall;
57
+ private removePendingCall;
58
+ private getPendingCall;
59
+ private generateId;
60
+ private handleRpcResponse;
61
+ private handleRpcNotification;
62
+ }
63
+
6
64
  interface NavigationStackInfo {
7
65
  isInStack: boolean;
8
66
  stackPosition: number;
@@ -26,6 +84,78 @@ interface NavigationApi {
26
84
  requestPopOrQuit(options?: QuitOptions): Promise<boolean>;
27
85
  }
28
86
 
87
+ type TimeIntervalTriggerInput = {
88
+ type: 'timeInterval';
89
+ seconds: number;
90
+ repeats?: boolean;
91
+ channelId?: string;
92
+ };
93
+ type DateTriggerInput = {
94
+ type: 'date';
95
+ date: string;
96
+ channelId?: string;
97
+ };
98
+ type CalendarTriggerInput = {
99
+ type: 'calendar';
100
+ year?: number;
101
+ month?: number;
102
+ day?: number;
103
+ hour?: number;
104
+ minute?: number;
105
+ second?: number;
106
+ repeats?: boolean;
107
+ channelId?: string;
108
+ };
109
+ type DailyTriggerInput = {
110
+ type: 'daily';
111
+ hour: number;
112
+ minute: number;
113
+ channelId?: string;
114
+ };
115
+ type WeeklyTriggerInput = {
116
+ type: 'weekly';
117
+ weekday: number;
118
+ hour: number;
119
+ minute: number;
120
+ channelId?: string;
121
+ };
122
+ type MonthlyTriggerInput = {
123
+ type: 'monthly';
124
+ day: number;
125
+ hour: number;
126
+ minute: number;
127
+ channelId?: string;
128
+ };
129
+ type YearlyTriggerInput = {
130
+ type: 'yearly';
131
+ month: number;
132
+ day: number;
133
+ hour: number;
134
+ minute: number;
135
+ channelId?: string;
136
+ };
137
+ type NotificationTriggerInput = null | TimeIntervalTriggerInput | DateTriggerInput | CalendarTriggerInput | DailyTriggerInput | WeeklyTriggerInput | MonthlyTriggerInput | YearlyTriggerInput;
138
+ interface ScheduleLocalNotificationOptions {
139
+ priority?: number;
140
+ groupId?: string;
141
+ payload?: Record<string, any>;
142
+ trigger?: NotificationTriggerInput;
143
+ }
144
+ interface ScheduleLocalNotification {
145
+ id: string;
146
+ title?: string | null;
147
+ body?: string | null;
148
+ payload?: Record<string, any>;
149
+ trigger?: NotificationTriggerInput;
150
+ }
151
+ interface NotificationsApi {
152
+ scheduleLocalNotification(title: string, body: string, options?: ScheduleLocalNotificationOptions): Promise<string | null>;
153
+ cancelLocalNotification(notificationId: string): Promise<boolean>;
154
+ getAllScheduledLocalNotifications(): Promise<ScheduleLocalNotification[]>;
155
+ isLocalNotificationsEnabled(): Promise<boolean>;
156
+ setLocalNotificationsEnabled(enabled: boolean): Promise<boolean>;
157
+ }
158
+
29
159
  interface ShowConfirmOptions {
30
160
  confirmText?: string;
31
161
  cancelText?: string;
@@ -184,12 +314,33 @@ interface LifecycleApi {
184
314
  onCleanup(callback: OnCleanupCallback): void;
185
315
  }
186
316
 
317
+ interface SharedAssetsApi {
318
+ loadCharactersBundle(): Promise<ArrayBuffer>;
319
+ loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
320
+ }
321
+
322
+ declare class RpcSharedAssetsApi implements SharedAssetsApi {
323
+ private readonly venusApi;
324
+ private readonly rpcClient;
325
+ constructor(rpcClient: RpcClient, venusApi: VenusAPI);
326
+ loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
327
+ loadCharactersBundle(): Promise<ArrayBuffer>;
328
+ }
329
+ interface LoadEmbeddedAssetsRequest {
330
+ assetKey: string;
331
+ }
332
+ interface LoadEmbeddedAssetsResponse {
333
+ base64Data: string;
334
+ }
335
+
187
336
  interface SpendCurrencyOptions {
188
337
  screenName?: string;
189
338
  }
190
339
  interface IapApi {
191
340
  getHardCurrencyBalance(): Promise<number>;
192
341
  spendCurrency(productId: string, amount: number, options?: SpendCurrencyOptions): Promise<void>;
342
+ openStore(): Promise<void>;
343
+ getCurrencyIcon(): Promise<LoadEmbeddedAssetsResponse>;
193
344
  }
194
345
 
195
346
  interface Avatar3dConfig {
@@ -624,13 +775,17 @@ interface VenusAPI {
624
775
  scheduleLocalNotifAsync(options: {
625
776
  title: string;
626
777
  body: string;
627
- timeFromNow: number;
778
+ timeFromNow?: number;
779
+ trigger?: NotificationTriggerInput;
780
+ priority?: number;
781
+ groupId?: string;
782
+ payload?: any;
628
783
  data?: any;
629
784
  sound?: string;
630
785
  badge?: number;
631
786
  }): Promise<string>;
632
787
  cancelLocalNotifAsync(notificationId: string): Promise<void>;
633
- getAllLocalNotifsAsync(): Promise<Array<any>>;
788
+ getAllLocalNotifsAsync(): Promise<ScheduleLocalNotification[]>;
634
789
  isLocalNotifEnabledAsync(): Promise<boolean>;
635
790
  setLocalNotifEnabledAsync(enabled: boolean): Promise<void>;
636
791
  showAvatar3dEditorAsync(options: {
@@ -681,12 +836,16 @@ interface VenusAPI {
681
836
  ai: AiApi;
682
837
  popups: PopupsApi;
683
838
  analytics: AnalyticsApi;
839
+ sharedAssets: SharedAssetsApi;
684
840
  }
685
841
 
686
842
  interface AdsApi {
843
+ /**
844
+ * @deprecated This is no longer needed. Do not use
845
+ */
687
846
  isRewardedAdReadyAsync(): Promise<boolean>;
688
847
  showRewardedAdAsync(): Promise<boolean>;
689
848
  showInterstitialAd(): Promise<boolean>;
690
849
  }
691
850
 
692
- export { type VenusConfig as $, type AnalyticsApi as A, type Avatar3dEdits as B, type CdnApi as C, type SubPath as D, type AiMessage as E, type FetchBlobOptions as F, type Asset as G, type HapticsApi as H, type IapApi as I, type Category as J, type Insets as K, type LifecycleApi as L, MockAvatarApi as M, type NavigationApi as N, type OnCleanupCallback as O, type PushAppOptions as P, type QuitOptions as Q, type RecipeRequirementResult as R, type ShowActionSheetOptions as S, type PostInfo as T, type VenusSimulationState as U, type VenusAPI as V, type VenusSimulationEffect as W, type VenusSimulationRecipe as X, type RecipeRequirementQuery as Y, type BatchRecipeRequirementsResult as Z, type VenusSimulationAPI as _, type NavigationStackInfo as a, type ActionSheetOption as a0, type PopupsApi as b, type ActionSheetItem as c, type ShowAlertOptions as d, type ShowConfirmOptions as e, type ShowToastOptions as f, type Profile as g, type AiApi as h, type AiChatCompletionRequest as i, type AiChatCompletionData as j, HapticFeedbackStyle as k, type OnShowCallback as l, type OnHideCallback as m, type OnPauseCallback as n, type OnPlayCallback as o, type OnQuitCallback as p, type OnResumeCallback as q, type PlayContext as r, type ShowContext as s, type VenusSimulationConfig as t, type SpendCurrencyOptions as u, type AdsApi as v, type Avatar3dApi as w, type AssetManifest as x, type Avatar3dConfig as y, type ShowEditorOptions as z };
851
+ export { MockAvatarApi as $, type AnalyticsApi as A, type RecipeRequirementResult as B, type SpendCurrencyOptions as C, type LoadEmbeddedAssetsResponse as D, type SharedAssetsApi as E, type AdsApi as F, type Avatar3dApi as G, type HapticsApi as H, type IapApi as I, type CdnApi as J, type AssetManifest as K, type LifecycleApi as L, type Avatar3dConfig as M, type NavigationApi as N, type OnCleanupCallback as O, type PushAppOptions as P, type QuitOptions as Q, type RpcRequest as R, type ScheduleLocalNotification as S, type ShowEditorOptions as T, type Avatar3dEdits as U, type VenusAPI as V, type SubPath as W, type FetchBlobOptions as X, type AiMessage as Y, type Asset as Z, type Category as _, type RpcResponse as a, type Insets as a0, type PostInfo as a1, type TimeIntervalTriggerInput as a2, type DateTriggerInput as a3, type CalendarTriggerInput as a4, type DailyTriggerInput as a5, type WeeklyTriggerInput as a6, type MonthlyTriggerInput as a7, type YearlyTriggerInput as a8, type NotificationTriggerInput as a9, type Subscription as aa, type OnRequestCallback as ab, type OnResponseCallback as ac, type OnNotificationCallback as ad, type RpcTransport as ae, RpcSharedAssetsApi as af, type LoadEmbeddedAssetsRequest as ag, type VenusSimulationState as ah, type VenusSimulationEffect as ai, type VenusSimulationRecipe as aj, type RecipeRequirementQuery as ak, type BatchRecipeRequirementsResult as al, type VenusSimulationAPI as am, type VenusConfig as an, type ActionSheetOption as ao, type RpcNotification as b, RpcClient as c, type NavigationStackInfo as d, type NotificationsApi as e, type ScheduleLocalNotificationOptions as f, type PopupsApi as g, type ActionSheetItem as h, type ShowActionSheetOptions as i, type ShowAlertOptions as j, type ShowConfirmOptions as k, type ShowToastOptions as l, type Profile as m, type AiApi as n, type AiChatCompletionRequest as o, type AiChatCompletionData as p, HapticFeedbackStyle as q, type OnShowCallback as r, type OnHideCallback as s, type OnPauseCallback as t, type OnPlayCallback as u, type OnQuitCallback as v, type OnResumeCallback as w, type PlayContext as x, type ShowContext as y, type VenusSimulationConfig as z };