types: make DataSource.stop compatible with LB4
Change the return value of `DataSource.stop()` from `Promise<void>` to `void | PromiseLike<void>` to avoid breaking existing LoopBack 4 applications, where DataSource subclasses are scaffolded with `stop(): ValueOrPromise<void>`. Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
This commit is contained in:
parent
4c665cd6f7
commit
7292d206e5
|
@ -288,7 +288,10 @@ export declare class DataSource extends EventEmitter {
|
|||
disconnect(callback: Callback): void;
|
||||
|
||||
// Only promise variant, callback is intentionally not described.
|
||||
stop(): Promise<void>;
|
||||
// Note we must use `void | PromiseLike<void>` to avoid breaking
|
||||
// existing LoopBack 4 applications.
|
||||
// TODO(semver-major): change the return type to `Promise<void>`
|
||||
stop(): void | PromiseLike<void>;
|
||||
|
||||
ping(): Promise<void>;
|
||||
// legacy callback style
|
||||
|
|
Loading…
Reference in New Issue