mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-23 11:50:15 +08:00
export all interfaces by wrapping them in exported Knex namespace
This commit is contained in:
Vendored
+10
-12
@@ -13,28 +13,29 @@ declare module "knex" {
|
||||
type Callback = Function;
|
||||
type Client = Function;
|
||||
type Value = string|number|boolean|Date;
|
||||
type ColumnName = string|Raw|QueryBuilder;
|
||||
type ColumnName = string|Knex.Raw|Knex.QueryBuilder;
|
||||
|
||||
interface Knex extends QueryInterface { }
|
||||
|
||||
interface Knex {
|
||||
(tableName?: string): QueryBuilder;
|
||||
interface Knex extends Knex.QueryInterface {
|
||||
(tableName?: string): Knex.QueryBuilder;
|
||||
VERSION: string;
|
||||
__knex__: string;
|
||||
|
||||
raw: RawBuilder;
|
||||
transaction: <R>(transactionScope: ((trx: Transaction) => void)) => Promise<any>;
|
||||
raw: Knex.RawBuilder;
|
||||
transaction: <R>(transactionScope: ((trx: Knex.Transaction) => void)) => Promise<any>;
|
||||
destroy(callback: Function): void;
|
||||
destroy(): Promise<void>;
|
||||
|
||||
schema: Knex.SchemaBuilder;
|
||||
|
||||
client: any;
|
||||
migrate: any;
|
||||
seed: any;
|
||||
fn: any;
|
||||
}
|
||||
|
||||
function Knex( config : Config ) : Knex;
|
||||
function Knex( config : Knex.Config ) : Knex;
|
||||
|
||||
namespace Knex {
|
||||
//
|
||||
// QueryInterface
|
||||
//
|
||||
@@ -296,10 +297,6 @@ declare module "knex" {
|
||||
// Schema builder
|
||||
//
|
||||
|
||||
interface Knex {
|
||||
schema: SchemaBuilder;
|
||||
}
|
||||
|
||||
interface SchemaBuilder {
|
||||
createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): Promise<void>;
|
||||
renameTable(oldTableName: string, newTableName: string): Promise<void>;
|
||||
@@ -448,6 +445,7 @@ declare module "knex" {
|
||||
extension?: string;
|
||||
tableName?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export = Knex;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user