Skip to content

Commit 6e45bec

Browse files
committed
update parameter descriptions in README and definitions for param constraints
1 parent 03d6841 commit 6e45bec

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ generateShards(options: { totalShards: number; threshold: number; inputDataBase6
152152

153153
Splits secret data (Base64) into encrypted shards in memory.
154154

155-
| Param | Type | Description |
156-
| -------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
157-
| **`options`** | <code>{ totalShards: number; threshold: number; inputDataBase64: string; }</code> | totalShards, threshold, and inputDataBase64 (Base64-encoded secret) |
158-
| **`callback`** | <code>(data?: { progress: number; shardsBase64?: string[]; }, error?: <a href="#error">Error</a>) =&gt; void</code> | Reports progress and returns shards as Base64 strings |
155+
| Param | Type | Description |
156+
| -------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
157+
| **`options`** | <code>{ totalShards: number; threshold: number; inputDataBase64: string; }</code> | totalShards (≤255), threshold (≥2, ≤255), and inputDataBase64 (Base64-encoded secret) |
158+
| **`callback`** | <code>(data?: { progress: number; shardsBase64?: string[]; }, error?: <a href="#error">Error</a>) =&gt; void</code> | Reports progress and returns shards as Base64 strings |
159159

160160
--------------------
161161

@@ -186,7 +186,7 @@ Restores a specific shard from a set of encrypted shards (all in memory, Base64)
186186

187187
| Param | Type | Description |
188188
| -------------- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
189-
| **`options`** | <code>{ shardIndex: number; inputShardsBase64: string[]; }</code> | shardIndex and inputShardsBase64 |
189+
| **`options`** | <code>{ shardIndex: number; inputShardsBase64: string[]; }</code> | shardIndex (&gt;0, ≤255) and inputShardsBase64 |
190190
| **`callback`** | <code>(data?: { progress: number; dataBase64?: string; }, error?: <a href="#error">Error</a>) =&gt; void</code> | Reports progress and returns the requested shard as Base64 |
191191

192192
--------------------
@@ -200,10 +200,10 @@ generateFileShards(options: { totalShards: number; threshold: number; srcPath: s
200200

201201
Splits a file into encrypted shard files.
202202

203-
| Param | Type | Description |
204-
| -------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
205-
| **`options`** | <code>{ totalShards: number; threshold: number; srcPath: string; dstPathRoot: string; }</code> | totalShards, threshold, srcPath (input file), dstPathRoot (output directory) |
206-
| **`callback`** | <code>(data?: { progress: number; shardsPaths?: string[]; }, error?: <a href="#error">Error</a>) =&gt; void</code> | Reports progress and returns paths to shard files |
203+
| Param | Type | Description |
204+
| -------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
205+
| **`options`** | <code>{ totalShards: number; threshold: number; srcPath: string; dstPathRoot: string; }</code> | totalShards (≤255), threshold (≥2, ≤255), srcPath (input file), dstPathRoot (output directory) |
206+
| **`callback`** | <code>(data?: { progress: number; shardsPaths?: string[]; }, error?: <a href="#error">Error</a>) =&gt; void</code> | Reports progress and returns paths to shard files |
207207

208208
--------------------
209209

@@ -216,10 +216,10 @@ generateShardsToFiles(options: { totalShards: number; threshold: number; inputDa
216216

217217
Splits secret data (Base64) into encrypted shard files.
218218

219-
| Param | Type | Description |
220-
| -------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
221-
| **`options`** | <code>{ totalShards: number; threshold: number; inputDataBase64: string; dstPathRoot: string; }</code> | totalShards, threshold, inputDataBase64, dstPathRoot (output directory) |
222-
| **`callback`** | <code>(data?: { progress: number; shardsPaths?: string[]; }, error?: <a href="#error">Error</a>) =&gt; void</code> | Reports progress and returns paths to shard files |
219+
| Param | Type | Description |
220+
| -------------- | ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
221+
| **`options`** | <code>{ totalShards: number; threshold: number; inputDataBase64: string; dstPathRoot: string; }</code> | totalShards (≤255), threshold (≥2, ≤255), inputDataBase64, dstPathRoot (output directory) |
222+
| **`callback`** | <code>(data?: { progress: number; shardsPaths?: string[]; }, error?: <a href="#error">Error</a>) =&gt; void</code> | Reports progress and returns paths to shard files |
223223

224224
--------------------
225225

@@ -264,10 +264,10 @@ restoreFileShard(options: { shardIndex: number; shardsPaths: string[]; dstPathRo
264264

265265
Restores a specific shard file from a set of encrypted shard files.
266266

267-
| Param | Type | Description |
268-
| -------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
269-
| **`options`** | <code>{ shardIndex: number; shardsPaths: string[]; dstPathRoot: string; }</code> | shardIndex, shardsPaths (input files), dstPathRoot (output directory) |
270-
| **`callback`** | <code>(data?: { progress: number; shardPath?: string; }, error?: <a href="#error">Error</a>) =&gt; void</code> | Reports progress and returns the path to the restored shard file |
267+
| Param | Type | Description |
268+
| -------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
269+
| **`options`** | <code>{ shardIndex: number; shardsPaths: string[]; dstPathRoot: string; }</code> | shardIndex (&gt;0, ≤255), shardsPaths (input files), dstPathRoot (output directory) |
270+
| **`callback`** | <code>(data?: { progress: number; shardPath?: string; }, error?: <a href="#error">Error</a>) =&gt; void</code> | Reports progress and returns the path to the restored shard file |
271271

272272
--------------------
273273

src/definitions.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export interface ShamirPlugin {
22
/**
33
* Splits secret data (Base64) into encrypted shards in memory.
4-
* @param options totalShards, threshold, and inputDataBase64 (Base64-encoded secret)
4+
* @param options totalShards (≤255), threshold (≥2, ≤255), and inputDataBase64 (Base64-encoded secret)
55
* @param callback Reports progress and returns shards as Base64 strings
66
*/
77
generateShards(
@@ -21,7 +21,7 @@ export interface ShamirPlugin {
2121

2222
/**
2323
* Restores a specific shard from a set of encrypted shards (all in memory, Base64).
24-
* @param options shardIndex and inputShardsBase64
24+
* @param options shardIndex (>0, ≤255) and inputShardsBase64
2525
* @param callback Reports progress and returns the requested shard as Base64
2626
*/
2727
restoreShard(
@@ -31,7 +31,7 @@ export interface ShamirPlugin {
3131

3232
/**
3333
* Splits a file into encrypted shard files.
34-
* @param options totalShards, threshold, srcPath (input file), dstPathRoot (output directory)
34+
* @param options totalShards (≤255), threshold (≥2, ≤255), srcPath (input file), dstPathRoot (output directory)
3535
* @param callback Reports progress and returns paths to shard files
3636
*/
3737
generateFileShards(
@@ -41,7 +41,7 @@ export interface ShamirPlugin {
4141

4242
/**
4343
* Splits secret data (Base64) into encrypted shard files.
44-
* @param options totalShards, threshold, inputDataBase64, dstPathRoot (output directory)
44+
* @param options totalShards (≤255), threshold (≥2, ≤255), inputDataBase64, dstPathRoot (output directory)
4545
* @param callback Reports progress and returns paths to shard files
4646
*/
4747
generateShardsToFiles(
@@ -71,7 +71,7 @@ export interface ShamirPlugin {
7171

7272
/**
7373
* Restores a specific shard file from a set of encrypted shard files.
74-
* @param options shardIndex, shardsPaths (input files), dstPathRoot (output directory)
74+
* @param options shardIndex (>0, ≤255), shardsPaths (input files), dstPathRoot (output directory)
7575
* @param callback Reports progress and returns the path to the restored shard file
7676
*/
7777
restoreFileShard(

0 commit comments

Comments
 (0)