@rainte/js 0.0.40 → 0.0.42

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.
@@ -1,2 +1,2 @@
1
- export declare const flattenTree: (tree: any[], prop?: string) => any;
2
- export declare const findByValue: (list: any[], value: any, prop?: string) => any;
1
+ export declare const flattenTree: <T = any>(tree: T[], prop?: string) => Omit<T, typeof prop>[];
2
+ export declare const findByValue: <T = any>(list: T[], value: any, prop?: string) => T | undefined;
@@ -9,5 +9,5 @@ export declare class SubDexie extends Dexie {
9
9
  constructor();
10
10
  }
11
11
  export declare const db: SubDexie;
12
- export declare const get: (key: string, raw?: boolean) => import("dexie").PromiseExtended<any>;
12
+ export declare const get: <T = any>(key: string, raw?: boolean) => Promise<T | undefined>;
13
13
  export declare const set: (key: string, value: any) => Promise<any>;
@@ -1,5 +1,5 @@
1
1
  export declare const ACCESS_TOKEN = "access_token";
2
- export declare const message: (data: any, text?: string) => any;
2
+ export declare const message: <T = string>(data: any, text?: string) => T;
3
3
  export declare const axios: import("axios").AxiosInstance;
4
4
  export declare const tokenRequestInterceptor: () => number;
5
5
  export declare const responseInterceptor: (onRejected?: ((error: any) => any) | null) => number;
@@ -1,3 +1,3 @@
1
1
  import { Options } from 'jsan';
2
2
  export declare const stringify: (value?: unknown, replacer?: (key: string, value: unknown) => unknown | Array<number | string> | null, space?: string | number, _options?: Options | boolean) => string;
3
- export declare const parse: (text: string, reviver?: (key: string, value: unknown) => unknown) => any;
3
+ export declare const parse: <T = any>(text: string, reviver?: (key: string, value: unknown) => unknown) => T;
@@ -1,9 +1,9 @@
1
1
  declare class Cache {
2
2
  private storage?;
3
3
  constructor(storage?: Storage);
4
- getRaw(key: string, defaultValue?: any): any;
4
+ getRaw(key: string, defaultValue?: string | null): string | null;
5
5
  setRaw(key: string, value: string): void;
6
- get(key: string, defaultValue?: any): any;
6
+ get<T = any>(key: string, defaultValue?: T | null): T | null;
7
7
  set(key: string, value: any): void;
8
8
  del(key: string): void;
9
9
  clear(): void;
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@rainte/js",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "type": "module",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
5
8
  "files": [
6
9
  "dist",
7
10
  "index.d.ts"
@@ -22,7 +25,11 @@
22
25
  "scripts": {
23
26
  "dev": "vite",
24
27
  "build": "vite build && tsc",
25
- "release": "pnpm build && npm version patch && npm publish --access public --registry=https://registry.npmjs.org"
28
+ "preview": "vite preview",
29
+ "push": "git add -A && git commit -m'commit' && git push",
30
+ "release": "npm publish --registry=https://registry.npmjs.org",
31
+ "prepublishOnly": "npm run build && npm run push && npm version patch",
32
+ "postpublish": "npm run push"
26
33
  },
27
34
  "dependencies": {
28
35
  "axios": "^1.8.4",