mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* [config] Add types for 'defer' and 'raw' features of node-config This change adds type definitions for the `raw` and `defer` features of [node-config](https://github.com/lorenwest/node-config/). The `raw` function is a wrapper that prevents node-config from processing the object and making it immutable, useful for things like stdout ([documentation here](https://github.com/lorenwest/node-config/wiki/Special-features-for-JavaScript-configuration-files#using-promises-processstdout-and-other-objects-in-javascript-config-files)). The `defer` function allows a value to be deferred until after the rest of the config functions were resolved. [Documentation Here](https://github.com/lorenwest/node-config/wiki/Special-features-for-JavaScript-configuration-files#deferred-values-in-javascript-configuration-files). * Add test for rawValue config
9 lines
398 B
TypeScript
9 lines
398 B
TypeScript
type DeferFunction<T,R> = (this: any, origValue: T) => R;
|
|
|
|
/*
|
|
* Allows a config value to be deferred for later. The original config object is passed
|
|
* into func as "this".
|
|
* See: https://github.com/lorenwest/node-config/wiki/Special-features-for-JavaScript-configuration-files#deferred-values-in-javascript-configuration-files
|
|
*/
|
|
export function deferConfig<T, R>(func: DeferFunction<T,R>): R;
|