Skip to content

Commit 957749b

Browse files
refactor: Add Type interfaces for native sdk helpers (#946)
1 parent 6b15343 commit 957749b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/nativeSdkHelpers.interfaces.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export interface INativeSdkHelpers {
2+
initializeSessionAttributes: (apiKey: string) => void;
3+
isBridgeV2Available: (bridgeName: string) => boolean;
4+
isWebviewEnabled: (
5+
requiredWebviewBridgeName: string,
6+
minWebviewBridgeVersion: number
7+
) => boolean;
8+
isBridgeV1Available: () => boolean;
9+
sendToNative: (path: string, value: string) => void;
10+
sendViaBridgeV1: (path: string, value: string) => void;
11+
sendViaIframeToIOS: (path: string, value: string) => void;
12+
sendViaBridgeV2: (path: string, value: string, requiredWebviewBridgeName: boolean) => void;
13+
}

src/sdkRuntimeModels.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
} from './identity-user-interfaces';
3232
import { IIdentityType } from './types.interfaces';
3333
import IntegrationCapture from './integrationCapture';
34+
import { INativeSdkHelpers } from './nativeSdkHelpers.interfaces';
3435
import { ICookieSyncManager } from './cookieSyncManager.interfaces';
3536

3637
// TODO: Resolve this with version in @mparticle/web-sdk
@@ -169,7 +170,7 @@ export interface MParticleWebSDK {
169170
_SessionManager: ISessionManager;
170171
_Consent: SDKConsentApi;
171172
Consent: SDKConsentApi;
172-
_NativeSdkHelpers: any; // TODO: Set up API
173+
_NativeSdkHelpers: INativeSdkHelpers;
173174
_Persistence: IPersistence;
174175
_preInit: any; // TODO: Set up API
175176
_instances?: Dictionary<MParticleWebSDK>;

0 commit comments

Comments
 (0)