11import { EventType , CallbackHandler } from './callbackManager' ;
2- import { isNormalizedPhone , normalizeEmail } from './diiNormalization' ;
3- import { hashAndEncodeIdentifier , hashIdentifier } from './encoding/hash' ;
4- import { CallbackContainer , sdkAssertErrorText , SdkBase , SDKSetup } from './sdkBase' ;
2+ import { CallbackContainer , IdHelper , sdkAssertErrorText , SdkBase , SDKSetup } from './sdkBase' ;
53import { ProductDetails } from './product' ;
64import { loadConfig } from './configManager' ;
75import { UidSecureSignalProviderType } from './secureSignal_types' ;
86
97export * from './exports' ;
108
11- export class UID2Helper {
12- public normalizeEmail ( email : string ) {
13- return normalizeEmail ( email ) ;
14- }
15-
16- public hashIdentifier ( normalizedEmail : string ) {
17- return hashIdentifier ( normalizedEmail ) ;
18- }
19-
20- public async hashAndEncodeIdentifier ( normalizedEmail : string ) {
21- return await hashAndEncodeIdentifier ( normalizedEmail ) ;
22- }
23-
24- public isNormalizedPhone ( phone : string ) {
25- return isNormalizedPhone ( phone ) ;
26- }
27- }
28-
299const productDetails : ProductDetails = {
3010 name : 'UID2' ,
3111 defaultBaseUrl : 'https://prod.uidapi.com' ,
@@ -75,7 +55,7 @@ export class UID2 extends SdkBase {
7555declare global {
7656 interface Window {
7757 __uid2 : UID2 | SDKSetup | undefined ;
78- __uid2Helper : UID2Helper | undefined ;
58+ __uid2Helper : IdHelper | undefined ;
7959 __uid2SecureSignalProvider ?: UidSecureSignalProviderType ;
8060 }
8161}
@@ -102,7 +82,7 @@ export function __uid2InternalHandleScriptLoad() {
10282 const callbacks = window ?. __uid2 ?. callbacks || [ ] ;
10383 const callbackContainer : CallbackContainer = { } ;
10484 window . __uid2 = new UID2 ( callbacks , callbackContainer ) ;
105- window . __uid2Helper = new UID2Helper ( ) ;
85+ window . __uid2Helper = new IdHelper ( ) ;
10686 if ( callbackContainer . callback ) callbackContainer . callback ( ) ;
10787 bootstrapInit ( ) ;
10888}
0 commit comments