Socket
Socket
Sign inDemoInstall

@types/service-worker-mock

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/service-worker-mock - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

8

service-worker-mock/index.d.ts

@@ -45,6 +45,6 @@ // Type definitions for service-worker-mock 2.0

function trigger(type: keyof ServiceWorkerGlobalScopeEventMap): Promise<void>;
function trigger(name: 'fetch', request: string | Request): Promise<void>;
function trigger(name: 'notificationclick' | 'notificationclose', args: Notification): Promise<void>;
function trigger(name: 'push', args: Partial<PushEvent>): Promise<void>;
function trigger(name: 'message', args: Partial<MessageEvent>): Promise<void>;
function trigger(name: "fetch", request: string | Request): Promise<void>;
function trigger(name: "notificationclick" | "notificationclose", args: Notification): Promise<void>;
function trigger(name: "push", args: Partial<PushEvent>): Promise<void>;
function trigger(name: "message", args: Partial<MessageEvent>): Promise<void>;

@@ -51,0 +51,0 @@ /**

{
"name": "@types/service-worker-mock",
"version": "2.0.1",
"version": "2.0.2",
"description": "TypeScript definitions for service-worker-mock",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/service-worker-mock",
"license": "MIT",

@@ -14,3 +15,3 @@ "contributors": [

"main": "",
"types": "index",
"types": "index.d.ts",
"repository": {

@@ -23,4 +24,4 @@ "type": "git",

"dependencies": {},
"typesPublisherContentHash": "5d83407ddc6f0a933c05b7687ff55d9fcd53e85456967d61b1a7f491d211fbdb",
"typeScriptVersion": "2.8"
"typesPublisherContentHash": "e52174ab701040adde216d0d08f30aeae19cc5eeb44eb1c9811d3cfd2af99868",
"typeScriptVersion": "4.5"
}

@@ -8,6 +8,70 @@ # Installation

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/service-worker-mock
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/service-worker-mock.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/service-worker-mock/index.d.ts)
````ts
// Type definitions for service-worker-mock 2.0
// Project: https://github.com/pinterest/service-workers/tree/master/packages/service-worker-mock#readme
// Definitions by: Remco Haszing <https://github.com/remcohaszing>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
Additional Details
* Last updated: Wed, 11 Sep 2019 05:39:00 GMT
export = makeServiceWorkerEnv;
declare function makeServiceWorkerEnv(): WorkerGlobalScope;
declare namespace makeServiceWorkerEnv {
interface Caches {
[key: string]: Cache;
}
type Listeners = Map<keyof ServiceWorkerGlobalScopeEventMap, EventListener>;
interface Snapshot {
/**
* A key/value map of current cache contents.
*/
caches: Caches;
/**
* A list of active clients.
*/
clients: Client[];
/**
* A list of active notifications.
*/
notifications: Notification[];
}
}
declare global {
/**
* A key/value map of active listeners (`install`/`activate`/`fetch`/etc).
*/
const listeners: makeServiceWorkerEnv.Listeners;
/**
* Used to trigger active listeners.
*/
function trigger(type: keyof ServiceWorkerGlobalScopeEventMap): Promise<void>;
function trigger(name: "fetch", request: string | Request): Promise<void>;
function trigger(name: "notificationclick" | "notificationclose", args: Notification): Promise<void>;
function trigger(name: "push", args: Partial<PushEvent>): Promise<void>;
function trigger(name: "message", args: Partial<MessageEvent>): Promise<void>;
/**
* Used to generate a snapshot of the service worker internals.
*/
function snapshot(): makeServiceWorkerEnv.Snapshot;
interface WorkerGlobalScope {
listeners: typeof listeners;
trigger: typeof trigger;
snapshot: typeof snapshot;
}
}
````
### Additional Details
* Last updated: Mon, 25 Sep 2023 13:39:06 GMT
* Dependencies: none

@@ -17,2 +81,2 @@ * Global values: none

# Credits
These definitions were written by Remco Haszing <https://github.com/remcohaszing>.
These definitions were written by [Remco Haszing](https://github.com/remcohaszing).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc