UNPKG

@broadcom/mat-detect-for-zowe-cli

Version:

MAT Detect plug-in for Zowe CLI

55 lines (54 loc) 2.64 kB
import { AbstractPluginLifeCycle } from "@zowe/imperative"; /** * This class performs lifecycle functions for your plug-in. You are free to * change the name of this class to reflect your plug-in and its actions. * * You only have to supply such a class if you specify the 'pluginLifeCycle' * property in your IImperativeConfig definition for your plug-in. In this sample, * that definition is supplied in src/pluginDef.ts. */ export declare class LifeCycleForSample extends AbstractPluginLifeCycle { /** * This function will be called after a plug-in is installed. * A plug-in can use this opportunity to perform a sanity test or to * perform some additional setup which is specific to your plug-in. * * If your plug-in'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 plug-in 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 plug-in can use this opportunity to revert any specialized setup that was * established during the lifetime of your plug-in. * * If your plug-in'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; }