import { FirebaseOptions } from 'firebase/app'; import { TemplateResult } from 'lit'; import { BgConfig } from '@progressive-development/pd-model'; import { PwaUpdateConfig } from '../pwa/types.js'; export declare const SC_INVALID_USER = -150; export declare const SC_TECHNICAL_FAILURE = -180; export declare class BusinessError extends Error { readonly code: number; /** * Comment, * * @param {string} message - The event detail object to be synced. * @param {number} code - The event detail object to be synced. */ constructor(message: string, code?: number); } /** * Implemeted service provider */ export type ServiceProviderFirebase = "firebase"; export type ServiceProviderMock = "mock"; export type ServiceProviderConfiguration = ServiceProviderFirebase | ServiceProviderMock; export interface FunctionResult { resultData: unknown; statusCode: number; } /** * Function model. */ export interface FunctionDefinition { name: string; successCodes: Array; fadeWindow: boolean; successTxt: string | TemplateResult; pendingTxt: string | TemplateResult; /** Additional parameters passed to the function */ param?: Record; redirect?: string; logoutOnFail?: boolean; } export interface FunctionParam { func: FunctionDefinition; inputData: unknown; } export interface FunctionsConfig { region: string; functions: Array; postLoginFunc?: FunctionDefinition; } /** * App data models. */ export interface MenuElement { key: string; name: string; sec?: string; route?: string; requiredRoles?: string[]; action?: () => void; topItem?: boolean; ref?: HTMLElement; icon?: string; } export interface NavigationPage { name: string; mainClass?: string; pattern: Array; auth: boolean; authFallback?: string; /** Required roles (claims) for this page - user must have at least one (OR logic) */ roles?: string[]; menu?: Array; topMenu?: Array; withTeaser?: boolean; withFooter?: boolean; hideMenu?: boolean; hideTopMenu?: boolean; topMenuItems?: Array; menuLogoRoute?: string; /** Top menu display mode: "integrated" (shared bg) or "detached" (own bg). Default: "detached" */ topMenuMode?: "integrated" | "detached"; /** Background config for pd-site-header (color, gradient, or image with overlay). */ bgConfig?: BgConfig; } export interface NavigationConfig { pages: Array; includeLogin: boolean; defaultPostLoginRoute?: boolean; /** Route to redirect to after logout. Defaults to "/" (home) */ logoutRedirect?: string; } export interface LinkObj { name: string; key: string; link?: string; action?: () => void; } export interface FooterSection { heading: string; links: LinkObj[]; } export interface FooterSocialLink { providerId: string; value: string; label?: string; } export interface Footer { sections?: FooterSection[]; socialLinks?: FooterSocialLink[]; legalLinks?: LinkObj[]; copyright?: string; version?: string; showVersion?: boolean; madeBy?: { txt: string; email?: string; link?: string; }; /** Background config for pd-footer (color, gradient, or image with overlay). */ bgConfig?: BgConfig; } /** mini-rx-store reducer function type */ export type ReducerFunction = (state: S, action: { type: string; payload?: unknown; }) => S; export interface StoreConfig { appName: string; /** Reducers object passed to mini-rx-store configureStore */ reducer: Record; /** * Effect functions for mini-rx-store. * Uses unknown[] as mini-rx-store expects Observable internally. */ effects: unknown[]; } export interface FileStorage { name: string; references: string[]; } export interface FileStorageConfig { storage: FileStorage[]; } export interface MessagingConfig { apidKey: string; } export interface AppConfiguration { serviceProvider?: ServiceProviderConfiguration; mock?: { mockResponse?: Map FunctionResult>; mockWaitTime?: number; }; navigationConfigParam: NavigationConfig; storeConfigParam?: StoreConfig; firebaseConfig?: FirebaseOptions; storageConfig?: FileStorageConfig; functionsConfig?: FunctionsConfig; messagingConfig?: MessagingConfig; /** Default loader style for pd-loading-state. Default: "spinner" */ defaultLoaderStyle?: "spinner" | "dots" | "pulse" | "logo"; /** * PWA update flow: texts for the built-in update dialog and options for * the update service (check interval, auto-apply on start). See * `PwaUpdateConfig` / docs/pwa-integration.md. */ pwaUpdateConfigParam?: PwaUpdateConfig; } export interface UploadFile { fileName: string; base64DataURL: string; descriptionName: string; description: string; storageName: string; referenceKey: string; subFolderName?: string; readonly?: boolean; } export interface StorageDocument { storageName: string; refKey: string; fileName: string; filePath: string; subFolderName?: string; documentType?: string; description?: string; descriptionName?: string; creation?: Date; creator?: string; size?: number; readonly?: boolean; /** Firebase FullMetadata or custom metadata object */ metaData?: unknown; } /** Firestore query constraint value types */ export type FirestoreValueType = string | number | boolean | null | Date | FirestoreValueType[]; export interface CollectionContraint { type: "where"; field: string; operator: "<" | ">" | ">=" | "<=" | "==" | "!=" | "array-contains" | "array-contains-any" | "in" | "not-in"; value: FirestoreValueType; } //# sourceMappingURL=service-provider-model.d.ts.map