/**
* Services Export - IMPORTANT NOTICE
*
* All Angular services from @pepperi-addons/ngx-lib require Angular's dependency injection
* and cannot be used in React-only environments without bundling the entire Angular runtime.
*
* This would cause significant bundling issues and bloat your React application.
*
* ALTERNATIVES:
* - For HTTP requests: Use the HTTP helper functions (pepHttpGet, pepHttpPost, etc.)
* - For UI components: Use the custom element components (PepDialog, PepSnackBar, etc.)
* - For utilities: Implement lightweight alternatives or use standard JavaScript libraries
*
* If you absolutely need Angular service functionality, you must use the Angular library
* directly in an Angular application, not in a React application.
*/
///
export interface PepHttpServiceBridge {
getHttpCall(url: string, httpOptions?: any): any;
postHttpCall(url: string, body: any | null, httpOptions?: any): any;
getWapiApiCall(url: string, httpOptions?: any): any;
postWapiApiCall(url: string, body: any | null, httpOptions?: any): any;
getPapiApiCall(url: string, httpOptions?: any): any;
postPapiApiCall(url: string, body: any | null, httpOptions?: any): any;
}
export interface PepTranslateServiceBridge {
instant(key: string | string[], interpolateParams?: Record): string | any;
get(key: string | string[], interpolateParams?: Record): any;
use(lang: string): any;
getDefaultLang(): string;
getCurrentLang(): string | undefined;
}
export declare type PepDialogActionsType = 'close' | 'cancel-continue' | 'cancel-ok' | 'cancel-delete' | 'custom';
export declare type PepDialogSizeType = 'inline' | 'small' | 'regular' | 'large' | 'full-screen';
export interface PepDialogActionButtonConfig {
title: string;
className?: string;
callback?: () => void;
}
export interface PepDialogDefaultOptions {
title?: string;
content?: string;
showClose?: boolean;
showHeader?: boolean;
showFooter?: boolean;
actionsType?: PepDialogActionsType;
actionButtons?: PepDialogActionButtonConfig[];
size?: PepDialogSizeType;
disableClose?: boolean;
hasBackdrop?: boolean;
height?: string;
minWidth?: string;
maxWidth?: string;
maxHeight?: string;
panelClass?: string;
}
export interface PepAddonServiceBridge {
getAddonApiCall(addonUUID: string, fileName: string, functionName: string, httpOptions?: any, isAsync?: boolean): any;
postAddonApiCall(addonUUID: string, fileName: string, functionName: string, body?: any, httpOptions?: any, isAsync?: boolean): any;
getAddonCPICall(addonUUID: string, url: string): Promise;
postAddonCPICall(addonUUID: string, url: string, body: any): Promise;
getServerBaseUrl(addonUUID: string, fileName?: string, isAsync?: boolean, localhostPort?: number): string;
getAddonStaticFolder(addonUUID: string): string;
setAddonStaticFolder(path: string, addonUUID: string): void;
setShellRouterData(data: {
addPadding?: boolean;
showSidebar?: boolean;
showHeader?: boolean;
}): void;
}
export declare function getPepCustomizationService(): PepCustomizationServiceBridge | undefined;
export declare function getPepAddonService(): PepAddonServiceBridge | undefined;
export declare function getPepColorService(): PepColorServiceBridge | undefined;
export declare function getPepLoaderService(): PepLoaderServiceBridge | undefined;
export declare function getPepRemoteLoaderService(): PepRemoteLoaderServiceBridge | undefined;
export declare function getPepAddonBlockLoaderService(): PepAddonBlockLoaderServiceBridge | undefined;
export interface PepSessionServiceBridge {
getIdpToken(): string | null;
getWapiBaseUrl(): string | null;
getPapiBaseUrl(): string | null;
getObject(key: string): T | null;
setObject(key: string, object: T): void;
removeObject(key: string): void;
}
export interface PepCustomizationServiceBridge {
getThemeVariables(): any;
setThemeVariables(themeVariablesToSet?: any): void;
getThemeVariable(key: string): string;
getBrandingTheme(): string;
getLoadingSpinnerColor(): string;
getBrandingMainColor(): string;
getTopBarHeight(): number;
hideFooter(): void;
showFooter(): void;
hideSettings(): void;
showSettings(): void;
}
export interface PepColorServiceBridge {
findClosestAccessibleColor(adjustableColor: string, otherColor: string, contrastRatio: number): string | null;
lightOrDark(color: any): 'light' | 'dark';
}
export interface PepLoaderServiceBridge {
show(): void;
hide(): void;
}
export declare type PepRemoteLoaderType = 'script' | 'module' | 'manifest';
export interface PepRemoteLoaderServiceBridge {
getRemoteLoaderOptions(blockLoaderData: {
relation: unknown;
addonPublicBaseURL: string;
}, blockRemoteEntry?: string, type?: PepRemoteLoaderType): Record;
}
export interface PepAddonBlockLoaderDialogDataOptions {
title?: string;
showClose?: boolean;
showHeader?: boolean;
showFooter?: boolean;
}
export interface PepAddonBlockLoaderContainerOptions {
name?: string;
slugName?: string;
blockType?: string;
addonUUID?: string;
blockRemoteEntry?: string;
remoteLoaderOptions?: Record;
hostObject?: unknown;
hostEventsCallback?: (event: any) => void;
}
export interface PepAddonBlockLoaderDialogOptions {
name?: string;
slugName?: string;
blockType?: string;
addonUUID?: string;
blockRemoteEntry?: string;
remoteLoaderOptions?: Record;
hostObject?: unknown;
hostEventsCallback?: (event: any) => void;
data?: PepAddonBlockLoaderDialogDataOptions;
config?: Record;
size?: PepDialogSizeType;
}
export interface PepAddonBlockLoaderContainerRegistration {
componentRef?: unknown;
destroy: () => void;
}
export interface PepAddonBlockLoaderServiceBridge {
loadAddonBlockInContainer(options: PepAddonBlockLoaderContainerOptions): PepAddonBlockLoaderContainerRegistration;
loadAddonBlockInDialog(options: PepAddonBlockLoaderDialogOptions): any;
}
export interface PepDialogServiceBridge {
openDefaultDialog(options: PepDialogDefaultOptions): any;
openColorPicker?(options: any): any;
}
export interface PepImageServiceBridge {
openImageDialog: (options: {
imageSrc?: string;
options?: Array<{
value?: string;
}>;
title?: string;
}) => unknown;
}
export interface PepSnackBarData {
title?: string;
content?: string;
}
export interface PepSnackBarServiceBridge {
getSnackBarConfig?: (options?: {
duration?: number;
}) => unknown;
openDefaultSnackBar: (data: PepSnackBarData, config?: unknown) => unknown;
}
export interface PepperiServicesBridge {
http?: PepHttpServiceBridge;
session?: PepSessionServiceBridge;
customization?: PepCustomizationServiceBridge;
translate?: PepTranslateServiceBridge;
addon?: PepAddonServiceBridge;
color?: PepColorServiceBridge;
loader?: PepLoaderServiceBridge;
remoteLoader?: PepRemoteLoaderServiceBridge;
addonBlockLoader?: PepAddonBlockLoaderServiceBridge;
dialog?: PepDialogServiceBridge;
image?: PepImageServiceBridge;
snackBar?: PepSnackBarServiceBridge;
}
export declare function getPepHttpService(): PepHttpServiceBridge | undefined;
export declare function getPepSessionService(): PepSessionServiceBridge | undefined;
export declare function getPepTranslateService(): PepTranslateServiceBridge | undefined;
export declare function getPepDialogService(): PepDialogServiceBridge | undefined;
export declare function getPepImageService(): PepImageServiceBridge | undefined;
export declare function getPepSnackBarService(): PepSnackBarServiceBridge | undefined;
export declare function pepHttpGetViaService(url: string, httpOptions?: any): Promise;
export declare function pepHttpPostViaService(url: string, body: any | null, httpOptions?: any): Promise;
export declare function pepHttpGetWapi(relativeUrl: string, httpOptions?: any): Promise;
export declare function pepHttpPostWapi(relativeUrl: string, body: any | null, httpOptions?: any): Promise;
export declare function pepHttpGetPapi(relativeUrl: string, httpOptions?: any): Promise;
export declare function pepHttpPostPapi(relativeUrl: string, body: any | null, httpOptions?: any): Promise;
export declare function pepGetIdpToken(): string | null;
export declare function pepGetWapiBaseUrl(): string | null;
export declare function pepGetPapiBaseUrl(): string | null;
export declare function pepSessionGetObject(key: string): T | null;
export declare function pepSessionSetObject(key: string, object: T): void;
export declare function pepSessionRemoveObject(key: string): void;
export declare function pepGetBrandingTheme(): string;
export declare function pepGetThemeVariables(): any;
export declare function pepSetThemeVariables(themeVariablesToSet?: any): void;
export declare function pepGetThemeVariable(key: string): string;
export declare function pepGetLoadingSpinnerColor(): string;
export declare function pepGetBrandingMainColor(): string;
export declare function pepGetTopBarHeight(): number;
export declare function pepHideFooter(): void;
export declare function pepShowFooter(): void;
export declare function pepHideSettings(): void;
export declare function pepShowSettings(): void;
export declare function pepTranslateInstant(key: string | string[], interpolateParams?: Record): string | any;
export declare function pepTranslateGet(key: string | string[], interpolateParams?: Record): Promise;
export declare function pepTranslateUse(lang: string): Promise;
export declare function pepTranslateGetDefaultLang(): string;
export declare function pepTranslateGetCurrentLang(): string | undefined;
export declare function pepAddonGetApi(addonUUID: string, fileName: string, functionName: string, httpOptions?: any, isAsync?: boolean): Promise;
export declare function pepAddonPostApi(addonUUID: string, fileName: string, functionName: string, body?: any, httpOptions?: any, isAsync?: boolean): Promise;
export declare function pepAddonGetCpi(addonUUID: string, url: string): Promise;
export declare function pepAddonPostCpi(addonUUID: string, url: string, body: any): Promise;
export declare function pepAddonGetServerBaseUrl(addonUUID: string, fileName?: string, isAsync?: boolean, localhostPort?: number): string;
export declare function pepAddonGetStaticFolder(addonUUID: string): string;
export declare function pepAddonSetStaticFolder(path: string, addonUUID: string): void;
export declare function pepAddonSetShellRouterData(data: {
addPadding?: boolean;
showSidebar?: boolean;
showHeader?: boolean;
}): void;
export declare function pepFindClosestAccessibleColor(adjustableColor: string, otherColor: string, contrastRatio: number): string | null;
export declare function pepLightOrDark(color: any): 'light' | 'dark';
export declare function pepLoaderShow(): void;
export declare function pepLoaderHide(): void;
export declare function pepOpenDefaultSnackBar(data: PepSnackBarData, options?: {
duration?: number;
}): unknown;
export declare function pepOpenDefaultDialog(options: PepDialogDefaultOptions): Promise;
export declare function pepOpenAddonBlockDialog(options: PepAddonBlockLoaderDialogOptions): Promise;
export declare function pepLoadAddonBlockInContainer(options: PepAddonBlockLoaderContainerOptions): PepAddonBlockLoaderContainerRegistration;
export declare function pepOpenColorPickerDialog(options: any): Promise;
export declare function pepOpenImageDialog(options: {
imageSrc?: string;
options?: Array<{
value?: string;
}>;
title?: string;
}): void;
export interface OpenReactPepDialogOptions {
title?: string;
showHeader?: boolean;
showFooter?: boolean;
showClose?: boolean;
disableClose?: boolean;
size?: PepDialogSizeType;
panelClass?: string;
height?: string;
minWidth?: string;
maxWidth?: string;
maxHeight?: string;
renderContent?: (close: (result?: T) => void, setTitle: (title: string) => void) => React.ReactNode;
}
export declare function openReactPepDialog(options: OpenReactPepDialogOptions): Promise;