fixup! address code review comments

This commit is contained in:
Miroslav Bajtoš 2018-06-29 08:35:22 +02:00
parent 548379ca2a
commit 6f3675b13c
No known key found for this signature in database
GPG Key ID: 6F2304BA9361C7E3
2 changed files with 8 additions and 2 deletions

2
types/common.d.ts vendored
View File

@ -18,7 +18,7 @@ export type Options = AnyObject<any>;
/**
* Type alias for Node.js callback functions
*/
export type Callback<T = any> = (err?: Error | null, result?: T) => void;
export type Callback<T = any> = (err?: any | null, result?: T) => void;
/**
* Return export type for promisified Node.js async methods.

8
types/model.d.ts vendored
View File

@ -242,8 +242,14 @@ export declare class ModelBuilder extends EventEmitter {
): ModelBaseClass;
}
/**
* An extension of the built-in Partial<T> type which allows partial values
* in deeply nested properties too.
*/
export type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]>; };
/**
* Union export type for model instance or plain object representing the model
* instance
*/
export type ModelData<T extends ModelBase = ModelBase> = T | Partial<T>;
export type ModelData<T extends ModelBase = ModelBase> = T | DeepPartial<T>;