@usercentrics/cmp-browser-sdk
Version:
Usercentrics CMP Browser SDK
30 lines (29 loc) • 1.49 kB
TypeScript
import { InitOptions, InitialUIValues, UI_LAYER, UI_VARIANT } from '../../interfaces';
import { CoreJsonResponse } from '../Api/interfaces';
export default class UIService {
private static instance;
initOptions: InitOptions | null;
isFirstTimePageVisit: boolean;
selectedLayer: UI_LAYER | null;
shouldAcceptAllImplicitly: boolean | null;
shouldShowFirstLayerOnVersionChange: boolean;
variant: UI_VARIANT | null;
private ampInstance;
private settingsV2;
private rulesetInstance;
private apiInstance;
private constructor();
static getInstance(): UIService;
static resetInstance(): void;
init(options: InitOptions): Promise<void>;
isFirstTimeVisit(): boolean;
shouldShowNone(): Promise<boolean>;
shouldManuallyResurface(): boolean;
shouldShowFirstLayer(coreJson: Pick<CoreJsonResponse, 'ccpa'>): boolean;
shouldForceReshowGDPRBanner(): boolean;
shouldShowPrivacyButton(coreJson: Pick<CoreJsonResponse, 'privacyButtonIsVisible' | 'privacyButtonUrls'>): boolean;
resolveUiVariant(tcf2Enabled?: boolean): Promise<UI_VARIANT>;
resolveUiInitialLayer(coreJson: Pick<CoreJsonResponse, 'ccpa' | 'privacyButtonIsVisible' | 'privacyButtonUrls'>): Promise<UI_LAYER>;
resolveUIOptions(coreJson: Pick<CoreJsonResponse, 'ccpa' | 'tcf2Enabled' | 'privacyButtonIsVisible' | 'privacyButtonUrls'>): Promise<InitialUIValues>;
shouldShowFirstLayerForCcpa(reshowCMP?: boolean, reshowAfterDays?: number): boolean;
}