diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-01-17 15:28:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-17 16:28:54 +0100 |
commit | 7db0605d456559f1ca9447e6fa778559fe50cc95 (patch) | |
tree | 8607446306b6e526dab149a465cac3e3d825b96b /cli/dts/lib.deno.worker.d.ts | |
parent | f4dbb267c6672f92605bc204b10ad9a96d160ef4 (diff) |
fix(op_crates/web): Use WorkerLocation for location in workers (#9084)
Diffstat (limited to 'cli/dts/lib.deno.worker.d.ts')
-rw-r--r-- | cli/dts/lib.deno.worker.d.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cli/dts/lib.deno.worker.d.ts b/cli/dts/lib.deno.worker.d.ts index 74609e8ab..a8f42f336 100644 --- a/cli/dts/lib.deno.worker.d.ts +++ b/cli/dts/lib.deno.worker.d.ts @@ -58,3 +58,26 @@ declare var onerror: declare var close: () => void; declare var name: string; declare var postMessage: (message: any) => void; + +// TODO(nayeemrmn): Move this to `op_crates/web` where its implementation is. +// The types there must first be split into window, worker and global types. +/** The absolute location of the script executed by the Worker. Such an object + * is initialized for each worker and is available via the + * WorkerGlobalScope.location property obtained by calling self.location. */ +declare class WorkerLocation { + constructor(); + readonly hash: string; + readonly host: string; + readonly hostname: string; + readonly href: string; + toString(): string; + readonly origin: string; + readonly pathname: string; + readonly port: string; + readonly protocol: string; + readonly search: string; +} + +// TODO(nayeemrmn): Move this to `op_crates/web` where its implementation is. +// The types there must first be split into window, worker and global types. +declare var location: WorkerLocation; |