Microsoft/TypeScript
Voir sur GitHubUnable to access ServiceWorkerGlobalScope via `self.`
Open
#14 877 ouverte le 27 mars 2017
BugDomain: lib.d.tsHelp Wanted
Métriques du dépôt
- Stars
- (48 455 stars)
- Métriques de merge PR
- (Merge moyen 6j 17h) (9 PRs mergées en 30 j)
Description
Since ServiceWorker related types sit in lib.webworker.d.ts, webworker lib need to be added to tsconfig.json.
{
"compilerOptions": {
"lib": [
"es2017",
"webworker"
]
}
}
But in current lib.webworker.d.ts, it declare var self: WorkerGlobalScope;, so we can't access ServiceWorkerGlobalScope via self.
TypeScript Version: 2.2.1
Expected behavior:
Can access ServiceWorkerGlobalScope via self.(like self.clients)
Actual behavior:
Access with error.
