-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document supported TypeScript version #305
Comments
Hi @HoldYourWaffle, Thanks for this question. I'll reach out to the product team and get an answer for you. |
The version of TypeScript used by Office Scripts is currently 4.0.3. We are currently looking at a way to update the *Script versions without risking breaking existing scripts. Given that this upgrade path is still undefined in the product, that we have a layer of additional TS restrictions for Office Scripts (some of which that limit the IntelliSense), and that the nature of Excel platforms and update channels complicates this whole conversation, we’re hesitant to document specific implementation details at this time. When this active discussion resolved, we’ll update the documentation accordingly. |
There are now lots of useful APIs available at runtime but missing TS types. In my smallish ~400-line script, I've had to resort to multiple hacks to get around this: // let x = distances.at(-1)!
let x: number = distances['at'](-1)
// const obj = Object.fromEntries(...)
const obj: Record<string, string> = Object['fromEntries'](...)
// const settled = await Promise.allSettled(...)
const settled: ({ status: 'fulfilled', value: QueryResultData } | { status: 'rejected', reason: unknown })[] = await
Promise['allSettled'](...)
// const result = results.findLastIndex(...)
const result = results['findLastIndex' as string as 'findIndex'](...)
// const locale = new Intl.Locale(...)
const locale: { language?: string, script?: string, region?: string } = new Intl['Locale'](...) It'd be really nice to have access to the latest APIs in TS as well as at runtime, especially given the lack of If the upgrade path is complicated by backward compatibility concerns, is there any possibility of relaxing the type checking requirements? I.e. scripts with type checking errors still run, they just show squiggly lines in the editor (and maybe warnings in the console), much like running TypeScript code in Deno without the Edit: Also, maybe relaxing type checking requirements could unblock #318? 🤞 |
Article URL
Office Scripts Code Editor environment
Issue
The article listed above mentions that Office Scripts are written in TypeScript, but it doesn't mention which version.
Based on some trial and error I'm fairly confident that (as of Excel version 2310) it's TypeScript v3.7, but I'd love to see some official documentation on this :)
The text was updated successfully, but these errors were encountered: