-
Notifications
You must be signed in to change notification settings - Fork 457
add URL typing to webworker #223
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
Conversation
URL is also available in workder. <https://url.spec.whatwg.org/#idl-index>
|
@VincentBel, It will cover your contributions to all Microsoft-managed open source projects. |
|
@vincentbel, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request. |
baselines/dom.generated.d.ts
Outdated
| close(): void; | ||
| } | ||
|
|
||
| interface URL { |
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.
interface URL is already defined in this file. no need to redefine it.
baselines/webworker.generated.d.ts
Outdated
| close(): void; | ||
| } | ||
|
|
||
| interface URL { |
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 edit inputfiles\knownWorkerInterfaces.json to add URL and URLSearcParams.
|
@mhegazy updated. But ci is still failing. I have see some other PRs, and they seems failed with the same error. |
| "SyncManager", | ||
| "USVString", | ||
| "URL", | ||
| "URLSearchParams", |
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.
looks like you need ObjectURLOptions as well
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.
Added.
|
thanks! |
URLis also available in worker. (URL IDL spec). Fix microsoft/TypeScript#14878.Questions:
URLtying is already defined ininputfiles/browser.webidl.xml#L11367-L11395, so it is only need to added toworker. So I added"flavor": "Worker", but it seems doesn't work.(same as"flavor": "All"forURLSearchParams) 😅URLandURLSearchParamsshould be added toWorkerGlobalScope. It is signed asExposed=(Window,Worker)in the spec IDLUSVString, but I usestringhere (keep it same as previous addedURLSearchParamstyping). Doesn't it matters?Updates:
URLandURLSearcParamstoknownWorkerInterfaces.json.URLandURLSearchParamsshouldn't be added toWorkerGlobalScope.(The same as fetch related typing)