Add exec Node API to FlipperLib
Summary: Changelog: Allow flipper plugins to run "exec" Node API on Flipper server. Reviewed By: mweststrate Differential Revision: D32881149 fbshipit-source-id: 46486a47ee9824ca68897c19fd86b4afc7f8bf1d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8ca2c59499
commit
e458ae76f9
@@ -13,6 +13,7 @@ import {NormalizedMenuEntry} from './MenuEntry';
|
||||
import {RealFlipperClient} from './Plugin';
|
||||
import {Notification} from './Notification';
|
||||
import {DetailSidebarProps} from '../ui/DetailSidebar';
|
||||
import {ExecOptions, ExecOut, BufferEncoding} from 'flipper-common';
|
||||
|
||||
export type FileEncoding = 'utf-8' | 'base64';
|
||||
|
||||
@@ -22,6 +23,18 @@ export interface FileDescriptor {
|
||||
path?: string;
|
||||
}
|
||||
|
||||
export type RemoteNodeAPI = {
|
||||
childProcess: {
|
||||
exec(
|
||||
command: string,
|
||||
options?: {encoding?: BufferEncoding} & ExecOptions,
|
||||
): Promise<ExecOut<string>>;
|
||||
};
|
||||
fs: {
|
||||
// TODO: Fill me
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* This interface exposes all global methods for which an implementation will be provided by Flipper itself
|
||||
*/
|
||||
@@ -105,6 +118,7 @@ export interface FlipperLib {
|
||||
homePath: string;
|
||||
appPath: string;
|
||||
};
|
||||
removeNodeAPI: RemoteNodeAPI;
|
||||
}
|
||||
|
||||
export let flipperLibInstance: FlipperLib | undefined;
|
||||
|
||||
Reference in New Issue
Block a user