Skip to content

Commit

Permalink
Revert "refactor(rudder-sdk-react-native): change to RudderContext fi…
Browse files Browse the repository at this point in the history
…le name"

This reverts commit 09ae601.
  • Loading branch information
1abhishekpandey committed Oct 25, 2023
1 parent 732df9a commit 3109f2b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interface RudderContext {
interface IRudderContext {
userAgent: string;
screen: {
width: number;
Expand Down Expand Up @@ -42,4 +42,4 @@ interface RudderContext {
customContextMap: Record<string, unknown>;
}

export default RudderContext;
export default IRudderContext;
4 changes: 2 additions & 2 deletions libs/sdk/src/NativeBridge.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NativeModules } from 'react-native';
import IDBEncryption from './IDBEncryption';
import RudderContext from './RudderContext';
import IRudderContext from './IRudderContext';

export interface Configuration {
dataPlaneUrl?: string;
Expand Down Expand Up @@ -53,7 +53,7 @@ export interface Bridge {
putAnonymousId(id: string): Promise<void>;
// eslint-disable-next-line @typescript-eslint/ban-types
registerCallback(integrationName: string, callback: Function): Promise<void>;
getRudderContext(): Promise<RudderContext | null>;
getRudderContext(): Promise<IRudderContext | null>;
startSession(sessionId?: string): Promise<void>;
endSession(): Promise<void>;
getSessionId(): Promise<number | null>;
Expand Down
6 changes: 3 additions & 3 deletions libs/sdk/src/RudderClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { configure } from './RudderConfiguration';
import bridge, { Configuration } from './NativeBridge';
import { logInit, logDebug, logError, logWarn } from './Logger';
import { SDK_VERSION } from './Constants';
import RudderContext from './RudderContext';
import IRudderContext from './IRudderContext';

const lock = new AsyncLock();

Expand Down Expand Up @@ -298,8 +298,8 @@ async function registerCallback(name: string, callback: Function) {
}
}

async function getRudderContext(): Promise<RudderContext | null> {
const context: RudderContext | null = await bridge.getRudderContext();
async function getRudderContext(): Promise<IRudderContext | null> {
const context: IRudderContext | null = await bridge.getRudderContext();
return context ?? null;
}

Expand Down
4 changes: 2 additions & 2 deletions libs/sdk/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import rudderClient from './RudderClient';
import { RUDDER_LOG_LEVEL } from './Logger';
import IDBEncryption from './IDBEncryption';
import RudderContext from './RudderContext';
import IRudderContext from './IRudderContext';

export { RUDDER_LOG_LEVEL, IDBEncryption, RudderContext };
export { RUDDER_LOG_LEVEL, IDBEncryption, IRudderContext };
export default rudderClient;

0 comments on commit 3109f2b

Please sign in to comment.