@expo/xdl
Version:
The Expo Development Library
70 lines (69 loc) • 2.74 kB
TypeScript
/// <reference types="node" />
import http from 'http';
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
declare type DevServer = WebpackDevServer | http.Server;
interface WebpackSettings {
url: string;
server: DevServer;
port: number;
protocol: 'http' | 'https';
host?: string;
}
declare type CLIWebOptions = {
dev?: boolean;
clear?: boolean;
pwa?: boolean;
nonInteractive?: boolean;
port?: number;
unimodulesOnly?: boolean;
onWebpackFinished?: (error?: Error) => void;
};
declare type BundlingOptions = {
dev?: boolean;
clear?: boolean;
pwa?: boolean;
isImageEditingEnabled?: boolean;
webpackEnv?: object;
mode?: 'development' | 'production' | 'test' | 'none';
https?: boolean;
nonInteractive?: boolean;
unimodulesOnly?: boolean;
onWebpackFinished?: (error?: Error) => void;
};
declare type WebpackConfiguration = webpack.Configuration;
export declare type WebEnvironment = {
projectRoot: string;
isImageEditingEnabled: boolean;
pwa: boolean;
mode: 'development' | 'production' | 'test' | 'none';
https: boolean;
offline?: boolean;
};
export declare function restartAsync(projectRoot: string, options?: BundlingOptions): Promise<WebpackSettings | null>;
export declare function printConnectionInstructions(projectRoot: string, options?: {}): void;
export declare function startAsync(projectRoot: string, options?: CLIWebOptions, deprecatedVerbose?: boolean): Promise<WebpackSettings | null>;
export declare function stopAsync(projectRoot: string): Promise<void>;
export declare function openAsync(projectRoot: string, options?: BundlingOptions): Promise<void>;
export declare function compileWebAppAsync(projectRoot: string, compiler: webpack.Compiler): Promise<any>;
export declare function bundleWebAppAsync(projectRoot: string, config: WebpackConfiguration): Promise<void>;
export declare function bundleAsync(projectRoot: string, options?: BundlingOptions): Promise<void>;
export declare function getProjectNameAsync(projectRoot: string): Promise<string>;
export declare function isRunning(): boolean;
export declare function getServer(projectRoot: string): DevServer | null;
export declare function getPort(): number | null;
/**
* Get the URL for the running instance of Webpack dev server.
*
* @param projectRoot
*/
export declare function getUrlAsync(projectRoot: string): Promise<string | null>;
export declare function invokeWebpackConfigAsync(env: WebEnvironment, argv?: string[]): Promise<WebpackConfiguration>;
export declare function openProjectAsync(projectRoot: string): Promise<{
success: true;
url: string;
} | {
success: false;
error: Error;
}>;
export {};