UNPKG

1.43 kBTypeScriptView Raw
1/**
2 * This file is part of the @egodigital/egoose distribution.
3 * Copyright (c) e.GO Digital GmbH, Aachen, Germany (https://www.e-go-digital.com/)
4 *
5 * @egodigital/egoose is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, version 3.
8 *
9 * @egodigital/egoose is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17/// <reference types="node" />
18import * as Stream from 'stream';
19/**
20 * Returns a value as buffer.
21 *
22 * @param {any} data The input data.
23 * @param {string} [enc] The custom encoding for string to use. Default: utf8
24 *
25 * @return {Promise<Buffer>} The promise with the buffer.
26 */
27export declare function asBuffer(data: any, enc?: string): Promise<Buffer>;
28/**
29 * Reads the content of a stream.
30 *
31 * @param {Stream.Readable} stream The stream.
32 * @param {string} [enc] The custom (string) encoding to use.
33 *
34 * @returns {Promise<Buffer>} The promise with the content.
35 */
36export declare function readAll(stream: Stream.Readable, enc?: string): Promise<Buffer>;