@ait-co/devtools 0.0.2 → 0.0.3

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.
@@ -1,7 +1,5 @@
1
- /**
2
- * @ait-co/devtools 중앙 상태 관리
3
- * DevTools Panel과 mock 구현체가 이 상태를 공유한다.
4
- */
1
+ //#region src/mock/types.d.ts
2
+ type Primitive = string | number | boolean | null | undefined | symbol;
5
3
  type PlatformOS = 'ios' | 'android';
6
4
  type OperationalEnvironment = 'toss' | 'sandbox';
7
5
  type NetworkStatus = 'OFFLINE' | 'WIFI' | '2G' | '3G' | '4G' | '5G' | 'WWAN' | 'UNKNOWN';
@@ -10,185 +8,185 @@ type PermissionName = 'clipboard' | 'contacts' | 'photos' | 'geolocation' | 'cam
10
8
  type HapticFeedbackType = 'tickWeak' | 'tap' | 'tickMedium' | 'softMedium' | 'basicWeak' | 'basicMedium' | 'success' | 'error' | 'wiggle' | 'confetti';
11
9
  type DeviceApiMode = 'mock' | 'web' | 'prompt';
12
10
  interface DeviceModes {
13
- camera: DeviceApiMode;
14
- photos: DeviceApiMode;
15
- location: DeviceApiMode;
16
- network: 'mock' | 'web';
17
- clipboard: 'mock' | 'web';
11
+ camera: DeviceApiMode;
12
+ photos: DeviceApiMode;
13
+ location: DeviceApiMode;
14
+ network: 'mock' | 'web';
15
+ clipboard: 'mock' | 'web';
18
16
  }
19
17
  interface MockData {
20
- images: string[];
21
- clipboardText: string;
18
+ images: string[];
19
+ clipboardText: string;
22
20
  }
23
21
  interface LocationCoords {
24
- latitude: number;
25
- longitude: number;
26
- altitude: number;
27
- accuracy: number;
28
- altitudeAccuracy: number;
29
- heading: number;
22
+ latitude: number;
23
+ longitude: number;
24
+ altitude: number;
25
+ accuracy: number;
26
+ altitudeAccuracy: number;
27
+ heading: number;
30
28
  }
31
29
  interface MockLocation {
32
- coords: LocationCoords;
33
- timestamp: number;
34
- accessLocation?: 'FINE' | 'COARSE';
30
+ coords: LocationCoords;
31
+ timestamp: number;
32
+ accessLocation?: 'FINE' | 'COARSE';
35
33
  }
36
34
  interface MockContact {
37
- name: string;
38
- phoneNumber: string;
35
+ name: string;
36
+ phoneNumber: string;
39
37
  }
40
38
  interface MockIapProduct {
41
- sku: string;
42
- type: 'CONSUMABLE' | 'NON_CONSUMABLE' | 'SUBSCRIPTION';
43
- displayName: string;
44
- displayAmount: string;
45
- iconUrl: string;
46
- description: string;
47
- renewalCycle?: 'WEEKLY' | 'MONTHLY' | 'YEARLY';
39
+ sku: string;
40
+ type: 'CONSUMABLE' | 'NON_CONSUMABLE' | 'SUBSCRIPTION';
41
+ displayName: string;
42
+ displayAmount: string;
43
+ iconUrl: string;
44
+ description: string;
45
+ renewalCycle?: 'WEEKLY' | 'MONTHLY' | 'YEARLY';
48
46
  }
49
47
  type IapNextResult = 'success' | 'USER_CANCELED' | 'INVALID_PRODUCT_ID' | 'PAYMENT_PENDING' | 'NETWORK_ERROR' | 'ITEM_ALREADY_OWNED' | 'INTERNAL_ERROR';
50
48
  interface AnalyticsLogEntry {
51
- timestamp: number;
52
- type: string;
53
- params: Record<string, unknown>;
49
+ timestamp: number;
50
+ type: string;
51
+ params: Record<string, unknown>;
54
52
  }
55
53
  interface SafeAreaInsets$1 {
56
- top: number;
57
- bottom: number;
58
- left: number;
59
- right: number;
54
+ top: number;
55
+ bottom: number;
56
+ left: number;
57
+ right: number;
60
58
  }
59
+ //#endregion
60
+ //#region src/mock/state.d.ts
61
61
  type Listener = () => void;
62
62
  interface AitDevtoolsState {
63
- platform: PlatformOS;
64
- environment: OperationalEnvironment;
65
- appVersion: string;
66
- locale: string;
67
- schemeUri: string;
68
- groupId: string;
69
- deploymentId: string;
70
- deviceId: string;
71
- brand: {
72
- displayName: string;
73
- icon: string;
74
- primaryColor: string;
75
- };
76
- networkStatus: NetworkStatus;
77
- permissions: Record<PermissionName, PermissionStatus>;
78
- location: MockLocation;
79
- safeAreaInsets: SafeAreaInsets$1;
80
- contacts: MockContact[];
81
- iap: {
82
- products: MockIapProduct[];
83
- nextResult: IapNextResult;
84
- pendingOrders: Array<{
85
- orderId: string;
86
- sku: string;
87
- paymentCompletedDate: string;
88
- }>;
89
- completedOrders: Array<{
90
- orderId: string;
91
- sku: string;
92
- status: 'COMPLETED' | 'REFUNDED';
93
- date: string;
94
- }>;
95
- };
96
- payment: {
97
- nextResult: 'success' | 'fail';
98
- failReason: string;
99
- };
100
- auth: {
101
- isLoggedIn: boolean;
102
- isTossLoginIntegrated: boolean;
103
- userKeyHash: string;
104
- };
105
- ads: {
106
- isLoaded: boolean;
107
- nextEvent: 'loaded' | 'clicked' | 'dismissed' | 'failedToShow' | 'impression' | 'userEarnedReward';
108
- };
109
- game: {
110
- profile: {
111
- nickname: string;
112
- profileImageUri: string;
113
- } | null;
114
- leaderboardScores: Array<{
115
- score: string;
116
- timestamp: number;
117
- }>;
118
- };
119
- analyticsLog: AnalyticsLogEntry[];
120
- deviceModes: DeviceModes;
121
- mockData: MockData;
122
- panelEditable: boolean;
63
+ platform: PlatformOS;
64
+ environment: OperationalEnvironment;
65
+ appVersion: string;
66
+ locale: string;
67
+ schemeUri: string;
68
+ groupId: string;
69
+ deploymentId: string;
70
+ deviceId: string;
71
+ brand: {
72
+ displayName: string;
73
+ icon: string;
74
+ primaryColor: string;
75
+ };
76
+ networkStatus: NetworkStatus;
77
+ permissions: Record<PermissionName, PermissionStatus>;
78
+ location: MockLocation;
79
+ safeAreaInsets: SafeAreaInsets$1;
80
+ contacts: MockContact[];
81
+ iap: {
82
+ products: MockIapProduct[];
83
+ nextResult: IapNextResult;
84
+ pendingOrders: Array<{
85
+ orderId: string;
86
+ sku: string;
87
+ paymentCompletedDate: string;
88
+ }>;
89
+ completedOrders: Array<{
90
+ orderId: string;
91
+ sku: string;
92
+ status: 'COMPLETED' | 'REFUNDED';
93
+ date: string;
94
+ }>;
95
+ };
96
+ payment: {
97
+ nextResult: 'success' | 'fail';
98
+ failReason: string;
99
+ };
100
+ auth: {
101
+ isLoggedIn: boolean;
102
+ isTossLoginIntegrated: boolean;
103
+ userKeyHash: string;
104
+ };
105
+ ads: {
106
+ isLoaded: boolean;
107
+ nextEvent: 'loaded' | 'clicked' | 'dismissed' | 'failedToShow' | 'impression' | 'userEarnedReward';
108
+ };
109
+ game: {
110
+ profile: {
111
+ nickname: string;
112
+ profileImageUri: string;
113
+ } | null;
114
+ leaderboardScores: Array<{
115
+ score: string;
116
+ timestamp: number;
117
+ }>;
118
+ };
119
+ analyticsLog: AnalyticsLogEntry[];
120
+ deviceModes: DeviceModes;
121
+ mockData: MockData;
122
+ panelEditable: boolean;
123
123
  }
124
124
  declare class AitStateManager {
125
- private _state;
126
- private _listeners;
127
- constructor();
128
- get state(): AitDevtoolsState;
129
- update(partial: Partial<AitDevtoolsState>): void;
130
- /** 중첩 객체 업데이트용 */
131
- patch<K extends keyof AitDevtoolsState>(key: K, partial: Partial<AitDevtoolsState[K]>): void;
132
- subscribe(listener: Listener): () => void;
133
- /** 분석 로그 추가 */
134
- logAnalytics(entry: Omit<AnalyticsLogEntry, 'timestamp'>): void;
135
- /** 이벤트 트리거 (backEvent, homeEvent 등) */
136
- trigger(event: string): void;
137
- reset(): void;
138
- private _notify;
125
+ private _state;
126
+ private _listeners;
127
+ constructor();
128
+ get state(): AitDevtoolsState;
129
+ update(partial: Partial<AitDevtoolsState>): void;
130
+ /** 중첩 객체 업데이트용 */
131
+ patch<K extends keyof AitDevtoolsState>(key: K, partial: Partial<AitDevtoolsState[K]>): void;
132
+ subscribe(listener: Listener): () => void;
133
+ /** 분석 로그 추가 */
134
+ logAnalytics(entry: Omit<AnalyticsLogEntry, 'timestamp'>): void;
135
+ /** 이벤트 트리거 (backEvent, homeEvent 등) */
136
+ trigger(event: string): void;
137
+ reset(): void;
138
+ private _notify;
139
139
  }
140
140
  declare const aitState: AitStateManager;
141
-
141
+ //#endregion
142
+ //#region src/mock/auth/index.d.ts
142
143
  /**
143
144
  * 인증/로그인 mock
144
145
  */
145
146
  declare function appLogin(): Promise<{
146
- authorizationCode: string;
147
- referrer: 'DEFAULT' | 'SANDBOX';
147
+ authorizationCode: string;
148
+ referrer: 'DEFAULT' | 'SANDBOX';
148
149
  }>;
149
150
  declare function getIsTossLoginIntegratedService(): Promise<boolean | undefined>;
150
151
  declare function getUserKeyForGame(): Promise<{
151
- hash: string;
152
- type: 'HASH';
152
+ hash: string;
153
+ type: 'HASH';
153
154
  } | 'INVALID_CATEGORY' | 'ERROR' | undefined>;
154
155
  interface AppsInTossSignTossCertParams {
155
- txId: string;
156
+ txId: string;
156
157
  }
157
158
  declare function appsInTossSignTossCert(_params: AppsInTossSignTossCertParams): Promise<void>;
158
-
159
- /**
160
- * 화면/네비게이션/이벤트 mock
161
- */
162
-
159
+ //#endregion
160
+ //#region src/mock/navigation/index.d.ts
163
161
  declare function closeView(): Promise<void>;
164
162
  declare function openURL(url: string): Promise<void>;
165
163
  declare function share(message: {
166
- message: string;
164
+ message: string;
167
165
  }): Promise<void>;
168
166
  declare function getTossShareLink(path: string, _ogImageUrl?: string): Promise<string>;
169
167
  declare function setIosSwipeGestureEnabled(_options: {
170
- isEnabled: boolean;
168
+ isEnabled: boolean;
171
169
  }): Promise<void>;
172
170
  declare function setDeviceOrientation(_options: {
173
- type: 'portrait' | 'landscape';
171
+ type: 'portrait' | 'landscape';
174
172
  }): Promise<void>;
175
173
  declare function setScreenAwakeMode(options: {
176
- enabled: boolean;
174
+ enabled: boolean;
177
175
  }): Promise<{
178
- enabled: boolean;
176
+ enabled: boolean;
179
177
  }>;
180
178
  declare function setSecureScreen(options: {
181
- enabled: boolean;
179
+ enabled: boolean;
182
180
  }): Promise<{
183
- enabled: boolean;
181
+ enabled: boolean;
184
182
  }>;
185
183
  declare function requestReview(): Promise<void>;
186
184
  declare function getPlatformOS(): 'ios' | 'android';
187
185
  declare function getOperationalEnvironment(): 'toss' | 'sandbox';
188
186
  declare function getTossAppVersion(): string;
189
187
  declare function isMinVersionSupported(minVersions: {
190
- android: string;
191
- ios: string;
188
+ android: string;
189
+ ios: string;
192
190
  }): boolean;
193
191
  declare function getSchemeUri(): string;
194
192
  declare function getLocale(): string;
@@ -197,433 +195,472 @@ declare function getGroupId(): string;
197
195
  declare function getNetworkStatus(): Promise<NetworkStatus>;
198
196
  declare function getServerTime(): Promise<number | undefined>;
199
197
  interface GraniteEventMap {
200
- backEvent: {
201
- onEvent: () => void;
202
- onError?: (error: Error) => void;
203
- options?: void;
204
- };
205
- homeEvent: {
206
- onEvent: () => void;
207
- onError?: (error: Error) => void;
208
- options?: void;
209
- };
198
+ backEvent: {
199
+ onEvent: () => void;
200
+ onError?: (error: Error) => void;
201
+ options?: void;
202
+ };
203
+ homeEvent: {
204
+ onEvent: () => void;
205
+ onError?: (error: Error) => void;
206
+ options?: void;
207
+ };
210
208
  }
211
209
  declare const graniteEvent: {
212
- addEventListener<K extends keyof GraniteEventMap>(event: K, { onEvent, onError }: {
213
- onEvent: GraniteEventMap[K]["onEvent"];
214
- onError?: GraniteEventMap[K]["onError"];
215
- options?: GraniteEventMap[K]["options"];
216
- }): () => void;
210
+ addEventListener<K extends keyof GraniteEventMap>(event: K, {
211
+ onEvent,
212
+ onError
213
+ }: {
214
+ onEvent: GraniteEventMap[K]["onEvent"];
215
+ onError?: GraniteEventMap[K]["onError"];
216
+ options?: GraniteEventMap[K]["options"];
217
+ }): () => void;
217
218
  };
218
219
  declare const appsInTossEvent: {
219
- addEventListener<K extends string>(_event: K, _handlers: {
220
- onEvent: (...args: unknown[]) => void;
221
- onError?: (error: Error) => void;
222
- options?: unknown;
223
- }): () => void;
220
+ addEventListener<K extends string>(_event: K, _handlers: {
221
+ onEvent: (...args: unknown[]) => void;
222
+ onError?: (error: Error) => void;
223
+ options?: unknown;
224
+ }): () => void;
224
225
  };
225
226
  interface TdsEventMap {
226
- navigationAccessoryEvent: {
227
- onEvent: (data: {
228
- id: string;
229
- }) => void;
230
- onError?: (error: Error) => void;
231
- options: undefined;
232
- };
227
+ navigationAccessoryEvent: {
228
+ onEvent: (data: {
229
+ id: string;
230
+ }) => void;
231
+ onError?: (error: Error) => void;
232
+ options: undefined;
233
+ };
233
234
  }
234
235
  declare const tdsEvent: {
235
- addEventListener<K extends keyof TdsEventMap>(event: K, { onEvent }: {
236
- onEvent: TdsEventMap[K]["onEvent"];
237
- onError?: TdsEventMap[K]["onError"];
238
- options?: TdsEventMap[K]["options"];
239
- }): () => void;
236
+ addEventListener<K extends keyof TdsEventMap>(event: K, {
237
+ onEvent
238
+ }: {
239
+ onEvent: TdsEventMap[K]["onEvent"];
240
+ onError?: TdsEventMap[K]["onError"];
241
+ options?: TdsEventMap[K]["options"];
242
+ }): () => void;
240
243
  };
241
244
  declare function onVisibilityChangedByTransparentServiceWeb(eventParams: {
242
- options: {
243
- callbackId: string;
244
- };
245
- onEvent: (isVisible: boolean) => void;
246
- onError: (error: unknown) => void;
245
+ options: {
246
+ callbackId: string;
247
+ };
248
+ onEvent: (isVisible: boolean) => void;
249
+ onError: (error: unknown) => void;
247
250
  }): () => void;
248
251
  declare const env: {
249
- getDeploymentId: () => string;
252
+ getDeploymentId: () => string;
250
253
  };
251
254
  declare function getAppsInTossGlobals(): {
252
- deploymentId: string;
253
- brandDisplayName: string;
254
- brandIcon: string;
255
- brandPrimaryColor: string;
255
+ deploymentId: string;
256
+ brandDisplayName: string;
257
+ brandIcon: string;
258
+ brandPrimaryColor: string;
256
259
  };
257
260
  type SafeAreaInsetsValue = {
258
- top: number;
259
- bottom: number;
260
- left: number;
261
- right: number;
261
+ top: number;
262
+ bottom: number;
263
+ left: number;
264
+ right: number;
262
265
  };
263
266
  type SafeAreaInsetsSubscribeHandler = {
264
- onEvent: (data: SafeAreaInsetsValue) => void;
267
+ onEvent: (data: SafeAreaInsetsValue) => void;
265
268
  };
266
269
  declare const SafeAreaInsets: {
267
- get: () => SafeAreaInsetsValue;
268
- subscribe: ({ onEvent }: SafeAreaInsetsSubscribeHandler) => (() => void);
270
+ get: () => SafeAreaInsetsValue;
271
+ subscribe: ({
272
+ onEvent
273
+ }: SafeAreaInsetsSubscribeHandler) => (() => void);
269
274
  };
270
275
  /** @deprecated */
271
276
  declare function getSafeAreaInsets(): number;
272
-
277
+ //#endregion
278
+ //#region src/mock/device/_helpers.d.ts
279
+ /**
280
+ * 디바이스 모듈 내부 공유 헬퍼
281
+ */
273
282
  declare function getDefaultPlaceholderImages(): string[];
283
+ //#endregion
284
+ //#region src/mock/device/storage.d.ts
285
+ /**
286
+ * Storage mock
287
+ * localStorage에 `__ait_storage:` prefix로 저장하여 앱 자체 localStorage와 분리
288
+ */
274
289
  declare const Storage: {
275
- getItem: (key: string) => Promise<string | null>;
276
- setItem: (key: string, value: string) => Promise<void>;
277
- removeItem: (key: string) => Promise<void>;
278
- clearItems: () => Promise<void>;
290
+ getItem: (key: string) => Promise<string | null>;
291
+ setItem: (key: string, value: string) => Promise<void>;
292
+ removeItem: (key: string) => Promise<void>;
293
+ clearItems: () => Promise<void>;
279
294
  };
295
+ //#endregion
296
+ //#region src/mock/device/location.d.ts
280
297
  declare enum Accuracy {
281
- Lowest = 1,
282
- Low = 2,
283
- Balanced = 3,
284
- High = 4,
285
- Highest = 5,
286
- BestForNavigation = 6
298
+ Lowest = 1,
299
+ Low = 2,
300
+ Balanced = 3,
301
+ High = 4,
302
+ Highest = 5,
303
+ BestForNavigation = 6
287
304
  }
288
-
289
305
  declare const getCurrentLocation: ((_options?: {
290
- accuracy: Accuracy;
306
+ accuracy: Accuracy;
291
307
  }) => Promise<MockLocation>) & {
292
- getPermission: () => Promise<PermissionStatus>;
293
- openPermissionDialog: () => Promise<"allowed" | "denied">;
308
+ getPermission: () => Promise<PermissionStatus>;
309
+ openPermissionDialog: () => Promise<"allowed" | "denied">;
294
310
  };
295
311
  interface StartUpdateLocationEventParams {
296
- onEvent: (response: MockLocation) => void;
297
- onError: (error: unknown) => void;
298
- options: {
299
- accuracy: Accuracy;
300
- timeInterval: number;
301
- distanceInterval: number;
302
- };
312
+ onEvent: (response: MockLocation) => void;
313
+ onError: (error: unknown) => void;
314
+ options: {
315
+ accuracy: Accuracy;
316
+ timeInterval: number;
317
+ distanceInterval: number;
318
+ };
303
319
  }
304
- declare function _startUpdateLocation(eventParams: StartUpdateLocationEventParams): () => void;
305
- declare const startUpdateLocation: typeof _startUpdateLocation & {
306
- getPermission: () => Promise<PermissionStatus>;
307
- openPermissionDialog: () => Promise<"denied" | "allowed">;
320
+ declare const startUpdateLocation: ((eventParams: StartUpdateLocationEventParams) => () => void) & {
321
+ getPermission: () => Promise<PermissionStatus>;
322
+ openPermissionDialog: () => Promise<"allowed" | "denied">;
308
323
  };
324
+ //#endregion
325
+ //#region src/mock/device/camera.d.ts
326
+ /**
327
+ * Camera & Album Photos mock
328
+ * mock/web/prompt 모드 지원
329
+ */
309
330
  declare const openCamera: ((_options?: {
310
- base64?: boolean;
311
- maxWidth?: number;
331
+ base64?: boolean;
332
+ maxWidth?: number;
312
333
  }) => Promise<{
313
- id: string;
314
- dataUri: string;
334
+ id: string;
335
+ dataUri: string;
315
336
  }>) & {
316
- getPermission: () => Promise<PermissionStatus>;
317
- openPermissionDialog: () => Promise<"allowed" | "denied">;
337
+ getPermission: () => Promise<PermissionStatus>;
338
+ openPermissionDialog: () => Promise<"allowed" | "denied">;
318
339
  };
319
340
  declare const fetchAlbumPhotos: ((options?: {
320
- maxCount?: number;
321
- maxWidth?: number;
322
- base64?: boolean;
341
+ maxCount?: number;
342
+ maxWidth?: number;
343
+ base64?: boolean;
323
344
  }) => Promise<Array<{
324
- id: string;
325
- dataUri: string;
345
+ id: string;
346
+ dataUri: string;
326
347
  }>>) & {
327
- getPermission: () => Promise<PermissionStatus>;
328
- openPermissionDialog: () => Promise<"allowed" | "denied">;
329
- };
330
- declare const fetchContacts: ((options: {
331
- size: number;
332
- offset: number;
333
- query?: {
334
- contains?: string;
335
- };
336
- }) => Promise<{
337
- result: MockContact[];
338
- nextOffset: number | null;
339
- done: boolean;
340
- }>) & {
341
- getPermission: () => Promise<PermissionStatus>;
342
- openPermissionDialog: () => Promise<"allowed" | "denied">;
348
+ getPermission: () => Promise<PermissionStatus>;
349
+ openPermissionDialog: () => Promise<"allowed" | "denied">;
343
350
  };
351
+ //#endregion
352
+ //#region src/mock/device/clipboard.d.ts
353
+ /**
354
+ * Clipboard mock
355
+ * mock/web 모드 지원
356
+ */
344
357
  declare const getClipboardText: (() => Promise<string>) & {
345
- getPermission: () => Promise<PermissionStatus>;
346
- openPermissionDialog: () => Promise<"allowed" | "denied">;
358
+ getPermission: () => Promise<PermissionStatus>;
359
+ openPermissionDialog: () => Promise<"allowed" | "denied">;
347
360
  };
348
361
  declare const setClipboardText: ((text: string) => Promise<void>) & {
349
- getPermission: () => Promise<PermissionStatus>;
350
- openPermissionDialog: () => Promise<"allowed" | "denied">;
362
+ getPermission: () => Promise<PermissionStatus>;
363
+ openPermissionDialog: () => Promise<"allowed" | "denied">;
351
364
  };
365
+ //#endregion
366
+ //#region src/mock/device/contacts.d.ts
367
+ /**
368
+ * Contacts mock
369
+ */
370
+ declare const fetchContacts: ((options: {
371
+ size: number;
372
+ offset: number;
373
+ query?: {
374
+ contains?: string;
375
+ };
376
+ }) => Promise<{
377
+ result: MockContact[];
378
+ nextOffset: number | null;
379
+ done: boolean;
380
+ }>) & {
381
+ getPermission: () => Promise<PermissionStatus>;
382
+ openPermissionDialog: () => Promise<"allowed" | "denied">;
383
+ };
384
+ //#endregion
385
+ //#region src/mock/device/haptic.d.ts
386
+ /**
387
+ * Haptic Feedback & saveBase64Data mock
388
+ */
352
389
  declare function generateHapticFeedback(options: {
353
- type: string;
390
+ type: string;
354
391
  }): Promise<void>;
355
392
  declare function saveBase64Data(params: {
356
- data: string;
357
- fileName: string;
358
- mimeType: string;
393
+ data: string;
394
+ fileName: string;
395
+ mimeType: string;
359
396
  }): Promise<void>;
360
-
397
+ //#endregion
398
+ //#region src/mock/iap/index.d.ts
361
399
  /**
362
400
  * IAP (인앱결제) mock
363
401
  */
364
402
  interface IapCreateOneTimePurchaseOrderOptions {
365
- options: {
366
- sku?: string;
367
- productId?: string;
368
- processProductGrant: (params: {
369
- orderId: string;
370
- }) => boolean | Promise<boolean>;
371
- };
372
- onEvent: (event: {
373
- type: 'success';
374
- data: IapOrderResult;
375
- }) => void | Promise<void>;
376
- onError: (error: unknown) => void | Promise<void>;
403
+ options: {
404
+ sku?: string;
405
+ productId?: string;
406
+ processProductGrant: (params: {
407
+ orderId: string;
408
+ }) => boolean | Promise<boolean>;
409
+ };
410
+ onEvent: (event: {
411
+ type: 'success';
412
+ data: IapOrderResult;
413
+ }) => void | Promise<void>;
414
+ onError: (error: unknown) => void | Promise<void>;
377
415
  }
378
416
  interface CreateSubscriptionPurchaseOrderOptions {
379
- options: {
380
- sku: string;
381
- offerId?: string | null;
382
- processProductGrant: (params: {
383
- orderId: string;
384
- subscriptionId?: string;
385
- }) => boolean | Promise<boolean>;
386
- };
387
- onEvent: (event: {
388
- type: 'success';
389
- data: IapOrderResult;
390
- }) => void | Promise<void>;
391
- onError: (error: unknown) => void | Promise<void>;
417
+ options: {
418
+ sku: string;
419
+ offerId?: string | null;
420
+ processProductGrant: (params: {
421
+ orderId: string;
422
+ subscriptionId?: string;
423
+ }) => boolean | Promise<boolean>;
424
+ };
425
+ onEvent: (event: {
426
+ type: 'success';
427
+ data: IapOrderResult;
428
+ }) => void | Promise<void>;
429
+ onError: (error: unknown) => void | Promise<void>;
392
430
  }
393
431
  interface IapOrderResult {
394
- orderId: string;
395
- displayName: string;
396
- displayAmount: string;
397
- amount: number;
398
- currency: string;
399
- fraction: number;
400
- miniAppIconUrl: string | null;
432
+ orderId: string;
433
+ displayName: string;
434
+ displayAmount: string;
435
+ amount: number;
436
+ currency: string;
437
+ fraction: number;
438
+ miniAppIconUrl: string | null;
401
439
  }
402
440
  declare const IAP: {
403
- createOneTimePurchaseOrder(params: IapCreateOneTimePurchaseOrderOptions): () => void;
404
- createSubscriptionPurchaseOrder(params: CreateSubscriptionPurchaseOrderOptions): () => void;
405
- getProductItemList(): Promise<{
406
- products: unknown[];
441
+ createOneTimePurchaseOrder(params: IapCreateOneTimePurchaseOrderOptions): () => void;
442
+ createSubscriptionPurchaseOrder(params: CreateSubscriptionPurchaseOrderOptions): () => void;
443
+ getProductItemList(): Promise<{
444
+ products: unknown[];
445
+ }>;
446
+ getPendingOrders(): Promise<{
447
+ orders: Array<{
448
+ orderId: string;
449
+ sku: string;
450
+ paymentCompletedDate: string;
407
451
  }>;
408
- getPendingOrders(): Promise<{
409
- orders: Array<{
410
- orderId: string;
411
- sku: string;
412
- paymentCompletedDate: string;
413
- }>;
452
+ }>;
453
+ getCompletedOrRefundedOrders(): Promise<{
454
+ hasNext: boolean;
455
+ nextKey?: string | null;
456
+ orders: Array<{
457
+ orderId: string;
458
+ sku: string;
459
+ status: "COMPLETED" | "REFUNDED";
460
+ date: string;
414
461
  }>;
415
- getCompletedOrRefundedOrders(): Promise<{
416
- hasNext: boolean;
417
- nextKey?: string | null;
418
- orders: Array<{
419
- orderId: string;
420
- sku: string;
421
- status: "COMPLETED" | "REFUNDED";
422
- date: string;
423
- }>;
424
- }>;
425
- completeProductGrant(args: {
426
- params: {
427
- orderId: string;
428
- };
429
- }): Promise<boolean>;
430
- getSubscriptionInfo(_args: {
431
- params: {
432
- orderId: string;
433
- };
434
- }): Promise<{
435
- subscription: {
436
- catalogId: number;
437
- status: string;
438
- expiresAt: string;
439
- isAutoRenew: boolean;
440
- gracePeriodExpiresAt: null;
441
- isAccessible: boolean;
442
- };
443
- }>;
444
- };
445
- declare function checkoutPayment(options: {
462
+ }>;
463
+ completeProductGrant(args: {
446
464
  params: {
447
- payToken: string;
465
+ orderId: string;
466
+ };
467
+ }): Promise<boolean>;
468
+ getSubscriptionInfo(_args: {
469
+ params: {
470
+ orderId: string;
471
+ };
472
+ }): Promise<{
473
+ subscription: {
474
+ catalogId: number;
475
+ status: string;
476
+ expiresAt: string;
477
+ isAutoRenew: boolean;
478
+ gracePeriodExpiresAt: null;
479
+ isAccessible: boolean;
448
480
  };
481
+ }>;
482
+ };
483
+ declare function checkoutPayment(options: {
484
+ params: {
485
+ payToken: string;
486
+ };
449
487
  }): Promise<{
450
- success: boolean;
451
- reason?: string;
488
+ success: boolean;
489
+ reason?: string;
452
490
  }>;
453
-
491
+ //#endregion
492
+ //#region src/mock/ads/index.d.ts
454
493
  /**
455
494
  * 광고 mock (GoogleAdMob, TossAds, FullScreenAd)
456
495
  */
457
496
  declare const GoogleAdMob: {
458
- loadAppsInTossAdMob: ((args: {
459
- onEvent: (data: {
460
- type: string;
461
- data?: unknown;
462
- }) => void;
463
- onError: (error: Error) => void;
464
- options?: {
465
- adGroupId?: string;
466
- };
467
- }) => (() => void)) & {
468
- isSupported: () => boolean;
469
- };
470
- showAppsInTossAdMob: ((args: {
471
- onEvent: (data: {
472
- type: string;
473
- data?: unknown;
474
- }) => void;
475
- onError: (error: Error) => void;
476
- options?: {
477
- adGroupId?: string;
478
- };
479
- }) => (() => void)) & {
480
- isSupported: () => boolean;
481
- };
482
- isAppsInTossAdMobLoaded: ((_options: {
483
- adGroupId?: string;
484
- }) => Promise<boolean>) & {
485
- isSupported: () => boolean;
486
- };
487
- };
488
- declare const TossAds: {
489
- initialize: ((_options: unknown) => void) & {
490
- isSupported: () => boolean;
491
- };
492
- attach: ((_adGroupId: string, target: string | HTMLElement, _options?: unknown) => void) & {
493
- isSupported: () => boolean;
494
- };
495
- attachBanner: ((_adGroupId: string, target: string | HTMLElement, _options?: unknown) => {
496
- destroy: () => void;
497
- }) & {
498
- isSupported: () => boolean;
499
- };
500
- destroy: ((_slotId: string) => void) & {
501
- isSupported: () => boolean;
502
- };
503
- destroyAll: (() => void) & {
504
- isSupported: () => boolean;
505
- };
506
- };
507
- declare const loadFullScreenAd: ((args: {
497
+ loadAppsInTossAdMob: ((args: {
508
498
  onEvent: (data: {
509
- type: string;
510
- data?: unknown;
499
+ type: string;
500
+ data?: unknown;
511
501
  }) => void;
512
502
  onError: (error: Error) => void;
513
503
  options?: {
514
- adGroupId?: string;
504
+ adGroupId?: string;
515
505
  };
516
- }) => (() => void)) & {
506
+ }) => (() => void)) & {
517
507
  isSupported: () => boolean;
518
- };
519
- declare const showFullScreenAd: ((args: {
508
+ };
509
+ showAppsInTossAdMob: ((args: {
520
510
  onEvent: (data: {
521
- type: string;
522
- data?: unknown;
511
+ type: string;
512
+ data?: unknown;
523
513
  }) => void;
524
514
  onError: (error: Error) => void;
525
515
  options?: {
526
- adGroupId?: string;
516
+ adGroupId?: string;
527
517
  };
528
- }) => (() => void)) & {
518
+ }) => (() => void)) & {
519
+ isSupported: () => boolean;
520
+ };
521
+ isAppsInTossAdMobLoaded: ((_options: {
522
+ adGroupId?: string;
523
+ }) => Promise<boolean>) & {
524
+ isSupported: () => boolean;
525
+ };
526
+ };
527
+ declare const TossAds: {
528
+ initialize: ((_options: unknown) => void) & {
529
+ isSupported: () => boolean;
530
+ };
531
+ attach: ((_adGroupId: string, target: string | HTMLElement, _options?: unknown) => void) & {
532
+ isSupported: () => boolean;
533
+ };
534
+ attachBanner: ((_adGroupId: string, target: string | HTMLElement, _options?: unknown) => {
535
+ destroy: () => void;
536
+ }) & {
529
537
  isSupported: () => boolean;
538
+ };
539
+ destroy: ((_slotId: string) => void) & {
540
+ isSupported: () => boolean;
541
+ };
542
+ destroyAll: (() => void) & {
543
+ isSupported: () => boolean;
544
+ };
545
+ };
546
+ declare const loadFullScreenAd: ((args: {
547
+ onEvent: (data: {
548
+ type: string;
549
+ data?: unknown;
550
+ }) => void;
551
+ onError: (error: Error) => void;
552
+ options?: {
553
+ adGroupId?: string;
554
+ };
555
+ }) => (() => void)) & {
556
+ isSupported: () => boolean;
557
+ };
558
+ declare const showFullScreenAd: ((args: {
559
+ onEvent: (data: {
560
+ type: string;
561
+ data?: unknown;
562
+ }) => void;
563
+ onError: (error: Error) => void;
564
+ options?: {
565
+ adGroupId?: string;
566
+ };
567
+ }) => (() => void)) & {
568
+ isSupported: () => boolean;
530
569
  };
531
-
570
+ //#endregion
571
+ //#region src/mock/game/index.d.ts
532
572
  /**
533
573
  * 게임/프로모션 mock
534
574
  */
535
575
  declare function grantPromotionReward(params: {
536
- params: {
537
- promotionCode: string;
538
- amount: number;
539
- };
576
+ params: {
577
+ promotionCode: string;
578
+ amount: number;
579
+ };
540
580
  }): Promise<{
541
- key: string;
581
+ key: string;
542
582
  } | {
543
- errorCode: string;
544
- message: string;
583
+ errorCode: string;
584
+ message: string;
545
585
  } | 'ERROR' | undefined>;
546
586
  declare function grantPromotionRewardForGame(params: {
547
- params: {
548
- promotionCode: string;
549
- amount: number;
550
- };
587
+ params: {
588
+ promotionCode: string;
589
+ amount: number;
590
+ };
551
591
  }): Promise<{
552
- key: string;
592
+ key: string;
553
593
  } | {
554
- errorCode: string;
555
- message: string;
594
+ errorCode: string;
595
+ message: string;
556
596
  } | 'ERROR' | undefined>;
557
597
  declare function submitGameCenterLeaderBoardScore(params: {
558
- score: string;
598
+ score: string;
559
599
  }): Promise<{
560
- statusCode: 'SUCCESS' | 'LEADERBOARD_NOT_FOUND' | 'PROFILE_NOT_FOUND' | 'UNPARSABLE_SCORE';
600
+ statusCode: 'SUCCESS' | 'LEADERBOARD_NOT_FOUND' | 'PROFILE_NOT_FOUND' | 'UNPARSABLE_SCORE';
561
601
  } | undefined>;
562
602
  declare function getGameCenterGameProfile(): Promise<{
563
- statusCode: 'SUCCESS';
564
- nickname: string;
565
- profileImageUri: string;
603
+ statusCode: 'SUCCESS';
604
+ nickname: string;
605
+ profileImageUri: string;
566
606
  } | {
567
- statusCode: 'PROFILE_NOT_FOUND';
607
+ statusCode: 'PROFILE_NOT_FOUND';
568
608
  } | undefined>;
569
609
  declare function openGameCenterLeaderboard(): Promise<void>;
570
610
  interface ContactsViralEvent {
571
- type: string;
572
- data: Record<string, unknown>;
611
+ type: string;
612
+ data: Record<string, unknown>;
573
613
  }
574
614
  declare function contactsViral(params: {
575
- options: {
576
- moduleId: string;
577
- };
578
- onEvent: (event: ContactsViralEvent) => void;
579
- onError: (error: unknown) => void;
615
+ options: {
616
+ moduleId: string;
617
+ };
618
+ onEvent: (event: ContactsViralEvent) => void;
619
+ onError: (error: unknown) => void;
580
620
  }): () => void;
581
-
621
+ //#endregion
622
+ //#region src/mock/analytics/index.d.ts
582
623
  /**
583
624
  * Analytics mock
584
625
  */
585
626
  type Primitive$1 = string | number | boolean | null | undefined | symbol;
586
627
  type LoggerParams = {
587
- log_name?: string;
628
+ log_name?: string;
588
629
  } & Record<string, Primitive$1>;
589
630
  declare const Analytics: {
590
- screen: (params?: LoggerParams) => Promise<void> | undefined;
591
- impression: (params?: LoggerParams) => Promise<void> | undefined;
592
- click: (params?: LoggerParams) => Promise<void> | undefined;
631
+ screen: (params?: LoggerParams) => Promise<void> | undefined;
632
+ impression: (params?: LoggerParams) => Promise<void> | undefined;
633
+ click: (params?: LoggerParams) => Promise<void> | undefined;
593
634
  };
594
635
  declare function eventLog(params: {
595
- log_name: string;
596
- log_type: 'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click';
597
- params: Record<string, Primitive$1>;
636
+ log_name: string;
637
+ log_type: 'debug' | 'info' | 'warn' | 'error' | 'event' | 'screen' | 'impression' | 'click';
638
+ params: Record<string, Primitive$1>;
598
639
  }): Promise<void>;
599
-
640
+ //#endregion
641
+ //#region src/mock/partner/index.d.ts
600
642
  /**
601
643
  * Partner / TDS mock
602
644
  */
603
645
  interface AddAccessoryButtonOptions {
604
- id: string;
605
- title: string;
606
- icon: {
607
- name: string;
608
- };
646
+ id: string;
647
+ title: string;
648
+ icon: {
649
+ name: string;
650
+ };
609
651
  }
610
652
  declare const partner: {
611
- addAccessoryButton(options: AddAccessoryButtonOptions): Promise<void>;
612
- removeAccessoryButton(): Promise<void>;
653
+ addAccessoryButton(options: AddAccessoryButtonOptions): Promise<void>;
654
+ removeAccessoryButton(): Promise<void>;
613
655
  };
614
-
615
- /**
616
- * 권한 시스템 mock
617
- * 각 디바이스 API (.getPermission, .openPermissionDialog)에 부착된다.
618
- */
619
-
656
+ //#endregion
657
+ //#region src/mock/permissions.d.ts
620
658
  declare function getPermission(name: PermissionName): Promise<PermissionStatus>;
621
659
  declare function openPermissionDialog(name: PermissionName): Promise<'allowed' | 'denied'>;
622
660
  declare function requestPermission(permission: {
623
- name: PermissionName;
624
- access: string;
661
+ name: PermissionName;
662
+ access: string;
625
663
  }): Promise<'allowed' | 'denied'>;
626
-
627
- type Primitive = string | number | boolean | null | undefined | symbol;
628
-
629
- export { Accuracy, type AitDevtoolsState, Analytics, type AnalyticsLogEntry, type DeviceApiMode, type DeviceModes, GoogleAdMob, type HapticFeedbackType, IAP, type IapNextResult, type LocationCoords, type MockContact, type MockData, type MockIapProduct, type MockLocation, type NetworkStatus, type OperationalEnvironment, type PermissionName, type PermissionStatus, type PlatformOS, type Primitive, SafeAreaInsets, type SafeAreaInsets$1 as SafeAreaInsetsType, Storage, TossAds, aitState, appLogin, appsInTossEvent, appsInTossSignTossCert, checkoutPayment, closeView, contactsViral, env, eventLog, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getDefaultPlaceholderImages, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPermission, getPlatformOS, getSafeAreaInsets, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, graniteEvent, grantPromotionReward, grantPromotionRewardForGame, isMinVersionSupported, loadFullScreenAd, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPermissionDialog, openURL, partner, requestPermission, requestReview, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, showFullScreenAd, startUpdateLocation, submitGameCenterLeaderBoardScore, tdsEvent };
664
+ //#endregion
665
+ export { Accuracy, type AitDevtoolsState, Analytics, type AnalyticsLogEntry, type DeviceApiMode, type DeviceModes, GoogleAdMob, type HapticFeedbackType, IAP, type IapNextResult, type LocationCoords, type MockContact, type MockData, type MockIapProduct, type MockLocation, type NetworkStatus, type OperationalEnvironment, type PermissionName, type PermissionStatus, type PlatformOS, type Primitive, type SafeAreaInsets, type SafeAreaInsets$1 as SafeAreaInsetsType, Storage, TossAds, aitState, appLogin, appsInTossEvent, appsInTossSignTossCert, checkoutPayment, closeView, contactsViral, env, eventLog, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getDefaultPlaceholderImages, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPermission, getPlatformOS, getSafeAreaInsets, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, graniteEvent, grantPromotionReward, grantPromotionRewardForGame, isMinVersionSupported, loadFullScreenAd, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPermissionDialog, openURL, partner, requestPermission, requestReview, saveBase64Data, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, showFullScreenAd, startUpdateLocation, submitGameCenterLeaderBoardScore, tdsEvent };
666
+ //# sourceMappingURL=index.d.ts.map