definitions.d.ts 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. /// <reference types="node" />
  2. /// <reference types="node" />
  3. /// <reference types="node" />
  4. /// <reference types="node" />
  5. /// <reference types="node" />
  6. import { BaseConfig, CommandInstanceInfo as FrameworkCommandInstanceInfo, CommandLineInputs, CommandLineOptions, CommandMetadata as FrameworkCommandMetadata, CommandMetadataInput as FrameworkCommandMetadataInput, CommandMetadataOption as FrameworkCommandMetadataOption, HydratedCommandMetadata as FrameworkHydratedCommandMetadata, ICommand as FrameworkCommand, INamespace as FrameworkNamespace, NamespaceLocateResult as FrameworkNamespaceLocateResult, PackageJson } from '@ionic/cli-framework';
  7. import { Logger } from '@ionic/cli-framework-output';
  8. import { PromptModule } from '@ionic/cli-framework-prompts';
  9. import { NetworkInterface } from '@ionic/utils-network';
  10. import { Subprocess, SubprocessOptions, WhichOptions } from '@ionic/utils-subprocess';
  11. import { ChildProcess, SpawnOptions } from 'child_process';
  12. import * as fs from 'fs';
  13. import type { Integration as CapacitorIntegration } from './lib/integrations/capacitor';
  14. import type { CapacitorConfig } from './lib/integrations/capacitor/config';
  15. import type { Integration as CordovaIntegration } from './lib/integrations/cordova';
  16. import type { Integration as EnterpriseIntegration } from './lib/integrations/enterprise';
  17. export { CommandLineInputs, CommandLineOptions, NamespaceMetadata, } from '@ionic/cli-framework';
  18. export declare type SuperAgentRequest = import('superagent').SuperAgentRequest;
  19. export interface SuperAgentError extends Error {
  20. response: import('superagent').Response;
  21. }
  22. export declare type LogFn = (msg: string) => void;
  23. export interface ILogger extends Logger {
  24. ok: LogFn;
  25. rawmsg: LogFn;
  26. }
  27. export interface StarterManifest {
  28. name: string;
  29. baseref: string;
  30. welcome?: string;
  31. }
  32. export interface CordovaPackageJson extends PackageJson {
  33. cordova: {
  34. platforms: string[];
  35. plugins: {
  36. [key: string]: unknown;
  37. };
  38. };
  39. }
  40. export interface LegacyAndroidBuildOutputEntry {
  41. outputType: {
  42. type: string;
  43. };
  44. path: string;
  45. }
  46. export interface AndroidBuildOutput {
  47. artifactType: {
  48. type: string;
  49. };
  50. elements: {
  51. outputFile: string;
  52. }[];
  53. }
  54. export interface Runner<T extends object, U> {
  55. run(options: T): Promise<U>;
  56. }
  57. export declare type ProjectType = 'angular' | 'angular-standalone' | 'custom' | 'bare' | 'react' | 'vue' | 'react-vite' | 'vue-vite';
  58. export declare type HookName = 'build:before' | 'build:after' | 'serve:before' | 'serve:after' | 'capacitor:run:before' | 'capacitor:build:before' | 'capacitor:sync:after';
  59. export declare type CapacitorRunHookName = 'capacitor:run:before';
  60. export declare type CapacitorBuildHookName = 'capacitor:build:before';
  61. export declare type CapacitorSyncHookName = 'capacitor:sync:after';
  62. export interface BaseHookContext {
  63. project: {
  64. type: ProjectType;
  65. dir: string;
  66. srcDir: string;
  67. };
  68. argv: string[];
  69. env: NodeJS.ProcessEnv;
  70. }
  71. export declare type AnyServeOptions = ReactServeOptions | AngularServeOptions;
  72. export declare type AnyBuildOptions = ReactBuildOptions | AngularBuildOptions;
  73. export interface CapacitorSyncHookInput {
  74. readonly name: CapacitorSyncHookName;
  75. readonly build?: AnyBuildOptions;
  76. readonly capacitor: IonicCapacitorOptions;
  77. }
  78. export interface CapacitorRunHookInput {
  79. readonly name: CapacitorRunHookName;
  80. readonly serve?: AnyServeOptions;
  81. readonly build?: AnyBuildOptions;
  82. readonly capacitor: IonicCapacitorOptions;
  83. }
  84. export interface CapacitorBuildHookInput {
  85. readonly name: CapacitorBuildHookName;
  86. readonly build: AnyBuildOptions;
  87. readonly capacitor: IonicCapacitorOptions;
  88. }
  89. export interface BuildHookInput {
  90. readonly name: 'build:before' | 'build:after';
  91. readonly build: AngularBuildOptions;
  92. }
  93. export interface ServeBeforeHookInput {
  94. readonly name: 'serve:before';
  95. readonly serve: AngularServeOptions;
  96. }
  97. export interface ServeAfterHookInput {
  98. readonly name: 'serve:after';
  99. readonly serve: (AngularServeOptions) & ServeDetails;
  100. }
  101. export declare type HookInput = BuildHookInput | ServeBeforeHookInput | ServeAfterHookInput | CapacitorRunHookInput | CapacitorBuildHookInput | CapacitorSyncHookInput;
  102. export declare type HookContext = BaseHookContext & HookInput;
  103. export declare type HookFn = (ctx: HookContext) => Promise<void>;
  104. export declare type IntegrationName = 'capacitor' | 'cordova' | 'enterprise';
  105. export interface ProjectIntegration {
  106. enabled?: boolean;
  107. root?: string;
  108. }
  109. export interface EnterpriseProjectIntegration extends ProjectIntegration {
  110. productKey?: string;
  111. registries?: string[];
  112. appId?: string;
  113. orgId?: string;
  114. keyId?: number;
  115. }
  116. export interface ProjectIntegrations {
  117. cordova?: ProjectIntegration;
  118. capacitor?: ProjectIntegration;
  119. enterprise?: EnterpriseProjectIntegration;
  120. }
  121. export interface Response<T extends object> extends APIResponseSuccess {
  122. data: T;
  123. }
  124. export interface ResourceClientLoad<T extends object> {
  125. load(id: string | number, modifiers: ResourceClientRequestModifiers): Promise<T>;
  126. }
  127. export interface ResourceClientDelete {
  128. delete(id: string | number): Promise<void>;
  129. }
  130. export interface ResourceClientCreate<T extends object, U extends object> {
  131. create(details: U): Promise<T>;
  132. }
  133. export interface ResourceClientPaginate<T extends object> {
  134. paginate(args?: Partial<PaginateArgs<Response<T[]>>>): IPaginator<Response<T[]>, PaginatorState>;
  135. }
  136. export interface ResourceClientRequestModifiers {
  137. fields?: string[];
  138. }
  139. export interface Org {
  140. name: string;
  141. }
  142. export interface GithubRepo {
  143. full_name: string;
  144. id: number;
  145. }
  146. export interface GithubBranch {
  147. name: string;
  148. }
  149. export interface AppAssociation {
  150. repository: RepoAssociation;
  151. }
  152. export interface RepoAssociationBase {
  153. html_url: string;
  154. clone_url: string;
  155. full_name: string;
  156. }
  157. export interface GithubRepoAssociation extends RepoAssociationBase {
  158. type: 'github';
  159. id: number;
  160. }
  161. export interface GitlabRepoAssociation extends RepoAssociationBase {
  162. type: 'gitlab';
  163. id: number;
  164. }
  165. export interface GitlabEnterpriseRepoAssociation extends RepoAssociationBase {
  166. type: 'gitlab_enterprise';
  167. id: number;
  168. }
  169. export interface BitbucketCloudRepoAssociation extends RepoAssociationBase {
  170. type: 'bitbucket_cloud';
  171. id: string;
  172. }
  173. export interface BitbucketServerRepoAssociation extends RepoAssociationBase {
  174. type: 'bitbucket_server';
  175. id: number;
  176. }
  177. export interface AzureDevopsRepoAssociation extends RepoAssociationBase {
  178. type: 'azure_devops';
  179. id: string;
  180. }
  181. export declare type RepoAssociation = GithubRepoAssociation | BitbucketCloudRepoAssociation | BitbucketServerRepoAssociation;
  182. export declare type AssociationType = 'github' | 'bitbucket_cloud' | 'bitbucket_server';
  183. export interface App {
  184. id: string;
  185. name: string;
  186. slug: string;
  187. org: null | Org;
  188. repo_url?: string;
  189. association?: null | AppAssociation;
  190. }
  191. export interface Login {
  192. user: User;
  193. token: string;
  194. }
  195. export interface User {
  196. id: number;
  197. email: string;
  198. oauth_identities?: OAuthIdentity;
  199. }
  200. export declare type OAuthIdentity = {
  201. [A in AssociationType]?: OAuthIdentityDetails;
  202. };
  203. export interface OAuthIdentityDetails {
  204. username: string;
  205. name: string;
  206. html_url: string;
  207. }
  208. export interface OAuthServerConfig {
  209. authorizationUrl: string;
  210. tokenUrl: string;
  211. clientId: string;
  212. apiAudience: string;
  213. }
  214. export interface OpenIdToken {
  215. access_token: string;
  216. expires_in: number;
  217. id_token?: string;
  218. refresh_token?: string;
  219. scope: 'openid profile email offline_access';
  220. token_type: 'Bearer';
  221. state?: string;
  222. }
  223. export interface Snapshot {
  224. id: string;
  225. sha: string;
  226. ref: string;
  227. state: string;
  228. created: string;
  229. note: string;
  230. }
  231. export interface SSHKey {
  232. id: string;
  233. pubkey: string;
  234. fingerprint: string;
  235. annotation: string;
  236. name: string;
  237. created: string;
  238. updated: string;
  239. }
  240. export interface SecurityProfile {
  241. name: string;
  242. tag: string;
  243. type: 'development' | 'production';
  244. created: string;
  245. credentials: {
  246. android?: object;
  247. ios?: object;
  248. };
  249. }
  250. export interface IConfig extends BaseConfig<ConfigFile> {
  251. getAPIUrl(): string;
  252. getDashUrl(): string;
  253. getGitHost(): string;
  254. getGitPort(): number;
  255. getHTTPConfig(): CreateRequestOptions;
  256. getOpenIDOAuthConfig(): OAuthServerConfig;
  257. }
  258. export interface ProjectPersonalizationDetails {
  259. name: string;
  260. projectId: string;
  261. packageId?: string;
  262. version?: string;
  263. description?: string;
  264. themeColor?: string;
  265. appIcon?: Buffer;
  266. splash?: Buffer;
  267. }
  268. export interface IProjectConfig {
  269. name: string;
  270. type?: ProjectType;
  271. id?: string;
  272. root?: string;
  273. readonly integrations: ProjectIntegrations;
  274. readonly hooks?: Record<HookName, string | string[] | undefined>;
  275. }
  276. export interface IMultiProjectConfig {
  277. defaultProject?: string;
  278. projects: {
  279. [key: string]: IProjectConfig | undefined;
  280. };
  281. }
  282. export declare type ProjectFile = IProjectConfig | IMultiProjectConfig;
  283. export interface IProject {
  284. readonly rootDirectory: string;
  285. readonly directory: string;
  286. readonly filePath: string;
  287. readonly pathPrefix: readonly string[];
  288. readonly type: ProjectType;
  289. readonly config: BaseConfig<IProjectConfig>;
  290. readonly details: import('./lib/project').ProjectDetailsResult;
  291. getSourceDir(sourceRoot?: string): Promise<string>;
  292. getDefaultDistDir(): Promise<string>;
  293. getDistDir(): Promise<string>;
  294. getInfo(): Promise<InfoItem[]>;
  295. detected(): Promise<boolean>;
  296. createIntegration(name: 'capacitor'): Promise<CapacitorIntegration>;
  297. createIntegration(name: 'cordova'): Promise<CordovaIntegration>;
  298. createIntegration(name: 'enterprise'): Promise<EnterpriseIntegration>;
  299. createIntegration(name: IntegrationName): Promise<IIntegration<ProjectIntegration>>;
  300. getIntegration(name: IntegrationName): Required<ProjectIntegration> | undefined;
  301. requireIntegration(name: IntegrationName): Required<ProjectIntegration>;
  302. requireAppflowId(): Promise<string>;
  303. getPackageJson(pkgName?: string, options?: {
  304. logErrors?: boolean;
  305. }): Promise<[PackageJson | undefined, string | undefined]>;
  306. requirePackageJson(pkgName?: string): Promise<PackageJson>;
  307. personalize(details: ProjectPersonalizationDetails): Promise<void>;
  308. getBuildRunner(): Promise<import('./lib/build').BuildRunner<any> | undefined>;
  309. getServeRunner(): Promise<import('./lib/serve').ServeRunner<any> | undefined>;
  310. getGenerateRunner(): Promise<import('./lib/generate').GenerateRunner<any> | undefined>;
  311. requireBuildRunner(): Promise<import('./lib/build').BuildRunner<any>>;
  312. requireServeRunner(): Promise<import('./lib/serve').ServeRunner<any>>;
  313. requireGenerateRunner(): Promise<import('./lib/generate').GenerateRunner<any>>;
  314. }
  315. export interface IntegrationAddDetails {
  316. quiet?: boolean;
  317. root: string;
  318. enableArgs?: string[];
  319. }
  320. export interface IntegrationAddHandlers {
  321. conflictHandler?: (f: string, stats: fs.Stats) => Promise<boolean>;
  322. onFileCreate?: (f: string) => void;
  323. }
  324. export interface IIntegration<T extends ProjectIntegration> {
  325. readonly name: IntegrationName;
  326. readonly summary: string;
  327. readonly archiveUrl?: string;
  328. readonly config: BaseConfig<T>;
  329. add(details: IntegrationAddDetails): Promise<void>;
  330. isAdded(): boolean;
  331. enable(config?: T): Promise<void>;
  332. isEnabled(): boolean;
  333. disable(): Promise<void>;
  334. getInfo(): Promise<InfoItem[]>;
  335. personalize(details: ProjectPersonalizationDetails): Promise<void>;
  336. }
  337. export interface PackageVersions {
  338. [key: string]: string;
  339. }
  340. export interface CommandMetadataInput extends FrameworkCommandMetadataInput {
  341. private?: boolean;
  342. }
  343. export interface CommandMetadataOption extends FrameworkCommandMetadataOption {
  344. private?: boolean;
  345. hint?: string;
  346. }
  347. export interface ExitCodeException extends Error {
  348. exitCode: number;
  349. }
  350. export interface CommandMetadata extends FrameworkCommandMetadata<CommandMetadataInput, CommandMetadataOption> {
  351. type: 'global' | 'project';
  352. }
  353. export declare type HydratedCommandMetadata = CommandMetadata & FrameworkHydratedCommandMetadata<ICommand, INamespace, CommandMetadata, CommandMetadataInput, CommandMetadataOption>;
  354. export declare type CommandInstanceInfo = FrameworkCommandInstanceInfo<ICommand, INamespace, CommandMetadata, CommandMetadataInput, CommandMetadataOption>;
  355. export declare type NamespaceLocateResult = FrameworkNamespaceLocateResult<ICommand, INamespace, CommandMetadata, CommandMetadataInput, CommandMetadataOption>;
  356. export interface ISession {
  357. login(email: string, password: string): Promise<void>;
  358. ssoLogin(email: string): Promise<void>;
  359. tokenLogin(token: string): Promise<void>;
  360. webLogin(): Promise<void>;
  361. wizardLogin(): Promise<string | undefined>;
  362. logout(): Promise<void>;
  363. isLoggedIn(): boolean;
  364. getUser(): {
  365. id: number;
  366. };
  367. getUserToken(): Promise<string>;
  368. }
  369. export interface IShellSpawnOptions extends SpawnOptions {
  370. showCommand?: boolean;
  371. }
  372. export interface IShellOutputOptions extends IShellSpawnOptions {
  373. fatalOnError?: boolean;
  374. fatalOnNotFound?: boolean;
  375. showError?: boolean;
  376. }
  377. export interface IShellRunOptions extends IShellOutputOptions {
  378. stream?: NodeJS.WritableStream;
  379. killOnExit?: boolean;
  380. truncateErrorOutput?: number;
  381. }
  382. export interface IShell {
  383. alterPath: (path: string) => string;
  384. run(command: string, args: readonly string[], options: IShellRunOptions): Promise<void>;
  385. output(command: string, args: readonly string[], options: IShellOutputOptions): Promise<string>;
  386. spawn(command: string, args: readonly string[], options: IShellSpawnOptions): Promise<ChildProcess>;
  387. cmdinfo(cmd: string, args?: readonly string[], options?: SubprocessOptions): Promise<string | undefined>;
  388. which(command: string, options?: WhichOptions): Promise<string>;
  389. createSubprocess(command: string, args: readonly string[], options?: SubprocessOptions): Promise<Subprocess>;
  390. }
  391. export interface ITelemetry {
  392. sendCommand(command: string, args: string[]): Promise<void>;
  393. }
  394. export declare type NpmClient = 'yarn' | 'npm' | 'pnpm';
  395. export declare type FeatureId = 'ssl-commands';
  396. export interface ConfigFile {
  397. 'version': string;
  398. 'telemetry': boolean;
  399. 'npmClient': NpmClient;
  400. 'interactive'?: boolean;
  401. 'proxy'?: string;
  402. 'ssl.cafile'?: string | string[];
  403. 'ssl.certfile'?: string | string[];
  404. 'ssl.keyfile'?: string | string[];
  405. 'urls.api'?: string;
  406. 'urls.dash'?: string;
  407. 'git.host'?: string;
  408. 'git.port'?: number;
  409. 'git.setup'?: boolean;
  410. 'org.id'?: string;
  411. 'user.id'?: number;
  412. 'user.email'?: string;
  413. 'tokens.user'?: string;
  414. 'tokens.telemetry'?: string;
  415. 'tokens.refresh'?: string;
  416. 'tokens.issuedOn'?: string;
  417. 'tokens.expiresInSeconds'?: number;
  418. 'tokens.flowName'?: string;
  419. 'oauth.openid.authorization_url'?: string;
  420. 'oauth.openid.token_url'?: string;
  421. 'oauth.openid.client_id'?: string;
  422. 'oauth.openid.api_audience'?: string;
  423. 'features.ssl-commands'?: boolean;
  424. }
  425. export interface SSLConfig {
  426. cafile?: string | string[];
  427. certfile?: string | string[];
  428. keyfile?: string | string[];
  429. }
  430. export interface CreateRequestOptions {
  431. userAgent: string;
  432. ssl?: SSLConfig;
  433. proxy?: string;
  434. }
  435. export declare type APIResponse = APIResponseSuccess | APIResponseError;
  436. export interface APIResponseMeta {
  437. status: number;
  438. version: string;
  439. request_id: string;
  440. }
  441. export declare type APIResponseData = object | object[] | string;
  442. export interface APIResponseErrorDetails {
  443. error_type: string;
  444. parameter: string;
  445. errors: string[];
  446. }
  447. export interface APIResponseError {
  448. error: APIResponseErrorError;
  449. meta: APIResponseMeta;
  450. }
  451. export interface APIResponseErrorError {
  452. message: string;
  453. link: string | null;
  454. type: string;
  455. details?: APIResponseErrorDetails[];
  456. }
  457. export interface APIResponseSuccess {
  458. data: APIResponseData;
  459. meta: APIResponseMeta;
  460. }
  461. export interface APIResponsePageTokenMeta extends APIResponseMeta {
  462. prev_page_token?: string;
  463. next_page_token?: string;
  464. }
  465. export declare type HttpMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'PURGE' | 'HEAD' | 'OPTIONS';
  466. export declare const enum ContentType {
  467. JSON = "application/json",
  468. FORM_URLENCODED = "application/x-www-form-urlencoded",
  469. HTML = "text/html"
  470. }
  471. export interface IClient {
  472. config: IConfig;
  473. make(method: HttpMethod, path: string, contentType?: ContentType): Promise<{
  474. req: SuperAgentRequest;
  475. }>;
  476. do(req: SuperAgentRequest): Promise<APIResponseSuccess>;
  477. paginate<T extends Response<object[]>>(args: PaginateArgs<T>): IPaginator<T>;
  478. }
  479. export declare type PaginateArgs<T extends Response<object[]>> = Pick<PaginatorDeps<T>, 'reqgen' | 'guard' | 'state' | 'max'>;
  480. export interface IPaginator<T extends Response<object[]>, S = PaginatorState> extends IterableIterator<Promise<T>> {
  481. readonly state: S;
  482. }
  483. export declare type PaginatorRequestGenerator = () => Promise<{
  484. req: SuperAgentRequest;
  485. }>;
  486. export declare type PaginatorGuard<T extends Response<object[]>> = (res: APIResponseSuccess) => res is T;
  487. export interface PaginatorState {
  488. done: boolean;
  489. loaded: number;
  490. }
  491. export interface PagePaginatorState extends PaginatorState {
  492. page: number;
  493. page_size?: number;
  494. }
  495. export interface TokenPaginatorState extends PaginatorState {
  496. page_token?: string;
  497. }
  498. export interface PaginatorDeps<T extends Response<object[]>, S = PaginatorState> {
  499. readonly client: IClient;
  500. readonly reqgen: PaginatorRequestGenerator;
  501. readonly guard: PaginatorGuard<T>;
  502. readonly state?: Partial<S>;
  503. readonly max?: number;
  504. }
  505. export declare type InfoItemGroup = 'ionic' | 'capacitor' | 'cordova' | 'utility' | 'system' | 'environment';
  506. export interface InfoItem {
  507. group: InfoItemGroup;
  508. name: string;
  509. value: string;
  510. key?: string;
  511. flair?: string;
  512. path?: string;
  513. hidden?: boolean;
  514. }
  515. export interface BaseBuildOptions {
  516. engine: string;
  517. platform?: string;
  518. project?: string;
  519. verbose?: boolean;
  520. '--': string[];
  521. }
  522. export interface BuildOptions<T extends ProjectType> extends BaseBuildOptions {
  523. type: T;
  524. }
  525. export interface AngularBuildOptions extends BuildOptions<'angular'> {
  526. /**
  527. * The Angular architect configuration to use for builds.
  528. *
  529. * The `--prod` command line flag is a shortcut which translates to the
  530. * 'production' configuration.
  531. */
  532. configuration?: string;
  533. sourcemaps?: boolean;
  534. cordovaAssets?: boolean;
  535. watch?: boolean;
  536. }
  537. export interface ReactBuildOptions extends BuildOptions<'react'> {
  538. publicUrl?: string;
  539. ci?: boolean;
  540. sourceMap?: boolean;
  541. inlineRuntimeChunk?: boolean;
  542. }
  543. export interface VueBuildOptions extends BuildOptions<'vue'> {
  544. configuration?: string;
  545. sourcemaps?: boolean;
  546. }
  547. export interface IonicCapacitorOptions extends CapacitorConfig {
  548. '--': string[];
  549. verbose?: boolean;
  550. }
  551. export interface CustomBuildOptions extends BuildOptions<'custom'> {
  552. }
  553. export interface GenerateOptions {
  554. name: string;
  555. }
  556. export interface AngularGenerateOptions extends GenerateOptions {
  557. [key: string]: any;
  558. schematic: string;
  559. }
  560. export interface IonicAngularGenerateOptions extends GenerateOptions {
  561. type: string;
  562. module: boolean;
  563. constants: boolean;
  564. }
  565. export interface ServeOptions {
  566. host: string;
  567. port: number;
  568. publicHost?: string;
  569. livereload: boolean;
  570. proxy: boolean;
  571. open: boolean;
  572. browser?: string;
  573. browserOption?: string;
  574. platform?: string;
  575. project?: string;
  576. verbose?: boolean;
  577. '--': string[];
  578. externalAddressRequired?: boolean;
  579. engine: string;
  580. }
  581. export interface AngularServeOptions extends ServeOptions {
  582. consolelogs?: boolean;
  583. consolelogsPort?: number;
  584. ssl?: boolean;
  585. configuration?: string;
  586. sourcemaps?: boolean;
  587. }
  588. export interface ReactServeOptions extends ServeOptions {
  589. https?: boolean;
  590. ci?: boolean;
  591. reactEditor?: string;
  592. }
  593. export interface VueServeOptions extends ServeOptions {
  594. https: boolean;
  595. mode: string;
  596. configuration?: string;
  597. sourcemaps?: boolean;
  598. }
  599. export interface CustomServeOptions extends ServeOptions {
  600. }
  601. export interface LabServeDetails {
  602. projectType: ProjectType;
  603. host: string;
  604. port: number;
  605. }
  606. export interface ServeDetails {
  607. custom: boolean;
  608. protocol: string;
  609. localAddress: string;
  610. externalAddress: string;
  611. port: number;
  612. externalNetworkInterfaces: NetworkInterface[];
  613. externallyAccessible: boolean;
  614. }
  615. export interface IonicContext {
  616. readonly binPath: string;
  617. readonly libPath: string;
  618. readonly execPath: string;
  619. readonly version: string;
  620. }
  621. export interface IonicEnvironment {
  622. readonly flags: IonicEnvironmentFlags;
  623. readonly client: IClient;
  624. readonly config: IConfig;
  625. readonly log: ILogger;
  626. readonly prompt: PromptModule;
  627. readonly ctx: IonicContext;
  628. readonly session: ISession;
  629. readonly shell: IShell;
  630. getInfo(): Promise<InfoItem[]>;
  631. }
  632. export interface IonicEnvironmentFlags {
  633. readonly interactive: boolean;
  634. readonly confirm: boolean;
  635. }
  636. export declare type DistTag = 'testing' | 'canary' | 'latest';
  637. export interface ICommand extends FrameworkCommand<ICommand, INamespace, CommandMetadata, CommandMetadataInput, CommandMetadataOption> {
  638. readonly env: IonicEnvironment;
  639. readonly project?: IProject;
  640. execute(inputs: CommandLineInputs, options: CommandLineOptions, metadata: CommandInstanceInfo): Promise<void>;
  641. }
  642. export interface CommandPreRun extends ICommand {
  643. preRun(inputs: CommandLineInputs, options: CommandLineOptions, metadata: CommandInstanceInfo): Promise<void>;
  644. }
  645. export interface INamespace extends FrameworkNamespace<ICommand, INamespace, CommandMetadata, CommandMetadataInput, CommandMetadataOption> {
  646. env: IonicEnvironment;
  647. project?: IProject;
  648. }
  649. export interface StarterList {
  650. starters: {
  651. name: string;
  652. id: string;
  653. type: ProjectType;
  654. }[];
  655. integrations: {
  656. name: IntegrationName;
  657. id: string;
  658. }[];
  659. }
  660. export interface BaseStarterTemplate {
  661. name: string;
  662. projectType: ProjectType;
  663. description?: string;
  664. }
  665. export interface RepoStarterTemplate extends BaseStarterTemplate {
  666. type: 'repo';
  667. repo: string;
  668. }
  669. export interface ManagedStarterTemplate extends BaseStarterTemplate {
  670. type: 'managed';
  671. id: string;
  672. }
  673. export declare type StarterTemplate = RepoStarterTemplate | ManagedStarterTemplate;
  674. export interface ResolvedStarterTemplate extends BaseStarterTemplate {
  675. archive: string;
  676. }
  677. export interface TelemetryIPCMessage {
  678. type: 'telemetry';
  679. data: {
  680. command: string;
  681. args: string[];
  682. };
  683. }
  684. export interface UpdateCheckIPCMessage {
  685. type: 'update-check';
  686. }
  687. export declare type IPCMessage = TelemetryIPCMessage | UpdateCheckIPCMessage;