Skip to content

Commit

Permalink
fix: upgrade typescript and fix type exports on default export
Browse files Browse the repository at this point in the history
  • Loading branch information
nikgraf committed Nov 30, 2023
1 parent d9451a1 commit 8474de9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"react-native": "0.71.6",
"react-native-builder-bob": "^0.20.0",
"release-it": "^15.0.0",
"typescript": "^4.5.2"
"typescript": "^5.3.2"
},
"resolutions": {
"@types/react": "17.0.21"
Expand Down
30 changes: 30 additions & 0 deletions src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ export type {
StringSecretBox,
Uint8ArrayOutputFormat,
} from 'libsodium-wrappers';
import type {
CryptoBox,
CryptoKX,
KeyPair,
KeyType,
MessageTag,
SecretBox,
StateAddress,
StringCryptoBox,
StringCryptoKX,
StringKeyPair,
StringMessageTag,
StringOutputFormat,
StringSecretBox,
Uint8ArrayOutputFormat,
} from 'libsodium-wrappers';
import * as hkdf from '@noble/hashes/hkdf';
import { sha256 } from '@noble/hashes/sha256';

Expand All @@ -28,6 +44,20 @@ let lib: typeof import('libsodium-wrappers');
// @ts-expect-error this is a proxy and basically can fail if loading is not complete
let sodium: typeof import('libsodium-wrappers') & {
loadSumoVersion: () => void;
CryptoBox: CryptoBox;
CryptoKX: CryptoKX;
KeyPair: KeyPair;
KeyType: KeyType;
MessageTag: MessageTag;
SecretBox: SecretBox;
StateAddress: StateAddress;
StringCryptoBox: StringCryptoBox;
StringCryptoKX: StringCryptoKX;
StringKeyPair: StringKeyPair;
StringMessageTag: StringMessageTag;
StringOutputFormat: StringOutputFormat;
StringSecretBox: StringSecretBox;
Uint8ArrayOutputFormat: Uint8ArrayOutputFormat;
} = new Proxy(
{},
{
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"importsNotUsedAsValues": "error",
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["esnext"],
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9707,16 +9707,16 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==

typescript@^4.5.2:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==

"typescript@^4.6.4 || ^5.0.0":
version "5.0.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==

typescript@^5.3.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.2.tgz#00d1c7c1c46928c5845c1ee8d0cc2791031d4c43"
integrity sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==

uglify-es@^3.1.9:
version "3.3.9"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"
Expand Down

0 comments on commit 8474de9

Please sign in to comment.