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

Provide webview/renderer API typings somewhere #99320

Closed
connor4312 opened this issue Jun 3, 2020 · 5 comments · Fixed by DefinitelyTyped/DefinitelyTyped#45731
Closed

Provide webview/renderer API typings somewhere #99320

connor4312 opened this issue Jun 3, 2020 · 5 comments · Fixed by DefinitelyTyped/DefinitelyTyped#45731
Assignees
Labels
debt Code quality issues notebook
Milestone

Comments

@connor4312
Copy link
Member

Right now we expose an API to cells, and to webviews, but we don't publish types for this. The webview API is very simple, but the renderer will be somewhat more complex.

We should consider either publishing these in @types/vscode, or in a separate @types package.

@JacksonKearl
Copy link
Contributor

JacksonKearl commented Jun 26, 2020

This would be helpful for microsoft/vscode-docs#3784. I think a @types/vscode-notebook or something would be a good place for it.

Aside, it'd be cool if ts libs could be contributed to...

{
	"extends": "tsconfig.json",
	"compilerOptions": { "lib": [ "vscode-notebook-output-context"] },
	"include": [ "client" ]
}

Right now we'd need a whole separate NPM scope to have separate @types I believe.

@connor4312
Copy link
Member Author

Right now we'd need a whole separate NPM scope to have separate @types I believe.

We can just PR a package called @types/vscode-notebook. The naming of packages is only constrained by the maintainers' policy, and there are types that don't correspond to single packages, e.g. https://www.npmjs.com/package/@types/kap-plugin

@JacksonKearl
Copy link
Contributor

JacksonKearl commented Jun 26, 2020

Poor wording, I mean the project would need a different package.json and node_modules/@types for the client code vs the extension host code.

(Or just know not call acquireApi outside of the client context of course. )

@connor4312
Copy link
Member Author

Oh, yea. In the sample renderer/code generator I'm using project references to keep things separated -- that also lets us use lib: dom only in the renderer and output es6 modules (only) for webpack.

@connor4312
Copy link
Member Author

PR submitted

@github-actions github-actions bot locked and limited conversation to collaborators Aug 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues notebook
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants