/// <reference types="node" /> import { PromptModule } from '@ionic/cli-framework-prompts'; import { NetworkInterface } from '@ionic/utils-network'; import { EventEmitter } from 'events'; import * as stream from 'stream'; import { CommandLineInputs, CommandLineOptions, CommandMetadata, CommandMetadataOption, IConfig, ILogger, IProject, IShell, IonicEnvironmentFlags, LabServeDetails, NpmClient, Runner, ServeDetails, ServeOptions } from '../definitions'; export declare const DEFAULT_DEV_LOGGER_PORT = 53703; export declare const DEFAULT_LIVERELOAD_PORT = 35729; export declare const DEFAULT_SERVER_PORT = 8100; export declare const DEFAULT_LAB_PORT = 8200; export declare const DEFAULT_DEVAPP_COMM_PORT = 53233; export declare const DEFAULT_ADDRESS = "localhost"; export declare const BIND_ALL_ADDRESS = "0.0.0.0"; export declare const LOCAL_ADDRESSES: string[]; export declare const BROWSERS: string[]; export declare const SERVE_SCRIPT = "ionic:serve"; export declare const COMMON_SERVE_COMMAND_OPTIONS: readonly CommandMetadataOption[]; export interface ServeRunnerDeps { readonly config: IConfig; readonly flags: IonicEnvironmentFlags; readonly log: ILogger; readonly project: IProject; readonly prompt: PromptModule; readonly shell: IShell; } export declare abstract class ServeRunner<T extends ServeOptions> implements Runner<T, ServeDetails> { protected devAppConnectionMade: boolean; protected abstract readonly e: ServeRunnerDeps; abstract getCommandMetadata(): Promise<Partial<CommandMetadata>>; abstract serveProject(options: T): Promise<ServeDetails>; abstract modifyOpenUrl(url: string, options: T): string; getPkgManagerServeCLI(): PkgManagerServeCLI; createOptionsFromCommandLine(inputs: CommandLineInputs, options: CommandLineOptions): ServeOptions; determineEngineFromCommandLine(options: CommandLineOptions): string; beforeServe(options: T): Promise<void>; run(options: T): Promise<ServeDetails>; afterServe(options: T, details: ServeDetails): Promise<void>; scheduleAfterServe(options: T, details: ServeDetails): void; getUsedPorts(options: T, details: ServeDetails): number[]; runLab(options: T, serveDetails: ServeDetails): Promise<LabServeDetails>; selectExternalIP(options: T): Promise<[string, NetworkInterface[]]>; } export interface ServeCLIOptions { readonly host: string; readonly port: number; } export interface ServeCLI<T extends ServeCLIOptions> { emit(event: 'compile', chunks: number): boolean; emit(event: 'ready'): boolean; on(event: 'compile', handler: (chunks: number) => void): this; on(event: 'ready', handler: () => void): this; once(event: 'compile', handler: (chunks: number) => void): this; once(event: 'ready', handler: () => void): this; } export declare abstract class ServeCLI<T extends ServeCLIOptions> extends EventEmitter { protected readonly e: ServeRunnerDeps; /** * The pretty name of this Serve CLI. */ abstract readonly name: string; /** * The npm package of this Serve CLI. */ abstract readonly pkg: string; /** * The bin program to use for this Serve CLI. */ abstract readonly program: string; /** * The prefix to use for log statements. */ abstract readonly prefix: string; /** * If specified, `package.json` is inspected for this script to use instead * of `program`. */ abstract readonly script?: string; /** * If true, the Serve CLI will not prompt to be installed. */ readonly global: boolean; private _resolvedProgram?; constructor(e: ServeRunnerDeps); get resolvedProgram(): string; /** * Build the arguments for starting this Serve CLI. Called by `this.start()`. */ protected abstract buildArgs(options: T): Promise<string[]>; /** * Build the environment variables to be passed to the Serve CLI. Called by `this.start()`; */ protected buildEnvVars(options: T): Promise<NodeJS.ProcessEnv>; /** * Called whenever a line of stdout is received. * * If `false` is returned, the line is not emitted to the log. * * By default, the CLI is considered ready whenever stdout is emitted. This * method should be overridden to more accurately portray readiness. * * @param line A line of stdout. */ protected stdoutFilter(line: string): boolean; /** * Called whenever a line of stderr is received. * * If `false` is returned, the line is not emitted to the log. */ protected stderrFilter(line: string): boolean; resolveScript(): Promise<string | undefined>; serve(options: T): Promise<void>; protected spawnWrapper(options: T): Promise<void>; protected spawn(options: T): Promise<void>; protected createLoggerStream(): NodeJS.WritableStream; protected resolveProgram(): Promise<string>; protected createStreamFilter(filter: (line: string) => boolean): stream.Transform; protected promptToInstall(): Promise<boolean>; } declare abstract class PkgManagerServeCLI extends ServeCLI<ServeOptions> { readonly abstract program: NpmClient; readonly global = true; readonly script = "ionic:serve"; protected resolveProgram(): Promise<string>; protected buildArgs(options: ServeOptions): Promise<string[]>; } export declare class NpmServeCLI extends PkgManagerServeCLI { readonly name = "npm CLI"; readonly pkg = "npm"; readonly program = "npm"; readonly prefix = "npm"; } export declare class PnpmServeCLI extends PkgManagerServeCLI { readonly name = "pnpm CLI"; readonly pkg = "pnpm"; readonly program = "pnpm"; readonly prefix = "pnpm"; } export declare class YarnServeCLI extends PkgManagerServeCLI { readonly name = "Yarn"; readonly pkg = "yarn"; readonly program = "yarn"; readonly prefix = "yarn"; } export {};
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
doctor | Folder | 0755 |
|
|
integrations | Folder | 0755 |
|
|
oauth | Folder | 0755 |
|
|
project | Folder | 0755 |
|
|
utils | Folder | 0755 |
|
|
app.d.ts | File | 1.15 KB | 0644 |
|
app.js | File | 2.5 KB | 0644 |
|
build.d.ts | File | 3.43 KB | 0644 |
|
build.js | File | 8.51 KB | 0644 |
|
color.d.ts | File | 484 B | 0644 |
|
color.js | File | 768 B | 0644 |
|
command.d.ts | File | 924 B | 0644 |
|
command.js | File | 5.47 KB | 0644 |
|
config.d.ts | File | 843 B | 0644 |
|
config.js | File | 3.83 KB | 0644 |
|
cordova-res.d.ts | File | 1.07 KB | 0644 |
|
cordova-res.js | File | 2.62 KB | 0644 |
|
diff.d.ts | File | 100 B | 0644 |
|
diff.js | File | 709 B | 0644 |
|
environment.d.ts | File | 1004 B | 0644 |
|
environment.js | File | 516 B | 0644 |
|
errors.d.ts | File | 891 B | 0644 |
|
errors.js | File | 1.77 KB | 0644 |
|
events.d.ts | File | 240 B | 0644 |
|
events.js | File | 498 B | 0644 |
|
executor.d.ts | File | 1 KB | 0644 |
|
executor.js | File | 3.7 KB | 0644 |
|
generate.d.ts | File | 923 B | 0644 |
|
generate.js | File | 351 B | 0644 |
|
git.d.ts | File | 747 B | 0644 |
|
git.js | File | 1.66 KB | 0644 |
|
help.d.ts | File | 2.4 KB | 0644 |
|
help.js | File | 3.66 KB | 0644 |
|
helper.d.ts | File | 252 B | 0644 |
|
helper.js | File | 654 B | 0644 |
|
hooks.d.ts | File | 841 B | 0644 |
|
hooks.js | File | 4.72 KB | 0644 |
|
http.d.ts | File | 2.62 KB | 0644 |
|
http.js | File | 7.56 KB | 0644 |
|
index.d.ts | File | 226 B | 0644 |
|
index.js | File | 6.09 KB | 0644 |
|
ionitron.d.ts | File | 148 B | 0644 |
|
ionitron.js | File | 4.72 KB | 0644 |
|
namespace.d.ts | File | 854 B | 0644 |
|
namespace.js | File | 686 B | 0644 |
|
native-run.d.ts | File | 1.5 KB | 0644 |
|
native-run.js | File | 4.98 KB | 0644 |
|
open.d.ts | File | 164 B | 0644 |
|
open.js | File | 507 B | 0644 |
|
prompts.d.ts | File | 402 B | 0644 |
|
prompts.js | File | 716 B | 0644 |
|
security.d.ts | File | 511 B | 0644 |
|
security.js | File | 785 B | 0644 |
|
serve.d.ts | File | 5.79 KB | 0644 |
|
serve.js | File | 22.4 KB | 0644 |
|
session.d.ts | File | 921 B | 0644 |
|
session.js | File | 7.82 KB | 0644 |
|
shell.d.ts | File | 1.95 KB | 0644 |
|
shell.js | File | 8.41 KB | 0644 |
|
snapshot.d.ts | File | 765 B | 0644 |
|
snapshot.js | File | 1.13 KB | 0644 |
|
ssh-config.d.ts | File | 646 B | 0644 |
|
ssh-config.js | File | 3.04 KB | 0644 |
|
ssh.d.ts | File | 1.67 KB | 0644 |
|
ssh.js | File | 3.53 KB | 0644 |
|
start.d.ts | File | 1.34 KB | 0644 |
|
start.js | File | 12.1 KB | 0644 |
|
telemetry.d.ts | File | 972 B | 0644 |
|
telemetry.js | File | 3.59 KB | 0644 |
|
updates.d.ts | File | 1.01 KB | 0644 |
|
updates.js | File | 3.82 KB | 0644 |
|
user.d.ts | File | 865 B | 0644 |
|
user.js | File | 2.37 KB | 0644 |
|