Skip to content

Commit 92e2ed1

Browse files
Also enable types in dist
1 parent 121f20b commit 92e2ed1

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

dist/e.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import * as R from "react";
2+
declare const _default: typeof R.useLayoutEffect;
3+
export default _default;

dist/e.native.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import * as R from "react";
2+
declare const _default: typeof R.useLayoutEffect;
3+
export default _default;

dist/index.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export interface StateWithValue<T> {
2+
use: () => [
3+
T,
4+
(newState: T | ((prev: T) => T), ac?: (newState: T) => void) => void
5+
];
6+
useValue: () => T;
7+
get: () => T;
8+
useSelector: <TSelected = unknown>(selector: (state: T) => TSelected, equalityFn?: Comparator<TSelected>) => TSelected;
9+
set: (newState: T | ((prev: T) => T), ac?: (newState: T) => void, ca?: (ns: T) => void) => void;
10+
reset: () => void;
11+
}
12+
interface Options<T> {
13+
onSet?: (newState: T, prevState: T) => any;
14+
}
15+
declare type Comparator<TSelected = unknown> = (a: TSelected, b: TSelected) => boolean;
16+
export declare function newRidgeState<T>(iv: T, o?: Options<T>): StateWithValue<T>;
17+
export {};

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-ridge-state",
3-
"version": "4.2.0",
3+
"version": "4.2.1",
44
"description": "react-ridge-state is a very simple global state management library for React and React Native",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -10,7 +10,7 @@
1010
"scripts": {
1111
"mocha": "mocha -r jsdom-global/register -r ts-node/register tests/**/*.mocha.tsx",
1212
"jest": "jest --maxWorkers=150",
13-
"build": "tsc --noEmit && npx esbuild ./src/* --outdir=dist --minify"
13+
"build": "tsc && npx esbuild ./src/* --outdir=dist --minify"
1414
},
1515
"devDependencies": {
1616
"@babel/plugin-transform-runtime": "^7.13.10",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"declaration": true,
66
"outDir": "./dist",
77
"removeComments": true,
8-
"jsx": "react"
8+
"jsx": "react",
9+
"emitDeclarationOnly": true
910
},
1011
"include": ["src/*"]
1112
}

0 commit comments

Comments
 (0)