pg-promise
Version:
PostgreSQL via promises
33 lines (22 loc) • 1.29 kB
TypeScript
/*
External Promise Provider.
The purpose of this module is to make it possible to enable declarations of a custom promise library
by patching this file manually. It presumes that you are already initializing pg-promise with a custom
promise library, using option `promiseLib`. If not, then you cannot use the provisions documented here.
Example of enabling declarations for Bluebird:
1. Install Bluebird ambient TypeScript as you normally would:
$ typings install bluebird --ambient --save
2. Add the reference path here, similar to this:
/// <reference path='../../../typings/main' />
3. Replace line `export=Promise` with the following:
import * as promise from 'bluebird';
export=promise;
Unfortunately, as of today it is impossible to use custom promises as TypeScript generics.
And you can find research details on this matter from the following link:
http://stackoverflow.com/questions/36593087/using-a-custom-promise-as-a-generic-type
In the meantime, if you do not want to get these settings overridden during an update or deployment,
it may be a good idea to copy all of the *.ts files into your own project, and use them from there.
*/
declare module 'ext-promise' {
export=Promise; // Using ES6 Promise by default
}