@simula/ads 1.1.0 → 1.3.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/README.md +51 -356
- package/dist/InChatAdSlot.d.ts.map +1 -1
- package/dist/components/GameCard.d.ts +11 -0
- package/dist/components/GameCard.d.ts.map +1 -0
- package/dist/components/GameGrid.d.ts +12 -0
- package/dist/components/GameGrid.d.ts.map +1 -0
- package/dist/components/GameIframe.d.ts +9 -0
- package/dist/components/GameIframe.d.ts.map +1 -0
- package/dist/components/MiniGameMenu.d.ts +4 -0
- package/dist/components/MiniGameMenu.d.ts.map +1 -0
- package/dist/components/inChatAd/InChatAdSlot.d.ts +4 -0
- package/dist/components/inChatAd/InChatAdSlot.d.ts.map +1 -0
- package/dist/components/miniGame/GameCard.d.ts +11 -0
- package/dist/components/miniGame/GameCard.d.ts.map +1 -0
- package/dist/components/miniGame/GameGrid.d.ts +12 -0
- package/dist/components/miniGame/GameGrid.d.ts.map +1 -0
- package/dist/components/miniGame/GameIframe.d.ts +9 -0
- package/dist/components/miniGame/GameIframe.d.ts.map +1 -0
- package/dist/components/miniGame/MiniGameMenu.d.ts +4 -0
- package/dist/components/miniGame/MiniGameMenu.d.ts.map +1 -0
- package/dist/components/miniGame/mockGames.d.ts +3 -0
- package/dist/components/miniGame/mockGames.d.ts.map +1 -0
- package/dist/components/mockGames.d.ts +3 -0
- package/dist/components/mockGames.d.ts.map +1 -0
- package/dist/components/sponsoredSuggestions/SponsoredSuggestions.d.ts +4 -0
- package/dist/components/sponsoredSuggestions/SponsoredSuggestions.d.ts.map +1 -0
- package/dist/index.d.ts +121 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2117 -248
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2070 -205
- package/dist/index.mjs.map +1 -1
- package/dist/types/SimulaProvider.d.ts +5 -0
- package/dist/types/SimulaProvider.d.ts.map +1 -0
- package/dist/types/components/inChatAd/InChatAdSlot.d.ts +4 -0
- package/dist/types/components/inChatAd/InChatAdSlot.d.ts.map +1 -0
- package/dist/types/components/miniGame/GameCard.d.ts +12 -0
- package/dist/types/components/miniGame/GameCard.d.ts.map +1 -0
- package/dist/types/components/miniGame/GameGrid.d.ts +13 -0
- package/dist/types/components/miniGame/GameGrid.d.ts.map +1 -0
- package/dist/types/components/miniGame/GameIframe.d.ts +21 -0
- package/dist/types/components/miniGame/GameIframe.d.ts.map +1 -0
- package/dist/types/components/miniGame/MiniGameMenu.d.ts +4 -0
- package/dist/types/components/miniGame/MiniGameMenu.d.ts.map +1 -0
- package/dist/types/components/miniGame/mockGames.d.ts +3 -0
- package/dist/types/components/miniGame/mockGames.d.ts.map +1 -0
- package/dist/types/components/nativeBanner/NativeBanner.d.ts +4 -0
- package/dist/types/components/nativeBanner/NativeBanner.d.ts.map +1 -0
- package/dist/types/components/nativeBanner/NativeBannerTest.d.ts +4 -0
- package/dist/types/components/nativeBanner/NativeBannerTest.d.ts.map +1 -0
- package/dist/types/components/nativeBanner/RadialLinesSpinner.d.ts +7 -0
- package/dist/types/components/nativeBanner/RadialLinesSpinner.d.ts.map +1 -0
- package/dist/types/components/nativeBanner/index.d.ts +3 -0
- package/dist/types/components/nativeBanner/index.d.ts.map +1 -0
- package/dist/types/components/sponsoredSuggestions/SponsoredSuggestions.d.ts +4 -0
- package/dist/types/components/sponsoredSuggestions/SponsoredSuggestions.d.ts.map +1 -0
- package/dist/types/hooks/useAssetLoadDetection.d.ts +14 -0
- package/dist/types/hooks/useAssetLoadDetection.d.ts.map +1 -0
- package/dist/types/hooks/useBotDetection.d.ts +3 -0
- package/dist/types/hooks/useBotDetection.d.ts.map +1 -0
- package/dist/types/hooks/useDebounce.d.ts +2 -0
- package/dist/types/hooks/useDebounce.d.ts.map +1 -0
- package/dist/types/hooks/useOMIDViewability.d.ts +24 -0
- package/dist/types/hooks/useOMIDViewability.d.ts.map +1 -0
- package/dist/types/hooks/useViewability.d.ts +6 -0
- package/dist/types/hooks/useViewability.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types.d.ts +189 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils/api.d.ts +62 -0
- package/dist/types/utils/api.d.ts.map +1 -0
- package/dist/types/utils/colorThemes.d.ts +21 -0
- package/dist/types/utils/colorThemes.d.ts.map +1 -0
- package/dist/types/utils/styling.d.ts +4 -0
- package/dist/types/utils/styling.d.ts.map +1 -0
- package/dist/types/utils/validation.d.ts +27 -0
- package/dist/types/utils/validation.d.ts.map +1 -0
- package/dist/types.d.ts +51 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/api.d.ts +2 -3
- package/dist/utils/api.d.ts.map +1 -1
- package/dist/utils/styling.d.ts +4 -3
- package/dist/utils/styling.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +2 -7
- package/dist/utils/validation.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SimulaProviderProps, SimulaContextValue } from './types';
|
|
3
|
+
export declare const useSimula: () => SimulaContextValue;
|
|
4
|
+
export declare const SimulaProvider: React.FC<SimulaProviderProps>;
|
|
5
|
+
//# sourceMappingURL=SimulaProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimulaProvider.d.ts","sourceRoot":"","sources":["../../src/SimulaProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuF,MAAM,OAAO,CAAC;AAC5G,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAU,MAAM,SAAS,CAAC;AAS1E,eAAO,MAAM,SAAS,QAAO,kBAM5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAmFxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InChatAdSlot.d.ts","sourceRoot":"","sources":["../../../../src/components/inChatAd/InChatAdSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AASjF,OAAO,EAAE,iBAAiB,EAAU,MAAM,aAAa,CAAC;AAexD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAqXpD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GameData, MiniGameTheme } from '../../types';
|
|
3
|
+
interface GameCardProps {
|
|
4
|
+
game: GameData;
|
|
5
|
+
charID: string;
|
|
6
|
+
theme: MiniGameTheme;
|
|
7
|
+
onGameSelect: (gameId: string) => void;
|
|
8
|
+
menuId?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const GameCard: React.FC<GameCardProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=GameCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameCard.d.ts","sourceRoot":"","sources":["../../../../src/components/miniGame/GameCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEtD,UAAU,aAAa;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAoR5C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GameData, MiniGameTheme } from '../../types';
|
|
3
|
+
interface GameGridProps {
|
|
4
|
+
games: GameData[];
|
|
5
|
+
maxGamesToShow: 3 | 6 | 9;
|
|
6
|
+
charID: string;
|
|
7
|
+
theme: MiniGameTheme;
|
|
8
|
+
onGameSelect: (gameId: string, gameName: string) => void;
|
|
9
|
+
menuId?: string | null;
|
|
10
|
+
}
|
|
11
|
+
export declare const GameGrid: React.FC<GameGridProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=GameGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/miniGame/GameGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQtD,UAAU,aAAa;IACrB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,cAAc,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AA4CD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAsL5C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Message } from '../../types';
|
|
3
|
+
interface GameIframeProps {
|
|
4
|
+
gameId: string;
|
|
5
|
+
charID: string;
|
|
6
|
+
charName: string;
|
|
7
|
+
charImage: string;
|
|
8
|
+
messages?: Message[];
|
|
9
|
+
delegateChar?: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onAdIdReceived?: (adId: string) => void;
|
|
12
|
+
charDesc?: string;
|
|
13
|
+
menuId?: string | null;
|
|
14
|
+
/** Controls the height of the game iframe (px, percentage, or null for fullscreen) */
|
|
15
|
+
playableHeight?: number | string;
|
|
16
|
+
/** Background color for the bottom sheet border area */
|
|
17
|
+
playableBorderColor?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const GameIframe: React.FC<GameIframeProps>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=GameIframe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameIframe.d.ts","sourceRoot":"","sources":["../../../../src/components/miniGame/GameIframe.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,sFAAsF;IACtF,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,wDAAwD;IACxD,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA4VhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MiniGameMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/miniGame/MiniGameMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAA2B,MAAM,aAAa,CAAC;AAiBzE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA6sBpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockGames.d.ts","sourceRoot":"","sources":["../../../../src/components/miniGame/mockGames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,eAAO,MAAM,SAAS,EAAE,QAAQ,EAuD/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/nativeBanner/NativeBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAKpE,OAAO,EAAE,iBAAiB,EAAmC,MAAM,aAAa,CAAC;AAiDjF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAwVnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeBannerTest.d.ts","sourceRoot":"","sources":["../../../../src/components/nativeBanner/NativeBannerTest.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAMjF,OAAO,EAAE,iBAAiB,EAAmC,MAAM,aAAa,CAAC;AASjF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAmExD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadialLinesSpinner.d.ts","sourceRoot":"","sources":["../../../../src/components/nativeBanner/RadialLinesSpinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAgDtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/nativeBanner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SponsoredSuggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/sponsoredSuggestions/SponsoredSuggestions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAA2B,MAAM,aAAa,CAAC;AAYjF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAkJpE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface AssetLoadResult {
|
|
3
|
+
isLoaded: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Hook to detect when a container's content has fully loaded and layout is stable.
|
|
7
|
+
*
|
|
8
|
+
* Two-phase detection:
|
|
9
|
+
* 1. Wait for all images to load (or error/timeout)
|
|
10
|
+
* 2. Wait for layout to stabilize (no resize events for LAYOUT_STABILITY_MS)
|
|
11
|
+
*/
|
|
12
|
+
export declare function useAssetLoadDetection(containerRef: RefObject<HTMLElement>, enabled: boolean): AssetLoadResult;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=useAssetLoadDetection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAssetLoadDetection.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAssetLoadDetection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,UAAU,eAAe;IACvB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAKD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,SAAS,CAAC,WAAW,CAAC,EACpC,OAAO,EAAE,OAAO,GACf,eAAe,CAmJjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBotDetection.d.ts","sourceRoot":"","sources":["../../../src/hooks/useBotDetection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,eAAO,MAAM,eAAe,QAAO,kBAmClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebounce.d.ts","sourceRoot":"","sources":["../../../src/hooks/useDebounce.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,IAAI,EAAE,OAAO,MAAM,EAAE,MAAM,GAAG,EAAE,SAwB3E,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface OMIDViewabilityResult {
|
|
2
|
+
isViewable: boolean;
|
|
3
|
+
hasBeenViewed: boolean;
|
|
4
|
+
impressionTracked: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface OMIDOptions {
|
|
7
|
+
threshold?: number;
|
|
8
|
+
durationMs?: number;
|
|
9
|
+
partnerName?: string;
|
|
10
|
+
partnerVersion?: string;
|
|
11
|
+
onImpressionTracked?: (adId: string) => void;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface Window {
|
|
15
|
+
omidSessionClient?: any;
|
|
16
|
+
omidSessionService?: any;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export declare const useOMIDViewability: (options?: OMIDOptions) => OMIDViewabilityResult & {
|
|
20
|
+
elementRef: React.RefObject<HTMLDivElement>;
|
|
21
|
+
trackImpression: (adId?: string) => void;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=useOMIDViewability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOMIDViewability.d.ts","sourceRoot":"","sources":["../../../src/hooks/useOMIDViewability.ts"],"names":[],"mappings":"AAEA,UAAU,qBAAqB;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,UAAU,WAAW;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAGD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,iBAAiB,CAAC,EAAE,GAAG,CAAC;QACxB,kBAAkB,CAAC,EAAE,GAAG,CAAC;KAC1B;CACF;AAED,eAAO,MAAM,kBAAkB,GAAI,UAAS,WAAgB,KAAG,qBAAqB,GAAG;IACrF,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CA0P1C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ViewabilityResult, ViewabilityOptions } from '../types';
|
|
2
|
+
export declare const useViewability: (options?: ViewabilityOptions) => ViewabilityResult & {
|
|
3
|
+
elementRef: React.RefObject<HTMLDivElement>;
|
|
4
|
+
trackImpression: (adId?: string) => void;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=useViewability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useViewability.d.ts","sourceRoot":"","sources":["../../../src/hooks/useViewability.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEtE,eAAO,MAAM,cAAc,GAAI,UAAS,kBAAuB,KAAG,iBAAiB,GAAG;IACpF,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAoF1C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { SimulaProvider, useSimula } from './SimulaProvider';
|
|
2
|
+
export { InChatAdSlot } from './components/inChatAd/InChatAdSlot';
|
|
3
|
+
export { MiniGameMenu } from './components/miniGame/MiniGameMenu';
|
|
4
|
+
export { NativeBanner } from './components/nativeBanner/NativeBanner';
|
|
5
|
+
export { RadialLinesSpinner } from './components/nativeBanner/RadialLinesSpinner';
|
|
6
|
+
export { useBotDetection } from './hooks/useBotDetection';
|
|
7
|
+
export { useViewability } from './hooks/useViewability';
|
|
8
|
+
export { useOMIDViewability } from './hooks/useOMIDViewability';
|
|
9
|
+
export { getColorTheme, getFontStyles, fonts, getBackgroundGradient, getSolidBackground, getTextMuted, getTextSecondary, getBorderLight, getShadow } from './utils/colorThemes';
|
|
10
|
+
export { filterContextForPrivacy } from './types';
|
|
11
|
+
export type { InChatTheme, Message, AdData, InChatAdSlotProps, SimulaProviderProps, SimulaContextValue, BotDetectionResult, ViewabilityOptions, ViewabilityResult, OMIDViewabilityOptions, OMIDViewabilityResult, ColorPalette, FontPalette, MiniGameTheme, MiniGameMenuProps, GameData, NativeContext, NativeBannerProps, } from './types';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,OAAO,EACL,aAAa,EACb,aAAa,EACb,KAAK,EACL,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,SAAS,EACV,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAElD,YAAY,EACV,WAAW,EACX,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,aAAa,EACb,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
export type AccentOption = 'blue' | 'red' | 'green' | 'yellow' | 'purple' | 'pink' | 'orange' | 'neutral' | 'gray' | 'tan' | 'transparent' | 'image';
|
|
2
|
+
export type FontOption = 'san-serif' | 'serif' | 'monospace';
|
|
3
|
+
export interface InChatTheme {
|
|
4
|
+
mode?: 'light' | 'dark' | 'auto';
|
|
5
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
6
|
+
accent?: AccentOption | AccentOption[];
|
|
7
|
+
font?: FontOption | FontOption[];
|
|
8
|
+
width?: number | string;
|
|
9
|
+
cornerRadius?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ColorPalette {
|
|
12
|
+
backgroundGradient1: string;
|
|
13
|
+
backgroundGradient2: string;
|
|
14
|
+
primary: string;
|
|
15
|
+
primaryHover: string;
|
|
16
|
+
secondary: string;
|
|
17
|
+
text: string;
|
|
18
|
+
border: string;
|
|
19
|
+
buttonText: string;
|
|
20
|
+
}
|
|
21
|
+
export interface FontPalette {
|
|
22
|
+
primary: string;
|
|
23
|
+
secondary: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Message {
|
|
26
|
+
role: string;
|
|
27
|
+
content: string;
|
|
28
|
+
}
|
|
29
|
+
export interface AdData {
|
|
30
|
+
id: string;
|
|
31
|
+
format: string;
|
|
32
|
+
iframeUrl?: string;
|
|
33
|
+
html?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface InChatAdSlotProps {
|
|
36
|
+
messages: Message[];
|
|
37
|
+
trigger?: Promise<any>;
|
|
38
|
+
formats?: string | string[];
|
|
39
|
+
theme?: InChatTheme;
|
|
40
|
+
debounceMs?: number;
|
|
41
|
+
charDesc?: string;
|
|
42
|
+
onImpression?: (ad: AdData) => void;
|
|
43
|
+
onClick?: (ad: AdData) => void;
|
|
44
|
+
onError?: (error: Error) => void;
|
|
45
|
+
}
|
|
46
|
+
export interface SimulaProviderProps {
|
|
47
|
+
apiKey: string;
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
devMode?: boolean;
|
|
50
|
+
primaryUserID?: string;
|
|
51
|
+
/** Privacy consent flag. When false, suppresses collection of PII (primaryUserID). Defaults to true. */
|
|
52
|
+
hasPrivacyConsent?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface SimulaContextValue {
|
|
55
|
+
apiKey: string;
|
|
56
|
+
devMode: boolean;
|
|
57
|
+
sessionId?: string;
|
|
58
|
+
/** Privacy consent flag. When false, PII should not be collected. */
|
|
59
|
+
hasPrivacyConsent: boolean;
|
|
60
|
+
/** Get cached ad for a slot/position */
|
|
61
|
+
getCachedAd: (slot: string, position: number) => AdData | null;
|
|
62
|
+
/** Cache an ad for a slot/position */
|
|
63
|
+
cacheAd: (slot: string, position: number, ad: AdData) => void;
|
|
64
|
+
/** Get cached height for a slot/position */
|
|
65
|
+
getCachedHeight: (slot: string, position: number) => number | null;
|
|
66
|
+
/** Cache height for a slot/position */
|
|
67
|
+
cacheHeight: (slot: string, position: number, height: number) => void;
|
|
68
|
+
/** Check if a slot/position has no fill */
|
|
69
|
+
hasNoFill: (slot: string, position: number) => boolean;
|
|
70
|
+
/** Mark a slot/position as having no fill */
|
|
71
|
+
markNoFill: (slot: string, position: number) => void;
|
|
72
|
+
}
|
|
73
|
+
export interface BotDetectionResult {
|
|
74
|
+
isBot: boolean;
|
|
75
|
+
reasons: string[];
|
|
76
|
+
}
|
|
77
|
+
export interface OMIDViewabilityOptions {
|
|
78
|
+
threshold?: number;
|
|
79
|
+
durationMs?: number;
|
|
80
|
+
partnerName?: string;
|
|
81
|
+
partnerVersion?: string;
|
|
82
|
+
onImpressionTracked?: (adId: string) => void;
|
|
83
|
+
}
|
|
84
|
+
export interface OMIDViewabilityResult {
|
|
85
|
+
isViewable: boolean;
|
|
86
|
+
hasBeenViewed: boolean;
|
|
87
|
+
impressionTracked: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface ViewabilityOptions {
|
|
90
|
+
threshold?: number;
|
|
91
|
+
durationMs?: number;
|
|
92
|
+
onImpressionTracked?: (adId: string) => void;
|
|
93
|
+
}
|
|
94
|
+
export interface ViewabilityResult {
|
|
95
|
+
isViewable: boolean;
|
|
96
|
+
isInstantViewable: boolean;
|
|
97
|
+
hasBeenViewed: boolean;
|
|
98
|
+
impressionTracked: boolean;
|
|
99
|
+
}
|
|
100
|
+
export interface MiniGameTheme {
|
|
101
|
+
backgroundColor?: string;
|
|
102
|
+
headerColor?: string;
|
|
103
|
+
borderColor?: string;
|
|
104
|
+
titleFont?: string;
|
|
105
|
+
secondaryFont?: string;
|
|
106
|
+
titleFontColor?: string;
|
|
107
|
+
secondaryFontColor?: string;
|
|
108
|
+
iconCornerRadius?: number;
|
|
109
|
+
/** Unified accent color for interactive elements (search bar focus, pagination). Default: '#3B82F6' (blue-500) */
|
|
110
|
+
accentColor?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Controls the height of the Mini Game iframe (not the ad).
|
|
113
|
+
* - number: pixel value (e.g., 500 = 500px)
|
|
114
|
+
* - string with %: percentage of screen height (e.g., "80%")
|
|
115
|
+
* - undefined/null: full screen (default behavior)
|
|
116
|
+
* Minimum height is 500px.
|
|
117
|
+
*/
|
|
118
|
+
playableHeight?: number | string;
|
|
119
|
+
/**
|
|
120
|
+
* Controls the background color of the curved border area above the playable
|
|
121
|
+
* when playableHeight is set (bottom sheet mode). Default: '#262626'
|
|
122
|
+
*/
|
|
123
|
+
playableBorderColor?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface GameData {
|
|
126
|
+
id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
iconUrl: string;
|
|
129
|
+
description: string;
|
|
130
|
+
iconFallback?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface MiniGameMenuProps {
|
|
133
|
+
isOpen: boolean;
|
|
134
|
+
onClose: () => void;
|
|
135
|
+
charName: string;
|
|
136
|
+
charID: string;
|
|
137
|
+
charImage: string;
|
|
138
|
+
messages?: Message[];
|
|
139
|
+
charDesc?: string;
|
|
140
|
+
maxGamesToShow?: 3 | 6 | 9;
|
|
141
|
+
theme?: MiniGameTheme;
|
|
142
|
+
delegateChar?: boolean;
|
|
143
|
+
}
|
|
144
|
+
export interface NativeContext {
|
|
145
|
+
searchTerm?: string;
|
|
146
|
+
tags?: string[];
|
|
147
|
+
category?: string;
|
|
148
|
+
title?: string;
|
|
149
|
+
description?: string;
|
|
150
|
+
userProfile?: string;
|
|
151
|
+
/** User email (requires privacy consent) */
|
|
152
|
+
userEmail?: string;
|
|
153
|
+
/** NSFW content flag */
|
|
154
|
+
nsfw?: boolean;
|
|
155
|
+
customContext?: Record<string, string | string[]>;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Filter NativeContext for privacy - removes PII fields when consent is not granted.
|
|
159
|
+
* When hasPrivacyConsent is false, removes userEmail and userProfile.
|
|
160
|
+
*/
|
|
161
|
+
export declare const filterContextForPrivacy: (context: NativeContext, hasPrivacyConsent: boolean) => NativeContext;
|
|
162
|
+
export interface NativeBannerProps {
|
|
163
|
+
slot: string;
|
|
164
|
+
/**
|
|
165
|
+
* Ad width. Supports multiple formats:
|
|
166
|
+
* - number < 1: percentage as decimal (e.g., 0.8 = 80%)
|
|
167
|
+
* - number >= 1: pixels (e.g., 500 = 500px)
|
|
168
|
+
* - string with %: percentage (e.g., "10%" = 10%)
|
|
169
|
+
* - string with number: pixels (e.g., "500" = 500px)
|
|
170
|
+
* - "auto" or null: fills container width (min 130px)
|
|
171
|
+
*/
|
|
172
|
+
width?: number | string | null;
|
|
173
|
+
position: number;
|
|
174
|
+
context: NativeContext;
|
|
175
|
+
/**
|
|
176
|
+
* Custom loading component to display while the ad is loading.
|
|
177
|
+
* - undefined: uses the default RadialLinesSpinner
|
|
178
|
+
* - null: disables the loading indicator entirely
|
|
179
|
+
* - React.ComponentType: renders your custom component
|
|
180
|
+
*/
|
|
181
|
+
loadingComponent?: React.ComponentType | null;
|
|
182
|
+
/** Called when the ad content has finished loading and is ready to display */
|
|
183
|
+
onLoad?: (ad: AdData) => void;
|
|
184
|
+
/** Called when the ad has been viewable for 1 second (MRC standard) */
|
|
185
|
+
onImpression?: (ad: AdData) => void;
|
|
186
|
+
/** Called when an error occurs fetching or loading the ad */
|
|
187
|
+
onError?: (error: Error) => void;
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,aAAa,GAAG,OAAO,CAAC;AACrJ,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,OAAO,GAAG,WAAW,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,IAAI,CA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B;IAChC,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,aAAa,CAAC;IACvB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;IAC9C,8EAA8E;IAC9E,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,uEAAuE;IACvE,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Message, AdData, InChatTheme, GameData, NativeContext } from '../types';
|
|
2
|
+
export interface FetchAdRequest {
|
|
3
|
+
messages: Message[];
|
|
4
|
+
apiKey: string;
|
|
5
|
+
slotId?: string;
|
|
6
|
+
theme?: InChatTheme;
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
charDesc?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FetchAdResponse {
|
|
11
|
+
ad?: AdData;
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function createSession(apiKey: string, devMode?: boolean, primaryUserID?: string): Promise<string | undefined>;
|
|
15
|
+
export declare const fetchAd: (request: FetchAdRequest) => Promise<FetchAdResponse>;
|
|
16
|
+
export declare const trackImpression: (adId: string, apiKey: string) => Promise<void>;
|
|
17
|
+
export declare const trackMenuGameClick: (menuId: string, gameName: string, apiKey: string) => Promise<void>;
|
|
18
|
+
export declare const trackViewportEntry: (adId: string, apiKey: string) => Promise<void>;
|
|
19
|
+
export declare const trackViewportExit: (adId: string, apiKey: string) => Promise<void>;
|
|
20
|
+
export interface CatalogResponse {
|
|
21
|
+
menuId: string;
|
|
22
|
+
games: GameData[];
|
|
23
|
+
}
|
|
24
|
+
export declare const fetchCatalog: () => Promise<CatalogResponse>;
|
|
25
|
+
export interface InitMinigameRequest {
|
|
26
|
+
gameType: string;
|
|
27
|
+
sessionId: string;
|
|
28
|
+
convId?: string | null;
|
|
29
|
+
currencyMode?: boolean;
|
|
30
|
+
w: number;
|
|
31
|
+
h: number;
|
|
32
|
+
char_id?: string;
|
|
33
|
+
char_name?: string;
|
|
34
|
+
char_image?: string;
|
|
35
|
+
char_desc?: string;
|
|
36
|
+
messages?: Message[];
|
|
37
|
+
delegate_char?: boolean;
|
|
38
|
+
menuId?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface MinigameResponse {
|
|
41
|
+
adType: 'minigame';
|
|
42
|
+
adInserted: boolean;
|
|
43
|
+
adResponse: {
|
|
44
|
+
ad_id: string;
|
|
45
|
+
iframe_url: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export declare const getMinigame: (params: InitMinigameRequest) => Promise<MinigameResponse>;
|
|
49
|
+
export declare const fetchAdForMinigame: (aid: string) => Promise<string | null>;
|
|
50
|
+
export interface FetchNativeBannerRequest {
|
|
51
|
+
sessionId: string;
|
|
52
|
+
slot: string;
|
|
53
|
+
position: number;
|
|
54
|
+
context: NativeContext;
|
|
55
|
+
width?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface FetchNativeAdResponse {
|
|
58
|
+
ad?: AdData;
|
|
59
|
+
error?: string;
|
|
60
|
+
}
|
|
61
|
+
export declare const fetchNativeBannerAd: (request: FetchNativeBannerRequest) => Promise<FetchNativeAdResponse>;
|
|
62
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAA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
2
|
+
background: string;
|
|
3
|
+
text: string;
|
|
4
|
+
primary: string;
|
|
5
|
+
primaryHover: string;
|
|
6
|
+
border: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FontPalette {
|
|
9
|
+
primary: string;
|
|
10
|
+
secondary: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const fonts: Record<string, FontPalette>;
|
|
13
|
+
export declare function getColorTheme(themeMode: 'light' | 'dark' | 'auto', _accent?: string): ColorPalette;
|
|
14
|
+
export declare const getSolidBackground: (colors: ColorPalette) => string;
|
|
15
|
+
export declare const getBackgroundGradient: (colors: ColorPalette) => string;
|
|
16
|
+
export declare const getTextMuted: (colors: ColorPalette) => string;
|
|
17
|
+
export declare const getTextSecondary: (colors: ColorPalette) => string;
|
|
18
|
+
export declare const getBorderLight: (colors: ColorPalette) => string;
|
|
19
|
+
export declare const getShadow: (colors: ColorPalette) => string;
|
|
20
|
+
export declare const getFontStyles: (font?: string) => FontPalette;
|
|
21
|
+
//# sourceMappingURL=colorThemes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorThemes.d.ts","sourceRoot":"","sources":["../../../src/utils/colorThemes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAE3B,UAAU,EAAE,MAAM,CAAC;IAGnB,IAAI,EAAE,MAAM,CAAC;IAGb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IAGrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAa7C,CAAC;AAsBF,wBAAgB,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CASlG;AAGD,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY,KAAG,MAEzD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,QAAQ,YAAY,KAAG,MAG5D,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,QAAQ,YAAY,KAAG,MAGnD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,YAAY,KAAG,MAGvD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,YAAY,KAAG,MAErD,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,QAAQ,YAAY,KAAG,MAEhD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAM,MAAoB,KAAG,WAE1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styling.d.ts","sourceRoot":"","sources":["../../../src/utils/styling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA4B,MAAM,UAAU,CAAC;AASjE,eAAO,MAAM,mBAAmB,GAAI,QAAO,WAAgB,KAAG,KAAK,CAAC,aAwBnE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,QAAO,WAAgB,WAwJ5D,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InChatTheme } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Validates SimulaProvider props
|
|
4
|
+
* Throws descriptive errors for invalid props
|
|
5
|
+
*/
|
|
6
|
+
export declare const validateSimulaProviderProps: (props: any) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Validates InChatAdSlot props
|
|
9
|
+
* Throws descriptive errors for invalid props
|
|
10
|
+
*/
|
|
11
|
+
export declare const validateInChatAdSlotProps: (props: any) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Validates theme object
|
|
14
|
+
* Throws descriptive errors for invalid theme properties
|
|
15
|
+
*/
|
|
16
|
+
export declare const validateTheme: (theme?: InChatTheme) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Validates NativeContext object
|
|
19
|
+
* Throws descriptive errors for invalid context properties
|
|
20
|
+
*/
|
|
21
|
+
export declare const validateNativeContext: (context: any) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Validates NativeBanner props
|
|
24
|
+
* Throws descriptive errors for invalid props
|
|
25
|
+
*/
|
|
26
|
+
export declare const validateNativeBannerProps: (props: any) => void;
|
|
27
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAC;AAOtD;;;GAGG;AACH,eAAO,MAAM,2BAA2B,GAAI,OAAO,GAAG,KAAG,IAkCxD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,GAAG,KAAG,IAqEtD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,WAAW,KAAG,IAoEnD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,GAAG,KAAG,IA2FpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,GAAG,KAAG,IAkFtD,CAAC"}
|