10-06-2017 08:50 - edited 10-06-2017 08:51
10-06-2017 08:50 - edited 10-06-2017 08:51
I can't get Promise working when using TypeScript.
My code is:
import geolocation from 'geolocation';
export function getCurrentLocation(): Promise<any> {
return new Promise<any>((resolve: any, reject: any) => {
geolocation.getCurrentPosition((position: any) => {
resolve(position.coords);
}, (error: any) => {
reject(error);
});
});
}When building I get the error:
/companion/util.ts (4,14): TS2693: 'Promise' only refers to a type, but is being used as a value here.
Answered! Go to the Best Answer.
Best Answer10-09-2017 08:21
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
10-09-2017 08:21
TypeScript is not officially supported by Fitbit Studio yet, but as a temporary solution:
declare const Promise: any;
I took this from your own message on Discord 🙂
Best Answer10-09-2017 08:21
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
10-09-2017 08:21
TypeScript is not officially supported by Fitbit Studio yet, but as a temporary solution:
declare const Promise: any;
I took this from your own message on Discord 🙂
Best Answer