import * as _$_transcend_io_type_utils0 from "@transcend-io/type-utils"; import * as t from "io-ts"; //#region src/core.d.ts /** Transcend logger items */ type LogItem = { /** Log item content */content: any; /** Log item styles */ styles: string[]; }; /** Transcend logger entry tag */ type LogTag = LogItem & { /** Log tag content must be a string */content: string; /** Log tags must have only one style */ styles: string[1]; }; /** Transcend logger entry message */ type LogMessage = LogItem; /** Console-safe log levels */ declare const ConsoleSafeLogLevel: t.KeyofC<{ info: null; log: null; warn: null; debug: null; error: null; trace: null; group: null; groupCollapsed: null; groupEnd: null; }>; /** Override type */ type ConsoleSafeLogLevel = t.TypeOf; /** Airgap log levels */ declare const LogLevel: t.UnionC<[t.KeyofC<{ info: null; log: null; warn: null; debug: null; error: null; trace: null; group: null; groupCollapsed: null; groupEnd: null; }>, t.LiteralC<"fatal">]>; /** Override type */ type LogLevel = t.TypeOf; /** Airgap logger entry types */ type LogEntryType = LogLevel; /** Airgap logger entries */ type LogEntry = { /** Log entry tag */tag: LogTag; /** Log entry message */ message: LogMessage; }; /** * Log emitter function */ type LogEmitter = { /** Styled log emitter function */styled(styles?: null | string | string[], ...entries: any[]): void; } & ((...entries: any[]) => void); /** Transcend Logger API */ type Logger = { /** * Set log tag during callback execution or from * this point on if no callback is provided. */ tag(logTag: string, callback?: () => any): void; } & { [method in LogLevel]: LogEmitter }; /** AirgapAuth auth options */ type AirgapAuthMap = { /** A `load` event from a just-loaded airgap.js script element (which implies auth by being loaded before airgap.js) */load?: Event; /** A user-initiated interaction event that was just dispatched. */ interaction?: Event; /** Automatically reload the page if needed to remove CSP. `false` by default. */ autoReload?: boolean; /** * Additional authorization key automatically conferred by airgap.js via setAuth() API for UI modules. * Required when optional strict authorization mode is enabled. */ key?: symbol; }; /** Airgap authorization proof */ type AirgapAuth = null | AirgapAuthMap /** * A user-initiated interaction event that was just dispatched, or * a `load` event from a just-loaded airgap.js script element (which implies auth by being loaded before airgap.js). */ | Event; /** A boolean value represented as either `'on'` or `'off'` */ declare const BooleanString: t.KeyofC<{ on: null; off: null; }>; /** Type override */ type BooleanString = t.TypeOf; /** Data privacy legal regimes */ type PrivacyRegime = string; interface GetPurposeTypesOptions { /** Regimes to include */ regimes?: PrivacyRegime[]; /** Privacy signals to include */ signals?: UserPrivacySignal[]; } /** * Regime to purpose scope map */ type RegimeToPurposeScopes = [PrivacyRegime[], TrackingPurpose[]][]; /** Reserved metadata, currently used for airgap module data syncing */ interface ReservedMetadata { /** Top-level key to avoid polluting the metadata key space */ tcmp?: Record; } /** * Extra metadata to be synced along with consent */ type Metadata = Record; /** setConsent() options */ interface ConsentOptions { /** Was consent confirmed by the user? */ confirmed?: boolean; /** * Was the UI shown to the user? * @deprecated It was discovered that this value was not being set reliably in some versions, and was not being used. */ prompted?: boolean; /** * Extra metadata to be synced along with consent * * Special values: * - `null` - Do not change metadata * - `false` - Clear metadata */ metadata?: (Metadata & ReservedMetadata) | null | false; /** Last updated for metadata */ metadataTimestamp?: string; /** Whether or not to return a Promise so that the caller can wait for sync to complete. By default, we do not wait for sync */ waitForSync?: boolean; /** Last updated */ timestamp?: string; } /** airgap.toggle() options */ type AirgapToggleOptions = /** Protection state */boolean | { /** Protection state */protection?: boolean; }; /** airgap.status format */ interface AirgapSystemStatus { /** Protection system active state */ protection: boolean; /** Have any CSPs been activated? */ csp: boolean; /** Monitoring system active state */ monitoring: boolean; /** Telemetry system active state */ telemetry: boolean; } /** * Request override config */ interface RequestOverride { /** Optional tracking purposes to gate the override with lack of consent */ unconsented?: TrackingPurpose[]; /** * Optional request matcher. This is a RegExp object (or string input * for the RegExp constructor). Overrides apply to all requests * when this is undefined. */ matcher?: RegExp | string; /** Override executor function or replacement string */ override: string | ((request: IPendingEvent, matcher?: RegExp) => void); /** Name */ name?: string; /** Note */ note?: string; /** Description */ description?: string; } /** Airgap watcher */ type AirgapWatcher = (request: IPendingEvent) => void; /** * Cookie override handler. This function can modify attempted cookie mutations. */ type CookieOverride = (event: IPendingCookieMutation) => void; /** * Passive cookie watcher. This function can view attempted cookie mutations in a read-only state. */ type CookieWatcher = (event: IPendingCookieMutation) => void; /** Event types (for purpose resolution) */ type TrackingEventType = 'request' | 'cookie'; /** Airgap sync types */ type AirgapSyncType = 'consent' | 'quarantine'; /** airgap.sync() options */ interface SyncOptions { /** types of data to sync */ sync?: AirgapSyncType[]; /** reset synchronized data (default: false) */ reset?: boolean; /** sync locally (i.e. XDI) */ local?: boolean; /** sync with remote endpoint */ backend?: boolean; /** signed authentication token to link consent with encrypted identifier */ auth?: string; } /** airgap.js API */ type AirgapAPI = Readonly<{ /** Embedded request watchers */watchers?: AirgapWatcher[]; /** Embedded request overrides (must specify pre-init) */ overrides?: RequestOverride[]; /** Embedded request overrides (must specify pre-init) */ cookieOverrides?: CookieOverride[]; /** Airgap ready event subscriber */ ready(callback: (airgap: AirgapAPI) => void): void; /** Queue of callbacks to dispatch once airgap is ready */ readyQueue?: ((airgap: AirgapAPI) => void)[]; /** Enqueue cross-domain data sync across all airgap bundle domains */ sync(options?: SyncOptions): Promise; /** * Resolve URL input reserialization post-regulation. * @param resolveOverrides - Resolve overrides. Defaults to true. */ resolve(url: Stringifiable, resolveOverrides?: boolean): Stringifiable; /** * Resolve consent status for given tracking purposes. Essential purposes override opted out unessential purposes. * * If `use` is not provided, consent is resolved for both request and cookie tracking event types. * @param trackingPurposes - Tracking purposes to resolve * @param use - Optional event type to use for tracking purpose resolution * @returns `true` if the applicable tracking purposes are consented. */ isConsented(trackingPurposes: TrackingPurposes, use?: TrackingEventType): boolean; /** Get tracking consent */ getConsent(): TrackingConsentDetails; /** Set tracking consent */ setConsent(/** Airgap auth proof */ auth: AirgapAuth, /** The tracking consent options. */ consent: TrackingConsent, /** Consent options */ options?: ConsentOptions): Promise | boolean; /** * Sets whether or not the Consent UI has been shown to the user * @deprecated It was discovered that this function was not working reliably in some versions, and that the value it set was not being used. */ setPrompted(state: boolean): Promise; /** Consents the user to all tracking purposes (requires recent UI interaction) */ optIn(/** Airgap auth proof */ auth: AirgapAuth): boolean; /** Revokes consent for all tracking purposes (requires recent UI interaction) */ optOut(/** Airgap auth proof */ auth: AirgapAuth): boolean; /** Returns true if the user is fully-opted in to all first-order tracking purposes */ isOptedIn(): boolean; /** Returns true if the user is fully-opted out to all first-order tracking purposes */ isOptedOut(): boolean; /** Resolve regime tracking purposes. If no regimes are provided, then the user's detected regimes are used */ getRegimePurposes(regimes?: Set): Set; /** Get initialized tracking purposes config */ getPurposeTypes(): TrackingPurposesTypes; /** Override pending requests */ override(auth: AirgapAuth, ...overrides: RequestOverride[]): Removable; /** Override cookies */ overrideCookies(auth: AirgapAuth, handler: (event: IPendingCookieMutation) => void): Removable; /** Listen to pending requests passively */ watch(watcher: AirgapWatcher): Removable; /** Listen to cookies passively */ watchCookies(watcher: CookieWatcher): Removable; /** Clear airgap queue & caches. Returns `true` on success. */ clear(auth: AirgapAuth): boolean; /** Reset airgap queue and consent. Returns `true` on success. */ reset(/** An airgap auth proof */ auth: AirgapAuth, /** Automatically reload the page if needed to remove CSP. */ autoReload?: boolean): boolean; /** Check whether a URL is allowed to be loaded */ isAllowed(/** URL to evaluate */ url: Stringifiable, /** Should overrides be resolved? true by default */ resolveOverrides?: boolean): Promise; /** Check whether a cookie is allowed to be set */ isCookieAllowed(/** IPendingCookieMutation-like object to evaluate */ cookie: string | IPendingCookieMutation | PendingCookieMutationInit, /** Should overrides be resolved? true by default */ resolveOverrides?: boolean): Promise; /** Check whether a IPendingRequest is allowed to be loaded */ isRequestAllowed(/** IPendingEvent to inspect */ request: IPendingEvent, /** Should overrides be resolved? true by default */ resolveOverrides?: boolean): Promise; /** Get purposes of URL */ getPurposes(/** URL to evaluate */ url: Stringifiable, /** Should overrides be resolved? true by default */ resolveOverrides?: boolean): Promise; /** Get purposes of IPendingRequest */ getRequestPurposes(/** IPendingEvent-like object to inspect */ request: string | IPendingEvent | PendingRequestInit, /** Should overrides be resolved? true by default */ resolveOverrides?: boolean): Promise; /** Get purposes of a cookie */ getCookiePurposes(/** IPendingCookieMutation-like object to evaluate */ cookie: string | IPendingCookieMutation | PendingCookieMutationInit, /** Should overrides be resolved? true by default */ resolveOverrides?: boolean): Promise; /** Export queues */ export(options?: AirgapExportOptions): AirgapQueues; /** Get a list of legal regimes that are potentially applicable to the user */ getRegimes(): Set; /** Get a list of detected active user agent privacy signals */ getPrivacySignals(): Set; /** Toggle all airgap.js protections. Auth must be a pre-airgap.js or airgap.js script 'load' event. Returns success status */ toggle(auth: AirgapAuth, options?: AirgapToggleOptions): boolean; /** Current airgap.js system flags */ status: AirgapSystemStatus; /** airgap.js version number */ version: string; /** override the event listener signature for consent change events */ addEventListener: (type: AirgapConsentEventType, callback: ((evt: ConsentChangeEventPayload) => void) | null, options?: boolean | AddEventListenerOptions | undefined) => void; }> & EventTarget; /** airgap.export() options */ interface AirgapExportOptions { /** Send output to web endpoint */ endpoint?: string; /** JSON pretty-print indentation (default: 0) */ space?: number; /** Save output to disk (default: off) */ save?: boolean; /** Filename for saving to disk */ filename?: string; } /** Exported airgap queues & consent */ type AirgapQueues = Readonly<{ /** airgap.js version number */version: string; /** Current user consent details */ consent: TrackingConsentDetails; /** Navigation page URL */ url: Stringifiable; /** Pending requests */ requests: PendingRequestDescriptor[]; /** Pending mutations (same-session-only replay) */ mutations: PendingMutationDescriptor[]; /** Pending cookies */ cookies: PendingCookieMutationDescriptor[]; /** Pending cookies (same-session-only replay) */ cookieMutations: PendingCookieMutationDescriptor[]; /** Sent requests */ sentRequests?: PendingRequestDescriptor[]; /** Set cookies */ setCookies?: PendingCookieMutationDescriptor[]; }>; /** * Airgap event types that send the ConsentChangeEventDetails object with them */ type AirgapConsentEventType = 'consent-change' | 'sync' | 'consent-resolution'; /** * airgap.js event type */ type AirgapEventType = AirgapConsentEventType | 'purpose-map-load'; interface ConsentChangeEventPayload { /** consent change event details */ detail: ConsentChangeEventDetails; } /** 'consent-change' custom event details */ type ConsentChangeEventDetails = { /** The old tracking consent */oldConsent: TrackingConsentDetails | null; /** The new tracking consent */ consent: TrackingConsentDetails | null; /** The tracking consent diff (what's changed in the new consent) */ changes: Record | null; /** Applicable privacy signals contributing to this consent change event */ signals?: Set | null; }; /** Removable process (can remove watchers, overrides, and protections) */ type Removable = { /** Remove/revoke process */remove(): void; }; /** Any value which implements `toString()` */ type Stringifiable = string | (string & { toString(): string; }); /** Special `defaultConsent` automatic opt-out value for any potential reason */ declare const AutoOptOut: t.LiteralC<"Auto">; /** Type override */ type AutoOptOut = t.TypeOf; /** Special `defaultConsent` automatic opt-out value for GDPR-protected users */ declare const AutoOptOutForGDPR: t.LiteralC<"AutoGDPR">; /** Type override */ type AutoOptOutForGDPR = t.TypeOf; /** * Special `defaultConsent` automatic opt-out value for users with DNT enabled. * Note that DNT is enabled by default for some browsers. */ declare const AutoOptOutForDNT: t.LiteralC<"AutoDNT">; /** Type override */ type AutoOptOutForDNT = t.TypeOf; /** * Special `defaultConsent` automatic opt-out value for users with GPC enabled. */ declare const AutoOptOutForGPC: t.LiteralC<"AutoGPC">; /** Type override */ type AutoOptOutForGPC = t.TypeOf; /** Potential values for `defaultConsent` config token list */ declare const DefaultConsentConfigValue: t.UnionC<[t.BooleanC, t.LiteralC<"Auto">, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>; /** Type override */ type DefaultConsentConfigValue = t.TypeOf; /** User-configurable user agent privacy signal */ declare const UserPrivacySignal: t.UnionC<[t.LiteralC<"GPC">, t.LiteralC<"DNT">]>; /** type overload */ type UserPrivacySignal = t.TypeOf; /** Tracking purpose metadata */ declare const TrackingPurposeDetails: t.IntersectionC<[t.TypeC<{ /** Tracking purpose name */name: t.StringC; /** Tracking purpose description (used in Consent Manager UI) */ description: t.StringC; /** Tracking purpose default consent (default: false) */ defaultConsent: t.UnionC<[t.BooleanC, t.LiteralC<"Auto">, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>; /** * Is this a first-order tracking purpose? If false, this is a * second-order tracking purpose that should only be used for * request overrides. * * This parameter previously meant: * Show tracking purpose in consent manager UI. * * Default value: true */ showInConsentManager: t.BooleanC; /** Allow user to configure their consent for this purpose (default: true) */ configurable: t.BooleanC; /** Is tracking purpose "essential" - i.e. consent is mandatory / equivalent to 'essential' permission (default: false) */ essential: t.BooleanC; }>, t.PartialC<{ /** Tracking type */trackingType: t.StringC; /** Respected opt-out privacy signals */ optOutSignals: t.ArrayC, t.LiteralC<"DNT">]>>; }>]>; /** Type override */ type TrackingPurposeDetails = t.TypeOf; /** Tracking purposes types configuration */ declare const TrackingPurposesTypes: t.RecordC, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>; /** * Is this a first-order tracking purpose? If false, this is a * second-order tracking purpose that should only be used for * request overrides. * * This parameter previously meant: * Show tracking purpose in consent manager UI. * * Default value: true */ showInConsentManager: t.BooleanC; /** Allow user to configure their consent for this purpose (default: true) */ configurable: t.BooleanC; /** Is tracking purpose "essential" - i.e. consent is mandatory / equivalent to 'essential' permission (default: false) */ essential: t.BooleanC; }>, t.PartialC<{ /** Tracking type */trackingType: t.StringC; /** Respected opt-out privacy signals */ optOutSignals: t.ArrayC, t.LiteralC<"DNT">]>>; }>]>>; /** Type override */ type TrackingPurposesTypes = t.TypeOf; /** Fully-resolved `defaultConsent` config */ declare const DefaultConsentConfig: t.RecordC, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>>; /** Type override */ type DefaultConsentConfig = t.TypeOf; /** Tracking purposes configuration */ declare const TrackingPurposesConfig: t.IntersectionC<[t.TypeC<{ /** Inherit default tracking purposes config */useDefault: t.BooleanC; types: t.RecordC, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>; /** * Is this a first-order tracking purpose? If false, this is a * second-order tracking purpose that should only be used for * request overrides. * * This parameter previously meant: * Show tracking purpose in consent manager UI. * * Default value: true */ showInConsentManager: t.BooleanC; /** Allow user to configure their consent for this purpose (default: true) */ configurable: t.BooleanC; /** Is tracking purpose "essential" - i.e. consent is mandatory / equivalent to 'essential' permission (default: false) */ essential: t.BooleanC; }>, t.PartialC<{ /** Tracking type */trackingType: t.StringC; /** Respected opt-out privacy signals */ optOutSignals: t.ArrayC, t.LiteralC<"DNT">]>>; }>]>>; }>, t.PartialC<{ defaultConsent: t.UnionC<[t.UnionC<[t.BooleanC, t.LiteralC<"Auto">, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>, t.RecordC, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>>]>; }>]>; /** Type override */ type TrackingPurposesConfig = { /** Inherit default tracking purposes config (Functional, Advertising, Analytics) */useDefault: boolean; /** Tracking purpose types */ types: TrackingPurposesTypes; /** Default consent states (takes precedence over `TrackingPurposesTypes[purpose].defaultConsent`) */ defaultConsent?: DefaultConsentConfigValue | DefaultConsentConfig; }; declare const TrackingConsent: t.IntersectionC<[t.PartialC<{ Essential: t.LiteralC; Unknown: t.LiteralC; }>, t.RecordC, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>, t.UndefinedC]>>]>; /** * Type override */ type TrackingConsent = t.TypeOf; declare const TrackingConsentWithNulls: t.RecordC; Unknown: t.LiteralC; }>, t.RecordC, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>, t.UndefinedC]>>]>, t.NullC]>>; /** Type override */ type TrackingConsentWithNulls = t.TypeOf; declare const CoreTrackingConsentDetails: t.IntersectionC<[t.TypeC<{ /** * Was tracking consent confirmed by the user? * If this is false, the consent was resolved from defaults & is not yet confirmed */ confirmed: t.BooleanC; /** Consent resolution/last-modified timestamp (ISO 8601) */ timestamp: t.StringC; }>, t.PartialC<{ /** Has the consent been updated (including no-change confirmation) since default resolution */updated: t.BooleanC; /** * Whether or not the UI has been shown to the end-user (undefined in older versions of airgap.js) * @deprecated It was discovered that this value was not being set reliably in some versions, and was not being used. */ prompted: t.BooleanC; /** Arbitrary metadata that customers want to be associated with consent state */ metadata: t.IntersectionC<[t.PartialC<{ tcmp: t.PartialC<{ tcf: t.PartialC<{ tcString: t.StringC; }>; }>; }>, t.UnknownRecordC]>; /** When the metadata was last updated */ metadataTimestamp: t.StringC; }>]>; /** Type override */ type CoreTrackingConsentDetails = t.TypeOf; declare const TrackingConsentDetails: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ /** * Was tracking consent confirmed by the user? * If this is false, the consent was resolved from defaults & is not yet confirmed */ confirmed: t.BooleanC; /** Consent resolution/last-modified timestamp (ISO 8601) */ timestamp: t.StringC; }>, t.PartialC<{ /** Has the consent been updated (including no-change confirmation) since default resolution */updated: t.BooleanC; /** * Whether or not the UI has been shown to the end-user (undefined in older versions of airgap.js) * @deprecated It was discovered that this value was not being set reliably in some versions, and was not being used. */ prompted: t.BooleanC; /** Arbitrary metadata that customers want to be associated with consent state */ metadata: t.IntersectionC<[t.PartialC<{ tcmp: t.PartialC<{ tcf: t.PartialC<{ tcString: t.StringC; }>; }>; }>, t.UnknownRecordC]>; /** When the metadata was last updated */ metadataTimestamp: t.StringC; }>]>, t.TypeC<{ /** Tracking consent config */purposes: t.IntersectionC<[t.PartialC<{ Essential: t.LiteralC; Unknown: t.LiteralC; }>, t.RecordC, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>, t.UndefinedC]>>]>; }>]>; /** Override types. */ type TrackingConsentDetails = t.TypeOf; declare const TrackingConsentOptionalData: t.PartialC<{ /** Transparency Consent (TCF) String */tcf: t.StringC; /** US Privacy (USP) String */ usp: t.StringC; /** Global Privacy Platform (GPP) String */ gpp: t.StringC; /** Consent Manager View State */ viewState: t.KeyofC<{ QuickOptions: unknown; QuickOptions3: unknown; AcceptAll: unknown; AcceptAllRejectAllToggle: unknown; AcceptAllOrMoreChoices: unknown; AcceptOrRejectAll: unknown; AcceptOrRejectAllOrMoreChoices: unknown; AcceptOrRejectAnalytics: unknown; AcceptOrRejectAdvertising: unknown; NoticeAndDoNotSell: unknown; DoNotSellExplainer: unknown; CompleteOptionsToggles: unknown; PrivacyPolicyNotice: unknown; PrivacyPolicyNoticeWithCloseButton: unknown; CompleteOptions: unknown; CompleteOptionsInverted: unknown; Hidden: unknown; TCF_EU: unknown; DoNotSellDisclosure: unknown; OptOutDisclosure: unknown; LanguageOptions: unknown; Collapsed: unknown; Closed: unknown; }>; /** Airgap Version */ airgapVersion: t.StringC; }>; declare const FullTrackingConsentDetails: t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{ /** * Was tracking consent confirmed by the user? * If this is false, the consent was resolved from defaults & is not yet confirmed */ confirmed: t.BooleanC; /** Consent resolution/last-modified timestamp (ISO 8601) */ timestamp: t.StringC; }>, t.PartialC<{ /** Has the consent been updated (including no-change confirmation) since default resolution */updated: t.BooleanC; /** * Whether or not the UI has been shown to the end-user (undefined in older versions of airgap.js) * @deprecated It was discovered that this value was not being set reliably in some versions, and was not being used. */ prompted: t.BooleanC; /** Arbitrary metadata that customers want to be associated with consent state */ metadata: t.IntersectionC<[t.PartialC<{ tcmp: t.PartialC<{ tcf: t.PartialC<{ tcString: t.StringC; }>; }>; }>, t.UnknownRecordC]>; /** When the metadata was last updated */ metadataTimestamp: t.StringC; }>]>, t.TypeC<{ /** Tracking consent config */purposes: t.IntersectionC<[t.PartialC<{ Essential: t.LiteralC; Unknown: t.LiteralC; }>, t.RecordC, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>, t.UndefinedC]>>]>; }>]>, t.PartialC<{ /** Transparency Consent (TCF) String */tcf: t.StringC; /** US Privacy (USP) String */ usp: t.StringC; /** Global Privacy Platform (GPP) String */ gpp: t.StringC; /** Consent Manager View State */ viewState: t.KeyofC<{ QuickOptions: unknown; QuickOptions3: unknown; AcceptAll: unknown; AcceptAllRejectAllToggle: unknown; AcceptAllOrMoreChoices: unknown; AcceptOrRejectAll: unknown; AcceptOrRejectAllOrMoreChoices: unknown; AcceptOrRejectAnalytics: unknown; AcceptOrRejectAdvertising: unknown; NoticeAndDoNotSell: unknown; DoNotSellExplainer: unknown; CompleteOptionsToggles: unknown; PrivacyPolicyNotice: unknown; PrivacyPolicyNoticeWithCloseButton: unknown; CompleteOptions: unknown; CompleteOptionsInverted: unknown; Hidden: unknown; TCF_EU: unknown; DoNotSellDisclosure: unknown; OptOutDisclosure: unknown; LanguageOptions: unknown; Collapsed: unknown; Closed: unknown; }>; /** Airgap Version */ airgapVersion: t.StringC; }>]>; /** Override types. */ type FullTrackingConsentDetails = t.TypeOf; declare const FullTrackingConsentDetailsWithNulls: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ /** * Was tracking consent confirmed by the user? * If this is false, the consent was resolved from defaults & is not yet confirmed */ confirmed: t.BooleanC; /** Consent resolution/last-modified timestamp (ISO 8601) */ timestamp: t.StringC; }>, t.PartialC<{ /** Has the consent been updated (including no-change confirmation) since default resolution */updated: t.BooleanC; /** * Whether or not the UI has been shown to the end-user (undefined in older versions of airgap.js) * @deprecated It was discovered that this value was not being set reliably in some versions, and was not being used. */ prompted: t.BooleanC; /** Arbitrary metadata that customers want to be associated with consent state */ metadata: t.IntersectionC<[t.PartialC<{ tcmp: t.PartialC<{ tcf: t.PartialC<{ tcString: t.StringC; }>; }>; }>, t.UnknownRecordC]>; /** When the metadata was last updated */ metadataTimestamp: t.StringC; }>]>, t.PartialC<{ /** Transparency Consent (TCF) String */tcf: t.StringC; /** US Privacy (USP) String */ usp: t.StringC; /** Global Privacy Platform (GPP) String */ gpp: t.StringC; /** Consent Manager View State */ viewState: t.KeyofC<{ QuickOptions: unknown; QuickOptions3: unknown; AcceptAll: unknown; AcceptAllRejectAllToggle: unknown; AcceptAllOrMoreChoices: unknown; AcceptOrRejectAll: unknown; AcceptOrRejectAllOrMoreChoices: unknown; AcceptOrRejectAnalytics: unknown; AcceptOrRejectAdvertising: unknown; NoticeAndDoNotSell: unknown; DoNotSellExplainer: unknown; CompleteOptionsToggles: unknown; PrivacyPolicyNotice: unknown; PrivacyPolicyNoticeWithCloseButton: unknown; CompleteOptions: unknown; CompleteOptionsInverted: unknown; Hidden: unknown; TCF_EU: unknown; DoNotSellDisclosure: unknown; OptOutDisclosure: unknown; LanguageOptions: unknown; Collapsed: unknown; Closed: unknown; }>; /** Airgap Version */ airgapVersion: t.StringC; }>, t.TypeC<{ /** Tracking consent config */purposes: t.RecordC; Unknown: t.LiteralC; }>, t.RecordC, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>, t.UndefinedC]>>]>, t.NullC]>>; }>]>; /** Override types. */ type FullTrackingConsentDetailsWithNulls = t.TypeOf; declare const ConsentPreferencesBody: t.TypeC<{ /** token containing encrypted identifier */token: t.StringC; /** consent partition (defaults to bundle id) */ partition: t.StringC; /** user consent */ consent: t.IntersectionC<[t.IntersectionC<[t.TypeC<{ /** * Was tracking consent confirmed by the user? * If this is false, the consent was resolved from defaults & is not yet confirmed */ confirmed: t.BooleanC; /** Consent resolution/last-modified timestamp (ISO 8601) */ timestamp: t.StringC; }>, t.PartialC<{ /** Has the consent been updated (including no-change confirmation) since default resolution */updated: t.BooleanC; /** * Whether or not the UI has been shown to the end-user (undefined in older versions of airgap.js) * @deprecated It was discovered that this value was not being set reliably in some versions, and was not being used. */ prompted: t.BooleanC; /** Arbitrary metadata that customers want to be associated with consent state */ metadata: t.IntersectionC<[t.PartialC<{ tcmp: t.PartialC<{ tcf: t.PartialC<{ tcString: t.StringC; }>; }>; }>, t.UnknownRecordC]>; /** When the metadata was last updated */ metadataTimestamp: t.StringC; }>]>, t.TypeC<{ /** Tracking consent config */purposes: t.IntersectionC<[t.PartialC<{ Essential: t.LiteralC; Unknown: t.LiteralC; }>, t.RecordC, t.LiteralC<"AutoGDPR">, t.LiteralC<"AutoDNT">, t.LiteralC<"AutoGPC">, t.KeyofC<{ on: null; off: null; }>]>, t.UndefinedC]>>]>; }>]>; }>; /** Override types. */ type ConsentPreferencesBody = t.TypeOf; declare const ConsentTokenPayload: t.IntersectionC<[t.TypeC<{ encryptedIdentifier: t.StringC; }>, t.PartialC<{ deprecatedEncryptedIdentifiers: t.ArrayC; }>]>; /** Type override */ type ConsentTokenPayload = t.TypeOf; /** Tracking purpose */ declare const TrackingPurpose: t.UnionC<[t.KeyofC<{ Unknown: "Unknown"; Essential: "Essential"; }>, t.StringC]>; /** Type override */ type TrackingPurpose = t.TypeOf; /** Tracking purposes */ type TrackingPurposes = Set; /** Tracking consent change diffs */ declare const ConsentChange: t.RecordC, t.StringC]>, t.BooleanC>; /** type overload */ type ConsentChange = t.TypeOf; /** Regime purpose scopes configuration */ declare const RegimePurposeScopesConfig: t.ArrayC>, _$_transcend_io_type_utils0.FixedLengthArrayBrand>>>; /** Type override */ type RegimePurposeScopesConfig = [/** Regimes */regimes: string[], /** In-scope purposes */purposes: TrackingPurpose[]][]; /** Request source types */ type AirgapRequestSource = 'unknown' | 'airgap.js' | 'fetch' | 'xhr' | 'websocket' | 'webtransport' | 'service-worker' | 'shared-worker' | 'worker' | 'module-worker' | 'shared-module-worker' | 'eventsource' | 'beacon' | 'CSPV' | 'navigation' | 'open' | 'script' | AirgapDOMRequestSource; /** DOM-initiated request source types */ type AirgapDOMRequestSource = 'DOM:style' | 'DOM:image' | 'DOM:media' | 'DOM:video' | 'DOM:audio' | 'DOM:track' | 'DOM:link' | 'DOM:form' | 'DOM:form-action' | 'DOM:view' | 'DOM:ping' | 'DOM:unknown'; /** * Airgap pending request descriptor init dictionary */ interface PendingRequestInit { /** Request initiator type */ type: AirgapRequestSource; /** Request URL */ url: Stringifiable; /** Persist request for cross-session replay (false by default) */ persist?: boolean; /** Request initialization data */ requestInit?: RequestInit; /** Request timestamp (ISO 8601) */ timestamp?: Stringifiable; /** Request DOM target */ target?: Node | IDynamicNodeReference | null; /** Mutator to apply changes associated with the request */ mutator?(): void; /** Serialize request or mutation state back to DOM patcher parser input */ serialize?(): any; /** Prevent credentials from being included in request */ omitCredentials?(): boolean; } /** Properties that are added to instantiated PendingRequests */ interface InstantiatedPendingRequestProps { /** Primary or first associated request URL input */ url: Stringifiable; /** All associated request URL inputs */ urls: Stringifiable[]; /** Request timestamp (ISO 8601) */ timestamp: Stringifiable; /** Serialize request or mutation state back to DOM patcher parser input */ serialize(): any; /** The following IPendingEvent APIs are only available to overrides: */ /** * All associated resolved request URLs. null = invalid URL or data: URL (parsing * skipped to optimize performance) */ URLs: (URL | null)[]; /** Prevent credentials from being included in request */ omitCredentials(): boolean; /** Whether or not request is currently allowed */ allowed: boolean; /** Bypass our consent logic and force-allow request */ allow(): void; /** Bypass our consent logic and force-deny request */ deny(): void; /** Bypass our consent logic to force-deny request and also block it from entering the replay quarantine */ block(): void; /** Resolved tracking purposes associated with this pending mutation */ purposes: Set; } /** * Airgap pending request descriptor with script annotation */ type PendingRequestDescriptor = PendingRequestInit & InstantiatedPendingRequestProps; /** Airgap pending request descriptor init with multiple URLs */ type PendingMutationInit = Omit & { /** Request URLs */urls: Stringifiable[]; }; /** PendingEvent init input */ type PendingEventInit = PendingRequestInit | PendingMutationInit; /** Pending mutation descriptor */ type PendingMutationDescriptor = PendingMutationInit & InstantiatedPendingRequestProps; /** Pending event props that can't or won't be serialized to JSON */ type PendingEventUnserializableProps = 'persist' | 'target' | 'mutator' | 'serialize' | 'URLs' | 'omitCredentials' | 'allow' | 'deny' | 'purposes' | 'allowed' | 'blocked'; /** JSON-safe representation of pending event tracking purposes */ interface PendingEventPurposesJSON { /** Tracking purposes list */ purposes?: TrackingPurpose[]; } /** Pending request subset to JSON-safe properties */ type PendingRequestJSON = Omit & PendingEventPurposesJSON; /** Pending mutation subset to JSON-safe properties */ type PendingMutationJSON = Omit & PendingEventPurposesJSON; /** Airgap pending request interface */ interface IPendingRequest extends PendingRequestDescriptor { /** Convert PendingRequest to JSON-safe representation */ toJSON(): PendingRequestJSON; } /** Airgap pending mutation interface */ interface IPendingMutation extends PendingMutationDescriptor { /** Convert PendingRequest to JSON-safe representation */ toJSON(): PendingMutationJSON; } /** Pending event descriptor */ type PendingEventDescriptor = PendingRequestDescriptor | PendingMutationDescriptor; /** Pending request or mutation */ type IPendingEvent = IPendingMutation | IPendingRequest; /** Unapproved request queue */ type PendingRequestQueue = IPendingRequest[]; /** Unapproved mutation queue */ type PendingMutationQueue = IPendingEvent[]; /** Unapproved event queue */ type PendingEventQueue = IPendingEvent[]; /** Cookie descriptor */ interface Cookie { /** Cookie name */ name: Stringifiable; /** Cookie value */ value?: Stringifiable; /** Cookie change event timestamp (ISO 8601) */ timestamp?: string; /** Expiry date (UTC date string or DOMTimeStamp) */ expires?: number | Stringifiable; /** Max cookie age (seconds) */ maxAge?: number; /** Optional cookie host scope */ domain?: Stringifiable; /** Optional cookie path scope */ path?: Stringifiable; /** Should cookie only be sent in secure contexts? */ secure?: boolean; /** * Should cookie be restricted to the same site? * Values: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite */ sameSite?: Stringifiable; /** * Is the cookie partitioned (e.g. by CHIPS)? * See https://developer.mozilla.org/en-US/docs/Web/Privacy/Partitioned_cookies * and https://developer.mozilla.org/en-US/docs/Web/API/CookieStore/get#:~:text=of%20the%20cookie.-,partitioned,-A%20boolean%20indicating */ partitioned?: boolean; /** Target document / node */ target?: Node | null; } /** * PendingCookieMutation constructor input */ interface PendingCookieMutationInit extends Cookie { /** Persist cookie for cross-session replay if quarantined (true by default) */ persist?: boolean; /** Mutator to apply cookie mutation */ mutator?(): void | Promise; } /** Properties that are added to instantiated PendingCookieMutations */ interface InstantiatedPendingCookieMutationProps { /** Expiry date (DOMTimeStamp) */ expires?: number; /** Cookie change event timestamp (Date.now() format) */ timestamp: string; /** Whether or not cookie is currently allowed. null = passthrough */ allowed?: boolean | null; /** Whether or not cookie is currently disallowed & blocked from entering the quarantine */ blocked?: boolean; /** Bypass our consent logic and force-allow cookie */ allow(): void; /** Bypass our consent logic and force-deny cookie */ deny(): void; /** Bypass our consent logic to force-deny cookie and also block it from entering the quarantine */ block(): void; /** Resolved tracking purposes associated with this pending mutation */ purposes: Set; /** Mutator to apply cookie mutation */ mutator(): void | Promise; } /** Pending cookie mutation descriptor */ type PendingCookieMutationDescriptor = Omit & InstantiatedPendingCookieMutationProps; /** Pending cookie mutation props that can't or won't be serialized to JSON */ type PendingCookieMutationUnserializableProps = 'persist' | 'mutator' | 'allow' | 'deny' | 'purposes' | 'allowed' | 'blocked'; /** JSON-safe representation of pending cookie mutation tracking purposes */ interface PendingCookieMutationPurposesJSON { /** Tracking purposes list */ purposes?: TrackingPurpose[]; } /** Pending request subset to JSON-safe properties */ type PendingCookieMutationJSON = Omit & PendingCookieMutationPurposesJSON; /** Airgap pending cookie mutation interface */ interface IPendingCookieMutation extends PendingCookieMutationDescriptor { /** Convert PendingCookieMutation to JSON-safe representation */ toJSON(): PendingCookieMutationJSON; } /** Pending cookie mutation queue */ type PendingCookieQueue = IPendingCookieMutation[]; /** Interface for dynamic node references */ interface IDynamicNodeReference { /** * Current node getter. This should always be used in `handleLiveMutation()`. * @returns current node */ getNode(): Element; /** * Live node getter. Use this to apply mutations in `quarantine()` * and `quarantineMutation()` handlers. * * `release()` must always be called after completing * mutations using `getLiveNode()`. * @returns live node */ getLiveNode(): Element; /** Release & garbage-collect internal node reference */ release(): void; } //#endregion export { AirgapAPI, AirgapAuth, AirgapAuthMap, AirgapConsentEventType, AirgapDOMRequestSource, AirgapEventType, AirgapExportOptions, AirgapQueues, AirgapRequestSource, AirgapSyncType, AirgapSystemStatus, AirgapToggleOptions, AirgapWatcher, AutoOptOut, AutoOptOutForDNT, AutoOptOutForGDPR, AutoOptOutForGPC, BooleanString, ConsentChange, ConsentChangeEventDetails, ConsentChangeEventPayload, ConsentOptions, ConsentPreferencesBody, ConsentTokenPayload, ConsoleSafeLogLevel, Cookie, CookieOverride, CookieWatcher, CoreTrackingConsentDetails, DefaultConsentConfig, DefaultConsentConfigValue, FullTrackingConsentDetails, FullTrackingConsentDetailsWithNulls, GetPurposeTypesOptions, IDynamicNodeReference, IPendingCookieMutation, IPendingEvent, IPendingMutation, IPendingRequest, InstantiatedPendingCookieMutationProps, InstantiatedPendingRequestProps, LogEmitter, LogEntry, LogEntryType, LogItem, LogLevel, LogMessage, LogTag, Logger, Metadata, PendingCookieMutationDescriptor, PendingCookieMutationInit, PendingCookieMutationJSON, PendingCookieQueue, PendingEventDescriptor, PendingEventInit, PendingEventQueue, PendingMutationDescriptor, PendingMutationInit, PendingMutationJSON, PendingMutationQueue, PendingRequestDescriptor, PendingRequestInit, PendingRequestJSON, PendingRequestQueue, PrivacyRegime, RegimePurposeScopesConfig, RegimeToPurposeScopes, Removable, RequestOverride, ReservedMetadata, Stringifiable, SyncOptions, TrackingConsent, TrackingConsentDetails, TrackingConsentOptionalData, TrackingConsentWithNulls, TrackingEventType, TrackingPurpose, TrackingPurposeDetails, TrackingPurposes, TrackingPurposesConfig, TrackingPurposesTypes, UserPrivacySignal }; //# sourceMappingURL=core.d.mts.map