UNPKG

@tmlmobilidade/lib

Version:
20 lines (19 loc) 967 B
import { type Environment } from '@tmlmobilidade/types'; interface AppConfigGroup { api_port: number; api_url: string; cookie_domain: string; cors_origin: RegExp | string | true; frontend_port: number; frontend_url: string; } declare const APP_CONFIGS: Record<string, Record<Environment, AppConfigGroup>>; /** * Retrieves the value of a specific property from the app configuration for a given app and environment. * @param app The app ID. * @param property The property of the app configuration to retrieve (e.g., 'api_url', 'frontend_url'). * @param environment The environment to get the property for. If not provided, it will use the ENVIRONMENT environment variable. * @returns The value of the specified property for the given app and environment. */ export declare function getAppConfig<Prop extends keyof AppConfigGroup>(app: keyof typeof APP_CONFIGS, property: Prop, environment?: Environment): AppConfigGroup[Prop]; export {};