Skip to content

Commit ebd427a

Browse files
committed
Use default lib for the SDK
1 parent 3413fb3 commit ebd427a

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

packages/sdk/src/encryption/RSAKeyPair.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* @todo This file contains code for both browser and Node.js environments. Consider
3+
* making it environment-specific (using separate files or conditional exports), and
4+
* remove the following "dom" lib reference when done.
5+
*/
6+
/// <reference lib="dom" />
7+
18
import crypto from 'crypto'
29
import { promisify } from 'util'
310
import { KeyExchangeKeyPair } from './KeyExchangeKeyPair'

packages/sdk/src/identity/ECDSAKeyPairIdentity.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { hexToBinary, EcdsaSecp256r1 } from '@streamr/utils'
22
import { KeyPairIdentity } from './KeyPairIdentity'
33
import { SignatureType } from '@streamr/trackerless-network'
44
import { StrictStreamrClientConfig } from '../Config'
5+
import type { webcrypto } from 'crypto'
56

67
const signingUtil = new EcdsaSecp256r1()
78

@@ -10,7 +11,7 @@ const signingUtil = new EcdsaSecp256r1()
1011
*/
1112
export class ECDSAKeyPairIdentity extends KeyPairIdentity {
1213

13-
private cachedJWK: JsonWebKey | undefined
14+
private cachedJWK: webcrypto.JsonWebKey | undefined
1415

1516
assertValidKeyPair(): void {
1617
signingUtil.assertValidKeyPair(this.publicKey, this.privateKey)

packages/sdk/tsconfig.jest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "../../tsconfig.jest.json",
33
"compilerOptions": {
4-
"lib": ["es2021", "dom"],
54
"experimentalDecorators": true,
65
"emitDecoratorMetadata": true,
76
"noImplicitOverride": false

packages/sdk/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"compilerOptions": {
44
"outDir": "dist",
55
"declarationDir": "dist/types",
6-
"lib": ["es2021", "dom"],
76
"experimentalDecorators": true,
87
"emitDecoratorMetadata": true,
98
"noImplicitOverride": false

0 commit comments

Comments
 (0)