UNPKG

@pallad/app-env

Version:

Detects environment (production, staging, test, development, ci) and helps making decision based on that

28 lines (27 loc) 2.03 kB
import { Factory } from "./Factory"; import { InfoInferEnvNames } from "./Info"; export declare const factory: Factory<"production" | "staging" | "development" | "ci" | "test" | "preview", string>; export declare const info: import("./Info").Info<"production" | "staging" | "development" | "ci" | "test" | "preview", string | undefined>; export declare const isProduction: boolean; export declare const isDevelopment: boolean; export declare const isStaging: boolean; export declare const isTest: boolean; export declare const isPreview: boolean; export declare const isCI: boolean; export declare const isCi: boolean; export declare const env: "production" | "staging" | "development" | "ci" | "test" | "preview"; export declare const name: "production" | "staging" | "development" | "ci" | "test" | "preview"; export declare const id: string | undefined; export declare const is: (...names: ("production" | "staging" | "development" | "ci" | "test" | "preview")[]) => boolean; export declare const isEnv: (...names: ("production" | "staging" | "development" | "ci" | "test" | "preview")[]) => boolean; export declare const isEnvId: (...names: (string | undefined)[]) => boolean; export declare const forEnv: (...names: ("production" | "staging" | "development" | "ci" | "test" | "preview")[]) => import("./Info").InfoValueGetter; export declare const forCI: import("./Info").InfoValueGetter; export declare const forCi: import("./Info").InfoValueGetter; export declare const forDevelopment: import("./Info").InfoValueGetter; export declare const forStaging: import("./Info").InfoValueGetter; export declare const forTest: import("./Info").InfoValueGetter; export declare const forProduction: import("./Info").InfoValueGetter; export declare const forPreview: import("./Info").InfoValueGetter; export declare const build: () => import("./Builder").Builder<undefined, import("./Info").Info<"production" | "staging" | "development" | "ci" | "test" | "preview", string | undefined>>; export type Env = InfoInferEnvNames<typeof info>;