Files
react-native-devtools-frontend/front_end/core/common/StringOutputStream.ts
T
Jan Scheffler 06ddc86dba [JSDOC2TS]: Migrate core/common
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>
2021-04-13 16:55:10 +00:00

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;
}
}