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

isInstalled #811

Closed
mlynch opened this issue Nov 21, 2016 · 3 comments · Fixed by #1425
Closed

isInstalled #811

mlynch opened this issue Nov 21, 2016 · 3 comments · Fixed by #1425

Comments

@mlynch
Copy link
Collaborator

mlynch commented Nov 21, 2016

Right now installed is not shipped as part of any typing for plugins, despite being available on every plugin. This makes it impossible to quickly check if a plugin is installed w/o doing something like Camera['installed']()

Either add this as a type, or export an isInstalled function that takes the class as an arg:

isInstalled(Camera)

@ihadeed
Copy link
Collaborator

ihadeed commented Nov 24, 2016

How about creating a base interface with optional methods/properties. Then make all plugins implement it. Nevermind, this doesn't work.

export interface IPlugin {
  /**
   * Checks if plugin is installed
   */
  installed?(): boolean;
  pluginName?: string;
  plugin?: string;
  pluginRef?: string;
  repo?: string;
  platforms?: string[];
}

export class Camera implements IPlugin { ... }

@billygerhard
Copy link

billygerhard commented Feb 21, 2017

I see you closed the related issue, but I haven't been able to find any documentation on how to actually use this. What I am trying to really get to is dynamically being able to see if the plugin is installed on a given platform without having to know before hand if that platform is supported.

@ihadeed
Copy link
Collaborator

ihadeed commented Apr 27, 2017

Figured it out...
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 a pull request may close this issue.

3 participants