From 1c5b70fc1db8710c3bfb3e4c1a4aa583766cf19d Mon Sep 17 00:00:00 2001 From: Juanjo Date: Tue, 18 Jan 2022 11:03:31 +0100 Subject: [PATCH 1/2] Change Connection.type to ConnectionType from string --- types/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 60b6c26..6a91b98 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -45,7 +45,8 @@ interface Connection { * Connection.CELL * Connection.NONE */ - type: string; + type: ConnectionType; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } @@ -59,4 +60,4 @@ declare var Connection: { CELL_4G: string; CELL: string; NONE: string; -} \ No newline at end of file +} From 6d3e71cedce1462482cfcc7c6859a9832a3f3be4 Mon Sep 17 00:00:00 2001 From: Juanjo Date: Tue, 18 Jan 2022 11:04:10 +0100 Subject: [PATCH 2/2] Add dispatchEvent() to Navigator.Connection --- types/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 6a91b98..1718a16 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -45,8 +45,9 @@ interface Connection { * Connection.CELL * Connection.NONE */ - type: ConnectionType; - + type: ConnectionType; + dispatchEvent(): boolean; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; }