From 6704aeed49baa97e09f7d9f99fb32878a076034a Mon Sep 17 00:00:00 2001
From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Date: Wed, 16 Sep 2020 15:21:53 -0700
Subject: [PATCH] Type updates for TS 4.1
TS 4.1 changes the name of some DOM types. This PR updates those names.
---
types/baidumap-web-sdk/baidumap-web-sdk-tests.ts | 2 +-
types/baidumap-web-sdk/index.d.ts | 1 +
types/bmapgl/bmapgl-tests.ts | 2 +-
types/bmapgl/index.d.ts | 1 +
types/google.geolocation/google.geolocation-tests.ts | 4 ++--
types/google.geolocation/index.d.ts | 5 +++--
types/pkijs/index.d.ts | 5 +++--
types/rx-dom/index.d.ts | 5 +++--
8 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/types/baidumap-web-sdk/baidumap-web-sdk-tests.ts b/types/baidumap-web-sdk/baidumap-web-sdk-tests.ts
index 95d83ca0ae..232fb5521f 100644
--- a/types/baidumap-web-sdk/baidumap-web-sdk-tests.ts
+++ b/types/baidumap-web-sdk/baidumap-web-sdk-tests.ts
@@ -3,7 +3,7 @@ import "baidumap-web-sdk";
class TestFixture {
// document: http://lbsyun.baidu.com/index.php?title=jspopular3.0
createMap(container: string | HTMLElement) {
- navigator.geolocation.getCurrentPosition((position: Position) => {
+ navigator.geolocation.getCurrentPosition((position: GeolocationPosition) => {
const point = new BMap.Point(position.coords.longitude, position.coords.latitude);
const map = new BMap.Map(container);
map.centerAndZoom(point, 15);
diff --git a/types/baidumap-web-sdk/index.d.ts b/types/baidumap-web-sdk/index.d.ts
index 335207783a..66d98d8cde 100644
--- a/types/baidumap-web-sdk/index.d.ts
+++ b/types/baidumap-web-sdk/index.d.ts
@@ -3,6 +3,7 @@
// Definitions by: Codemonk
// ipcjs
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// Minimum TypeScript Version: 4.1
/* *****************************************************************************
Copyright [Codemonk] [Codemonk@live.cn]
diff --git a/types/bmapgl/bmapgl-tests.ts b/types/bmapgl/bmapgl-tests.ts
index 818757de2d..ea7da24ade 100644
--- a/types/bmapgl/bmapgl-tests.ts
+++ b/types/bmapgl/bmapgl-tests.ts
@@ -3,7 +3,7 @@ import "bmapgl";
class TestFixture {
// document: http://lbsyun.baidu.com/index.php?title=jspopularGL
createMap(container: string | HTMLElement) {
- navigator.geolocation.getCurrentPosition((position: Position) => {
+ navigator.geolocation.getCurrentPosition((position: GeolocationPosition) => {
const point = new BMapGL.Point(position.coords.longitude, position.coords.latitude);
const map = new BMapGL.Map(container);
map.centerAndZoom(point, 15);
diff --git a/types/bmapgl/index.d.ts b/types/bmapgl/index.d.ts
index 507025bd87..33319df043 100644
--- a/types/bmapgl/index.d.ts
+++ b/types/bmapgl/index.d.ts
@@ -2,6 +2,7 @@
// Project: http://lbsyun.baidu.com/index.php?title=jspopularGL
// Definitions by: Junior2ran
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// Minimum TypeScript Version: 4.1
/* *****************************************************************************
Copyright [Junior2ran] [hdr01@126.com]
diff --git a/types/google.geolocation/google.geolocation-tests.ts b/types/google.geolocation/google.geolocation-tests.ts
index ed097def1f..a1a25774ee 100644
--- a/types/google.geolocation/google.geolocation-tests.ts
+++ b/types/google.geolocation/google.geolocation-tests.ts
@@ -9,10 +9,10 @@ if(isInit){
alert("Functionality not available");
}
-function success_callback(position: Position): void {
+function success_callback(position: GeolocationPosition): void {
geo_position_js.showMap(position.coords.latitude, position.coords.longitude);
}
-function error_callback(positionError: PositionError): void {
+function error_callback(positionError: GeolocationPositionError): void {
console.log(positionError.code);
}
diff --git a/types/google.geolocation/index.d.ts b/types/google.geolocation/index.d.ts
index 6793eb1547..954559b25a 100644
--- a/types/google.geolocation/index.d.ts
+++ b/types/google.geolocation/index.d.ts
@@ -1,11 +1,12 @@
// Type definitions for Google Geolocation 0.4.8
// Project: https://code.google.com/p/geo-location-javascript/
// Definitions by: Vincent Bortone
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// Minimum TypeScript Version: 4.1
interface GeolocationStatic {
init(): boolean;
- getCurrentPosition(success: (position: Position) => void, error?: (positionError: PositionError) => void, opts?: PositionOptions): void;
+ getCurrentPosition(success: (position: GeolocationPosition) => void, error?: (positionError: GeolocationPositionError) => void, opts?: PositionOptions): void;
showMap(latitude: number, longitude: number): void;
}
diff --git a/types/pkijs/index.d.ts b/types/pkijs/index.d.ts
index 939d0e35f1..9f8f1cf133 100644
--- a/types/pkijs/index.d.ts
+++ b/types/pkijs/index.d.ts
@@ -2,6 +2,7 @@
// Project: https://github.com/PeculiarVentures/PKI.js
// Definitions by: Stepan Miroshin
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+// Minimum TypeScript Version: 4.1
///
///
@@ -662,8 +663,8 @@ declare module "pkijs/src/CryptoEngine" {
verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise;
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): Promise;
decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): Promise;
- deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise;
- deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): Promise;
+ deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise;
+ deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): Promise;
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise;
encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): Promise;
}
diff --git a/types/rx-dom/index.d.ts b/types/rx-dom/index.d.ts
index 9b612021af..9f4530313e 100644
--- a/types/rx-dom/index.d.ts
+++ b/types/rx-dom/index.d.ts
@@ -2,6 +2,7 @@
// Project: https://github.com/Reactive-Extensions/RxJS-DOM
// Definitions by: oliver Weichhold
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+// Minimum TypeScript Version: 4.1
import * as Rx from 'rx';
@@ -132,8 +133,8 @@ declare module 'rx' {
// Geolocation
namespace geolocation {
- function getCurrentPosition(geolocationOptions?: GeolocationOptions): Rx.Observable;
- function watchPosition(geolocationOptions?: GeolocationOptions): Rx.Observable;
+ function getCurrentPosition(geolocationOptions?: GeolocationOptions): Rx.Observable;
+ function watchPosition(geolocationOptions?: GeolocationOptions): Rx.Observable;
}
}
}