UNPKG

@broadcom/ca7-for-zowe-cli

Version:

CA 7 Workload Automation Plug-in for Zowe CLI

55 lines (54 loc) 2.63 kB
import { AbstractPluginLifeCycle } from "@zowe/imperative"; /** * This class performs lifecycle functions for your plugin. You are free to * change the name of this class to reflect your plugin and its actions. * * You only have to supply such a class if you specify the 'pluginLifeCycle' * property in your IImperativeConfig definition for your plugin. In this sample, * that definition is supplied in src/pluginDef.ts. */ export declare class LifeCycleForCA7 extends AbstractPluginLifeCycle { /** * This function will be called after a plugin is installed. * A plugin can use this opportunity to perform a sanity test or to * perform some additional setup which is specific to your plugin. * * If your plugin's postInstall function performs an asynchronous operation, * its postInstall function should return a promise, allowing the CLI * to await the postInstall function. Such a signature would be like this: * * public async postInstall(): Promise<void> * * If it has no asynchronous operation, the postInstall function can be * written as a synchronous function. That is the style which this trivial * synchronous sample uses below. * * If you supply this class, you must supply this function. If you have nothing to * do post-install, then simply return from the function. */ postInstall(): void; /** * This function will be called before a plugin is uninstalled. * This lifecycle hook is intended to replace the capability that used to * be performed by the NPM pre-uninstall action before NPM removed that * capability in NPM version 7. * See https://docs.npmjs.com/cli/v9/using-npm/scripts#a-note-on-a-lack-of-npm-uninstall-scripts * * A plugin can use this opportunity to revert any specialized setup that was * established during the lifetime of your plugin. * * If your plugin's preUninstall function performs an asynchronous operation, * its preUninstall function should return a promise, allowing the CLI * framework to await the preUninstall function. Such a signature would be like this: * * public async preUninstall(): Promise<void> * * If it has no asynchronous operation, the preUninstall function can be * written as a synchronous function. That is the style which this trivial * synchronous sample uses below. * * If you supply this class, you must supply this function. If you have nothing to * do pre-uninstall, then simply return from the function. */ preUninstall(): void; }