Files
flipper/desktop/flipper-server-companion/src/initializeFlipperLibImplementation.tsx
Andrey Goncharov 7f111a11de Expose isConnected and currentUser
Summary: Requested by antonk52 and MSYS team

Reviewed By: passy

Differential Revision: D44662243

fbshipit-source-id: 2bace476c4e79b6a05bfb89ddc3e6acb437c6c3b
2023-04-04 05:26:31 -07:00

43 lines
1.0 KiB
TypeScript

/**
* Copyright (c) Meta Platforms, Inc. and 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 {
createState,
Logger,
_setFlipperLibImplementation,
} from 'flipper-plugin-core';
import {baseFlipperLibImplementation, RenderHost} from 'flipper-frontend-core';
export function initializeFlipperLibImplementation(
renderHost: RenderHost,
logger: Logger,
) {
const base = baseFlipperLibImplementation(renderHost, logger);
_setFlipperLibImplementation({
...base,
intern: {
...base.intern,
// TODO: Implement me
currentUser: () => createState(null),
// TODO: Implement me
isConnected: () => createState(true),
},
enableMenuEntries() {},
createPaste() {
// TODO: Implement me
throw new Error('Not implemented');
},
selectPlugin() {},
showNotification() {
// TODO: Write to stdout/stderr?
throw new Error('Not supported in headless context');
},
});
}