10.14.1
Fixes for TypeScript declarations:
- Fixing declaration for method
result
- Fixing declaration for
txMode
namespace, so it is consistent with how the library works:
Example of correct txMode
usage:
import {txMode} from 'pg-promise';
const {isolationLevel, TransactionMode} = txMode;
const mode = new TransactionMode({tiLevel: isolationLevel.none});
Or, you still can extract those from both uninitialized library:
import * as pgPromise from 'pg-promise';
const {isolationLevel, TransactionMode} = pgPromise.txMode; // from uninitialized library
... and from initialized library instance:
import * as pgPromise from 'pg-promise';
const pgp = pgPromise({/* init options */}); // initializing the library
const {isolationLevel, TransactionMode} = pgp.txMode; // from initialized library