seed-words 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/BUILD.md ADDED
@@ -0,0 +1,7 @@
1
+ ## Generating Typescript Definitions
2
+
3
+ npx -p typescript tsc seedwords.js --declaration --allowJs --emitDeclarationOnly --outDir dist
4
+
5
+ ## Generating README.md
6
+
7
+ jsdoc2md seedwords.js >README.md
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The initialize function has to be called before attempting to invoke any other function. This function should be called only once.
3
+ *
4
+ * @async
5
+ * @function initialize
6
+ * @return {Promise<boolean>} Returns a promise of type boolean; true if the initialization succeeded, else false.
7
+ */
8
+ export function initialize(): Promise<boolean>;
9
+ /**
10
+ * The getWordListFromSeedArray function returns the word list corresponding to a byte array.
11
+ *
12
+ * @function getWordListFromSeedArray
13
+ * @param {array} seedArray - An array of bytes. This array should have an even number of elements.
14
+ * @return {array} Returns the array of words (string) corresponding to the input seed array. Returns null on failure. This function can fail if the seedArray is invalid or initialize() hasn't been called.
15
+ */
16
+ export function getWordListFromSeedArray(seedArray: any[]): any[];
17
+ /**
18
+ * The doesSeedWordExist function returns the word list corresponding to a byte array.
19
+ *
20
+ * @function doesSeedWordExist
21
+ * @param {string} word - A seed word to find whether it exists in the list or not.
22
+ * @return {boolean} Returns true if the seed word exists. Returns false if it doesn't exist. Returns null on failure. This function can fail if initialize() function was not called.
23
+ */
24
+ export function doesSeedWordExist(word: string): boolean;
25
+ /**
26
+ * The getAllSeedWords function returns all the seed words in an array.
27
+ *
28
+ * @function getAllSeedWords
29
+ * @return {array} Returns an array with the list of all seed words.
30
+ */
31
+ export function getAllSeedWords(): any[];
32
+ /**
33
+ * The getSeedArrayFromWordList function a byte array that corresponds to the seed word list.
34
+ *
35
+ * @function getSeedArrayFromWordList
36
+ * @param {array} wordList - An array of seed words.
37
+ * @return {array} Returns an array of bytes that correspond to the wordList. Returns null on failure. This function can fail if initialize() function was not called or the word doesn't exist.
38
+ */
39
+ export function getSeedArrayFromWordList(wordList: any[]): any[];
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "seed-words",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Seed Words JS SDK",
5
5
  "main": "seedwords.js",
6
6
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "build": "npx -p typescript tsc seedwords.js --declaration --allowJs --emitDeclarationOnly --outDir dist && jsdoc2md seedwords.js >README.md"
8
9
  },
9
10
  "repository": {
10
11
  "type": "git",
package/tsconfig.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ // Change this to match your project
3
+ "include": ["seedwords.js"],
4
+ "compilerOptions": {
5
+ // Tells TypeScript to read JS files, as
6
+ // normally they are ignored as source files
7
+ "allowJs": true,
8
+ // Generate d.ts files
9
+ "declaration": true,
10
+ // This compiler run should
11
+ // only output d.ts files
12
+ "emitDeclarationOnly": true,
13
+ // Types should go into this directory.
14
+ // Removing this would place the .d.ts files
15
+ // next to the .js files
16
+ "outDir": "dist",
17
+ // go to js file when using IDE functions like
18
+ // "Go to Definition" in VSCode
19
+ "declarationMap": true
20
+ }
21
+ }