/** * Converts an environment variable to a `boolean` * Returns `false` if the value is `"false"`, `"0"` or `undefined`. * Otherwise, returns `true`. */ export declare const parseBooleanEnvVariable: (variable: string | undefined) => boolean; /** * Creates a function that returns the passed value if the given `condition` evaluates to `true`, * or `undefined` (or the specified `fallback` value) otherwise. * Arrays are treated specially. If the passed `value` is an array, and the `condition` * evaluates to `true`, a new array is returned with all the falsey values in the original array * removed. If the `condition` evaluates to `false`, and the `fallback` value is falsey, * the fallback value will default to an empty array. This is to make it convenient to compose * configurations that expect arrays of strings or objects and be able to spread the arrays * without having to worry about spreading `undefined` (`[...undefined]`) * (which would be a runtime error). * * @example * ```javascript * const isCi = process.env.CI; * const isProd = process.env.NODE_ENV === 'production'; * const isReact = process.env.REACT === 'true'; * * const ifCi = createConditionalWithFallback(isCi); * const ifProd = createConditionalWithFallback(isProd); * const ifReact = createConditionalWithFallback(isReact); * * const deploymentTasks = [ifCi('yarn publish') || 'yarn test']; * * const babelConfig = { * presets: compact([ * 'babel-preset-env', * ...ifReact(['babel-preset-react', ifProd('babel-preset-minify')]) * ]), * }; * ``` */ export declare function createConditionalWithFallback(condition: boolean): (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; declare type NonFalsey = T extends (false | '' | 0) ? never : NonNullable; export declare const isTest: boolean; export declare const isProduction: boolean; export declare const isCi: boolean; export declare const isDevelopment: boolean; export declare const isDev: boolean; export declare const isProd: boolean; export declare const isHot: boolean; export declare const isPreact: boolean; export declare const isReact: boolean; export declare const isEs5: boolean; export declare const isEsNext: boolean; export declare const isPerf: boolean; export declare const shouldTypeCheck: boolean; export declare const isDebug: boolean; export declare const ifProd: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export declare const ifHot: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export declare const ifTest: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export declare const ifDev: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export declare const ifReact: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export declare const ifPreact: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export declare const ifEs5: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export declare const ifEsNext: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export declare const ifCi: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export declare const ifPerf: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export declare const ifDebug: (value: T, fallback?: F | undefined) => T extends any[] ? any[] | NonFalsey | NonFalsey : T | F; export {};