Files
flipper/desktop/types/npm-api.d.ts
Anton Nikolaev e48707151a Move the code related to plugin loading / installation to "flipper-plugin-lib"
Summary:
Sorry for so long diff, but actually there are no functional changes, just refactoring to make further changes of Plugin Manager easier to understand.

I've de-coupled the code related to plugin management from UI code and moved it from PluginInstaller UI component (which will be replaced soon by new UI) to "flipper-plugin-lib".  So pretty much everything related to plugin discovery and installation now consolidated in this package.

Additionally, this refactoring enables re-using of plugin management code in "flipper-pkg", e.g. to create CLI command for plugin installation from NPM, e.g.: `flipper-pkg install flipper-plugin-reactotron`.

Reviewed By: passy

Differential Revision: D23679346

fbshipit-source-id: 82e7b9de9afa08c508c1b228c2038b4ba423571c
2020-09-16 06:32:58 -07:00

38 lines
734 B
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
*/
// Very incomplete stub with only the methods we use defined.
declare module 'npm-api' {
export default class NpmApi {
constructor(...args: any[]);
list(...args: any[]): any;
maintainer(...args: any[]): any;
repo(name: string): Repository;
reset(...args: any[]): any;
use(...args: any[]): any;
view(...args: any[]): any;
}
export class Repository {
package(): Promise<Package>;
}
export interface Package {
name: string;
version: string;
[name: string]: string;
}
}