import { Observable } from "rxjs"; import { UserId } from "../../types/guid"; export type Urls = { base?: string; webVault?: string; api?: string; identity?: string; icons?: string; notifications?: string; events?: string; keyConnector?: string; scim?: string; }; export type PayPalConfig = { businessId?: string; buttonAction?: string; }; export enum Region { US = "US", EU = "EU", SelfHosted = "Self-hosted", } export enum RegionDomain { US = "bitwarden.com", EU = "bitwarden.eu", USQA = "bitwarden.pw", } export abstract class EnvironmentService { urls: Observable; usUrls: Urls; euUrls: Urls; selectedRegion?: Region; initialized = true; hasBaseUrl: () => boolean; getNotificationsUrl: () => string; getWebVaultUrl: () => string; /** * Retrieves the URL of the cloud web vault app. * * @returns {string} The URL of the cloud web vault app. * @remarks Use this method only in views exclusive to self-host instances. */ getCloudWebVaultUrl: () => string; /** * Sets the URL of the cloud web vault app based on the region parameter. * * @param {Region} region - The region of the cloud web vault app. */ setCloudWebVaultUrl: (region: Region) => void; /** * Seed the environment for a given user based on the globally set defaults. */ seedUserEnvironment: (userId: UserId) => Promise; getSendUrl: () => string; getIconsUrl: () => string; getApiUrl: () => string; getIdentityUrl: () => string; getEventsUrl: () => string; getKeyConnectorUrl: () => string; getScimUrl: () => string; setUrlsFromStorage: () => Promise; setUrls: (urls: Urls) => Promise; getHost: (userId?: string) => Promise; setRegion: (region: Region) => Promise; getUrls: () => Urls; isCloud: () => boolean; isEmpty: () => boolean; }