PluginAPI.d.ts
1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import * as utils from '@umijs/utils';
import Html from '../Html/Html';
import Logger from '../Logger/Logger';
import { EnableBy } from './enums';
import Service from './Service';
import { ICommand, IHook, IPlugin, IPluginConfig, IPreset } from './types';
interface IOpts {
id: string;
key: string;
service: Service;
}
export default class PluginAPI {
id: string;
key: string;
service: Service;
Html: typeof Html;
utils: typeof utils;
logger: Logger;
constructor(opts: IOpts);
describe({ id, key, config, enableBy, }?: {
id?: string;
key?: string;
config?: IPluginConfig;
onChange?: any;
enableBy?: EnableBy | (() => boolean);
}): void;
register(hook: IHook): void;
registerCommand(command: ICommand): void;
registerPresets(presets: (IPreset | string)[]): void;
registerPlugins(plugins: (IPlugin | string)[]): void;
registerMethod({ name, fn, exitsError, }: {
name: string;
fn?: Function;
exitsError?: boolean;
}): void;
skipPlugins(pluginIds: string[]): void;
}
export {};