// This Promise is replaced by one from the @Cordova decorator that wraps
// the plugin's callbacks. We provide a dummy one here so TypeScript
// knows that the correct return type is Promise, because there's no way
// for it to know the return type from a decorator.
// See https://github.com/Microsoft/TypeScript/issues/4881
return new Promise<any>((res, rej) => {});
With the intention to reduce confusion about the decorator magic that is happening to change the return type. But I'm wondering if we just add the return type and a void return, so each wrapper looks more like an interface:
@Cordova()
static show(options?: {
buttonLabels: string[],
title?: string,
androidTheme?: number,
androidEnableCancelButton?: boolean,
winphoneEnableCancelButton?: boolean,
addCancelButtonWithLabel?: string,
addDestructiveButtonWithLabel?: string,
position?: number[]
}) : Promise<any> { return }
/**
* Hide the ActionSheet.
*/
@Cordova()
static hide() : Promise<any> { return }