import { Batch } from '@mparticle/event-models'; import { MPID, IdentifyRequest, SDKEventCustomFlags, ConsentState, UserIdentities } from '@mparticle/web-sdk'; import { IKitConfigs } from './configAPIClient'; import { DataPlanResult, KitBlockerOptions, LogLevelType, SDKDataPlan, SDKEvent, SDKGeoLocation, SDKInitConfig, SDKProduct } from './sdkRuntimeModels'; import { Dictionary, AttributeValue } from './utils'; import { SDKConsentState } from './consent'; import { ConfiguredKit, MPForwarder, UnregisteredKit } from './forwarders.interfaces'; import { IdentityCallback, UserAttributes } from './identity-user-interfaces'; import { IPersistenceMinified } from './persistence.interfaces'; import { CookieSyncDates, IPixelConfiguration } from './cookieSyncManager'; import { IMParticleWebSDKInstance } from './mp-instance'; export interface SDKConfig { isDevelopmentMode?: boolean; logger: { error?(msg: any): any; warning?(msg: any): any; verbose?(msg: any): any; }; onCreateBatch(batch: Batch): Batch; customFlags?: SDKEventCustomFlags; dataPlan: SDKDataPlan; dataPlanOptions: KitBlockerOptions; dataPlanResult?: DataPlanResult; appName?: string; appVersion?: string; package?: string; flags?: IFeatureFlags; kitConfigs: IKitConfigs[]; kits: Dictionary; logLevel?: LogLevelType; cookieDomain?: string; cookieExpiration?: number; maxCookieSize?: number | undefined; minWebviewBridgeVersion: 1 | 2 | undefined; identifyRequest: IdentifyRequest; identityCallback: IdentityCallback; integrationDelayTimeout: number; sideloadedKits: MPForwarder[]; aliasMaxWindow: number; deviceId?: string; forceHttps?: boolean; aliasUrl?: string; configUrl?: string; identityUrl?: string; userAudienceUrl?: string; isIOS?: boolean; maxAliasWindow: number; maxProducts: number; requestConfig?: boolean; sessionTimeout?: number; timeout?: number; useNativeSdk?: boolean; useCookieStorage?: boolean; v1SecureServiceUrl?: string; v2SecureServiceUrl?: string; v3SecureServiceUrl?: string; webviewBridgeName?: string; workspaceToken?: string; requiredWebviewBridgeName?: string; isLoggingEnabled?: boolean; } export type ServerSettings = Dictionary; export type SessionAttributes = Dictionary; export type LocalSessionAttributes = Dictionary; export type IntegrationAttribute = Dictionary; export type IntegrationAttributes = Dictionary; export type WrapperSDKTypes = 'flutter' | 'none'; export interface WrapperSDKInfo { name: WrapperSDKTypes; version: string | null; isInfoSet: boolean; } export interface IFeatureFlags { reportBatching?: boolean; eventBatchingIntervalMillis?: number; offlineStorage?: string; directURLRouting?: boolean; cacheIdentity?: boolean; captureIntegrationSpecificIds?: boolean; 'captureIntegrationSpecificIds.V2'?: string; astBackgroundEvents?: boolean; autoLogPageView?: boolean; } export interface IStore { isEnabled: boolean; isInitialized: boolean; mpid: MPID; sessionAttributes: SessionAttributes; localSessionAttributes: LocalSessionAttributes; currentSessionMPIDs: MPID[]; consentState: SDKConsentState | null; sessionId: string | null; isFirstRun: boolean; clientId: string; deviceId: string; devToken: string | null; serverSettings: ServerSettings; dateLastEventSent: Date; sessionStartDate: Date; currentPosition: SDKGeoLocation | null; isTracking: boolean; watchPositionId: number | null; cartProducts: SDKProduct[]; eventQueue: SDKEvent[]; currencyCode: string | null; globalTimer: number | null; context: string | null; configurationLoaded: boolean; identityCallInFlight: boolean; identityCallFailed: boolean; identifyRequestCount: number; SDKConfig: Partial; nonCurrentUserMPIDs: Record; identifyCalled: boolean; isLoggedIn: boolean; sideloadedKitsCount?: number; cookieSyncDates: CookieSyncDates; integrationAttributes: IntegrationAttributes; requireDelay: boolean; isLocalStorageAvailable: boolean | null; storageName: string | null; activeForwarders: ConfiguredKit[]; kits: Dictionary; sideloadedKits: MPForwarder[]; configuredForwarders: ConfiguredKit[]; pixelConfigurations: IPixelConfiguration[]; integrationDelayTimeoutStart: number; webviewBridgeEnabled?: boolean; bridgeV1Available?: boolean; bridgeV2Available?: boolean; wrapperSDKInfo: WrapperSDKInfo; roktAccountId: string | null; integrationName: string | null; persistenceData?: IPersistenceMinified; getConsentState?(mpid: MPID): ConsentState | null; setConsentState?(mpid: MPID, consentState: ConsentState): void; _getFromPersistence?(mpid: MPID, key: string): T; _setPersistence?(mpid: MPID, key: string, value: T): void; getDeviceId?(): string; setDeviceId?(deviceId: string): void; getFirstSeenTime?(mpid: MPID): number; setFirstSeenTime?(mpid: MPID, time?: number): void; getLastSeenTime?(mpid: MPID): number; setLastSeenTime?(mpid: MPID, time?: number): void; getLocalSessionAttributes?(): LocalSessionAttributes; setLocalSessionAttribute?(key: string, value: AttributeValue): void; getUserAttributes?(mpid: MPID): UserAttributes; setUserAttributes?(mpid: MPID, attributes: UserAttributes): void; getUserIdentities?(mpid: MPID): UserIdentities; setUserIdentities?(mpid: MPID, userIdentities: UserIdentities): void; getRoktAccountId?(): string; setRoktAccountId?(accountId: string): void; getTimeOnSite?(): number | undefined; getTotalTimeOnSite?(): number | undefined; getIntegrationName?(): string; setIntegrationName?(integrationName: string): void; addMpidToSessionHistory?(mpid: MPID, previousMpid?: MPID): void; hasInvalidIdentifyRequest?: () => boolean; nullifySession?: () => void; processConfig(config: SDKInitConfig): void; syncPersistenceData?: () => void; } export default function Store(this: IStore, config: SDKInitConfig, mpInstance: IMParticleWebSDKInstance, apiKey?: string): void; export declare function processFlags(config: SDKInitConfig): IFeatureFlags; export declare function processBaseUrls(config: SDKInitConfig, flags: IFeatureFlags, apiKey?: string): Dictionary;