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 trusted-types #32000

Merged
merged 3 commits into from Jan 19, 2019

Conversation

Projects
None yet
3 participants
@vrana
Copy link
Contributor

vrana commented Jan 9, 2019

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • tslint.json should be present, and tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

vrana added some commits Jan 9, 2019

@typescript-bot

This comment has been minimized.

Copy link

typescript-bot commented Jan 9, 2019

@vrana Thank you for submitting this PR!

Because this is a new definition, a DefinitelyTyped maintainer will be reviewing this PR in the next few days once the Travis CI build passes.

In the meantime, if the build fails or a merge conflict occurs, I'll let you know. Have a nice day!

@vrana

This comment has been minimized.

Copy link
Contributor Author

vrana commented Jan 9, 2019

@koto approves.

@typescript-bot

This comment has been minimized.

Copy link

typescript-bot commented Jan 14, 2019

After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience!

private readonly _TrustedScriptBrand: true; // To prevent structural typing.
}

declare class TrustedScriptURL {

This comment has been minimized.

@DanielRosenwasser

DanielRosenwasser Jan 16, 2019

Collaborator

Should these extend from each other? The original source code does, and it might make instanceof work better. I'm not familiar with how this library is supposed to be used though.

This comment has been minimized.

@vrana

vrana Jan 16, 2019

Author Contributor

They should not. The goal of this declaration is to describe the spec (to be published soon) with one working implementation (google-chrome-unstable --enable-blink-features=TrustedDOMTypes --enable-experimental-web-platform-features). They don't extend from each other there. https://github.com/WICG/trusted-types is just a polyfill and I will fix that instead.

This comment has been minimized.

@vrana

vrana Jan 16, 2019

Author Contributor

This comment has been minimized.

@vrana

@DanielRosenwasser DanielRosenwasser merged commit efefe5f into DefinitelyTyped:master Jan 19, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment