Files
awesome-cordova-plugins/src/@ionic-native/core/ionic-native-plugin.ts
Mike Hartington 614ade447f feat(): angular ivy support (#3309)
* init

* cleanup packagelock

* testing

* chore(package): refresh package-lock.json

* updates

* chore(): fix builds

* chore(): rework package-lock

* chore(): lint

Co-authored-by: Daniel Sogl <daniel@sogls.de>
2020-02-07 17:51:47 +01:00

63 lines
1.3 KiB
TypeScript

import { checkAvailability } from './decorators/common';
import { get } from './util';
export class IonicNativePlugin {
static pluginName = '';
static pluginRef = '';
static plugin = '';
static repo = '';
static platforms: string[] = [];
static install = '';
/**
* Returns a boolean that indicates whether the plugin is installed
* @return {boolean}
*/
static installed(): boolean {
const isAvailable = checkAvailability(this.pluginRef) === true;
return isAvailable;
}
/**
* Returns the original plugin object
*/
static getPlugin(): any {
if (typeof window !== 'undefined') {
return get(window, this.pluginRef);
}
return null;
}
/**
* Returns the plugin's name
*/
static getPluginName(): string {
const pluginName = this.pluginName;
return pluginName;
}
/**
* Returns the plugin's reference
*/
static getPluginRef(): string {
const pluginRef = this.pluginRef;
return pluginRef;
}
/**
* Returns the plugin's install name
*/
static getPluginInstallName(): string {
const plugin = this.plugin;
return plugin;
}
/**
* Returns the plugin's supported platforms
*/
static getSupportedPlatforms(): string[] {
const platform = this.platforms;
return platform;
}
}