a fix for tslint.

This commit is contained in:
Saeed Tabrizi
2017-07-19 19:06:21 +04:30
parent 8bf14fc21f
commit b9f2a3e762
2 changed files with 21 additions and 33 deletions

View File

@@ -87,8 +87,8 @@ declare module "orientjs" {
className?: string
};
class Manager extends MigrationManager{
constructor (config: MigrationManagerConfig);
class Manager extends MigrationManager {
constructor(config: MigrationManagerConfig);
}
interface Migration {
name: string;
@@ -374,7 +374,7 @@ declare module "orientjs" {
* @param {Integer} offset The offset to start returning records from.
* @promise {Object[]} An array of records in the class.
*/
find(attributes: any, limit ?: number, offset?: number): Promise<Record[]>;
find(attributes: any, limit?: number, offset?: number): Promise<Record[]>;
/**
* Create a record for this class.
*
@@ -764,18 +764,18 @@ declare module "orientjs" {
interface RawExpression {
db: Db;
value: string;
as(alias:string): RawExpression;
as(alias: string): RawExpression;
}
interface AbsSqlFunction {
new (field: number | string): AbsSqlFunction;
new(field: number | string): AbsSqlFunction;
}
interface AvgSqlFunction {
new (field: string): AvgSqlFunction;
new(field: string): AvgSqlFunction;
}
interface SequenceSqlFunction {
new (name: string): SequenceSqlFunction;
new(name: string): SequenceSqlFunction;
next(): number;
current(): number;
reset(): number;
@@ -789,12 +789,12 @@ declare module "orientjs" {
}
interface QueryOptions {
params?:any;
params?: any;
mode?: "s" | "a" | "l";
fetchPlan?: any;
limit?: number;
token?:any;
class?:string;
token?: any;
class?: string;
language?: "SQL" | "Javascript"
}
@@ -981,10 +981,10 @@ declare module "orientjs" {
*/
let(params?: any): Statement;
let(name: string, value: string | Statement): Statement;
/** Create a transactional query with if.
*
* @return {Query} The query instance.
*/
/** Create a transactional query with if.
*
* @return {Query} The query instance.
*/
if(condition: SqlExpression, statements: Statement[]): Statement;
/** Create a transactional query with if.
*
@@ -1035,7 +1035,7 @@ declare module "orientjs" {
* @param {String|Object} options The server URL, or configuration object
*/
interface Server {
new (options?: ServerConfig): Server;
new(options?: ServerConfig): Server;
config: ServerConfiguration;
logger: Logger;
@@ -1155,7 +1155,7 @@ declare module "orientjs" {
}
interface ODatabase extends Db {
new (config?: {
new(config?: {
host: string,
port?: number,
username?: string,

View File

@@ -5,22 +5,10 @@ let dbserver = orientjs({
port: 2424,
username: 'root',
password: 'root'
});
});
let db = dbserver.use({
name: 'mytestdb',
username: 'root',
password: 'root'
});
name: 'mytestdb',
username: 'root',
password: 'root'
});
{
var manager = new orientjs.Migration.Manager({
db: db,
dir: __dirname + '/migrations'
});
manager.up(1)
.then(function () {
console.log('migrated up by one!')
});
}