DefinitelyTyped/types/yesql/index.d.ts
Lluís Ulzurrun de Asanza Sàez c6653d383f Fix wrong return types in yesql pg and mysql functions (#27149)
Please fill in this template.

- [x] Use a meaningful title for the pull request. Include the name of the package modified.
- [x] Test the change in your own code. (Compile and run.)
- [x] Add or edit tests to reflect the change. (Run with `npm test`.)
- [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).
- [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).
- [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present).

Select one of these and delete the others:

If changing an existing definition:
- [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/pihvi/yesql/blob/master/yesql.js#L28 and https://github.com/pihvi/yesql/blob/master/yesql.js#L47
- [x] Increase the version number in the header if appropriate.
- [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dtslint/dt.json" }`.
2018-07-09 14:20:03 -07:00

21 lines
617 B
TypeScript

// Type definitions for yesql 3.2
// Project: https://github.com/pihvi/yesql#readme
// Definitions by: Lluís Ulzurrun de Asanza Sáez <https://github.com/Sumolari>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
declare function readSqlFiles(
dir: string,
options?: {
pg?: boolean,
type?: 'pg' | 'mysql'
}
): string;
declare namespace readSqlFiles {
function pg(query: string): (data: object) => {text: string, values: any[]};
function mysql(query: string): (data: object) => {sql: string, values: any[]};
}
export = readSqlFiles;