question

undertheweatherllc avatar image
undertheweatherllc asked

SdkTestingCloudScript for TypeScript

I'm in the process of setting up a TypeScript project using cloudscript.d.ts and playstream.d.ts from the SdkTestingCloudScript github project by copying those 2 files into a Scripts/Typings/Playfab/ directory in my TypeScript project. However, when I try to transpile the project, I get 100+ errors.

Most of them are

';' expected

or

Could not find symbol

where some symbols are 'type', 'Conditionals', 'ContinentCode'

or

Unexpected token;

I'm pretty new to Javascript and Typescript. Are these just typical syntax errors or am I missing some sort of dependencies, file placement, or something else?

Thanks in advance!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Joshua Strunk avatar image
Joshua Strunk answered

"TypeScript 1.0.3.0 if that matters", it does, thanks!

The SDK currently mixes both , and ; separators in its interface declarations. Support for commas was added in 1.5.This brings up an oversite in the documentation and TypeScript generators, we never came up with a styling guide or rules on which compiler versions we should support.

Regardless I would recommend updating your TypeScript compiler(it is all the way on v2.2) and possibly try keeping it up to date. They release new stable versions every month.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

undertheweatherllc avatar image undertheweatherllc commented ·

Good to know. Thanks! Apparently, TypeScript 1.8 is the last supported version for VS 2013. Failing that, I will have to consider switching my project over to VS 2015.

0 Likes 0 ·
Joshua Strunk avatar image Joshua Strunk undertheweatherllc commented ·

I would consider looking at VSCode. The TypeScript and VSCode teams are pretty close at Microsoft. The TypeScript release schedule was in fact just changed to line up with the VSCode schedule. Added bonus VSCode is built using TypeScript.

0 Likes 0 ·
brendan avatar image
brendan answered

It sounds like they're mainly syntax errors, but the missing "ContinentCode" symbol is odd. Can you post a snippet that exhibits this issue?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

undertheweatherllc avatar image undertheweatherllc commented ·

I'm taking cloudscript.d.ts wholesale from the Playfab github page here:

https://github.com/PlayFab/SdkTestingCloudScript/blob/master/Scripts/typings/PlayFab/CloudScript.d.ts

I just drop it in a barebones TypeScript project and get the errors mentioned above.

I'll post a specific snippet later on (not in front of it right now), but I'm pretty sure the error was occurring on all instance of it.

I don't think I have to include parts of the JavascriptSDK (https://github.com/PlayFab/JavaScriptSDK), right?

Also, I'm on VS Community 2013 and TypeScript 1.0.3.0 if that matters.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.