Commit fe18df1
authored
refactor: Drop
This PR removes `"dom"` from SDK's TypeScript `lib` configuration to
avoid pulling browser-specific types into the default scope. The SDK is
not primarily a browser environment, and having DOM types globally
available was masking environment boundaries and weakening type safety.
The remaining changes are necessary follow-ups to keep the codebase
compiling and to make environment assumptions more explicit.
### Changes
**TypeScript configuration:**
* Removed `"dom"` from the `lib` array in both `tsconfig.json` and
`tsconfig.jest.json` to better reflect the intended runtime environment
and prevent accidental reliance on browser-only APIs.
**Type safety and cryptographic key handling:**
* Updated `cachedJWK` in `ECDSAKeyPairIdentity` from `JsonWebKey` to
`webcrypto.JsonWebKey`.
* Explicitly imported the `webcrypto` type from Node’s `crypto` module
to avoid relying on DOM-provided global types and to clarify the source
of the API.
This ensures cryptographic types are correctly scoped and remain
available after removing the DOM lib.
**Documentation and environment targeting:**
* Added a `@todo` comment and a local `dom` lib reference in
`RSAKeyPair.ts` to document that the file currently mixes browser and
Node.js code.
* This makes the environment dependency explicit and flags the file for
future refactoring into environment-specific implementations."dom" lib from SDK's TypeScript config and clarify environment usage (#3303)1 parent 3413fb3 commit fe18df1
File tree
4 files changed
+11
-3
lines changed- packages/sdk
- src
- encryption
- identity
4 files changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
1 | 8 | | |
2 | 9 | | |
3 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments