Skip to content

Commit

Permalink
fixed share types
Browse files Browse the repository at this point in the history
  • Loading branch information
HillLiu committed Dec 27, 2024
1 parent 402336d commit 1978d4b
Show file tree
Hide file tree
Showing 4 changed files with 371 additions and 436 deletions.
3 changes: 2 additions & 1 deletion packages/reshow-constant/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.17.14",
"version": "0.18.0",
"name": "reshow-constant",
"repository": {
"type": "git",
Expand All @@ -15,6 +15,7 @@
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.x",
"@types/react": "*",
"reshow-unit-dom": "*"
},
"exports": {
Expand Down
9 changes: 7 additions & 2 deletions packages/reshow-constant/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

/**
* @template T
* @typedef {React.Dispatch<React.SetStateAction<T>>} SetStateAction
* @typedef {import("react").SetStateAction<T>} SetStateAction
*/

/**
* @template T
* @typedef {[T, SetStateAction<T>]} useState
* @typedef {import("react").Dispatch<SetStateAction<T>>} DispatchSetStateAction
*/

/**
* @template T
* @typedef {[T, DispatchSetStateAction<T>]} useState
*/

/**
Expand Down
18 changes: 13 additions & 5 deletions packages/reshow-constant/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/**
* @template T
* @typedef {React.Dispatch<React.SetStateAction<T>>} SetStateAction
* @typedef {import("react").SetStateAction<T>} SetStateAction
*/
/**
* @template T
* @typedef {[T, SetStateAction<T>]} useState
* @typedef {import("react").Dispatch<SetStateAction<T>>} DispatchSetStateAction
*/
/**
* @template T
* @typedef {[T, DispatchSetStateAction<T>]} useState
*/
/**
* Basic type
Expand All @@ -31,13 +35,17 @@ export const T_UNDEFINED: undefined;
export const T_NULL: null;
export const T_TRUE: true;
export const T_FALSE: false;
export const KEYS: (o: object) => string[];
export const KEYS: {
(o: object): string[];
(o: {}): string[];
};
export const IS_ARRAY: (arg: any) => arg is any[];
export function OBJ_SIZE(o?: (object | (string | null)) | undefined): number;
export function NEW_OBJ(): any;
export function HAS(obj: object | undefined | null, key?: (string | null) | undefined): boolean;
export const REAL_TIME_URL: "--rtime-url--";
export const REAL_TIME_DATA_KEY: "--rtime-data--";
export type SetStateAction<T> = React.Dispatch<React.SetStateAction<T>>;
export type useState<T> = [T, SetStateAction<T>];
export type SetStateAction<T> = import("react").SetStateAction<T>;
export type DispatchSetStateAction<T> = import("react").Dispatch<SetStateAction<T>>;
export type useState<T> = [T, DispatchSetStateAction<T>];
export type SAFE_UNDEFINED = undefined | null | false | 0;
Loading

0 comments on commit 1978d4b

Please sign in to comment.