Reviewed By: passy Differential Revision: D17863711 fbshipit-source-id: 259dc77826fb803ff1b88c88529d7f679d3b74d8
76 lines
1.8 KiB
TypeScript
76 lines
1.8 KiB
TypeScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
export declare class PluginManager {
|
|
constructor(options?: Partial<LivePluginManager.PluginManagerOptions>);
|
|
install(
|
|
name: string,
|
|
version?: string,
|
|
): Promise<LivePluginManager.IPluginInfo>;
|
|
readonly options: LivePluginManager.PluginManagerOptions;
|
|
}
|
|
|
|
declare namespace LivePluginManager {
|
|
interface IPluginInfo {
|
|
readonly mainFile: string;
|
|
readonly location: string;
|
|
readonly name: string;
|
|
readonly version: string;
|
|
readonly dependencies: {[name: string]: string};
|
|
}
|
|
|
|
interface PluginSandbox {
|
|
env?: NodeJS.ProcessEnv;
|
|
global?: NodeJS.Global;
|
|
}
|
|
|
|
export interface NpmRegistryAuthToken {
|
|
token: string;
|
|
}
|
|
|
|
export interface NpmRegistryAuthBasic {
|
|
username: string;
|
|
password: string;
|
|
}
|
|
|
|
interface NpmRegistryConfig {
|
|
auth?: NpmRegistryAuthToken | NpmRegistryAuthBasic;
|
|
userAgent?: string;
|
|
}
|
|
|
|
export interface GithubAuthUserToken {
|
|
type: 'token';
|
|
token: string;
|
|
}
|
|
|
|
export interface GithubAuthBasic {
|
|
type: 'basic';
|
|
username: string;
|
|
password: string;
|
|
}
|
|
|
|
export type GithubAuth = GithubAuthUserToken | GithubAuthBasic;
|
|
|
|
interface PluginManagerOptions {
|
|
cwd: string;
|
|
pluginsPath: string;
|
|
sandbox: PluginSandbox;
|
|
npmRegistryUrl: string;
|
|
npmRegistryConfig: NpmRegistryConfig;
|
|
npmInstallMode: 'useCache' | 'noCache';
|
|
requireCoreModules: boolean;
|
|
hostRequire?: NodeRequire;
|
|
ignoredDependencies: Array<string | RegExp>;
|
|
staticDependencies: {[key: string]: any};
|
|
githubAuthentication?: GithubAuth;
|
|
lockWait: number;
|
|
lockStale: number;
|
|
}
|
|
}
|