Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor IBMiComponent for easier export #2381

Closed
wants to merge 1 commit into from

Conversation

worksofliam
Copy link
Contributor

Refactor methods in the IBMiComponent class to improve export functionality. This includes changing access modifiers and return types for better clarity and consistency.

It also enables IBMiComponent to be implemented, and not only extended. This is particularly important for other extensions, so they can add their own components.

  class a implements IBMiComponent {
    state: ComponentState = `NotChecked`;
    cachedInstallDirectory: string | undefined;
    constructor(readonly connection: IBMi) {}
    async getInstallDirectory(): Promise<string> {
      return `BOOP`;
    }
    getState(): ComponentState {
      return `NotInstalled`;
    }
    async check(): Promise<ComponentState> {
      return `NotInstalled`;
    }
    toString(): string {
      throw new Error("Method not implemented.");
    }
    getIdentification(): ComponentIdentification {
      return {name: `test`, version: 1};
    }
    getRemoteState(): ComponentState | Promise<ComponentState> {
      throw new Error("Method not implemented.");
    }
    async update(): Promise<ComponentState> {
      return `Installed`;
    }
  }
  
  extensionComponentRegistry.registerComponent(context, a);

Copy link
Contributor

👋 A new build is available for this PR based on f0618d3.

@worksofliam
Copy link
Contributor Author

This screenshot shows that with this PR, we can implement the IBMiComponent to add components.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant