workers: proper TS libs, more spec-compliant APIs (#3812)

* split lib.deno_main.d.ts into:
  - lib.deno.shared_globals.d.ts
  - lib.deno.window.d.ts
  - lib.deno.worker.d.ts
* remove no longer used libs:
  - lib.deno_main.d.ts
  - lib.deno_worker.d.ts
* change module loading to use proper TS library for compilation
* align to Worker API spec:
  - Worker.terminate()
  - self.close()
  - self.name
This commit is contained in:
Bartek Iwańczuk 2020-01-29 18:54:23 +01:00 committed by GitHub
parent d14864c57c
commit 161adfc51b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 449 additions and 287 deletions

View file

@ -132,7 +132,7 @@ declare global {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var onmessage: ((e: { data: any }) => Promise<void> | void) | undefined;
// Called in compiler
var workerClose: () => void;
var close: () => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var postMessage: (msg: any) => void;
// Assigned to `self` global - compiler