import { AsyncCallback, AsyncNodeCallback } from "../_interfaces"; import { EventStream } from "../EventStream"; /** * Creates an EventStream from a function that accepts a callback. The function * is supposed to call its callback just once. * * @param f - Function that gets called at the stream activation * * @example * * const resultStream = F.fromCallback(cb => { * callSomeLongTask(result => { * cb(processResult(result)) * }) * }) * * @public */ export declare function fromCallback(f: AsyncCallback): EventStream; /** * Behaves the same way as `fromCallback`, except that it expects the callback * to be called in the Node.js convention: `callback(error, data)`, where error is * `null` if everything is fine. * * @param f - Function that gets called at the stream activation * @see fromCallback * * @example * * const fileContent = F.fromNodeCallback(cb => { * fs.readFile("myFile.txt", cb) * }) * * @public */ export declare function fromNodeCallback(f: AsyncNodeCallback): EventStream;