index.d.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { BaseConfig } from '@ionic/cli-framework';
  2. import { PromptModule } from '@ionic/cli-framework-prompts';
  3. import { IClient, IConfig, IIntegration, ILogger, IProject, ISession, IShell, InfoItem, IntegrationAddDetails, IntegrationName, ProjectIntegration, ProjectPersonalizationDetails } from '../../definitions';
  4. import type { Integration as CapacitorIntegration } from './capacitor';
  5. import type { Integration as CordovaIntegration } from './cordova';
  6. import type { Integration as EnterpriseIntegration } from './enterprise';
  7. export { INTEGRATION_NAMES } from '../../guards';
  8. export interface IntegrationOptions {
  9. quiet?: boolean;
  10. }
  11. export interface IntegrationDeps {
  12. readonly prompt: PromptModule;
  13. readonly client: IClient;
  14. readonly session: ISession;
  15. readonly config: IConfig;
  16. readonly shell: IShell;
  17. readonly project: IProject;
  18. readonly log: ILogger;
  19. }
  20. export declare class IntegrationConfig extends BaseConfig<ProjectIntegration> {
  21. provideDefaults(c: Partial<Readonly<ProjectIntegration>>): ProjectIntegration;
  22. }
  23. export declare abstract class BaseIntegration<T extends ProjectIntegration> implements IIntegration<T> {
  24. protected readonly e: IntegrationDeps;
  25. abstract readonly name: IntegrationName;
  26. abstract readonly summary: string;
  27. abstract readonly archiveUrl?: string;
  28. abstract readonly config: BaseConfig<T>;
  29. constructor(e: IntegrationDeps);
  30. static createFromName(deps: IntegrationDeps, name: 'capacitor'): Promise<CapacitorIntegration>;
  31. static createFromName(deps: IntegrationDeps, name: 'cordova'): Promise<CordovaIntegration>;
  32. static createFromName(deps: IntegrationDeps, name: 'enterprise'): Promise<EnterpriseIntegration>;
  33. static createFromName(deps: IntegrationDeps, name: IntegrationName): Promise<CapacitorIntegration | CordovaIntegration | EnterpriseIntegration>;
  34. getInfo(): Promise<InfoItem[]>;
  35. isAdded(): boolean;
  36. isEnabled(): boolean;
  37. enable(config?: ProjectIntegration): Promise<void>;
  38. disable(): Promise<void>;
  39. personalize(details: ProjectPersonalizationDetails): Promise<void>;
  40. add(details: IntegrationAddDetails): Promise<void>;
  41. }