mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-11-03 11:49:12 +08:00
Bug: chromium:1158760 Change-Id: I19af6df53598616a7bdc6180e026ba7011a51969 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2822647 Commit-Queue: Jan Scheffler <janscheffler@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
29 lines
603 B
TypeScript
29 lines
603 B
TypeScript
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
/* eslint-disable rulesdir/no_underscored_properties */
|
|
|
|
export interface OutputStream {
|
|
write(data: string): Promise<void>;
|
|
close(): Promise<void>;
|
|
}
|
|
|
|
export class StringOutputStream implements OutputStream {
|
|
_data: string;
|
|
constructor() {
|
|
this._data = '';
|
|
}
|
|
|
|
async write(chunk: string): Promise<void> {
|
|
this._data += chunk;
|
|
}
|
|
|
|
async close(): Promise<void> {
|
|
}
|
|
|
|
data(): string {
|
|
return this._data;
|
|
}
|
|
}
|