vast 1.0.6 → 1.0.9

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/package.json +4 -2
  2. package/types/vast.d.ts +8 -11
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.6",
2
+ "version": "1.0.9",
3
3
  "license": "MIT",
4
4
  "main": "./dist/cjs/vast.js",
5
5
  "types": "./types/vast.d.ts",
@@ -41,5 +41,7 @@
41
41
  },
42
42
  "./package.json": "./package.json",
43
43
  "./": "./"
44
- }
44
+ },
45
+ "unpkg": "./dist/umd/vast.production.js",
46
+ "jsdelivr": "./dist/umd/vast.production.js"
45
47
  }
package/types/vast.d.ts CHANGED
@@ -1,13 +1,10 @@
1
- declare function createState(onStateChange?: (...args: unknown[]) => unknown): TCreateStateReturn;
2
- type TStateInput<S> = S | ((prevState?: S) => S);
3
- type TSetStateInput<S> = S | ((prevState: S) => S);
4
- type TState = ReturnType<typeof createState>;
5
- type TStateHandlerReturn<S> = [
6
- S,
7
- (nextState: TSetStateInput<S>) => void
8
- ];
9
- type TCreateStateReturn = {
1
+ declare function createState(onStateChange?: (...args: unknown[]) => unknown): CreateStateReturn;
2
+ type StateInput<S> = S | ((prevState?: S) => S);
3
+ type SetStateInput<S> = S | ((prevState: S) => S);
4
+ type State = ReturnType<typeof createState>;
5
+ type StateHandlerReturn<S> = [S, (nextState: SetStateInput<S>) => void];
6
+ type CreateStateReturn = {
10
7
  reset: () => void;
11
- registerStateKey: <S>(initialState?: TStateInput<S> | undefined, onUpdate?: (() => void) | undefined) => () => TStateHandlerReturn<S>;
8
+ registerStateKey: <S>(initialState?: StateInput<S> | undefined, onUpdate?: (() => void) | undefined) => () => StateHandlerReturn<S>;
12
9
  };
13
- export { createState, TState, TStateHandlerReturn };
10
+ export { createState, State, StateHandlerReturn };