You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.1 KiB

/// <reference types="expo__bunyan" />
/// <reference types="node" />
import type Log from '@expo/bunyan';
import { MessageSocket } from '@expo/dev-server';
import http from 'http';
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;
onWebpackFinished?: (error?: Error) => void;
forceManifestType?: 'classic' | 'expo-updates';
};
declare type BundlingOptions = {
dev?: boolean;
clear?: boolean;
port?: number;
pwa?: boolean;
isImageEditingEnabled?: boolean;
webpackEnv?: object;
mode?: 'development' | 'production' | 'test' | 'none';
https?: boolean;
nonInteractive?: boolean;
onWebpackFinished?: (error?: Error) => void;
};
export declare type WebEnvironment = {
projectRoot: string;
isImageEditingEnabled: boolean;
pwa: boolean;
mode: 'development' | 'production' | 'test' | 'none';
https: boolean;
logger: Log;
};
export declare function isTargetingNative(): boolean;
export declare type WebpackDevServerResults = {
server: DevServer;
location: Omit<WebpackSettings, 'server'>;
messageSocket: MessageSocket;
};
export declare function broadcastMessage(message: 'reload' | string, data?: any): Promise<void>;
export declare function startAsync(projectRoot: string, options?: CLIWebOptions): Promise<WebpackDevServerResults | null>;
export declare function stopAsync(projectRoot: string): Promise<void>;
export declare function openAsync(projectRoot: string, options?: BundlingOptions): Promise<void>;
export declare function bundleAsync(projectRoot: string, options?: BundlingOptions): Promise<void>;
/**
* Get the URL for the running instance of Webpack dev server.
*
* @param projectRoot
*/
export declare function getUrlAsync(projectRoot: string): Promise<string | null>;
export {};