@chocbite/ts-lib-state 1.0.0 → 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/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>;
@@ -1427,4 +1437,4 @@ declare const state: {
1427
1437
  from_ws: <RT, WT = RT, REL extends _chocbite_ts_lib_result.Option<StateRelated> = _chocbite_ts_lib_result.Option<{}>>(this: void, init: RT, setter?: ((value: WT, state: OwnerWS$6<RT, _chocbite_ts_lib_result.Result<RT, string>, WT, REL>, old?: _chocbite_ts_lib_result.Result<RT, string> | undefined) => _chocbite_ts_lib_result.Result<void, string>) | true, helper?: StateHelper<WT, REL>) => StateSyncRESWS<RT, WT, REL>;
1428
1438
  };
1429
1439
 
1430
- export { type State, type StateArray, type StateArrayREA, type StateArrayREAWA, type StateArrayREAWS, type StateArrayRES, type StateArrayRESWA, type StateArrayRESWS, type StateArrayROA, type StateArrayROAWA, type StateArrayROAWS, type StateArrayROS, type StateArrayROSWA, type StateArrayROSWS, type StateArrayRead, StateArrayReadType, type StateArraySyncRES, type StateArraySyncRESWS, type StateArraySyncROS, type StateArraySyncROSWS, type StateArrayWrite, type StateCollectedREA, type StateCollectedRES, type StateCollectedROA, type StateCollectedROS, type StateDelayedREA, type StateDelayedREAWA, type StateDelayedREAWS, type StateDelayedROA, type StateDelayedROAWA, type StateDelayedROAWS, StateEnumHelper, type StateEnumRelated, type StateInferResult, type StateInferSub, type StateInferType, type StateLazyRES, type StateLazyRESWS, type StateLazyROS, type StateLazyROSWS, StateNumberHelper, type StateNumberRelated, type StateProxyREA, type StateProxyREAWA, type StateProxyREAWS, type StateProxyRES, type StateProxyRESWA, type StateProxyRESWS, type StateProxyROA, type StateProxyROAWA, type StateProxyROAWS, type StateProxyROS, type StateProxyROSWA, type StateProxyROSWS, type StateREA, type StateREAWA, type StateREAWS, type StateRES, type StateRESWA, type StateRESWS, type StateROA, type StateROAWA, type StateROAWS, type StateROS, type StateROSWA, type StateROSWS, type StateResourceFuncREA, type StateResourceFuncREAWA, type StateResourceFuncROA, StateResourceREA, StateResourceREAWA, StateResourceROA, StateStringHelper, type StateStringRelated, type StateSub, type StateSyncRES, type StateSyncRESWS, type StateSyncROS, type StateSyncROSWS, state };
1440
+ export { type State, type StateArray, type StateArrayREA, type StateArrayREAWA, type StateArrayREAWS, type StateArrayRES, type StateArrayRESWA, type StateArrayRESWS, type StateArrayROA, type StateArrayROAWA, type StateArrayROAWS, type StateArrayROS, type StateArrayROSWA, type StateArrayROSWS, type StateArrayRead, StateArrayReadType, type StateArraySyncRES, type StateArraySyncRESWS, type StateArraySyncROS, type StateArraySyncROSWS, type StateArrayWrite, type StateCollectedREA, type StateCollectedRES, type StateCollectedROA, type StateCollectedROS, type StateDelayedREA, type StateDelayedREAWA, type StateDelayedREAWS, type StateDelayedROA, type StateDelayedROAWA, type StateDelayedROAWS, StateEnumHelper, type StateEnumRelated, type StateInferResult, type StateInferSub, type StateInferType, type StateLazyRES, type StateLazyRESWS, type StateLazyROS, type StateLazyROSWS, StateNumberHelper, type StateNumberRelated, type StateProxyREA, type StateProxyREAWA, type StateProxyREAWS, type StateProxyRES, type StateProxyRESWA, type StateProxyRESWS, type StateProxyROA, type StateProxyROAWA, type StateProxyROAWS, type StateProxyROS, type StateProxyROSWA, type StateProxyROSWS, type StateREA, type StateREAWA, type StateREAWS, type StateRES, type StateRESWA, type StateRESWS, type StateROA, type StateROAWA, type StateROAWS, type StateROS, type StateROSWA, type StateROSWS, type StateResourceFuncREA, type StateResourceFuncREAWA, type StateResourceFuncROA, StateResourceREA, StateResourceREAWA, StateResourceROA, StateStringHelper, type StateStringRelated, type StateSub, type StateSyncRES, type StateSyncRESWS, type StateSyncROS, type StateSyncROSWS, state as default, state };
package/dist/index.js CHANGED
@@ -3690,9 +3690,11 @@ var state = {
3690
3690
  err_ws: STATE_SYNC.res_ws.err,
3691
3691
  from_ws: STATE_SYNC.res_ws.ok
3692
3692
  };
3693
+ var index_default = state;
3693
3694
  export {
3694
3695
  StateEnumHelper,
3695
3696
  StateNumberHelper,
3696
3697
  StateStringHelper,
3698
+ index_default as default,
3697
3699
  state
3698
3700
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chocbite/ts-lib-state",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "State management library for TypeScript",
5
5
  "author": "chocolateandmilkwin",
6
6
  "license": "MIT",