reaxes-utils 2.0.5 → 2.0.8

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/changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.0.8
2
+ Fixed d.ts declaration in package.json
3
+ # 2.0.6
4
+ Fixed types
1
5
  # 2.0.5
2
6
  * Fixed obsReaction disposer.
3
7
  # 2.0.4
package/package.json CHANGED
@@ -1,22 +1,16 @@
1
1
  {
2
2
  "name": "reaxes-utils",
3
- "version": "2.0.5",
3
+ "version": "2.0.8",
4
4
  "main": "esm/index.js",
5
5
  "module": "esm/index.js",
6
6
  "exports": {
7
7
  ".": {
8
- "import": "./esm/index.js"
8
+ "import": "./esm/index.js",
9
+ "types": "./types/index.d.ts"
9
10
  },
10
11
  "./react-hooks": {
11
- "import": "./esm/react-hooks/index.js"
12
+ "import": "./esm/react-hooks/index.js",
13
+ "types": "./types/react-hooks/index.d.ts"
12
14
  }
13
- },
14
- "typesVersions": {
15
- "*": {
16
- "react-hooks": [
17
- "./types/react-hooks/index.d.ts"
18
- ]
19
- }
20
- },
21
- "types": "./types/index.d.ts"
15
+ }
22
16
  }
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ export declare const If: {
3
+ ({ children, condition }: {
4
+ children: any;
5
+ condition: any;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ Else: () => any;
8
+ };
9
+ export declare const Else: () => any;
10
+ type Switch = React.FunctionComponent<{
11
+ children: any;
12
+ target: any;
13
+ }> & {
14
+ Case: Function;
15
+ Default: Function;
16
+ };
17
+ export declare const Switch: Switch;
18
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const assert: <Expect extends unknown, List extends any[]>(expected: Expect, expressionList: List, consoleWarn?: boolean) => boolean;
2
+ export declare const assertTrue: (array: any, consoleWarn?: boolean) => boolean;
3
+ export declare const assertFalse: (array: any, consoleWarn?: boolean) => boolean;
4
+ export declare const assert1of: <Expected extends unknown, ExpressionList extends any[]>(expected: Expected, expressionList: ExpressionList, consoleWarn?: boolean) => boolean;
5
+ export declare const assert1ofTrue: (expressionList: any, consoleWarn?: boolean) => boolean;
6
+ export declare const assert1ofFalse: (expressionList: any, consoleWarn?: boolean) => boolean;
@@ -0,0 +1 @@
1
+ export declare const asyncCall: <T extends Function>(callback: T) => void;
@@ -0,0 +1,9 @@
1
+ type crayon = ((css: Partial<CSSStyleDeclaration>) => (...logs: any[]) => void) & {
2
+ [key in 'trace' | 'warn' | 'log' | 'info' | 'error' | 'debug' | 'assert' | 'clear' | 'count' | 'countReset' | 'dir' | 'dirxml' | 'table']: ((...any: any[]) => any) & {
3
+ [key in string]: (...any: any[]) => any;
4
+ };
5
+ } & {
6
+ [key in string]: (...any: any[]) => any;
7
+ };
8
+ export declare const crayon: crayon;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ export * from './xImport';
2
+ export * from './xPromise';
3
+ export * from './shallowequal.utility';
4
+ export * from './asyncCall.utility';
5
+ export * from './crayon.utility';
6
+ export * from './makePair.utility';
7
+ export * from './timer.utility';
8
+ export * from './queryString.utility';
9
+ export * from './assert-group.utility';
@@ -0,0 +1 @@
1
+ export declare const makePair: <I, F extends (value: I) => any>(value: I, ...callbacks: F[]) => [I, ...ReturnType<F>[]];
@@ -0,0 +1,6 @@
1
+ type ret = {
2
+ [p: string]: string;
3
+ };
4
+ export declare const decodeQueryString: <result extends ret>(str?: string) => ret;
5
+ export declare const encodeQueryString: (source: object) => string;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './useForceUpdate';
2
+ export * from './useStateWithCallback';
@@ -0,0 +1 @@
1
+ export declare const useForceUpdate: () => () => void;
@@ -0,0 +1,4 @@
1
+ export declare function useStateWithCallback<T>(initialState: T): [T, SetStateWithCallback<T>];
2
+ type SetStateWithCallback<T> = (newState: SetStateAction<T>, callback?: (state: T) => void) => void;
3
+ import { SetStateAction } from 'react';
4
+ export {};
@@ -0,0 +1 @@
1
+ export declare function shallowEqual(objA: any, objB: any, compare?: any, compareContext?: any): boolean;
@@ -0,0 +1,14 @@
1
+ export declare const Timer: {
2
+ new (): {
3
+ "__#1@#subscribeList": any[];
4
+ "__#1@#currentTime": number;
5
+ "__#1@#interval": any;
6
+ "__#1@#currentTimeout": any;
7
+ "__#1@#status": boolean;
8
+ start: (time: any) => void | any;
9
+ subscribe(callback: any): any;
10
+ unsubscribe(callback: any): any;
11
+ destroy(): void;
12
+ stop(): any;
13
+ };
14
+ };
@@ -0,0 +1 @@
1
+ export declare const xImport: <T extends { [p in keyof T]: T[p]; }>(imports: T) => Promise<{ [p_1 in keyof T]: Awaited<T[p_1]>; }>;
@@ -0,0 +1,8 @@
1
+ export declare const xPromise: <T>(callback?: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => Promise<T> & {
2
+ resolve: (value: T | PromiseLike<T>) => void;
3
+ reject: (reason?: any) => void;
4
+ };
5
+ export type XPromise<T = any> = Promise<T> & {
6
+ resolve: (value: T) => void;
7
+ reject: (reason: any) => void;
8
+ };