mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Fix return types of the async versions
This commit is contained in:
Vendored
+6
-6
@@ -1477,7 +1477,7 @@ declare global {
|
||||
* @param options (optional) Some internal options.
|
||||
* @param callback Is called when the operation has finished (successfully or not)
|
||||
*/
|
||||
getDevicesAsync(options?: unknown): Promise<Array<GetObjectsItem<DeviceObject>>>;
|
||||
getDevicesAsync(options?: unknown): Promise<DeviceObject[]>;
|
||||
|
||||
/**
|
||||
* Returns a list of all channels in this adapter instance
|
||||
@@ -1502,9 +1502,9 @@ declare global {
|
||||
* @param parentDevice (optional) Name of the parent device to filter the channels by
|
||||
* @param options (optional) Some internal options.
|
||||
*/
|
||||
getChannelsOfAsync(): Promise<Array<GetObjectsItem<ChannelObject>>>;
|
||||
getChannelsOfAsync(): Promise<ChannelObject[]>;
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
getChannelsOfAsync(parentDevice: string, options?: unknown): Promise<Array<GetObjectsItem<ChannelObject>>>;
|
||||
getChannelsOfAsync(parentDevice: string, options?: unknown): Promise<ChannelObject[]>;
|
||||
|
||||
/**
|
||||
* Returns a list of all states in this adapter instance
|
||||
@@ -1524,9 +1524,9 @@ declare global {
|
||||
* @param options (optional) Some internal options.
|
||||
*/
|
||||
// tslint:disable:unified-signatures
|
||||
getStatesOfAsync(): Promise<Array<GetObjectsItem<StateObject>>>;
|
||||
getStatesOfAsync(parentDevice: string, parentChannel?: string): Promise<Array<GetObjectsItem<StateObject>>>;
|
||||
getStatesOfAsync(parentDevice: string, parentChannel: string, options?: unknown): Promise<Array<GetObjectsItem<StateObject>>>;
|
||||
getStatesOfAsync(): Promise<StateObject[]>;
|
||||
getStatesOfAsync(parentDevice: string, parentChannel?: string): Promise<StateObject[]>;
|
||||
getStatesOfAsync(parentDevice: string, parentChannel: string, options?: unknown): Promise<StateObject[]>;
|
||||
// tslint:enable:unified-signatures
|
||||
|
||||
// ==============================
|
||||
|
||||
@@ -291,17 +291,26 @@ function repro2() {
|
||||
function repro3() {
|
||||
adapter.getDevices((error, deviceList) => {
|
||||
if (deviceList) {
|
||||
deviceList[0]; // $ExpectType DeviceObject
|
||||
deviceList; // $ExpectType DeviceObject[]
|
||||
}
|
||||
});
|
||||
adapter.getDevicesAsync().then(list => {
|
||||
list; // $ExpectType DeviceObject[]
|
||||
});
|
||||
adapter.getChannels((error, channelList) => {
|
||||
if (channelList) {
|
||||
channelList[0]; // $ExpectType ChannelObject
|
||||
channelList; // $ExpectType ChannelObject[]
|
||||
}
|
||||
});
|
||||
adapter.getChannelsOfAsync().then(list => {
|
||||
list; // $ExpectType ChannelObject[]
|
||||
});
|
||||
adapter.getStatesOf((error, stateList) => {
|
||||
if (stateList) {
|
||||
stateList[0]; // $ExpectType StateObject
|
||||
stateList; // $ExpectType StateObject[]
|
||||
}
|
||||
});
|
||||
adapter.getStatesOfAsync().then(list => {
|
||||
list; // $ExpectType StateObject[]
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user