Files
flipper/desktop/plugins/public/ui-debugger/fb-stubs/StreamInterceptor.tsx
Luke De Feo f181551ce6 UID refactor 2/n Split types into client and desktop types
Summary: This file was getting overwelhming, and this seemed like a reasonable way to split it

Reviewed By: elboman

Differential Revision: D47547532

fbshipit-source-id: ab2bfa22daabbed13ec1445da0cf8ba88bda12d7
2023-07-21 07:17:31 -07:00

33 lines
777 B
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 {DeviceOS} from 'flipper-plugin';
import {Id, Metadata, UINode} from '../ClientTypes';
import {StreamInterceptor} from '../DesktopTypes';
export function getStreamInterceptor(_: DeviceOS): StreamInterceptor {
return new NoOpStreamInterceptor();
}
class NoOpStreamInterceptor implements StreamInterceptor {
init() {
return null;
}
async transformNodes(
nodes: Map<Id, UINode>,
): Promise<[Map<Id, UINode>, Metadata[]]> {
return [nodes, []];
}
async transformMetadata(metadata: Metadata): Promise<Metadata> {
return metadata;
}
}