import { AdminUiAppConfig, AdminUiAppDevModeConfig, AdminUiConfig, Type } from '@vendx/common/lib/shared-types';
import { ConfigService, OnVendxBootstrap, OnVendxClose, RuntimeVendxConfig } from '@vendx/core';
/**
 * @description
 * Configuration options for the {@link AdminUiPlugin}.
 *
 * @docsCategory AdminUiPlugin
 */
export interface AdminUiPluginOptions {
    /**
     * @description
     * The port on which the server will listen. If not
     */
    port: number;
    /**
     * @description
     * The hostname of the server serving the static admin ui files.
     *
     * @default 'localhost'
     */
    hostname?: string;
    /**
     * @description
     * By default, the AdminUiPlugin comes bundles with a pre-built version of the
     * Admin UI. This option can be used to override this default build with a different
     * version, e.g. one pre-compiled with one or more ui extensions.
     */
    app?: AdminUiAppConfig | AdminUiAppDevModeConfig;
    /**
     * @description
     * The hostname of the Vend˟ server which the admin ui will be making API calls
     * to. If set to "auto", the admin ui app will determine the hostname from the
     * current location (i.e. `window.location.hostname`).
     *
     * @deprecated Use the adminUiConfig property instead
     * @default 'auto'
     */
    apiHost?: string | 'auto';
    /**
     * @description
     * The port of the Vend˟ server which the admin ui will be making API calls
     * to. If set to "auto", the admin ui app will determine the port from the
     * current location (i.e. `window.location.port`).
     *
     * @deprecated Use the adminUiConfig property instead
     * @default 'auto'
     */
    apiPort?: number | 'auto';
    /**
     * @description
     * Allows the contents of the `vendx-ui-config.json` file to be set, e.g.
     * for specifying the Vend˟ GraphQL API host, available UI languages, etc.
     */
    adminUiConfig?: Partial<AdminUiConfig>;
}
/**
 * @description
 * This plugin starts a static server for the Admin UI app, and proxies it via the `/admin/` path of the main Vend˟ server.
 *
 * The Admin UI allows you to administer all aspects of your store, from inventory management to order tracking. It is the tool used by
 * store administrators on a day-to-day basis for the management of the store.
 *
 * ## Installation
 *
 * `yarn add \@vendx/admin-ui-plugin`
 *
 * or
 *
 * `npm install \@vendx/admin-ui-plugin`
 *
 * @example
 * ```ts
 * import { AdminUiPlugin } from '\@vendx/admin-ui-plugin';
 *
 * const config: VendxConfig = {
 *   // Add an instance of the plugin to the plugins array
 *   plugins: [
 *     AdminUiPlugin.init({ port: 3002 }),
 *   ],
 * };
 * ```
 *
 * @docsCategory AdminUiPlugin
 */
export declare class AdminUiPlugin implements OnVendxBootstrap, OnVendxClose {
    private configService;
    private static options;
    private server;
    constructor(configService: ConfigService);
    /**
     * @description
     * Set the plugin options
     */
    static init(options: AdminUiPluginOptions): Type<AdminUiPlugin>;
    /** @internal */
    static configure(config: RuntimeVendxConfig): Promise<RuntimeVendxConfig>;
    /** @internal */
    onVendxBootstrap(): Promise<void>;
    /** @internal */
    onVendxClose(): Promise<void>;
    /**
     * Takes an optional AdminUiConfig provided in the plugin options, and returns a complete
     * config object for writing to disk.
     */
    private getAdminUiConfig;
    /**
     * Overwrites the parts of the admin-ui app's `vendx-ui-config.json` file relating to connecting to
     * the server admin API.
     */
    private overwriteAdminUiConfig;
    /**
     * It might be that the ui-devkit compiler has not yet copied the config
     * file to the expected location (particularly when running in watch mode),
     * so polling is used to check multiple times with a delay.
     */
    private pollForConfigFile;
    private static isDevModeApp;
}
