Skip to content
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

Using excel.d.ts in another project #304

Closed
HoldYourWaffle opened this issue Nov 30, 2023 · 4 comments
Closed

Using excel.d.ts in another project #304

HoldYourWaffle opened this issue Nov 30, 2023 · 4 comments
Labels
Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP

Comments

@HoldYourWaffle
Copy link
Contributor

office-js-docs-reference uses DT as the source of truth for its type definitions, which can be conveniently installed in a project with @types/office-js. Is there an equivalent for Office Scripts?

There seem to be two versions of excel.d.ts in this repository:

The latter seems to get generated based on the first by GenerateDocs.sh.

Can this first file be considered a "source of truth", or is there a better place to get these type definitions from?

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Nov 30, 2023
@AlexJerabek
Copy link
Collaborator

Hi @HoldYourWaffle,

This came up in a Stack Overflow post a while back: https://stackoverflow.com/questions/71938117/excelscript-type-definnitions

Basically, the type definitions are shipped with Excel. This repo maintains a [copy of the .d.ts file](https://github.com/OfficeDev/office-scripts-docs-reference/blob/main/generate-docs/script-inputs/excel.d.ts to generate the reference documentation. This is the most up-to-date publicly accessible version of the type definitions.

If you're curious about the documentation generation, the process here is similar to that of the Office JS reference documentation, as documented here.

I'm going to close this issue, since there's not an actionable work item. Feel free to keep the discussion going, though.

@HoldYourWaffle
Copy link
Contributor Author

Aaah interesting, that makes sense, thanks for the clarification!

Are there any plans to publish these definitions as an npm package, like office-js?
I could write a script to download the file from this repository, but that seems a little janky :P

@AlexJerabek
Copy link
Collaborator

We actually discourage people from using the npm package for office-js. It's better to use what's in the CDN because that'll always be up-to-date.

We have no plans to publish the @types of Office Scripts, since the only consumption of them is in the in-client Code Editor. What are you looking to do with the type definitions?

@HoldYourWaffle
Copy link
Contributor Author

That's good to know, thanks for the heads up!

I'm looking into setting up a basic "traditional" development environment to work around office-scripts-docs#663 and various other limitations of the in-client editor (such as #305 and the lack of (reusable) modules).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP
Projects
None yet
Development

No branches or pull requests

2 participants