import { ValidatorSpec } from "envalid"; /** * Usage: * 1.) Add a `` tag to your * index.html's at the top most position, i.e.: * * * * * * ... * 2.) Create your own configuration singleton module in a separate file: * * import { fromWeb, requiredStr } from "@protomodule/instruments" * * export const config = fromWeb({ * REACT_APP_API_URL: requiredStr(), * }) * * 3.) Access environment variables type-safe like so `const BASE_API_URI = config.REACT_APP_API_URL` * 4.) You can add your variables to `.env` when running `yarn start` * OR * You can set *actual environment variables* when running as a Docker container */ declare global { interface Window { env: { [key: string]: string; }; } } export declare const yesNo: (spec?: import("envalid").Spec | undefined) => ValidatorSpec; export declare const requiredStr: (spec?: import("envalid").Spec | undefined) => ValidatorSpec; export declare type Schema = { [K in keyof T]: ValidatorSpec; }; export declare const fromWeb: (schema: Schema) => Readonly;