Summary: Added support for `createPaste` in Sandy plugins Nice minimalistic example of how to expose a Flipper api to Sandy. Note that some indirection could be removed by having an interface that is shared directly between `BasePluginClient` and `FlipperLib` (e.g. `PublicFlipperLib`). In contrast to `addMenuEntries` from the previous diff, `createPaste` is basically exposed verbatim to Sandy without additional wrapping, so those cases could be made simpler. Maybe will do that later. Reviewed By: passy Differential Revision: D22815873 fbshipit-source-id: e6d0773a35341edfe5de0898317eaadf88de79d0
19 lines
524 B
TypeScript
19 lines
524 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
|
|
*/
|
|
|
|
import {NormalizedMenuEntry} from './MenuEntry';
|
|
|
|
/**
|
|
* This interface exposes all global methods for which an implementation will be provided by Flipper itself
|
|
*/
|
|
export interface FlipperLib {
|
|
enableMenuEntries(menuEntries: NormalizedMenuEntry[]): void;
|
|
createPaste(input: string): Promise<string | undefined>;
|
|
}
|