Move server add-on interfaces to flipper-common

Reviewed By: antonk52

Differential Revision: D34169419

fbshipit-source-id: 69fcc8da7d98f59818fbb5b486a488f19830cd81
This commit is contained in:
Andrey Goncharov
2022-02-28 03:50:34 -08:00
committed by Facebook GitHub Bot
parent b9294645d3
commit 04eab80c98
8 changed files with 59 additions and 48 deletions

View File

@@ -10,20 +10,15 @@
import assert from 'assert';
import {assertNotNull} from '../comms/Utilities';
import {
ServerAddOnDesktopToModuleConnection,
FlipperServerForServerAddOn,
} from './ServerAddOnDesktopToModuleConnection';
import {
ServerAddOnModuleToDesktopConnection,
ServerAddOnPluginConnection,
} from './ServerAddOnModuleToDesktopConnection';
ServerAddOnCleanup,
ServerAddOn as ServerAddOnFn,
} from 'flipper-common';
import {ServerAddOnDesktopToModuleConnection} from './ServerAddOnDesktopToModuleConnection';
import {ServerAddOnModuleToDesktopConnection} from './ServerAddOnModuleToDesktopConnection';
type ServerAddOnCleanup = () => Promise<void>;
interface ServerAddOnModule {
serverAddOn?: (
connection: ServerAddOnPluginConnection,
{flipperServer}: {flipperServer: FlipperServerForServerAddOn},
) => Promise<ServerAddOnCleanup>;
serverAddOn?: ServerAddOnFn;
}
const loadPlugin = (_pluginName: string): ServerAddOnModule => {