@neo-one/server-plugin
Version:
NEO•ONE Server plugin API.
41 lines (40 loc) • 1.48 kB
TypeScript
import { Monitor } from '@neo-one/monitor';
import { ResourceType } from './ResourceType';
import { TaskList } from './TaskList';
import { CLIArgs, CLIHook, CreateHook, InteractiveCommand, PluginManager } from './types';
export interface PluginOptions {
readonly monitor: Monitor;
}
export interface CLIHookConfig {
readonly name: string;
readonly hook: CLIHook;
}
export interface CreateHookConfig {
readonly plugin: string;
readonly resourceType: string;
readonly hook: CreateHook;
}
export declare class Plugin {
readonly monitor: Monitor;
constructor({ monitor }: PluginOptions);
reset(): Promise<void>;
readonly name: string;
readonly names: {
readonly capital: string;
readonly capitalPlural: string;
readonly lower: string;
readonly lowerPlural: string;
};
readonly resourceTypes: readonly ResourceType[];
readonly resourceTypeByName: {
readonly [resourceType: string]: ResourceType;
};
readonly dependencies: readonly string[];
readonly commands: ReadonlyArray<(cliArgs: CLIArgs) => void>;
readonly interactive: readonly InteractiveCommand[];
readonly createHooks: readonly CreateHookConfig[];
readonly cliPreHooks: readonly CLIHookConfig[];
readonly cliPostHooks: readonly CLIHookConfig[];
executeTaskList(_pluginManager: PluginManager, _options: string): TaskList;
request(_pluginManager: PluginManager, _options: string): Promise<any>;
}