import { Logger } from 'common-stuff';
import { z } from 'zod';
export declare enum Environment {
    Production = "production",
    Development = "development"
}
declare const configSchema: z.ZodObject<{
    /**
     * Server host.
     *
     * Default: `0.0.0.0`
     */
    host: z.ZodString;
    /**
     * Server port.
     *
     * Default: `env.PORT` or 3000
     */
    port: z.ZodNumber;
    /**
     * Project environment.
     *
     * Default: `production`
     */
    environment: z.ZodNativeEnum<typeof Environment>;
    /**
     * Logging configuration.
     *
     * Default: `console`
     */
    logging: z.ZodObject<{
        transports: z.ZodArray<z.ZodUnion<[z.ZodObject<{
            type: z.ZodLiteral<"console">;
        }, "strip", z.ZodTypeAny, {
            type: "console";
        }, {
            type: "console";
        }>, z.ZodObject<{
            type: z.ZodLiteral<"loggly">;
            subdomain: z.ZodString;
            token: z.ZodString;
            tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
        }, "strip", z.ZodTypeAny, {
            tags?: string[] | undefined;
            type: "loggly";
            subdomain: string;
            token: string;
        }, {
            tags?: string[] | undefined;
            type: "loggly";
            subdomain: string;
            token: string;
        }>]>>;
        /**
         * Logging level.
         *
         * Default: `info`
         */
        level: z.ZodEnum<["debug", "info", "warn", "error"]>;
    }, "strip", z.ZodTypeAny, {
        transports: ({
            type: "console";
        } | {
            tags?: string[] | undefined;
            type: "loggly";
            subdomain: string;
            token: string;
        })[];
        level: "error" | "debug" | "info" | "warn";
    }, {
        transports: ({
            type: "console";
        } | {
            tags?: string[] | undefined;
            type: "loggly";
            subdomain: string;
            token: string;
        })[];
        level: "error" | "debug" | "info" | "warn";
    }>;
    /**
     * Torrent client settings
     */
    torrents: z.ZodObject<{
        path: z.ZodString;
        /**
         * Delete torrent data if it is inactive for X seconds.
         *
         * Default: `3600`
         */
        ttl: z.ZodNumber;
        /**
         * Load default trackers list & use it for each torrents.
         *
         * Default: `true`
         */
        useDefaultTrackers: z.ZodBoolean;
        /**
         * Additional trackers (`tr` parameter) which will be appended to each torrent.
         *
         * Default: `[]`
         */
        announce: z.ZodArray<z.ZodString>;
        /**
         * Web Seed (`ws` parameter) which will be appended to each torrent.
         *
         * Default: `[]`
         */
        urlList: z.ZodArray<z.ZodString>;
        /**
         * Peer addresses (`x.pe` parameter).
         *
         * Default: `[]`
         */
        peerAddresses: z.ZodArray<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        path: string;
        announce: string[];
        urlList: string[];
        peerAddresses: string[];
        ttl: number;
        useDefaultTrackers: boolean;
    }, {
        path: string;
        announce: string[];
        urlList: string[];
        peerAddresses: string[];
        ttl: number;
        useDefaultTrackers: boolean;
    }>;
    /**
     * Security settings
     */
    security: z.ZodObject<{
        /**
         * Stream API (`/stream/:torrent`) settings
         */
        streamApi: z.ZodObject<{
            /**
             * Protect stream API with [JSON Web Token](https://jwt.io/).
             *
             * If `apiKey` is not set, it can also be used as API key (`authorization`: `bearer ${apiKey}`).
             *
             * Default: `undefined`
             */
            key: z.ZodOptional<z.ZodString>;
            /**
             * The maximum allowed age for tokens to still be valid.
             * It is expressed in seconds or a string describing a time span [zeit/ms](https://github.com/vercel/ms)
             *
             * Default: `6h`
             */
            maxAge: z.ZodString;
        }, "strip", z.ZodTypeAny, {
            key?: string | undefined;
            maxAge: string;
        }, {
            key?: string | undefined;
            maxAge: string;
        }>;
        /**
         * Serve frontend static files
         *
         * Default: environment === 'production'
         */
        frontendEnabled: z.ZodBoolean;
        /**
         * Enable API
         *
         * Default: true
         */
        apiEnabled: z.ZodBoolean;
        /**
         * Protect API with key. It should be passed to headers to access the API (`authorization`: `bearer ${apiKey}`).
         *
         * If `streamApi` doesn't have a separate key, `apiKey` can be used as JSON Web Token.
         *
         * Default: undefined
         */
        apiKey: z.ZodOptional<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        apiKey?: string | undefined;
        streamApi: {
            key?: string | undefined;
            maxAge: string;
        };
        frontendEnabled: boolean;
        apiEnabled: boolean;
    }, {
        apiKey?: string | undefined;
        streamApi: {
            key?: string | undefined;
            maxAge: string;
        };
        frontendEnabled: boolean;
        apiEnabled: boolean;
    }>;
    /**
     * Get ip from `X-Forwarded-*` header.
     *
     * Default: true if inside App Engine or Heroku else false
     */
    trustProxy: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
    environment: Environment;
    host: string;
    port: number;
    logging: {
        transports: ({
            type: "console";
        } | {
            tags?: string[] | undefined;
            type: "loggly";
            subdomain: string;
            token: string;
        })[];
        level: "error" | "debug" | "info" | "warn";
    };
    torrents: {
        path: string;
        announce: string[];
        urlList: string[];
        peerAddresses: string[];
        ttl: number;
        useDefaultTrackers: boolean;
    };
    security: {
        apiKey?: string | undefined;
        streamApi: {
            key?: string | undefined;
            maxAge: string;
        };
        frontendEnabled: boolean;
        apiEnabled: boolean;
    };
    trustProxy: boolean;
}, {
    environment: Environment;
    host: string;
    port: number;
    logging: {
        transports: ({
            type: "console";
        } | {
            tags?: string[] | undefined;
            type: "loggly";
            subdomain: string;
            token: string;
        })[];
        level: "error" | "debug" | "info" | "warn";
    };
    torrents: {
        path: string;
        announce: string[];
        urlList: string[];
        peerAddresses: string[];
        ttl: number;
        useDefaultTrackers: boolean;
    };
    security: {
        apiKey?: string | undefined;
        streamApi: {
            key?: string | undefined;
            maxAge: string;
        };
        frontendEnabled: boolean;
        apiEnabled: boolean;
    };
    trustProxy: boolean;
}>;
export declare type Config = z.infer<typeof configSchema>;
export declare const isInGoogleAppEngine: boolean;
export declare const isInHeroku: boolean;
export declare function readConfig(path: string | undefined): Promise<Config>;
/**
 * Frontend package path to build directory
 */
export declare const frontendBuildPath: string;
export interface Globals {
    config: Config;
    logger: Logger;
}
export {};
