@apps-in-toss/types 1.9.3 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -306,4 +306,220 @@ type PermissionFunctionWithDialog<T extends (...args: any[]) => any> = T & {
306
306
  openPermissionDialog: PermissionDialogFunction;
307
307
  };
308
308
 
309
- export { Accuracy, type CompatiblePlaceholderArgument, type ContactEntity, type ContactResult, type CreatePermissionFunctionOptions, type FetchAlbumPhotos, type FetchAlbumPhotosOptions, FetchAlbumPhotosPermissionError, type FetchContacts, type FetchContactsOptions, FetchContactsPermissionError, type GetClipboardText, GetClipboardTextPermissionError, type GetCurrentLocation, type GetCurrentLocationOptions, GetCurrentLocationPermissionError, type GetPermissionFunction, type ImageResponse, type InternalGetPermissionFunction, type InternalPermissionDialogFunction, type Location, type LocationCoords, type OpenCamera, type OpenCameraOptions, OpenCameraPermissionError, type PermissionAccess, type PermissionDialogFunction, type PermissionErrorConstructorParams, type PermissionErrorType, type PermissionFunctionName, type PermissionFunctionWithDialog, type PermissionName, type PermissionStatus, type RequestPermissionFunction, type SetClipboardText, type SetClipboardTextOptions, SetClipboardTextPermissionError, type StartUpdateLocation, type StartUpdateLocationEventParams, type StartUpdateLocationOptions, StartUpdateLocationPermissionError };
309
+ interface LoadFullScreenAdOptions {
310
+ adGroupId: string;
311
+ }
312
+ interface LoadFullScreenAdEvent {
313
+ type: 'loaded';
314
+ }
315
+ interface LoadFullScreenAdParams {
316
+ options: LoadFullScreenAdOptions;
317
+ onEvent: (data: LoadFullScreenAdEvent) => void;
318
+ onError: (err: unknown) => void;
319
+ }
320
+ interface ShowFullScreenAdOptions {
321
+ adGroupId: string;
322
+ }
323
+ type AdMobFullScreenEvent$1 = AdClicked$1 | AdDismissed$1 | AdFailedToShow$1 | AdImpression$1 | AdShow$1;
324
+ type AdClicked$1 = {
325
+ type: 'clicked';
326
+ };
327
+ type AdDismissed$1 = {
328
+ type: 'dismissed';
329
+ };
330
+ type AdFailedToShow$1 = {
331
+ type: 'failedToShow';
332
+ };
333
+ type AdImpression$1 = {
334
+ type: 'impression';
335
+ };
336
+ type AdShow$1 = {
337
+ type: 'show';
338
+ };
339
+ type AdUserEarnedReward$1 = {
340
+ type: 'userEarnedReward';
341
+ data: {
342
+ unitType: string;
343
+ unitAmount: number;
344
+ };
345
+ };
346
+ type ShowFullScreenAdEvent = AdMobFullScreenEvent$1 | AdUserEarnedReward$1 | {
347
+ type: 'requested';
348
+ };
349
+ interface ShowFullScreenAdParams {
350
+ options: ShowFullScreenAdOptions;
351
+ onEvent: (data: ShowFullScreenAdEvent) => void;
352
+ onError: (err: unknown) => void;
353
+ }
354
+
355
+ interface FetchTossAdOptions {
356
+ adGroupId: string;
357
+ sdkId: string;
358
+ availableStyleIds: string[];
359
+ }
360
+ interface TossAdEventLogParams {
361
+ log_name: string;
362
+ log_type: string;
363
+ params: Record<string, unknown>;
364
+ }
365
+
366
+ /**
367
+ * @public
368
+ * @category 광고
369
+ * @name AdMobFullScreenEvent
370
+ * @description 앱 화면을 덮는 광고(예: 전면 광고, 보상형 광고)를 사용하는 경우에 발생하는 이벤트 타입이에요.
371
+ * @example
372
+ * ### 광고 이벤트 처리하기
373
+ * ```ts
374
+ * function handleEvent(event: AdMobFullScreenEvent) {
375
+ * switch (event.type) {
376
+ * case 'clicked':
377
+ * console.log('광고가 클릭됐어요.');
378
+ * break;
379
+ *
380
+ * case 'dismissed':
381
+ * console.log('광고가 닫혔어요.');
382
+ * break;
383
+ *
384
+ * case 'failedToShow':
385
+ * console.log('광고가 보여지지 않았어요.');
386
+ * break;
387
+ *
388
+ * case 'impression':
389
+ * console.log('광고가 노출됐어요.');
390
+ * break;
391
+ *
392
+ * case 'show':
393
+ * console.log('광고가 보여졌어요.');
394
+ * break;
395
+ * }
396
+ * }
397
+ * ```
398
+ */
399
+ type AdMobFullScreenEvent = AdClicked | AdDismissed | AdFailedToShow | AdImpression | AdShow;
400
+ type AdClicked = {
401
+ type: 'clicked';
402
+ };
403
+ type AdDismissed = {
404
+ type: 'dismissed';
405
+ };
406
+ type AdFailedToShow = {
407
+ type: 'failedToShow';
408
+ };
409
+ type AdImpression = {
410
+ type: 'impression';
411
+ };
412
+ type AdShow = {
413
+ type: 'show';
414
+ };
415
+ type AdUserEarnedReward = {
416
+ type: 'userEarnedReward';
417
+ data: {
418
+ unitType: string;
419
+ unitAmount: number;
420
+ };
421
+ };
422
+ interface AdMobHandlerParams<Options = void, Event = AdMobFullScreenEvent> {
423
+ options: Options;
424
+ onEvent: (event: Event) => void;
425
+ onError: (error: unknown) => void;
426
+ }
427
+ /**
428
+ * @public
429
+ * @category 광고
430
+ * @name ResponseInfo
431
+ * @description 광고 로드 응답 정보를 담고 있는 객체예요.
432
+ * @property {Array<AdNetworkResponseInfo>} adNetworkInfoArray 광고 네트워크 응답 정보 배열예요.
433
+ * @property {AdNetworkResponseInfo | null} loadedAdNetworkInfo 로드된 광고 네트워크 응답 정보예요.
434
+ * @property {string | null} responseId 광고 응답 ID예요.
435
+ */
436
+ interface ResponseInfo {
437
+ adNetworkInfoArray: Array<AdNetworkResponseInfo>;
438
+ loadedAdNetworkInfo: AdNetworkResponseInfo | null;
439
+ responseId: string | null;
440
+ }
441
+ /**
442
+ * @public
443
+ * @category 광고
444
+ * @name AdNetworkResponseInfo
445
+ * @description 광고 네트워크 응답 정보를 담고 있는 객체예요.
446
+ * @property {string} adSourceId 광고 소스 ID예요.
447
+ * @property {string} adSourceName 광고 소스 이름이예요.
448
+ * @property {string} adSourceInstanceId 광고 소스 인스턴스 ID예요.
449
+ * @property {string} adSourceInstanceName 광고 소스 인스턴스 이름이예요.
450
+ * @property {string | null} adNetworkClassName 광고 네트워크 클래스 이름이예요.
451
+ */
452
+ interface AdNetworkResponseInfo {
453
+ adSourceId: string;
454
+ adSourceName: string;
455
+ adSourceInstanceId: string;
456
+ adSourceInstanceName: string;
457
+ adNetworkClassName: string | null;
458
+ }
459
+ /**
460
+ * @public
461
+ * @category 광고
462
+ * @name AdMobLoadResult
463
+ * @description 광고의 ID와 응답 정보를 담고 있는 객체예요. 광고를 로드한 뒤, 관련 정보를 확인할 때 유용해요.
464
+ * @property {string} adGroupId 광고 그룹 ID예요.
465
+ * @property {string} adUnitId 광고 ID예요.
466
+ * @property {ResponseInfo} responseInfo 광고 로드 응답 정보예요. 자세한 내용은 [ResponseInfo](/react-native/reference/native-modules/광고/ResponseInfo.html)를 참고하세요.
467
+ */
468
+ interface AdMobLoadResult {
469
+ adGroupId: string;
470
+ adUnitId: string;
471
+ responseInfo: ResponseInfo;
472
+ }
473
+ interface LoadAdMobOptions {
474
+ /**
475
+ * 광고 그룹 단위 ID
476
+ */
477
+ adGroupId: string;
478
+ }
479
+ /**
480
+ * @public
481
+ * @category 광고
482
+ * @name LoadAdMobEvent
483
+ * @description 광고를 불러오는 함수에서 발생하는 이벤트 타입이에요. `loaded` 이벤트가 발생하면 광고를 성공적으로 불러온 거예요. 이때 [AdMobLoadResult](/react-native/reference/native-modules/광고/AdMobLoadResult.html) 객체가 함께 반환돼요.
484
+ */
485
+ type LoadAdMobEvent = {
486
+ type: 'loaded';
487
+ data: AdMobLoadResult;
488
+ };
489
+ /**
490
+ * @public
491
+ * @category 광고
492
+ * @name LoadAdMobParams
493
+ * @description 광고를 불러오는 함수에 필요한 옵션 객체예요.
494
+ */
495
+ type LoadAdMobParams = AdMobHandlerParams<LoadAdMobOptions, LoadAdMobEvent>;
496
+ interface ShowAdMobOptions {
497
+ /**
498
+ * 광고 그룹 단위 ID
499
+ */
500
+ adGroupId: string;
501
+ }
502
+ /**
503
+ * @public
504
+ * @category 광고
505
+ * @name ShowAdMobEvent
506
+ * @description 광고를 보여주는 함수에서 발생하는 이벤트 타입이에요. `requested` 이벤트가 발생하면 광고 노출 요청이 Google AdMob에 성공적으로 전달된 거예요.
507
+ */
508
+ type ShowAdMobEvent = AdMobFullScreenEvent | AdUserEarnedReward | {
509
+ type: 'requested';
510
+ };
511
+ /**
512
+ * @public
513
+ * @category 광고
514
+ * @name ShowAdMobParams
515
+ * @description 불러온 광고를 보여주는 함수에 필요한 옵션 객체예요.
516
+ */
517
+ type ShowAdMobParams = AdMobHandlerParams<ShowAdMobOptions, ShowAdMobEvent>;
518
+ interface IsAdMobLoadedOptions {
519
+ /**
520
+ * 광고 그룹 단위 ID
521
+ */
522
+ adGroupId: string;
523
+ }
524
+
525
+ export { Accuracy, type AdMobFullScreenEvent, type AdMobHandlerParams, type AdMobLoadResult, type AdNetworkResponseInfo, type AdUserEarnedReward, type CompatiblePlaceholderArgument, type ContactEntity, type ContactResult, type CreatePermissionFunctionOptions, type FetchAlbumPhotos, type FetchAlbumPhotosOptions, FetchAlbumPhotosPermissionError, type FetchContacts, type FetchContactsOptions, FetchContactsPermissionError, type FetchTossAdOptions, type GetClipboardText, GetClipboardTextPermissionError, type GetCurrentLocation, type GetCurrentLocationOptions, GetCurrentLocationPermissionError, type GetPermissionFunction, type ImageResponse, type InternalGetPermissionFunction, type InternalPermissionDialogFunction, type IsAdMobLoadedOptions, type LoadAdMobEvent, type LoadAdMobOptions, type LoadAdMobParams, type LoadFullScreenAdEvent, type LoadFullScreenAdOptions, type LoadFullScreenAdParams, type Location, type LocationCoords, type OpenCamera, type OpenCameraOptions, OpenCameraPermissionError, type PermissionAccess, type PermissionDialogFunction, type PermissionErrorConstructorParams, type PermissionErrorType, type PermissionFunctionName, type PermissionFunctionWithDialog, type PermissionName, type PermissionStatus, type RequestPermissionFunction, type ResponseInfo, type SetClipboardText, type SetClipboardTextOptions, SetClipboardTextPermissionError, type ShowAdMobEvent, type ShowAdMobOptions, type ShowAdMobParams, type ShowFullScreenAdEvent, type ShowFullScreenAdOptions, type ShowFullScreenAdParams, type StartUpdateLocation, type StartUpdateLocationEventParams, type StartUpdateLocationOptions, StartUpdateLocationPermissionError, type TossAdEventLogParams };
package/dist/index.d.ts CHANGED
@@ -306,4 +306,220 @@ type PermissionFunctionWithDialog<T extends (...args: any[]) => any> = T & {
306
306
  openPermissionDialog: PermissionDialogFunction;
307
307
  };
308
308
 
309
- export { Accuracy, type CompatiblePlaceholderArgument, type ContactEntity, type ContactResult, type CreatePermissionFunctionOptions, type FetchAlbumPhotos, type FetchAlbumPhotosOptions, FetchAlbumPhotosPermissionError, type FetchContacts, type FetchContactsOptions, FetchContactsPermissionError, type GetClipboardText, GetClipboardTextPermissionError, type GetCurrentLocation, type GetCurrentLocationOptions, GetCurrentLocationPermissionError, type GetPermissionFunction, type ImageResponse, type InternalGetPermissionFunction, type InternalPermissionDialogFunction, type Location, type LocationCoords, type OpenCamera, type OpenCameraOptions, OpenCameraPermissionError, type PermissionAccess, type PermissionDialogFunction, type PermissionErrorConstructorParams, type PermissionErrorType, type PermissionFunctionName, type PermissionFunctionWithDialog, type PermissionName, type PermissionStatus, type RequestPermissionFunction, type SetClipboardText, type SetClipboardTextOptions, SetClipboardTextPermissionError, type StartUpdateLocation, type StartUpdateLocationEventParams, type StartUpdateLocationOptions, StartUpdateLocationPermissionError };
309
+ interface LoadFullScreenAdOptions {
310
+ adGroupId: string;
311
+ }
312
+ interface LoadFullScreenAdEvent {
313
+ type: 'loaded';
314
+ }
315
+ interface LoadFullScreenAdParams {
316
+ options: LoadFullScreenAdOptions;
317
+ onEvent: (data: LoadFullScreenAdEvent) => void;
318
+ onError: (err: unknown) => void;
319
+ }
320
+ interface ShowFullScreenAdOptions {
321
+ adGroupId: string;
322
+ }
323
+ type AdMobFullScreenEvent$1 = AdClicked$1 | AdDismissed$1 | AdFailedToShow$1 | AdImpression$1 | AdShow$1;
324
+ type AdClicked$1 = {
325
+ type: 'clicked';
326
+ };
327
+ type AdDismissed$1 = {
328
+ type: 'dismissed';
329
+ };
330
+ type AdFailedToShow$1 = {
331
+ type: 'failedToShow';
332
+ };
333
+ type AdImpression$1 = {
334
+ type: 'impression';
335
+ };
336
+ type AdShow$1 = {
337
+ type: 'show';
338
+ };
339
+ type AdUserEarnedReward$1 = {
340
+ type: 'userEarnedReward';
341
+ data: {
342
+ unitType: string;
343
+ unitAmount: number;
344
+ };
345
+ };
346
+ type ShowFullScreenAdEvent = AdMobFullScreenEvent$1 | AdUserEarnedReward$1 | {
347
+ type: 'requested';
348
+ };
349
+ interface ShowFullScreenAdParams {
350
+ options: ShowFullScreenAdOptions;
351
+ onEvent: (data: ShowFullScreenAdEvent) => void;
352
+ onError: (err: unknown) => void;
353
+ }
354
+
355
+ interface FetchTossAdOptions {
356
+ adGroupId: string;
357
+ sdkId: string;
358
+ availableStyleIds: string[];
359
+ }
360
+ interface TossAdEventLogParams {
361
+ log_name: string;
362
+ log_type: string;
363
+ params: Record<string, unknown>;
364
+ }
365
+
366
+ /**
367
+ * @public
368
+ * @category 광고
369
+ * @name AdMobFullScreenEvent
370
+ * @description 앱 화면을 덮는 광고(예: 전면 광고, 보상형 광고)를 사용하는 경우에 발생하는 이벤트 타입이에요.
371
+ * @example
372
+ * ### 광고 이벤트 처리하기
373
+ * ```ts
374
+ * function handleEvent(event: AdMobFullScreenEvent) {
375
+ * switch (event.type) {
376
+ * case 'clicked':
377
+ * console.log('광고가 클릭됐어요.');
378
+ * break;
379
+ *
380
+ * case 'dismissed':
381
+ * console.log('광고가 닫혔어요.');
382
+ * break;
383
+ *
384
+ * case 'failedToShow':
385
+ * console.log('광고가 보여지지 않았어요.');
386
+ * break;
387
+ *
388
+ * case 'impression':
389
+ * console.log('광고가 노출됐어요.');
390
+ * break;
391
+ *
392
+ * case 'show':
393
+ * console.log('광고가 보여졌어요.');
394
+ * break;
395
+ * }
396
+ * }
397
+ * ```
398
+ */
399
+ type AdMobFullScreenEvent = AdClicked | AdDismissed | AdFailedToShow | AdImpression | AdShow;
400
+ type AdClicked = {
401
+ type: 'clicked';
402
+ };
403
+ type AdDismissed = {
404
+ type: 'dismissed';
405
+ };
406
+ type AdFailedToShow = {
407
+ type: 'failedToShow';
408
+ };
409
+ type AdImpression = {
410
+ type: 'impression';
411
+ };
412
+ type AdShow = {
413
+ type: 'show';
414
+ };
415
+ type AdUserEarnedReward = {
416
+ type: 'userEarnedReward';
417
+ data: {
418
+ unitType: string;
419
+ unitAmount: number;
420
+ };
421
+ };
422
+ interface AdMobHandlerParams<Options = void, Event = AdMobFullScreenEvent> {
423
+ options: Options;
424
+ onEvent: (event: Event) => void;
425
+ onError: (error: unknown) => void;
426
+ }
427
+ /**
428
+ * @public
429
+ * @category 광고
430
+ * @name ResponseInfo
431
+ * @description 광고 로드 응답 정보를 담고 있는 객체예요.
432
+ * @property {Array<AdNetworkResponseInfo>} adNetworkInfoArray 광고 네트워크 응답 정보 배열예요.
433
+ * @property {AdNetworkResponseInfo | null} loadedAdNetworkInfo 로드된 광고 네트워크 응답 정보예요.
434
+ * @property {string | null} responseId 광고 응답 ID예요.
435
+ */
436
+ interface ResponseInfo {
437
+ adNetworkInfoArray: Array<AdNetworkResponseInfo>;
438
+ loadedAdNetworkInfo: AdNetworkResponseInfo | null;
439
+ responseId: string | null;
440
+ }
441
+ /**
442
+ * @public
443
+ * @category 광고
444
+ * @name AdNetworkResponseInfo
445
+ * @description 광고 네트워크 응답 정보를 담고 있는 객체예요.
446
+ * @property {string} adSourceId 광고 소스 ID예요.
447
+ * @property {string} adSourceName 광고 소스 이름이예요.
448
+ * @property {string} adSourceInstanceId 광고 소스 인스턴스 ID예요.
449
+ * @property {string} adSourceInstanceName 광고 소스 인스턴스 이름이예요.
450
+ * @property {string | null} adNetworkClassName 광고 네트워크 클래스 이름이예요.
451
+ */
452
+ interface AdNetworkResponseInfo {
453
+ adSourceId: string;
454
+ adSourceName: string;
455
+ adSourceInstanceId: string;
456
+ adSourceInstanceName: string;
457
+ adNetworkClassName: string | null;
458
+ }
459
+ /**
460
+ * @public
461
+ * @category 광고
462
+ * @name AdMobLoadResult
463
+ * @description 광고의 ID와 응답 정보를 담고 있는 객체예요. 광고를 로드한 뒤, 관련 정보를 확인할 때 유용해요.
464
+ * @property {string} adGroupId 광고 그룹 ID예요.
465
+ * @property {string} adUnitId 광고 ID예요.
466
+ * @property {ResponseInfo} responseInfo 광고 로드 응답 정보예요. 자세한 내용은 [ResponseInfo](/react-native/reference/native-modules/광고/ResponseInfo.html)를 참고하세요.
467
+ */
468
+ interface AdMobLoadResult {
469
+ adGroupId: string;
470
+ adUnitId: string;
471
+ responseInfo: ResponseInfo;
472
+ }
473
+ interface LoadAdMobOptions {
474
+ /**
475
+ * 광고 그룹 단위 ID
476
+ */
477
+ adGroupId: string;
478
+ }
479
+ /**
480
+ * @public
481
+ * @category 광고
482
+ * @name LoadAdMobEvent
483
+ * @description 광고를 불러오는 함수에서 발생하는 이벤트 타입이에요. `loaded` 이벤트가 발생하면 광고를 성공적으로 불러온 거예요. 이때 [AdMobLoadResult](/react-native/reference/native-modules/광고/AdMobLoadResult.html) 객체가 함께 반환돼요.
484
+ */
485
+ type LoadAdMobEvent = {
486
+ type: 'loaded';
487
+ data: AdMobLoadResult;
488
+ };
489
+ /**
490
+ * @public
491
+ * @category 광고
492
+ * @name LoadAdMobParams
493
+ * @description 광고를 불러오는 함수에 필요한 옵션 객체예요.
494
+ */
495
+ type LoadAdMobParams = AdMobHandlerParams<LoadAdMobOptions, LoadAdMobEvent>;
496
+ interface ShowAdMobOptions {
497
+ /**
498
+ * 광고 그룹 단위 ID
499
+ */
500
+ adGroupId: string;
501
+ }
502
+ /**
503
+ * @public
504
+ * @category 광고
505
+ * @name ShowAdMobEvent
506
+ * @description 광고를 보여주는 함수에서 발생하는 이벤트 타입이에요. `requested` 이벤트가 발생하면 광고 노출 요청이 Google AdMob에 성공적으로 전달된 거예요.
507
+ */
508
+ type ShowAdMobEvent = AdMobFullScreenEvent | AdUserEarnedReward | {
509
+ type: 'requested';
510
+ };
511
+ /**
512
+ * @public
513
+ * @category 광고
514
+ * @name ShowAdMobParams
515
+ * @description 불러온 광고를 보여주는 함수에 필요한 옵션 객체예요.
516
+ */
517
+ type ShowAdMobParams = AdMobHandlerParams<ShowAdMobOptions, ShowAdMobEvent>;
518
+ interface IsAdMobLoadedOptions {
519
+ /**
520
+ * 광고 그룹 단위 ID
521
+ */
522
+ adGroupId: string;
523
+ }
524
+
525
+ export { Accuracy, type AdMobFullScreenEvent, type AdMobHandlerParams, type AdMobLoadResult, type AdNetworkResponseInfo, type AdUserEarnedReward, type CompatiblePlaceholderArgument, type ContactEntity, type ContactResult, type CreatePermissionFunctionOptions, type FetchAlbumPhotos, type FetchAlbumPhotosOptions, FetchAlbumPhotosPermissionError, type FetchContacts, type FetchContactsOptions, FetchContactsPermissionError, type FetchTossAdOptions, type GetClipboardText, GetClipboardTextPermissionError, type GetCurrentLocation, type GetCurrentLocationOptions, GetCurrentLocationPermissionError, type GetPermissionFunction, type ImageResponse, type InternalGetPermissionFunction, type InternalPermissionDialogFunction, type IsAdMobLoadedOptions, type LoadAdMobEvent, type LoadAdMobOptions, type LoadAdMobParams, type LoadFullScreenAdEvent, type LoadFullScreenAdOptions, type LoadFullScreenAdParams, type Location, type LocationCoords, type OpenCamera, type OpenCameraOptions, OpenCameraPermissionError, type PermissionAccess, type PermissionDialogFunction, type PermissionErrorConstructorParams, type PermissionErrorType, type PermissionFunctionName, type PermissionFunctionWithDialog, type PermissionName, type PermissionStatus, type RequestPermissionFunction, type ResponseInfo, type SetClipboardText, type SetClipboardTextOptions, SetClipboardTextPermissionError, type ShowAdMobEvent, type ShowAdMobOptions, type ShowAdMobParams, type ShowFullScreenAdEvent, type ShowFullScreenAdOptions, type ShowFullScreenAdParams, type StartUpdateLocation, type StartUpdateLocationEventParams, type StartUpdateLocationOptions, StartUpdateLocationPermissionError, type TossAdEventLogParams };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/types",
3
3
  "type": "module",
4
- "version": "1.9.3",
4
+ "version": "1.10.0",
5
5
  "description": "Types for Apps In Toss",
6
6
  "scripts": {
7
7
  "typecheck": "tsc --noEmit",
@@ -0,0 +1,153 @@
1
+ /**
2
+ * @public
3
+ * @category 광고
4
+ * @name AdMobFullScreenEvent
5
+ * @description 앱 화면을 덮는 광고(예: 전면 광고, 보상형 광고)를 사용하는 경우에 발생하는 이벤트 타입이에요.
6
+ * @example
7
+ * ### 광고 이벤트 처리하기
8
+ * ```ts
9
+ * function handleEvent(event: AdMobFullScreenEvent) {
10
+ * switch (event.type) {
11
+ * case 'clicked':
12
+ * console.log('광고가 클릭됐어요.');
13
+ * break;
14
+ *
15
+ * case 'dismissed':
16
+ * console.log('광고가 닫혔어요.');
17
+ * break;
18
+ *
19
+ * case 'failedToShow':
20
+ * console.log('광고가 보여지지 않았어요.');
21
+ * break;
22
+ *
23
+ * case 'impression':
24
+ * console.log('광고가 노출됐어요.');
25
+ * break;
26
+ *
27
+ * case 'show':
28
+ * console.log('광고가 보여졌어요.');
29
+ * break;
30
+ * }
31
+ * }
32
+ * ```
33
+ */
34
+ export type AdMobFullScreenEvent = AdClicked | AdDismissed | AdFailedToShow | AdImpression | AdShow;
35
+
36
+ type AdClicked = { type: 'clicked' };
37
+ type AdDismissed = { type: 'dismissed' };
38
+ type AdFailedToShow = { type: 'failedToShow' };
39
+ type AdImpression = { type: 'impression' };
40
+ type AdShow = { type: 'show' };
41
+
42
+ export type AdUserEarnedReward = { type: 'userEarnedReward'; data: { unitType: string; unitAmount: number } };
43
+
44
+ export interface AdMobHandlerParams<Options = void, Event = AdMobFullScreenEvent> {
45
+ options: Options;
46
+ onEvent: (event: Event) => void;
47
+ onError: (error: unknown) => void;
48
+ }
49
+
50
+ /**
51
+ * @public
52
+ * @category 광고
53
+ * @name ResponseInfo
54
+ * @description 광고 로드 응답 정보를 담고 있는 객체예요.
55
+ * @property {Array<AdNetworkResponseInfo>} adNetworkInfoArray 광고 네트워크 응답 정보 배열예요.
56
+ * @property {AdNetworkResponseInfo | null} loadedAdNetworkInfo 로드된 광고 네트워크 응답 정보예요.
57
+ * @property {string | null} responseId 광고 응답 ID예요.
58
+ */
59
+ export interface ResponseInfo {
60
+ adNetworkInfoArray: Array<AdNetworkResponseInfo>;
61
+ loadedAdNetworkInfo: AdNetworkResponseInfo | null;
62
+ responseId: string | null;
63
+ }
64
+
65
+ /**
66
+ * @public
67
+ * @category 광고
68
+ * @name AdNetworkResponseInfo
69
+ * @description 광고 네트워크 응답 정보를 담고 있는 객체예요.
70
+ * @property {string} adSourceId 광고 소스 ID예요.
71
+ * @property {string} adSourceName 광고 소스 이름이예요.
72
+ * @property {string} adSourceInstanceId 광고 소스 인스턴스 ID예요.
73
+ * @property {string} adSourceInstanceName 광고 소스 인스턴스 이름이예요.
74
+ * @property {string | null} adNetworkClassName 광고 네트워크 클래스 이름이예요.
75
+ */
76
+ export interface AdNetworkResponseInfo {
77
+ adSourceId: string;
78
+ adSourceName: string;
79
+ adSourceInstanceId: string;
80
+ adSourceInstanceName: string;
81
+ adNetworkClassName: string | null;
82
+ }
83
+
84
+ /**
85
+ * @public
86
+ * @category 광고
87
+ * @name AdMobLoadResult
88
+ * @description 광고의 ID와 응답 정보를 담고 있는 객체예요. 광고를 로드한 뒤, 관련 정보를 확인할 때 유용해요.
89
+ * @property {string} adGroupId 광고 그룹 ID예요.
90
+ * @property {string} adUnitId 광고 ID예요.
91
+ * @property {ResponseInfo} responseInfo 광고 로드 응답 정보예요. 자세한 내용은 [ResponseInfo](/react-native/reference/native-modules/광고/ResponseInfo.html)를 참고하세요.
92
+ */
93
+ export interface AdMobLoadResult {
94
+ adGroupId: string;
95
+ adUnitId: string;
96
+ responseInfo: ResponseInfo;
97
+ }
98
+
99
+ export interface LoadAdMobOptions {
100
+ /**
101
+ * 광고 그룹 단위 ID
102
+ */
103
+ adGroupId: string;
104
+ }
105
+
106
+ /**
107
+ * @public
108
+ * @category 광고
109
+ * @name LoadAdMobEvent
110
+ * @description 광고를 불러오는 함수에서 발생하는 이벤트 타입이에요. `loaded` 이벤트가 발생하면 광고를 성공적으로 불러온 거예요. 이때 [AdMobLoadResult](/react-native/reference/native-modules/광고/AdMobLoadResult.html) 객체가 함께 반환돼요.
111
+ */
112
+ export type LoadAdMobEvent = {
113
+ type: 'loaded';
114
+ data: AdMobLoadResult;
115
+ };
116
+
117
+ /**
118
+ * @public
119
+ * @category 광고
120
+ * @name LoadAdMobParams
121
+ * @description 광고를 불러오는 함수에 필요한 옵션 객체예요.
122
+ */
123
+ export type LoadAdMobParams = AdMobHandlerParams<LoadAdMobOptions, LoadAdMobEvent>;
124
+
125
+ export interface ShowAdMobOptions {
126
+ /**
127
+ * 광고 그룹 단위 ID
128
+ */
129
+ adGroupId: string;
130
+ }
131
+
132
+ /**
133
+ * @public
134
+ * @category 광고
135
+ * @name ShowAdMobEvent
136
+ * @description 광고를 보여주는 함수에서 발생하는 이벤트 타입이에요. `requested` 이벤트가 발생하면 광고 노출 요청이 Google AdMob에 성공적으로 전달된 거예요.
137
+ */
138
+ export type ShowAdMobEvent = AdMobFullScreenEvent | AdUserEarnedReward | { type: 'requested' };
139
+
140
+ /**
141
+ * @public
142
+ * @category 광고
143
+ * @name ShowAdMobParams
144
+ * @description 불러온 광고를 보여주는 함수에 필요한 옵션 객체예요.
145
+ */
146
+ export type ShowAdMobParams = AdMobHandlerParams<ShowAdMobOptions, ShowAdMobEvent>;
147
+
148
+ export interface IsAdMobLoadedOptions {
149
+ /**
150
+ * 광고 그룹 단위 ID
151
+ */
152
+ adGroupId: string;
153
+ }
package/src/index.ts CHANGED
@@ -1 +1,4 @@
1
1
  export * from './permissions';
2
+ export * from './integratedAd';
3
+ export * from './tossAd';
4
+ export * from './googleAdMobV2';
@@ -0,0 +1,35 @@
1
+ export interface LoadFullScreenAdOptions {
2
+ adGroupId: string;
3
+ }
4
+
5
+ export interface LoadFullScreenAdEvent {
6
+ type: 'loaded';
7
+ }
8
+
9
+ export interface LoadFullScreenAdParams {
10
+ options: LoadFullScreenAdOptions;
11
+ onEvent: (data: LoadFullScreenAdEvent) => void;
12
+ onError: (err: unknown) => void;
13
+ }
14
+
15
+ export interface ShowFullScreenAdOptions {
16
+ adGroupId: string;
17
+ }
18
+
19
+ type AdMobFullScreenEvent = AdClicked | AdDismissed | AdFailedToShow | AdImpression | AdShow;
20
+
21
+ type AdClicked = { type: 'clicked' };
22
+ type AdDismissed = { type: 'dismissed' };
23
+ type AdFailedToShow = { type: 'failedToShow' };
24
+ type AdImpression = { type: 'impression' };
25
+ type AdShow = { type: 'show' };
26
+
27
+ type AdUserEarnedReward = { type: 'userEarnedReward'; data: { unitType: string; unitAmount: number } };
28
+
29
+ export type ShowFullScreenAdEvent = AdMobFullScreenEvent | AdUserEarnedReward | { type: 'requested' };
30
+
31
+ export interface ShowFullScreenAdParams {
32
+ options: ShowFullScreenAdOptions;
33
+ onEvent: (data: ShowFullScreenAdEvent) => void;
34
+ onError: (err: unknown) => void;
35
+ }
@@ -0,0 +1,11 @@
1
+ export interface FetchTossAdOptions {
2
+ adGroupId: string;
3
+ sdkId: string;
4
+ availableStyleIds: string[];
5
+ }
6
+
7
+ export interface TossAdEventLogParams {
8
+ log_name: string;
9
+ log_type: string;
10
+ params: Record<string, unknown>;
11
+ }