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