-
Notifications
You must be signed in to change notification settings - Fork 169
Add TS externs. #457
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
Add TS externs. #457
Conversation
…ply to the existing `main` file.
…'t already in the JS externs into a local type.
…ire a workaround.
…le) and add `export {};` (force module goal for internal builds).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some documentation / clarity comments. Please do address, but otherwise LGTM
@@ -0,0 +1,23 @@ | |||
/** | |||
* @externs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here and elsewhere: I don't think this file should be marked as @externs
. In the internal bazel rules, a ts_declaration() automatically produces externs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
@@ -0,0 +1,84 @@ | |||
/** | |||
* @externs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, re @externs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -0,0 +1,57 @@ | |||
/** | |||
* @externs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@externs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -0,0 +1,71 @@ | |||
/** | |||
* @externs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@externs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
packages/shadycss/src/env.d.ts
Outdated
@@ -0,0 +1,31 @@ | |||
/** | |||
* @externs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@externs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -0,0 +1,37 @@ | |||
/** | |||
* @externs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@externs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
packages/shadydom/src/env.d.ts
Outdated
@@ -0,0 +1,60 @@ | |||
/** | |||
* @externs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@externs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -0,0 +1,20 @@ | |||
/** | |||
* @externs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@externs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
* rights grant found at http://polymer.github.io/PATENTS.txt | ||
*/ | ||
|
||
// This file needs to be a module for the declarations to apply globally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here and elsewhere: kinda the opposite is the case. declarations in non-modules are global by default
but for consistency and our own sanity, we prefer all files to be modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this comment doesn't make sense; updated.
@@ -0,0 +1,19 @@ | |||
/** | |||
* @externs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@externs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
This PR adds externs for released packages in TypeScript's
.d.ts
format.The original JSCompiler types from which these were converted conflate types that are used only within the package to describe internal objects or expand known built-in types for use by the package itself with types that are intended for the user of the package. The new types only expose the package's interface in the externs file and keep those intended for internal use in an
env.d.ts
file in each package's source folder.The TS externs are included in the published packages next to their JSCompiler counterparts, but are not set as the
types
field because they aren't relevant to some of the packages'main
module (i.e. Shady CSS).This PR also generates a new
webcomponents-bundle.d.ts
file next towebcomponents-bundle.js
, which bundles all of the individual polyfills' externs.