Fixed references to Bluebird 2.0

This commit is contained in:
Leonard Hecker
2016-08-11 13:13:12 +02:00
parent 9745184299
commit 568ec4378d
30 changed files with 1567 additions and 1567 deletions

2
acl/acl.d.ts vendored
View File

@@ -3,7 +3,7 @@
// Definitions by: Qubo <https://github.com/tkQubo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path='../node/node.d.ts'/>
/// <reference path='../redis/redis.d.ts'/>

View File

@@ -3,7 +3,7 @@
// Definitions by: Gorgi Kosev <https://github.com/spion>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../anydb-sql/anydb-sql.d.ts" />
declare module "anydb-sql-migrations" {
@@ -31,4 +31,4 @@ declare module "anydb-sql-migrations" {
items: MigrationTask[];
}) => any) => Promise<any>;
};
}
}

2
asana/asana.d.ts vendored
View File

@@ -3,7 +3,7 @@
// Definitions by: Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../request/request.d.ts" />
declare module "asana" {

View File

@@ -1,5 +1,5 @@
/// <reference path="../node/node.d.ts" />
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="blue-tape.d.ts" />
import tape = require('blue-tape');

View File

@@ -1,5 +1,5 @@
/// <reference path="bluebird-retry.d.ts" />
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
import Promise = require('bluebird');
import retry = require('bluebird-retry');
@@ -32,4 +32,4 @@ var options:retry.Options = {
interval: 500
};
retry(logFail, options);
retry(logFail, options);

View File

@@ -3,7 +3,7 @@
// Definitions by: Pascal Vomhoff <https://github.com/pvomhoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
declare module "bluebird-retry" {
import Promise = require('bluebird');

View File

@@ -3,7 +3,7 @@
// Definitions by: Andrew Schurman <http://github.com/arcticwaters>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path='../lodash/lodash-3.10.d.ts' />
/// <reference path="../knex/knex.d.ts" />
/// <reference path="../create-error/create-error.d.ts" />

View File

@@ -6,7 +6,7 @@
// Imported from: https://github.com/soywiz/typescript-node-definitions/consolidate.d.ts
/// <reference path="../node/node.d.ts" />
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
declare module "consolidate" {
var cons: Consolidate;

View File

@@ -6,7 +6,7 @@
// Imported from: https://github.com/soywiz/typescript-node-definitions/fs-extra.d.ts via TSD fs-extra definition
///<reference path="../node/node.d.ts"/>
///<reference path="../bluebird/bluebird.d.ts"/>
///<reference path="../bluebird/bluebird-2.0.d.ts"/>
declare module "fs-extra-promise" {
import stream = require("stream");

View File

@@ -3,7 +3,7 @@
// Definitions by: Philip Spain <https://github.com/philipisapain>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
declare module 'inline-css' {
import Promise = require('bluebird');

View File

@@ -3,7 +3,7 @@
// Definitions by: inversify <https://github.com/inversify>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
interface Symbol {
toString(): string;
@@ -31,9 +31,9 @@ declare namespace inversify {
export interface Newable<T> {
new(...args: any[]): T;
}
export type ServiceIdentifier<T> = (string|Symbol|Newable<T>);
export interface Binding<T> extends Clonable<Binding<T>> {
guid: string;
moduleId: string;
@@ -49,66 +49,66 @@ declare namespace inversify {
scope: number; // BindingScope
type: number; // BindingType
}
export interface Factory<T> extends Function {
(...args: any[]): (((...args: any[]) => T)|T);
}
export interface FactoryCreator<T> extends Function {
(context: Context): Factory<T>;
}
export interface Provider<T> extends Function {
(): Promise<T>;
}
export interface ProviderCreator<T> extends Function {
(context: Context): Provider<T>;
}
export interface PlanAndResolve<T> {
(args: PlanAndResolveArgs): T[];
}
export interface PlanAndResolveArgs {
multiInject: boolean;
serviceIdentifier: ServiceIdentifier<any>;
target: Target;
contextInterceptor: (contexts: Context) => Context;
}
export interface Middleware extends Function {
(next: PlanAndResolve<any>): PlanAndResolve<any>;
}
export interface Context {
guid: string;
kernel: Kernel;
plan: Plan;
addPlan(plan: Plan): void;
}
export interface ReflectResult {
[key: string]: Metadata[];
}
export interface Metadata {
key: string;
value: any;
}
export interface Plan {
parentContext: Context;
rootRequest: Request;
}
export interface Planner {
createContext(kernel: Kernel): Context;
createPlan(parentContext: Context, binding: Binding<any>, target: Target): Plan;
getBindings<T>(kernel: Kernel, serviceIdentifier: ServiceIdentifier<T>): Binding<T>[];
getActiveBindings(parentRequest: Request, target: Target): Binding<any>[];
}
export interface QueryableString {
startsWith(searchString: string): boolean;
endsWith(searchString: string): boolean;
@@ -116,7 +116,7 @@ declare namespace inversify {
equals(compareString: string): boolean;
value(): string;
}
export interface Request {
guid: string;
serviceIdentifier: ServiceIdentifier<any>;
@@ -131,7 +131,7 @@ declare namespace inversify {
target: Target
): Request;
}
export interface Target {
guid: string;
serviceIdentifier: ServiceIdentifier<any>;
@@ -145,11 +145,11 @@ declare namespace inversify {
matchesNamedTag(name: string): boolean;
matchesTag(key: string): (value: any) => boolean;
}
export interface Resolver {
resolve<T>(context: Context): T;
}
export interface Kernel {
guid: string;
bind<T>(serviceIdentifier: ServiceIdentifier<T>): BindingToSyntax<T>;
@@ -167,25 +167,25 @@ declare namespace inversify {
snapshot(): void;
restore(): void;
}
export interface Bind extends Function {
<T>(serviceIdentifier: ServiceIdentifier<T>): BindingToSyntax<T>;
}
export interface KernelModule {
guid: string;
registry: (bind: Bind) => void;
}
export interface KernelSnapshot {
bindings: Lookup<Binding<any>>;
middleware: PlanAndResolve<any>;
}
export interface Clonable<T> {
clone(): T;
}
export interface Lookup<T> extends Clonable<Lookup<T>> {
add(serviceIdentifier: ServiceIdentifier<any>, value: T): void;
get(serviceIdentifier: ServiceIdentifier<any>): Array<T>;
@@ -193,22 +193,22 @@ declare namespace inversify {
removeByModuleId(moduleId: string): void;
hasKey(serviceIdentifier: ServiceIdentifier<any>): boolean;
}
export interface KeyValuePair<T> {
serviceIdentifier: ServiceIdentifier<any>;
value: Array<T>;
}
export interface BindingInSyntax<T> {
inSingletonScope(): BindingWhenOnSyntax<T>;
}
export interface BindingInWhenOnSyntax<T> extends BindingInSyntax<T>, BindingWhenOnSyntax<T> {}
export interface BindingOnSyntax<T> {
onActivation(fn: (context: Context, injectable: T) => T): BindingWhenSyntax<T>;
}
export interface BindingToSyntax<T> {
to(constructor: { new(...args: any[]): T; }): BindingInWhenOnSyntax<T>;
toConstantValue(value: T): BindingWhenOnSyntax<T>;
@@ -219,9 +219,9 @@ declare namespace inversify {
toAutoFactory<T2>(serviceIdentifier: ServiceIdentifier<T2>): BindingWhenOnSyntax<T>;
toProvider<T2>(provider: ProviderCreator<T2>): BindingWhenOnSyntax<T>;
}
export interface BindingWhenOnSyntax<T> extends BindingWhenSyntax<T>, BindingOnSyntax<T> {}
export interface BindingWhenSyntax<T> {
when(constraint: (request: Request) => boolean): BindingOnSyntax<T>;
whenTargetNamed(name: string): BindingOnSyntax<T>;
@@ -238,7 +238,7 @@ declare namespace inversify {
whenAnyAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax<T>;
whenNoAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax<T>;
}
}
export var Kernel: interfaces.KernelConstructor;

View File

@@ -1,5 +1,5 @@
///<reference path="java.d.ts"/>
///<reference path="../bluebird/bluebird.d.ts"/>
///<reference path="../bluebird/bluebird-2.0.d.ts"/>
import java = require('java');
import BluePromise = require('bluebird');

2
karma/karma.d.ts vendored
View File

@@ -3,7 +3,7 @@
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../node/node.d.ts" />
/// <reference path="../log4js/log4js.d.ts" />

2
knex/knex.d.ts vendored
View File

@@ -3,7 +3,7 @@
// Definitions by: Qubo <https://github.com/tkQubo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../node/node.d.ts" />
declare module "knex" {

View File

@@ -1,4 +1,4 @@
/// <reference path="..\node\node.d.ts" />
/// <reference path="../node/node.d.ts" />
/// <reference path="libxmljs.d.ts" />
var libxmljs = require("libxmljs");

2
mz/mz.d.ts vendored
View File

@@ -5,7 +5,7 @@
// Modified from the node.js definitions https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/node/node.d.ts
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../node/node.d.ts" />

View File

@@ -1,6 +1,6 @@
/// <reference path="./node-mysql-wrapper.d.ts" />
/// <reference path="../node/node.d.ts" />
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
var express = require('express');
var app = express();
@@ -40,7 +40,7 @@ db.ready(() => {
var usersDb = db.table<User>("users");
//or var usersDb = db.table("users"); if you don't want intel auto complete from your ide/editor
usersDb.findById(16, (_user) => {
@@ -65,7 +65,7 @@ db.ready(() => {
orderByDesc: "commentId" //give me the first 50 comments ordered by -commentId (DESC) from table 'comments' and put them at 'myComments' property inside the result object.
}
}
}).then(_user=> { // to get this promise use : .promise()
}).then(_user=> { // to get this promise use : .promise()
console.log("\n-------------TEST 2 ------------\n");
console.log(_user.username + " with ");
console.log(_user.myComments.length + " comments ");
@@ -103,7 +103,7 @@ db.ready(() => {
}
}, (_users) => {
console.log("---------------TEST 6----------------------------------------");
_users.forEach(_user=> {
console.log(_user.userId + " " + _user.username + " found with " + _user.comments.length + " comments");
@@ -112,55 +112,55 @@ db.ready(() => {
});
//if no rules setted to find method it's uses the table's rules ( if exists)
let _criteriaFromBuilder = usersDb.criteria
.except("password") // or .exclude(...columns). the only column you cannot except/exclude is the primary key (because it is used at where clause), be careful.
.where("userId", 24)
.joinAs("info", "userInfos", "userId")
.joinAs("info", "userInfos", "userId")
.at("info")
.limit(1) //because we make it limit 1 it will return this result as object not as array.
.parent()
.joinAs("myComments", "comments", "userId")
.joinAs("myComments", "comments", "userId")
.at("myComments").limit(2)
.joinAs("likes", "commentLikes", "commentId")
.original().orderBy("userId", true).build();
/* console.dir(_criteriaFromBuilder);
prints this object: ( of course you can create your own in order to pass it on .find table methods )
{
userId:23,
myComments:{
userId: '=',
tableRules:{
table: 'comments',
limit:2
},
likes:{
commentId: '=',
tableRules:{
table: 'commentLikes'
}
}
},
tableRules:{
tableRules:{
orderByDesc: 'userId',
except: ['password']
}
}
*/
usersDb.find(_criteriaFromBuilder).then(_users=> {

View File

@@ -3,8 +3,8 @@
// Definitions by: Makis Maropoulos <https://github.com/kataras>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path='./../mysql/mysql.d.ts' />
///<reference path='./../bluebird/bluebird.d.ts' />
///<reference path='../mysql/mysql.d.ts' />
///<reference path='../bluebird/bluebird-2.0.d.ts' />
///<reference path="./my-meteor.d.ts" />
@@ -53,26 +53,26 @@ declare module "node-mysql-wrapper" {
class Helper {
/**
/**
* Callback like forEach
* @name valueCallback
* @function
* @param {T} the value of the object's key
* @param {T} the value of the object's key
* @returnTye {U}
* @return {U}
*/
/**
* Callback like forEach
* @name keyCallback
* @function
* @param {string} the name of the object's key
* @param {string} the name of the object's key
* @returnTye {U}
* @return {U}
*/
constructor();
/**
* Create and return a copy of an object.
* @param {T} object the object you want to copy.
@@ -80,7 +80,7 @@ declare module "node-mysql-wrapper" {
* @return {T}
*/
static copyObject<T>(object: T): T;
/**
* Converts any_string to anyString and returns it.
* @param {string} columnKey the string you want to convert.
@@ -88,7 +88,7 @@ declare module "node-mysql-wrapper" {
* @return {string}
*/
static toObjectProperty(columnKey: string): string;
/**
* Converts anyString to any_string and returns it.
* @param {string} objectKey the string you want to convert.
@@ -96,7 +96,7 @@ declare module "node-mysql-wrapper" {
* @return {string}
*/
static toRowProperty(objectKey: string): string;
/**
* Iterate object's keys and return their values to the callback.
* @param {<T>} map the object.
@@ -115,14 +115,14 @@ declare module "node-mysql-wrapper" {
*/
static forEachKey<T, U>(map: Map<T>, callback: (key: string) => U): U;
/**
* Checks if anything is a function.
* @param {functionToCheck} the object or function to pass
* @return boolean
*/
static isFunction(functionToCheck: any): boolean;
/**
* Checks if an object has 'tableRules' property.
* @param {obj} the object to pass
@@ -145,24 +145,24 @@ declare module "node-mysql-wrapper" {
class CriteriaParts implements ICriteriaParts {
/**
* The raw format of the criteria eg: {yearsOld:22}.
*/
rawCriteriaObject: any;
/**
* Which tables to search after the find method of the proto table finish.
*/
tables: TableToSearchPart[];
/**
* The properties of the criteria which don't belong to the database's table.
*/
noDatabaseProperties: string[];
/**
* The converted/exported where clause.
* The converted/exported where clause.
*/
whereClause: string;
@@ -174,7 +174,7 @@ declare module "node-mysql-wrapper" {
class CriteriaDivider<T> {
private _table;
constructor(table: Table<T>);
/**
* Builds the criteria raw object to Criteria object.
* @param {any} rawCriteriaObject the criteria at raw format you pass eg: {yearsOld:18}.
@@ -198,7 +198,7 @@ declare module "node-mysql-wrapper" {
static build(): SelectQueryRules;
private last(propertyClauseName);
except(...columns: string[]): SelectQueryRules;
/**
* Same as .except(...columns)
*/
@@ -236,7 +236,7 @@ declare module "node-mysql-wrapper" {
constructor(primaryTable: Table<T>, tablePropertyName?: string, parentBuilder?: CriteriaBuilder<any>);
except(...columns: string[]): CriteriaBuilder<T>;
/**
* Same as .except(...columns)
*/
@@ -259,7 +259,7 @@ declare module "node-mysql-wrapper" {
parent(): CriteriaBuilder<T>;
original(): CriteriaBuilder<T>;
/**
* Auto kanei kuklous mexri na paei sto primary table kai ekei na epistrepsei to sunoliko raw criteria gia execute i kati allo.
*/
@@ -270,7 +270,7 @@ declare module "node-mysql-wrapper" {
}
class SelectQuery<T> implements IQuery<T> { // T for Table's result type.
_table: Table<T>
constructor(_table: Table<T>);
@@ -315,7 +315,7 @@ declare module "node-mysql-wrapper" {
static RESERVED_PROPERTY_NAMES: string[];
private propertyChangedListeners: PropertyChangedCallback[];
/** Make the obj observable. Used in constructor or extend this class and use it. */
private makeObservable(obj: any): void;
@@ -324,7 +324,7 @@ declare module "node-mysql-wrapper" {
/**Add a listener/observer to watch for changes in this object's properties */
onPropertyChanged(listener: PropertyChangedCallback): void;
/** If developer wants manualy notify for property changed */
notifyPropertyChanged(propertyName: string, oldValue: any): void;
@@ -388,7 +388,7 @@ declare module "node-mysql-wrapper" {
findById(id: number | string, callback?: (result: T) => any): Promise<T>;
findAll(tableRules?: RawRules, callback?: (_results: T[]) => any): Promise<T[]>;
/**
* .insert() and .update() do the same thing: .save();
*/
@@ -399,7 +399,7 @@ declare module "node-mysql-wrapper" {
save(criteriaRawJsObject: any, callback?: (_result: any) => any): Promise<T | any>;
remove(criteriaOrID: any | number | string, callback?: (_result: DeleteAnswer) => any): Promise<DeleteAnswer>;
/**
* same thing as .remove();
*/
@@ -423,7 +423,7 @@ declare module "node-mysql-wrapper" {
fillAll(): void;
fillOne(criteriaRawJsObject: any): void;
//ONLY MONGO/METEOR COLLECTION METHODS START
allow(options: {
insert?: (userId: string, doc: T) => boolean;
@@ -457,36 +457,36 @@ declare module "node-mysql-wrapper" {
reactive?: boolean;
transform?: Function;
}): T;
//ONLY MONGO/METEOR COLLECTION METHODS FINISH.
}
class Connection extends EventEmitter {
/**
* The real database connection socket.
*/
connection: Mysql.IConnection;
/**
* Collection of the supported event types for the tables.
*/
eventTypes: string[];
/**
* Force to fetch ONLY these Database table names {array of string}.
* Force to fetch ONLY these Database table names {array of string}.
*/
tableNamesToUseOnly: any[];
/**
* All tables {MysqlTable} inside this connection's database.
*/
tables: Table<any>[];
constructor(connection: string | Mysql.IConnection | Mysql.IConnectionConfig);
/**
* Creates the MysqlConnection from the connection url or the real connection object.
* @param {string | Mysql.IConnection | Mysql.IConnectionConfig} connection the connection url or the real connection object.
@@ -494,36 +494,36 @@ declare module "node-mysql-wrapper" {
* @return {nothing}
*/
create(connection: string | Mysql.IConnection | Mysql.IConnectionConfig): void;
/**
* Attach a real connection.
* @param {Mysql.IConnection} connection the real connection object.
* @returnType {nothing}
* @return {nothing}
* @return {nothing}
*/
attach(connection: Mysql.IConnection): void;
/**
* Close the entire real connection and remove all event's listeners (if exist).
* @param {function} callback If error occurs when closing the connection, this callback has the responsibility to catch it.
* @returnType {nothing}
* @return {nothing}
* @return {nothing}
*/
end(callback?: (error: any) => void): void;
/**
* Close the entire real connection and remove all event's listeners (if exist).
* the difference from the 'end' is that this method doesn't care about errors so no callback passing here.
* the difference from the 'end' is that this method doesn't care about errors so no callback passing here.
*/
destroy(): void;
/**
* Clear all binary logs from the whole database.
* When finish returns a promise, use it with .then(function(){});
* @return Promise
*/
clearBinaryLogs(): Promise<void>;
/**
* Link the real connection with this MysqlConnection object.
* @param {function} readyCallback when the link operation is done this callback is executed.
@@ -531,7 +531,7 @@ declare module "node-mysql-wrapper" {
* @return {Promise}
*/
link(readyCallback?: () => void): Promise<void>;
/**
* Force to use/fetch information from only certain of database's tables, otherwise all database's tables information will be fetched.
* @param {Array} tables the array of the tables {string}
@@ -539,22 +539,22 @@ declare module "node-mysql-wrapper" {
* @return {nothing}
*/
useOnly(...tables: any[]): void;
/**
* This method has the resposibility of fetching the correct tables from the database ( table = columns' names, primary key name).
* @returnType {Promise}
* @return {Promise}
*/
fetchDatabaseInformation(): Promise<void>;
/**
* Escape the query column's value and return it.
* @param {string} val the value which will be escaped.
* @param {string} val the value which will be escaped.
* @returnType {string}
* @return {string}
*/
escape(val: string): string;
/**
* Call when must notify the Database events, SAVE(INSERT,UPDATE), REMOVE(DELETE).
* @param {string} tableWhichCalled the table name which event is coming from.
@@ -564,40 +564,40 @@ declare module "node-mysql-wrapper" {
* @return {nothing}
*/
notice(tableWhichCalled: string, queryStr: string, rawRows: any[]): void;
/**
* Adds an event listener/watcher on a table for a 'database event'.
* @param {string} tableName the table name which you want to add the event listener.
* @param {string or string[]} evtType the event(s) type you want to watch, one of these(string) or an array of them(string[]): ["INSERT", "UPDATE", "REMOVE", "SAVE"].
* @param {function} callback Callback which has one parameter(typeof any[]) which filled by the rawRows (results after query executed and before parsed to object(s)).
* @param {function} callback Callback which has one parameter(typeof any[]) which filled by the rawRows (results after query executed and before parsed to object(s)).
* @returnType {nothing}
* @return {nothing}
*/
watch(tableName: string, evtType: any, callback: (rawRows: any[]) => void): void;
/**
* Removes an event listener/watcher from a table for a specific event type.
* @param {string} tableName the table name which you want to remove the event listener.
* @param {string} tableName the table name which you want to remove the event listener.
* @param {string} evtType the Event type you want to remove, one of these: "INSERT", "UPDATE", "REMOVE", "SAVE".
* @param {function} callbackToRemove the callback that you were used for watch this event type.
* @returnType {nothing}
* @return {nothing}
*/
unwatch(tableName: string, evtType: string, callbackToRemove: (rawResults: any[]) => void): void;
/**
* Executes a database query.
* @param {string} queryStr the query text/string to be executed.
* @param {function} callback the function will be called and fill the one and only parameter when an errors occurs.
* @param {any[]} queryArguments (optional) the query arguments you want to pass into query. ['arg1','arg2']...
* @returnType {nothing}
* @return {nothing}
* @return {nothing}
*/
query(queryStr: string, callback: (err: Mysql.IError, results: any) => any, queryArguments?: any[]): void;
/**
* Returns a MysqlTable object from the database factory. (Note: this method doesn't create anything, just finds and returns the correct table, you don't have to create anything at all. Tables are fetched by the library itself.)
* If you are using typescript you can pass a class (generic<T>) in order to use the auto completion assistance on table's results methods(find,findById,findAll,save,remove,safeRemove).
* If you are using typescript you can pass a class (generic<T>) in order to use the auto completion assistance on table's results methods(find,findById,findAll,save,remove,safeRemove).
* @param {string} tableName the table name which you want to get, on the form of: 'anyDatabaseTable' OR 'any_database_table' (possible your real table name into your database).
* @returnType {MysqlTable}
* @return {MysqlTable}
@@ -606,7 +606,7 @@ declare module "node-mysql-wrapper" {
}
class Table<T> {
/** Private keywords here are useless but I put them.
/** Private keywords here are useless but I put them.
* If the developer wants to see the properties of the Table class, he/she just comes here.
*/
@@ -622,55 +622,55 @@ declare module "node-mysql-wrapper" {
constructor(tableName: string, connection: Connection);
/**
* An array of all columns' names inside this table.
*/
columns: string[];
/**
* The name of the primary key column which this table is using.
*/
primaryKey: string;
/**
* The MysqlConnection object which this MysqlTable belongs.
* The MysqlConnection object which this MysqlTable belongs.
*/
connection: Connection;
/**
* The real database name of the table. Autofilled by library.
* The real database name of the table. Autofilled by library.
*/
name: string;
/**
* Set of the query rules that will be applied after the 'where clause' on each select query executed by this table.
* Set of the query rules that will be applied after the 'where clause' on each select query executed by this table.
* @return {SelectQueryRules}
*/
rules: SelectQueryRules;
/**
* Returns this table's criteria divider class.
* @return {CriteriaDivider}
*/
criteriaDivider: CriteriaDivider<T>;
/**
* Returns new Criteria Builder each time.
* Helps you to make criteria raw js objects ready to use in find,remove and save methods.
* @return {CriteriaBuilder}
*/
criteria: CriteriaBuilder<T>;
/**
* Adds or turn on an event listener/watcher on a table for a 'database event'.
* @param {string} evtType the event type you want to watch, one of these: ["INSERT", "UPDATE", "REMOVE", "SAVE"].
* @param {function} callback Callback which has one parameter(typeof any[]) which filled by the rawResults (results after query executed and before exports to object(s)).
* @param {function} callback Callback which has one parameter(typeof any[]) which filled by the rawResults (results after query executed and before exports to object(s)).
* @returnType {nothing}
* @return {nothing}
*/
on(evtType: string, callback: (rawResults: any[]) => void): void;
/**
* Removes or turn off an event listener/watcher from a table for a specific event type.
* @param {string} evtType the Event type you want to remove, one of these: "INSERT", "UPDATE", "REMOVE", "SAVE".
@@ -679,7 +679,7 @@ declare module "node-mysql-wrapper" {
* @return {nothing}
*/
off(evtType: string, callbackToRemove: (rawResults: any[]) => void): void;
/**
* Use it when you want to check if extended function is exists here.
* @param {string} extendedFunctionName the name of the function you want to check.
@@ -687,16 +687,16 @@ declare module "node-mysql-wrapper" {
* @return {boolean}
*/
has(extendedFunctionName: string): boolean;
/**
* Extends this table's capabilities with a function.
* @param {string} functionName the function name you want to use, this is used when you want to call this function later.
* @param {function} theFunction the function with any optional parameters you want to pass along.
* @returnType {nothing}
* @return {nothing}
* @return {nothing}
*/
extend(functionName: string, theFunction: (...args: any[]) => any): void;
/**
* Converts and returns an object from this form: { a_property:'dsda', other_property:something, any_property_name:true } to { aProperty:..., otherProperty...,anyPropertyName...}
* @param {any} row the raw row object.
@@ -704,7 +704,7 @@ declare module "node-mysql-wrapper" {
* @return {any}
*/
objectFromRow(row: any): any;
/**
* Converts and returns an object from this form: { aProperty:'dsda', otherProperty:something, anyPropertyName:true } to { a_property:..., other_property...,any_property_name...}
* @param {any} row the raw row object.
@@ -712,7 +712,7 @@ declare module "node-mysql-wrapper" {
* @return {any}
*/
rowFromObject(obj: any): any;
/**
* Returns and array of [columns[],values[]]
* @param {any} jsObject the raw row object.
@@ -720,7 +720,7 @@ declare module "node-mysql-wrapper" {
* @return {array}
*/
getRowAsArray(jsObject: any): Array<any>;
/**
* Returns the primary key's value from an object.
* @param {any} jsObject the object which you want to find and return the value of the primary key.
@@ -728,11 +728,11 @@ declare module "node-mysql-wrapper" {
* @return {number | string}
*/
getPrimaryKeyValue(jsObject: any): number | string;
/**
*
*
*/
find(criteriaRawJsObject: any): Promise<T[]>; // only criteria
find(criteriaRawJsObject: any): Promise<T[]>; // only criteria
find(criteriaRawJsObject: any, callback: ((_results: T[]) => any)): Promise<T[]>; // criteria and callback
find(criteriaRawJsObject: any, callback?: (_results: T[]) => any): Promise<T[]>;
@@ -778,7 +778,7 @@ declare module "node-mysql-wrapper" {
constructor(connection?: Connection);
static when(..._promises: Promise<any>[]): Promise<any>;
setConnection(connection: Connection): void;
/**
* Force to use/fetch information from only certain of database's tables, otherwise all database's tables information will be fetched.
* @param {Array} tables the array of the tables {string}
@@ -793,18 +793,18 @@ declare module "node-mysql-wrapper" {
noticeReady(): void;
removeReadyListener(callback: () => void): void;
query(queryStr: string, callback: (err: Mysql.IError, results: any) => any, queryArguments?: any[]): void;
/**
* Close the entire real connection and remove all event's listeners (if exist).
* the difference from the 'end' is that this method doesn't care about errors so no callback passing here.
* the difference from the 'end' is that this method doesn't care about errors so no callback passing here.
*/
destroy(): void;
/**
* Close the entire real connection and remove all event's listeners (if exist).
* @param {function} maybeAcallbackError If error occurs when closing the connection, this callback has the responsibility to catch it.
* @returnType {nothing}
* @return {nothing}
* @return {nothing}
*/
end(maybeAcallbackError: (err: any) => void): void;
@@ -820,7 +820,7 @@ declare module "node-mysql-wrapper" {
}
function wrap(mysqlUrlOrObjectOrMysqlAlreadyConnection: Mysql.IConnection | string, ...useTables: any[]): Database;
/** For meteor js only
* Same as wrap but it's sync mode - autoconnect to the database without need to use database.ready(callback).
*/

View File

@@ -3,7 +3,7 @@
// Definitions by: Rogier Schouten <https://github.com/rogierschouten/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../node/node.d.ts" />
/// <reference path="../nodemailer-direct-transport/nodemailer-direct-transport.d.ts" />
/// <reference path="../nodemailer-smtp-transport/nodemailer-smtp-transport.d.ts" />
@@ -45,7 +45,7 @@ declare module "nodemailer" {
* Send mail using a template.
*/
templateSender(template?: any, defaults?: any): (mailData: any, context: any) => Promise<SentMessageInfo>;
/**
* Send mail using a template with a callback.
*/
@@ -59,7 +59,7 @@ declare module "nodemailer" {
* @param pluginFunc is a function that takes two arguments: the mail object and a callback function
*/
use(step: string, plugin: Plugin): void;
/**
* Verifies connection with server
*/

View File

@@ -5,7 +5,7 @@
// Developed with love in www.nowcando.com
/// <reference path="../node/node.d.ts" />
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/* =================== USAGE ===================

View File

@@ -1,5 +1,5 @@
/// <reference path="pify.d.ts" />
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
import * as pify from 'pify';
import * as Bluebird from 'bluebird';
@@ -28,4 +28,4 @@ const fsP = pify(fs);
fsP.readFile('foo.txt').then((result: string) => assert(result, 'foo'));
pify(fs.readFile)('foo.txt').then((result: string) => assert(result, 'foo'));
pify(fs.readFile, Bluebird)('bar.txt').then((result: string) => assert(result, 'bar'));
pify(fs.readFile, Bluebird)('bar.txt').then((result: string) => assert(result, 'bar'));

View File

@@ -1,5 +1,5 @@
///<reference path='project-oxford.d.ts' />
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../node/node.d.ts" />
/// <reference path="../mocha/mocha.d.ts" />

View File

@@ -3,8 +3,8 @@
// Definitions by: Scott Southwood <https://github.com/scsouthw/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="..\bluebird\bluebird.d.ts" />
/// <reference path="..\node\node.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../node/node.d.ts" />
declare module "project-oxford" {
import Promise = require("bluebird");

14
redlock/redlock.d.ts vendored
View File

@@ -3,23 +3,23 @@
// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../redis/redis.d.ts" />
declare module "redlock" {
import * as redis from 'redis';
import * as Promise from 'bluebird';
import * as Promise from 'bluebird';
namespace Redlock {
interface Callback<T> {
(err: any, value?: T): void;
}
interface Lock {
redlock: Redlock;
resource: string;
value: any;
@@ -38,7 +38,7 @@ declare module "redlock" {
interface LockError extends Error {}
}
class Redlock {
driftFactor: number;
@@ -59,6 +59,6 @@ declare module "redlock" {
extend(lock: Redlock.Lock, ttl: number, callback?: Redlock.Callback<Redlock.Lock>): Promise<Redlock.Lock>;
}
export = Redlock;
}

View File

@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../request/request.d.ts" />
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
declare module 'request-promise' {
import request = require('request');

View File

@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Reference: http://www.rethinkdb.com/api/#js
// TODO: Document manipulation and below
///<reference path="../bluebird/bluebird.d.ts"/>
///<reference path="../bluebird/bluebird-2.0.d.ts"/>
declare module "rethinkdb" {

View File

@@ -6,7 +6,7 @@
// Based on original work by: samuelneff <https://github.com/samuelneff/sequelize-auto-ts/blob/master/lib/sequelize.d.ts>
/// <reference path='../lodash/lodash.d.ts' />
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../validator/validator.d.ts" />
declare module "sequelize" {

View File

@@ -3,7 +3,7 @@
// Definitions by: Riderman de Sousa Barbosa <https://github.com/ridermansb/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="..\promises-a-plus\promises-a-plus.d.ts"/>
/// <reference path="../promises-a-plus/promises-a-plus.d.ts"/>
declare namespace Stamplay {

File diff suppressed because it is too large Load Diff

2
umzug/umzug.d.ts vendored
View File

@@ -3,7 +3,7 @@
// Definitions by: Ivan Drinchev <https://github.com/drinchev/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
/// <reference path="../sequelize/sequelize.d.ts" />
declare module "umzug" {