Skip to content

Commit

Permalink
Merge pull request #14 from muhammed-shaheer-keerirakath/main
Browse files Browse the repository at this point in the history
✅ Added type declarations for the JS library exports
  • Loading branch information
cyyber authored Jul 25, 2024
2 parents 3ca3f82 + 2456420 commit 024981f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@theqrl/wallet.js",
"version": "0.1.1",
"description": "",
"main": "src/dilithium.js",
"main": "src/index.js",
"types": "types/index.d.ts",
"scripts": {
"test": "mocha",
Expand Down
18 changes: 15 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
export * from './dilithium.js';
export * from './qrl/wordlist.js';
export * from './utils/mnemonic.js';
const dilithium = require('./dilithium.js');
const mnemonic = require('./utils/mnemonic.js');
const wordlist = require('./qrl/wordlist.js');

module.exports = {
Dilithium: dilithium.Dilithium,
extractMessage: dilithium.extractMessage,
extractSignature: dilithium.extractSignature,
getDilithiumAddressFromPK: dilithium.getDilithiumAddressFromPK,
getDilithiumDescriptor: dilithium.getDilithiumDescriptor,
isValidDilithiumAddress: dilithium.isValidDilithiumAddress,
MnemonicToSeedBin: mnemonic.MnemonicToSeedBin,
SeedBinToMnemonic: mnemonic.SeedBinToMnemonic,
WORD_LIST: wordlist.WordList,
};
14 changes: 11 additions & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
export * from "./dilithium.js";
export * from "./qrl/wordlist.js";
export * from "./utils/mnemonic.js";
import dilithium = require("./dilithium.js");
import mnemonic = require("./utils/mnemonic.js");
export let Dilithium: typeof dilithium.Dilithium;
export let extractMessage: typeof dilithium.extractMessage;
export let extractSignature: typeof dilithium.extractSignature;
export let getDilithiumAddressFromPK: typeof dilithium.getDilithiumAddressFromPK;
export let getDilithiumDescriptor: typeof dilithium.getDilithiumDescriptor;
export let isValidDilithiumAddress: typeof dilithium.isValidDilithiumAddress;
export let MnemonicToSeedBin: typeof mnemonic.MnemonicToSeedBin;
export let SeedBinToMnemonic: typeof mnemonic.SeedBinToMnemonic;
export let WORD_LIST: string[];
//# sourceMappingURL=index.d.ts.map

0 comments on commit 024981f

Please # to comment.