tamda
Version:
Practical functional programming library for TypeScript
20 lines (19 loc) • 811 B
TypeScript
import { Indexable } from '../indexable';
/**
* Extracts the value of the property `prop` in a `source` object.
* @param source Object to pick property from.
* @param prop Property name/key to extract value from `source`.
*/
export declare function prop<T extends Indexable, K extends keyof T>(source: T, prop: K): T[K];
/**
* Returns a function that
* extracts the value of the property `prop` in a `source` object.
* @param prop Property name/key to extract value from `source`.
*/
export declare function prop<T extends Indexable>(prop: keyof T): typeof deferred;
/**
* Extracts the value of the property `prop` in a `source` object.
* @param source Object to pick property from.
*/
declare function deferred<T extends Indexable, K extends keyof T>(source: T): T[K];
export {};