mirror of
https://github.com/appium/appium.git
synced 2026-02-22 03:08:47 -06:00
This change modifies the type of `BasePlugin.newMethodMap`, adds a parameter to the `MethodMap` type, and updates the base plugin TS config for better incremental builds.
36 lines
862 B
JavaScript
36 lines
862 B
JavaScript
import {logger} from '@appium/support';
|
|
|
|
/**
|
|
* @implements {Plugin}
|
|
*/
|
|
class BasePlugin {
|
|
/**
|
|
* Subclasses should use type `import('@appium/types').MethodMap<SubclassName>`.
|
|
*
|
|
* This will verify that the commands in the `newMethodMap` property are
|
|
* valid. It is impossible to use a generic type param here; the type of this should really
|
|
* be something like `MethodMap<T extends BasePlugin>` but that isn't a thing TS does.
|
|
*
|
|
* @type {import('@appium/types').MethodMap<any>}
|
|
*/
|
|
static newMethodMap = {};
|
|
|
|
/** @type {Plugin['cliArgs']} */
|
|
cliArgs;
|
|
|
|
/**
|
|
* @param {string} pluginName
|
|
*/
|
|
constructor(pluginName) {
|
|
this.name = pluginName;
|
|
this.logger = logger.getLogger(`Plugin [${pluginName}]`);
|
|
}
|
|
}
|
|
|
|
export default BasePlugin;
|
|
export {BasePlugin};
|
|
|
|
/**
|
|
* @typedef {import('@appium/types').Plugin} Plugin
|
|
*/
|