@chocbite/ts-lib-state 1.0.1 → 1.0.3

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +12 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -360,8 +360,12 @@ declare abstract class StateBase<RT, WT, REL extends Option<StateRelated>, RRT e
360
360
  * @template RT - The type of the state’s value when read.
361
361
  * @template REL - The type of related states, defaults to an empty object.*/
362
362
  interface StateResourceOwnerREA<RT, WT, REL extends Option<StateRelated>> {
363
+ /**Updates the resource and fulfills all promises for value
364
+ * @param update if true, also updates the buffer and notifies subscribers, otherwise only fulfills the promises for single gets*/
363
365
  update_single(value: Result<RT, string>, update?: boolean): void;
366
+ /**Updates the resource subscribers and buffer with the given value*/
364
367
  update_resource(value: Result<RT, string>): void;
368
+ /**Gets the current buffer value*/
365
369
  get buffer(): Result<RT, string> | undefined;
366
370
  get state(): State<RT, WT, REL>;
367
371
  get read_only(): StateREA<RT, REL, WT>;
@@ -415,7 +419,10 @@ type StateResourceFuncREA<RT, REL extends Option<StateRelated> = Option<{}>, WT
415
419
  * @template WT - The type which can be written to the state.
416
420
  * @template REL - The type of related states, defaults to an empty object.*/
417
421
  interface StateResourceOwnerREAWA<RT, WT, REL extends Option<StateRelated>> {
422
+ /**Updates the resource and fulfills all promises for value
423
+ * @param update if true, also updates the buffer and notifies subscribers, otherwise only fulfills the promises for single gets*/
418
424
  update_single(value: Result<RT, string>, update?: boolean): void;
425
+ /**Updates the resource subscribers and buffer with the given value*/
419
426
  update_resource(value: Result<RT, string>): void;
420
427
  get buffer(): Result<RT, string> | undefined;
421
428
  get state(): State<RT, WT, REL>;
@@ -479,7 +486,10 @@ type StateResourceFuncREAWA<RT, REL extends Option<StateRelated> = Option<{}>, W
479
486
  * @template RT - The type of the state’s value when read.
480
487
  * @template REL - The type of related states, defaults to an empty object.*/
481
488
  interface StateResourceOwnerROA<RT, WT, REL extends Option<StateRelated>> {
489
+ /**Updates the resource and fulfills all promises for value
490
+ * @param update if true, also updates the buffer and notifies subscribers, otherwise only fulfills the promises for single gets*/
482
491
  update_single(value: ResultOk<RT>, update?: boolean): void;
492
+ /**Updates the resource subscribers and buffer with the given value*/
483
493
  update_resource(value: ResultOk<RT>): void;
484
494
  get buffer(): ResultOk<RT> | undefined;
485
495
  get state(): State<RT, WT, REL>;
@@ -552,6 +562,8 @@ interface StateNumberRelated extends StateRelated {
552
562
  max?: number;
553
563
  unit?: string;
554
564
  decimals?: number;
565
+ step?: number;
566
+ start?: number;
555
567
  }
556
568
  declare class StateNumberHelper implements StateNumberRelated, StateHelper<number, OptionSome<StateNumberRelated>> {
557
569
  min: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chocbite/ts-lib-state",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "State management library for TypeScript",
5
5
  "author": "chocolateandmilkwin",
6
6
  "license": "MIT",