-
Notifications
You must be signed in to change notification settings - Fork 439
Feature/add webworkers api widl #455
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
Feature/add webworkers api widl #455
Conversation
baselines/dom.generated.d.ts
Outdated
@@ -16632,5 +16657,5 @@ type VRDisplayEventReason = "mounted" | "navigation" | "requested" | "unmounted" | |||
type VREye = "left" | "right"; | |||
type VideoFacingModeEnum = "user" | "environment" | "left" | "right"; | |||
type VisibilityState = "hidden" | "visible" | "prerender" | "unloaded"; | |||
type WorkerType = "classic" | "module"; | |||
type WorkerType = "classic" | "module" | "classic" | "module"; |
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.
this needs to be filtered.
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.
done
baselines/webworker.generated.d.ts
Outdated
declare function clearInterval(handle: number): void; | ||
declare function clearTimeout(handle: number): void; | ||
declare function importScripts(...urls: string[]): void; | ||
declare function setImmediate(handler: any, ...args: any[]): number; |
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.
why are these removed?
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.
Because widlprocess does not support [Global]
yet 😅 #456
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.
#456 is merged, please rebuild!
6bd9cb6
to
2e66a38
Compare
I was going to add full HTML spec in once, but being incremental is probably better 😁 |
The multipaged worker spec lacks |
Oh, this is an oops situation. I expected the empty WindowOrWorkerGlobalScope would automatically get some types from already added specs, but:
|
@saschanaz should I remove it for now?
|
It also has IndexedDB and other stable types. Worker will lose access for them without proper WindowOrWorkerGlobalScope definition. I think we should add those lost types manually for now. (Don't forget adding |
inputfiles/knownWorkerTypes.json
Outdated
@@ -1,6 +1,126 @@ | |||
[ | |||
"ClientQueryOptions", |
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.
You may want to remove these 😀
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.
I meant not only that one but all additions here, because now types are autoexposed (#457). Some exceptions are for override-type.
b8f6438
to
f5b57f8
Compare
f5b57f8
to
72e9691
Compare
declare function importScripts(...urls: string[]): void; | ||
declare function setImmediate(handler: any, ...args: any[]): number; | ||
declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; | ||
declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; |
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.
is that expected? should setTimeout
not be available for workers?
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.
It's needed, I think we should wait until we get WindowOrWorkerGlobalScope
.
Microsoft/TypeScript#/23653
Web Workers Spec