@alova/wormhole
Version:
More modern openAPI generating solution for alova.js
31 lines (30 loc) • 733 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createPlugin = createPlugin;
/**
* Creates a plugin factory function with proper typing
*
* @param plugin - Function that creates a plugin instance
* @returns The original plugin function with proper typing
*
* @example
* // Create a custom plugin
* const myPlugin = createPlugin((options: MyOptions) => ({
* handleApi: (apiDescriptor) => {
* // Plugin implementation
* return apiDescriptor;
* }
* }));
*
* // Use the plugin
* generate({
* generator: [{
* // ...
* plugins: [myPlugin({ key: 'value' })]
* }]
* });
*/
function createPlugin(plugin) {
return plugin;
}
exports.default = createPlugin;