/** * This module adds User ID support to prebid.js * @module modules/userId */ import { type StartAuctionOptions } from '../../src/prebid.js'; import { type StorageManager, type StorageType } from '../../src/storageManager.js'; import { delay } from '../../src/utils/promise.js'; import type { ORTBRequest } from "../../src/types/ortb/request.d.ts"; import type { AnyFunction } from "../../src/types/functions.d.ts"; import type { ProviderParams, UserId, UserIdProvider, UserIdConfig, IdProviderSpec, ProviderResponse } from "./spec.ts"; export declare const PBJS_USER_ID_OPTOUT_NAME = "_pbjs_id_optout"; export declare const coreStorage: StorageManager; export declare const dep: { isAllowed: any; }; declare module '../../src/userSync' { interface UserSyncConfig { /** * EID source to use as PPID for GAM. * * Publishers using Google AdManager may want to sync one of the identifiers as their Google PPID for frequency capping or reporting. * The PPID in GAM (which is unrelated to the PPID UserId Submodule) has strict rules; refer to Google AdManager documentation for them. * Please note, Prebid uses a GPT command to sync identifiers for publisher convenience. * It doesn’t currently work for instream video requests, as Prebid typically interacts with the player, * which in turn may interact with IMA. IMA does has a similar method as GPT, but IMA does not gather this ID from GPT. */ ppid?: string; /** * Map from userID name (the key in the object returned by `getUserIds`) to names of modules that should be preferred * as sources for that ID, in order of decreasing priority. */ idPriority?: { [idName: keyof UserId]: UserIdProvider[]; }; userIds?: (UserIdConfig | UserIdConfig)[]; encryptedSignalSources?: { sources: { source: string[]; encrypt: boolean; customFunc: AnyFunction; }[]; /** * The amount of time (in milliseconds) after which registering of signals will happen. Default value 0 is considered if ‘registerDelay’ is not provided. */ registerDelay?: number; }; /** * If true (the default), updating userSync.userIds will not remove previously configured IDs. */ retainConfig?: boolean; /** * If true, updating userSync.userIds will automatically refresh IDs that have not yet been fetched. */ autoRefresh?: boolean; /** * If true, user ID modules will only be allowed to save data in the location specified in the configuration. */ enforceStorageType?: boolean; } } export declare let syncDelay: any; export declare let auctionDelay: any; export declare function setSubmoduleRegistry(submodules: any): void; export declare function setStoredValue(submodule: any, value: any): void; export declare const COOKIE_SUFFIXES: string[]; export declare const HTML5_SUFFIXES: string[]; export declare function deleteStoredValue(submodule: any): void; export declare function enrichEids(ortb2Fragments: any): any; declare module '../../src/adapterManager' { interface BaseBidRequest { userIdAsEids: ORTBRequest['user']['eids']; } } export declare function addIdData({ ortb2Fragments }: { ortb2Fragments: any; }): void; /** * Hook is executed before adapters, but after consentManagement. Consent data is requied because * this module requires GDPR consent with Purpose #1 to save data locally. * The two main actions handled by the hook are: * 1. check gdpr consentData and handle submodule initialization. * 2. append user id data (loaded from cookied/html or from the getId method) to bids to be accessed in adapters. * @param {Object} reqBidsConfigObj required; This is the same param that's used in pbjs.requestBids. * @param {function} fn required; The next function in the chain, used by hook.ts */ export declare const startAuctionHook: import("../../src/hook.js").BeforeHook<"async", (options: import("../../src/prebid.js").PrivRequestBidsOptions | StartAuctionOptions) => void>; export declare function adUnitEidsHook(next: any, auction: any): void; /** * This function will be exposed in global-name-space so that userIds stored by Prebid UserId module can be used by external codes as well. * Simple use case will be passing these UserIds to A9 wrapper solution */ declare function getUserIds(): Partial; /** * This function will be exposed in global-name-space so that userIds stored by Prebid UserId module can be used by external codes as well. * Simple use case will be passing these UserIds to A9 wrapper solution */ declare function getUserIdsAsEids(): ORTBRequest['user']['eids']; /** * This function will be exposed in global-name-space so that userIds stored by Prebid UserId module can be used by external codes as well. * Simple use case will be passing these UserIds to A9 wrapper solution */ declare function getUserIdsAsEidBySource(sourceName: string): ORTBRequest['user']['eids'][0] | undefined; /** * This function will be exposed in global-name-space so that userIds for a source can be exposed * Sample use case is exposing this function to ESP */ declare function getEncryptedEidsForSource(source: any, encrypt: any, customFunction: any): any; /** * This function will be exposed in the global-name-space so that publisher can register the signals-ESP. */ declare function registerSignalSources(): void; /** * Force (re)initialization of ID submodules. * * This will force a refresh of the specified ID submodules regardless of `auctionDelay` / `syncDelay` settings, and * return a promise that resolves to the same value as `getUserIds()` when the refresh is complete. * If a refresh is already in progress, it will be canceled (rejecting promises returned by previous calls to `refreshUserIds`). * * submoduleNames submodules to refresh. If omitted, refresh all submodules. * callback called when the refresh is complete */ declare function refreshUserIds({ submoduleNames }?: { submoduleNames?: string[]; }, callback?: () => void): Promise>; /** * @returns a promise that resolves to the same value as `getUserIds()`, but only once all ID submodules have completed * initialization. This can also be used to synchronize calls to other ID accessors, e.g. * * ``` * pbjs.getUserIdsAsync().then(() => { * const eids = pbjs.getUserIdsAsEids(); // guaranteed to be completely initialized at this point * }); * ``` */ declare function getUserIdsAsync(): Promise>; export declare function getConsentHash(): string; /** * list of submodule configurations with valid 'storage' or 'value' obj definitions * storage config: contains values for storing/retrieving User ID data in browser storage * value config: object properties that are copied to bids (without saving to storage) */ export declare function getValidSubmoduleConfigs(configRegistry: any): any[]; export declare function generateSubmoduleContainers(options: any, configs: any, prevSubmodules?: SubmoduleContainer[], registry?: IdProviderSpec[]): any[]; type SubmoduleContainer

= { submodule: IdProviderSpec

; enabledStorageTypes?: StorageType[]; config: UserIdConfig

; callback?: ProviderResponse['callback']; idObj: any; storageMgr: StorageManager; refreshIds?: boolean; }; export declare function requestDataDeletion(next: any, ...args: any[]): void; /** * enable submodule in User ID */ export declare function attachIdSystem(submodule: IdProviderSpec): void; declare module '../../src/prebidGlobal' { interface PrebidJS { getUserIds: typeof getUserIds; getUserIdsAsync: typeof getUserIdsAsync; getUserIdsAsEids: typeof getUserIdsAsEids; getEncryptedEidsForSource: typeof getEncryptedEidsForSource; registerSignalSources: typeof registerSignalSources; refreshUserIds: typeof refreshUserIds; getUserIdsAsEidBySource: typeof getUserIdsAsEidBySource; } } /** * test browser support for storage config types (local storage or cookie), initializes submodules but consentManagement is required, * so a callback is added to fire after the consentManagement module. * @param {{getConfig:function}} config */ export declare function init(config: any, { mkDelay }?: { mkDelay?: typeof delay; }): void; export declare function resetUserIds(): void; export {};