Skip to content

Commit

Permalink
Merge pull request #1778 from strongloop/fix-datasource-getmodel-typing
Browse files Browse the repository at this point in the history
Fix typescript typing for DataSource.prototype.getModel()
  • Loading branch information
raymondfeng committed Sep 19, 2019
2 parents ad1777f + 1e8b8a0 commit 8946516
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions types/datasource.d.ts
Expand Up @@ -108,7 +108,15 @@ export declare class DataSource extends EventEmitter {
options?: Options,
): T;

getModel(modelName: string): ModelBaseClass | undefined;
/**
* Look up a model class by name
* @param modelName Model name
* @param forceCreate A flag to force creation of a model if not found
*/
getModel(
modelName: string,
forceCreate?: boolean,
): ModelBaseClass | undefined;

/**
* Remove a model from the registry.
Expand Down Expand Up @@ -197,17 +205,15 @@ export declare class DataSource extends EventEmitter {
execute(
command: string | object,
args?: any[] | object,
options?: Options
options?: Options,
): Promise<any>;

/**
* Begin a new transaction.
*
*
* @param [options] Options {isolationLevel: '...', timeout: 1000}
* @returns Promise A promise which resolves to a Transaction object
*/
beginTransaction(
options?: IsolationLevel | Options,
): Promise<Transaction>;
/**
* Begin a new transaction.
*
*
* @param [options] Options {isolationLevel: '...', timeout: 1000}
* @returns Promise A promise which resolves to a Transaction object
*/
beginTransaction(options?: IsolationLevel | Options): Promise<Transaction>;
}

0 comments on commit 8946516

Please sign in to comment.