@apps-in-toss/framework 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
@@ -6,8 +6,9 @@ export * from '@apps-in-toss/analytics';
6
6
  import { InitialProps, GraniteProps } from '@granite-js/react-native';
7
7
  import { WebViewProps as WebViewProps$1 } from '@granite-js/native/react-native-webview';
8
8
  import { ExternalWebViewScreenProps } from '@toss/tds-react-native';
9
- import { StartUpdateLocationOptions, Location } from '@apps-in-toss/types';
9
+ import { StartUpdateLocationOptions, Location, LoadFullScreenAdParams, ShowFullScreenAdParams } from '@apps-in-toss/types';
10
10
  export * from '@apps-in-toss/types';
11
+ export { FetchTossAdOptions, LoadFullScreenAdEvent, LoadFullScreenAdOptions, LoadFullScreenAdParams, ShowFullScreenAdEvent, ShowFullScreenAdOptions, ShowFullScreenAdParams, TossAdEventLogParams } from '@apps-in-toss/types';
11
12
  import { onVisibilityChangedByTransparentServiceWeb } from '@apps-in-toss/native-modules';
12
13
  export * from '@apps-in-toss/native-modules';
13
14
  export { OverlayProvider, useOverlay } from '@toss/tds-react-native/private';
@@ -166,75 +167,69 @@ declare function useTopNavigation(): {
166
167
 
167
168
  declare const env: {
168
169
  getDeploymentId: () => string;
170
+ getWebViewType: () => "partner" | "external" | "game" | undefined;
171
+ getAppName: () => string;
169
172
  };
170
173
 
171
174
  declare const INTERNAL__onVisibilityChangedByTransparentServiceWeb: typeof onVisibilityChangedByTransparentServiceWeb;
172
175
 
173
- interface LoadFullScreenAdOptions {
174
- adGroupId: string;
175
- }
176
- interface LoadFullScreenAdEvent {
177
- type: 'loaded';
178
- }
179
- interface LoadFullScreenAdParams {
180
- options: LoadFullScreenAdOptions;
181
- onEvent: (data: LoadFullScreenAdEvent) => void;
182
- onError: (err: unknown) => void;
183
- }
184
176
  declare const loadFullScreenAd: {
185
177
  (params: LoadFullScreenAdParams): () => void;
186
178
  isSupported: () => boolean;
187
179
  };
188
- interface ShowFullScreenAdOptions {
189
- adGroupId: string;
190
- }
191
- type AdMobFullScreenEvent = AdClicked | AdDismissed | AdFailedToShow | AdImpression | AdShow;
192
- type AdClicked = {
193
- type: 'clicked';
194
- };
195
- type AdDismissed = {
196
- type: 'dismissed';
197
- };
198
- type AdFailedToShow = {
199
- type: 'failedToShow';
200
- };
201
- type AdImpression = {
202
- type: 'impression';
203
- };
204
- type AdShow = {
205
- type: 'show';
206
- };
207
- type AdUserEarnedReward = {
208
- type: 'userEarnedReward';
209
- data: {
210
- unitType: string;
211
- unitAmount: number;
212
- };
213
- };
214
- type ShowFullScreenAdEvent = AdMobFullScreenEvent | AdUserEarnedReward | {
215
- type: 'requested';
216
- };
217
- interface ShowFullScreenAdParams {
218
- options: ShowFullScreenAdOptions;
219
- onEvent: (data: ShowFullScreenAdEvent) => void;
220
- onError: (err: unknown) => void;
221
- }
222
180
  declare function showFullScreenAd(params: ShowFullScreenAdParams): () => void;
223
181
  declare namespace showFullScreenAd {
224
182
  var isSupported: () => boolean;
225
183
  }
226
184
 
227
- interface FetchTossAdOptions {
185
+ interface AdError {
186
+ code: number;
187
+ message: string;
188
+ domain?: string;
189
+ }
190
+ interface BannerSlotEventPayload {
191
+ slotId: string;
228
192
  adGroupId: string;
229
- sdkId: string;
230
- availableStyleIds: string[];
193
+ adMetadata: {
194
+ creativeId: string;
195
+ requestId: string;
196
+ styleId: string;
197
+ };
231
198
  }
232
-
233
- interface TossAdEventLogParams {
234
- log_name: string;
235
- log_type: string;
236
- params: Record<string, unknown>;
199
+ interface BannerSlotErrorPayload {
200
+ slotId: string;
201
+ adGroupId: string;
202
+ adMetadata: Record<string, never>;
203
+ error: {
204
+ code: number;
205
+ message: string;
206
+ domain?: string;
207
+ };
208
+ }
209
+ interface BannerSlotCallbacks {
210
+ onAdRendered?: (payload: BannerSlotEventPayload) => void;
211
+ onAdViewable?: (payload: BannerSlotEventPayload) => void;
212
+ onAdClicked?: (payload: BannerSlotEventPayload) => void;
213
+ onAdImpression?: (payload: BannerSlotEventPayload) => void;
214
+ onAdFailedToRender?: (payload: BannerSlotErrorPayload) => void;
215
+ onNoFill?: (payload: {
216
+ slotId: string;
217
+ adGroupId: string;
218
+ adMetadata: Record<string, never>;
219
+ }) => void;
237
220
  }
221
+ type InlineAdTheme = 'auto' | 'light' | 'dark';
222
+ type InlineAdTone = 'blackAndWhite' | 'grey';
223
+ type InlineAdVariant = 'expanded' | 'card';
224
+ interface InlineAdProps extends BannerSlotCallbacks {
225
+ adGroupId: string;
226
+ theme?: InlineAdTheme;
227
+ tone?: InlineAdTone;
228
+ variant?: InlineAdVariant;
229
+ impressFallbackOnMount?: boolean;
230
+ }
231
+
232
+ declare function InlineAd(props: InlineAdProps): react_jsx_runtime.JSX.Element | null;
238
233
 
239
234
  declare const Analytics: {
240
235
  init: (options: _apps_in_toss_analytics.AnalyticsConfig) => void;
@@ -243,4 +238,4 @@ declare const Analytics: {
243
238
  Area: ({ children, params: _params, ...props }: _apps_in_toss_analytics.LoggingAreaProps) => react_jsx_runtime.JSX.Element;
244
239
  };
245
240
 
246
- export { Analytics, AppsInToss, type ExternalWebViewProps, type FetchTossAdOptions, type GameWebViewProps, INTERNAL__onVisibilityChangedByTransparentServiceWeb, type LoadFullScreenAdEvent, type LoadFullScreenAdOptions, type LoadFullScreenAdParams, type PartnerWebViewProps, type ShowFullScreenAdEvent, type ShowFullScreenAdOptions, type ShowFullScreenAdParams, type TossAdEventLogParams, type UseGeolocationOptions, WebView, type WebViewProps, env, loadFullScreenAd, showFullScreenAd, useCreateUserAgent, useGeolocation, useTopNavigation, useWaitForReturnNavigator };
241
+ export { type AdError, Analytics, AppsInToss, type BannerSlotCallbacks, type BannerSlotErrorPayload, type BannerSlotEventPayload, type ExternalWebViewProps, type GameWebViewProps, INTERNAL__onVisibilityChangedByTransparentServiceWeb, InlineAd, type InlineAdProps, type InlineAdTheme, type InlineAdTone, type InlineAdVariant, type PartnerWebViewProps, type UseGeolocationOptions, WebView, type WebViewProps, env, loadFullScreenAd, showFullScreenAd, useCreateUserAgent, useGeolocation, useTopNavigation, useWaitForReturnNavigator };
package/dist/index.d.ts CHANGED
@@ -6,8 +6,9 @@ export * from '@apps-in-toss/analytics';
6
6
  import { InitialProps, GraniteProps } from '@granite-js/react-native';
7
7
  import { WebViewProps as WebViewProps$1 } from '@granite-js/native/react-native-webview';
8
8
  import { ExternalWebViewScreenProps } from '@toss/tds-react-native';
9
- import { StartUpdateLocationOptions, Location } from '@apps-in-toss/types';
9
+ import { StartUpdateLocationOptions, Location, LoadFullScreenAdParams, ShowFullScreenAdParams } from '@apps-in-toss/types';
10
10
  export * from '@apps-in-toss/types';
11
+ export { FetchTossAdOptions, LoadFullScreenAdEvent, LoadFullScreenAdOptions, LoadFullScreenAdParams, ShowFullScreenAdEvent, ShowFullScreenAdOptions, ShowFullScreenAdParams, TossAdEventLogParams } from '@apps-in-toss/types';
11
12
  import { onVisibilityChangedByTransparentServiceWeb } from '@apps-in-toss/native-modules';
12
13
  export * from '@apps-in-toss/native-modules';
13
14
  export { OverlayProvider, useOverlay } from '@toss/tds-react-native/private';
@@ -166,75 +167,69 @@ declare function useTopNavigation(): {
166
167
 
167
168
  declare const env: {
168
169
  getDeploymentId: () => string;
170
+ getWebViewType: () => "partner" | "external" | "game" | undefined;
171
+ getAppName: () => string;
169
172
  };
170
173
 
171
174
  declare const INTERNAL__onVisibilityChangedByTransparentServiceWeb: typeof onVisibilityChangedByTransparentServiceWeb;
172
175
 
173
- interface LoadFullScreenAdOptions {
174
- adGroupId: string;
175
- }
176
- interface LoadFullScreenAdEvent {
177
- type: 'loaded';
178
- }
179
- interface LoadFullScreenAdParams {
180
- options: LoadFullScreenAdOptions;
181
- onEvent: (data: LoadFullScreenAdEvent) => void;
182
- onError: (err: unknown) => void;
183
- }
184
176
  declare const loadFullScreenAd: {
185
177
  (params: LoadFullScreenAdParams): () => void;
186
178
  isSupported: () => boolean;
187
179
  };
188
- interface ShowFullScreenAdOptions {
189
- adGroupId: string;
190
- }
191
- type AdMobFullScreenEvent = AdClicked | AdDismissed | AdFailedToShow | AdImpression | AdShow;
192
- type AdClicked = {
193
- type: 'clicked';
194
- };
195
- type AdDismissed = {
196
- type: 'dismissed';
197
- };
198
- type AdFailedToShow = {
199
- type: 'failedToShow';
200
- };
201
- type AdImpression = {
202
- type: 'impression';
203
- };
204
- type AdShow = {
205
- type: 'show';
206
- };
207
- type AdUserEarnedReward = {
208
- type: 'userEarnedReward';
209
- data: {
210
- unitType: string;
211
- unitAmount: number;
212
- };
213
- };
214
- type ShowFullScreenAdEvent = AdMobFullScreenEvent | AdUserEarnedReward | {
215
- type: 'requested';
216
- };
217
- interface ShowFullScreenAdParams {
218
- options: ShowFullScreenAdOptions;
219
- onEvent: (data: ShowFullScreenAdEvent) => void;
220
- onError: (err: unknown) => void;
221
- }
222
180
  declare function showFullScreenAd(params: ShowFullScreenAdParams): () => void;
223
181
  declare namespace showFullScreenAd {
224
182
  var isSupported: () => boolean;
225
183
  }
226
184
 
227
- interface FetchTossAdOptions {
185
+ interface AdError {
186
+ code: number;
187
+ message: string;
188
+ domain?: string;
189
+ }
190
+ interface BannerSlotEventPayload {
191
+ slotId: string;
228
192
  adGroupId: string;
229
- sdkId: string;
230
- availableStyleIds: string[];
193
+ adMetadata: {
194
+ creativeId: string;
195
+ requestId: string;
196
+ styleId: string;
197
+ };
231
198
  }
232
-
233
- interface TossAdEventLogParams {
234
- log_name: string;
235
- log_type: string;
236
- params: Record<string, unknown>;
199
+ interface BannerSlotErrorPayload {
200
+ slotId: string;
201
+ adGroupId: string;
202
+ adMetadata: Record<string, never>;
203
+ error: {
204
+ code: number;
205
+ message: string;
206
+ domain?: string;
207
+ };
208
+ }
209
+ interface BannerSlotCallbacks {
210
+ onAdRendered?: (payload: BannerSlotEventPayload) => void;
211
+ onAdViewable?: (payload: BannerSlotEventPayload) => void;
212
+ onAdClicked?: (payload: BannerSlotEventPayload) => void;
213
+ onAdImpression?: (payload: BannerSlotEventPayload) => void;
214
+ onAdFailedToRender?: (payload: BannerSlotErrorPayload) => void;
215
+ onNoFill?: (payload: {
216
+ slotId: string;
217
+ adGroupId: string;
218
+ adMetadata: Record<string, never>;
219
+ }) => void;
237
220
  }
221
+ type InlineAdTheme = 'auto' | 'light' | 'dark';
222
+ type InlineAdTone = 'blackAndWhite' | 'grey';
223
+ type InlineAdVariant = 'expanded' | 'card';
224
+ interface InlineAdProps extends BannerSlotCallbacks {
225
+ adGroupId: string;
226
+ theme?: InlineAdTheme;
227
+ tone?: InlineAdTone;
228
+ variant?: InlineAdVariant;
229
+ impressFallbackOnMount?: boolean;
230
+ }
231
+
232
+ declare function InlineAd(props: InlineAdProps): react_jsx_runtime.JSX.Element | null;
238
233
 
239
234
  declare const Analytics: {
240
235
  init: (options: _apps_in_toss_analytics.AnalyticsConfig) => void;
@@ -243,4 +238,4 @@ declare const Analytics: {
243
238
  Area: ({ children, params: _params, ...props }: _apps_in_toss_analytics.LoggingAreaProps) => react_jsx_runtime.JSX.Element;
244
239
  };
245
240
 
246
- export { Analytics, AppsInToss, type ExternalWebViewProps, type FetchTossAdOptions, type GameWebViewProps, INTERNAL__onVisibilityChangedByTransparentServiceWeb, type LoadFullScreenAdEvent, type LoadFullScreenAdOptions, type LoadFullScreenAdParams, type PartnerWebViewProps, type ShowFullScreenAdEvent, type ShowFullScreenAdOptions, type ShowFullScreenAdParams, type TossAdEventLogParams, type UseGeolocationOptions, WebView, type WebViewProps, env, loadFullScreenAd, showFullScreenAd, useCreateUserAgent, useGeolocation, useTopNavigation, useWaitForReturnNavigator };
241
+ export { type AdError, Analytics, AppsInToss, type BannerSlotCallbacks, type BannerSlotErrorPayload, type BannerSlotEventPayload, type ExternalWebViewProps, type GameWebViewProps, INTERNAL__onVisibilityChangedByTransparentServiceWeb, InlineAd, type InlineAdProps, type InlineAdTheme, type InlineAdTone, type InlineAdVariant, type PartnerWebViewProps, type UseGeolocationOptions, WebView, type WebViewProps, env, loadFullScreenAd, showFullScreenAd, useCreateUserAgent, useGeolocation, useTopNavigation, useWaitForReturnNavigator };