PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/xstream/extra

Просмотр файла: fromDiagram.d.ts

import { Stream, InternalProducer, InternalListener } from '../index';
export interface FromDiagramOptions {
    values?: Object;
    errorValue?: any;
    timeUnit?: number;
}
export declare class DiagramProducer implements InternalProducer<any> {
    private diagram;
    private values;
    private errorVal;
    private timeUnit;
    private tasks;
    constructor(diagram: string, opt?: FromDiagramOptions);
    _start(out: InternalListener<any>): void;
    private schedule;
    _stop(): void;
}
/**
 * Creates a real stream out of an ASCII drawing of a stream. Each string
 * character represents an amount of time passed (by default, 20 milliseconds).
 * `-` characters represent nothing special, `|` is a symbol to mark the
 * completion of the stream, `#` is an error on the stream, and any other
 * character is a "next" event.
 *
 * Example:
 *
 * ```js
 * import fromDiagram from 'xstream/extra/fromDiagram'
 *
 * const stream = fromDiagram('--a--b---c-d--|')
 *
 * stream.addListener({
 *   next: (x) => console.log(x),
 *   error: (err) => console.error(err),
 *   complete: () => console.log('concat completed'),
 * })
 * ```
 *
 * The character `a` represent emission of the event `'a'`, a string. If you
 * want to emit something else than a string, you need to provide those values
 * in the options argument.
 *
 * Example:
 *
 * ```js
 * import fromDiagram from 'xstream/extra/fromDiagram'
 *
 * const stream = fromDiagram('--a--b---c-d--|', {
 *   values: {a: 10, b: 20, c: 30, d: 40}
 * })
 *
 * stream.addListener({
 *   next: (x) => console.log(x),
 *   error: (err) => console.error(err),
 *   complete: () => console.log('concat completed'),
 * })
 * ```
 *
 * That way, the stream will emit the numbers 10, 20, 30, 40. The `options`
 * argument may also take `timeUnit`, a number to configure how many
 * milliseconds does each represents, and `errorValue`, a value to send out as
 * the error which `#` represents.
 *
 * @factory true
 * @param {string} diagram A string representing a timeline of values, error,
 * or complete notifications that should happen on the output stream.
 * @param options An options object that allows you to configure some additional
 * details of the creation of the stream.
 * @return {Stream}
 */
export default function fromDiagram(diagram: string, options?: FromDiagramOptions): Stream<any>;

Выполнить команду


Для локальной разработки. Не используйте в интернете!