@connectv/core
Version:
agent-based reactive programming library for typescript/javascript
31 lines (30 loc) • 956 B
TypeScript
import { ResolveCallback, ErrorCallback, ContextType } from '../shared/types';
import { Pipe } from './pipe';
export declare type MapFuncSync = (value: any) => any;
export declare type MapFuncAsync = (value: any, callback: ResolveCallback<any>, error: ErrorCallback, context: ContextType) => void;
export declare type MapFunc = MapFuncSync | MapFuncAsync;
/**
*
* Represents [map](https://connective.dev/docs/map) pins.
*
*/
export declare class Map extends Pipe {
/**
*
* The transformation of this map pin.
*
*/
readonly map: MapFunc;
constructor(_func: MapFunc);
}
/**
*
* Creates a [map](https://connective.dev/docs/map) pin using given transformation.
* A map pin will transform incoming values based on given transformation.
* [Checkout the docs](https://connective.dev/docs/map) for examples and further information.
*
* @param map
*
*/
export declare function map(map: MapFunc): Map;
export default map;