@ht-sdks/consent-manager 0.2.0 → 0.2.1

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.
@@ -5,10 +5,11 @@ interface AnalyticsParams {
5
5
  destinations: Destination[];
6
6
  destinationPreferences: CategoryPreferences | null | undefined;
7
7
  isConsentRequired: boolean;
8
+ consentUpdate?: Promise<void>;
8
9
  shouldReload?: boolean;
9
10
  devMode?: boolean;
10
11
  defaultDestinationBehavior?: DefaultDestinationBehavior;
11
12
  categoryPreferences: CategoryPreferences | null | undefined;
12
13
  }
13
- export default function conditionallyLoadAnalytics({ writeKey, options, destinations, destinationPreferences, isConsentRequired, shouldReload, devMode, defaultDestinationBehavior, categoryPreferences, }: AnalyticsParams): void;
14
+ export default function conditionallyLoadAnalytics({ writeKey, options, destinations, destinationPreferences, isConsentRequired, shouldReload, consentUpdate, devMode, defaultDestinationBehavior, categoryPreferences, }: AnalyticsParams): void;
14
15
  export {};
@@ -20,5 +20,5 @@ type SavePreferences = Preferences & {
20
20
  * @param listener a function to be invoked when ConsentPreferences are saved
21
21
  */
22
22
  export declare function onPreferencesSaved(listener: (prefs: Preferences) => void): () => EventEmitter<[never]>;
23
- export declare function savePreferences({ destinationPreferences, customPreferences, cookieDomain, cookieName, cookieExpires, cookieAttributes, }: SavePreferences): void;
23
+ export declare function savePreferences({ destinationPreferences, customPreferences, cookieDomain, cookieName, cookieExpires, cookieAttributes, }: SavePreferences): Promise<void> | undefined;
24
24
  export {};
package/types/types.d.ts CHANGED
@@ -10,7 +10,7 @@ export type HtEventsBrowserOptions = {
10
10
  export type HtEventsBrowser = {
11
11
  initialized: boolean;
12
12
  load: (writeKey: string, options?: HtEventsBrowserOptions) => void;
13
- track: (event: string, properties: Record<string, any>, options?: any, callback?: any) => void;
13
+ track: (event: string, properties: Record<string, any>, options?: any, callback?: any) => void | Promise<unknown>;
14
14
  addSourceMiddleware: (middleware: Middleware) => void;
15
15
  };
16
16
  export type Middleware = (input: MiddlewareInput) => void;