@rainte/js 0.0.18 → 0.0.19
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/dist/types/lib/main.d.ts +9 -0
- package/dist/types/src/date/index.d.ts +24 -0
- package/dist/types/src/db/index.d.ts +18 -0
- package/dist/types/src/fast/index.d.ts +11 -0
- package/dist/types/src/file/index.d.ts +9 -0
- package/dist/types/src/hash/index.d.ts +5 -0
- package/dist/types/src/http/axios.d.ts +7 -0
- package/dist/types/src/http/index.d.ts +13 -0
- package/dist/types/src/json/index.d.ts +8 -0
- package/dist/types/src/main.d.ts +1 -0
- package/dist/types/src/storage/index.d.ts +17 -0
- package/dist/types/src/url/index.d.ts +9 -0
- package/dist/types/vite.config.d.ts +2 -0
- package/package.json +8 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * as date from '@/date';
|
|
2
|
+
export * as db from '@/db';
|
|
3
|
+
export * as fast from '@/fast';
|
|
4
|
+
export * as file from '@/file';
|
|
5
|
+
export * as hash from '@/hash';
|
|
6
|
+
export * as http from '@/http';
|
|
7
|
+
export * as json from '@/json';
|
|
8
|
+
export * as storage from '@/storage';
|
|
9
|
+
export * as url from '@/url';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
export { dayjs };
|
|
3
|
+
export declare const FORMAT: {
|
|
4
|
+
DATETIME: string;
|
|
5
|
+
DATE: string;
|
|
6
|
+
TIME: string;
|
|
7
|
+
YEAR: string;
|
|
8
|
+
MONTH: string;
|
|
9
|
+
HOUR: string;
|
|
10
|
+
MINUTE: string;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: {
|
|
13
|
+
dayjs: typeof dayjs;
|
|
14
|
+
FORMAT: {
|
|
15
|
+
DATETIME: string;
|
|
16
|
+
DATE: string;
|
|
17
|
+
TIME: string;
|
|
18
|
+
YEAR: string;
|
|
19
|
+
MONTH: string;
|
|
20
|
+
HOUR: string;
|
|
21
|
+
MINUTE: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Dexie, { Table } from 'dexie';
|
|
2
|
+
export interface DexieRow {
|
|
3
|
+
id?: number;
|
|
4
|
+
key: string;
|
|
5
|
+
value: any;
|
|
6
|
+
}
|
|
7
|
+
export declare class SubDexie extends Dexie {
|
|
8
|
+
rows: Table<DexieRow>;
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
export declare const db: SubDexie;
|
|
12
|
+
export declare const get: (key: string, value?: boolean) => import("dexie").PromiseExtended<any>;
|
|
13
|
+
export declare const set: (key: string, value: any) => Promise<void>;
|
|
14
|
+
declare const _default: {
|
|
15
|
+
get: (key: string, value?: boolean) => import("dexie").PromiseExtended<any>;
|
|
16
|
+
set: (key: string, value: any) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const findByValue: (list: any[], value: any) => any;
|
|
2
|
+
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
3
|
+
export declare const log: (message: any, type?: string) => void;
|
|
4
|
+
export declare const fail: (message: string) => never;
|
|
5
|
+
declare const _default: {
|
|
6
|
+
findByValue: (list: any[], value: any) => any;
|
|
7
|
+
sleep: (ms: number) => Promise<unknown>;
|
|
8
|
+
log: (message: any, type?: string) => void;
|
|
9
|
+
fail: (message: string) => never;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const toBase64: (blob: Blob) => Promise<string>;
|
|
2
|
+
export declare const toBlob: (base64: string) => Blob;
|
|
3
|
+
export declare const download: (filename: string, obj: Blob | MediaSource) => void;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
toBase64: (blob: Blob) => Promise<string>;
|
|
6
|
+
toBlob: (base64: string) => Blob;
|
|
7
|
+
download: (filename: string, obj: Blob | MediaSource) => void;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const ACCESS_TOKEN = "access_token";
|
|
2
|
+
export declare const message: (data: any, text?: string) => any;
|
|
3
|
+
export declare const axios: import("axios").AxiosInstance;
|
|
4
|
+
export declare const tokenRequestInterceptor: () => number;
|
|
5
|
+
export declare const responseInterceptor: (onRejected?: ((error: any) => any) | null) => number;
|
|
6
|
+
export declare const retry: (error: any, refreshURL: string, refreshRequest: () => Promise<any>) => Promise<unknown>;
|
|
7
|
+
export default axios;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
export * from './axios';
|
|
3
|
+
export declare const get: (url: string, params?: Record<string, any>) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
export declare const post: (url: string, data?: Record<string, any>) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
export declare const download: (config: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
+
export declare const request: (config: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
get: (url: string, params?: Record<string, any>) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
|
+
post: (url: string, data?: Record<string, any>) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
10
|
+
download: (config: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
11
|
+
request: (config: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Options } from 'jsan';
|
|
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) => unknown;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
stringify: (value?: unknown, replacer?: (key: string, value: unknown) => unknown | Array<number | string> | null, space?: string | number, _options?: Options | boolean) => string;
|
|
6
|
+
parse: (text: string, reviver?: (key: string, value: unknown) => unknown) => unknown;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare class Cache {
|
|
2
|
+
private storage;
|
|
3
|
+
constructor(storage: Storage);
|
|
4
|
+
getRaw(key: string, defaultValue?: any): any;
|
|
5
|
+
setRaw(key: string, value: string): void;
|
|
6
|
+
get(key: string, defaultValue?: any): any;
|
|
7
|
+
set(key: string, value: any): void;
|
|
8
|
+
del(key: string): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare const local: Cache;
|
|
12
|
+
export declare const session: Cache;
|
|
13
|
+
declare const _default: {
|
|
14
|
+
local: Cache;
|
|
15
|
+
session: Cache;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const search: () => URLSearchParams;
|
|
2
|
+
export declare const all: () => ObjectProps;
|
|
3
|
+
export declare const open: (url?: string | URL, target?: string, features?: string) => void;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
search: () => URLSearchParams;
|
|
6
|
+
all: () => ObjectProps;
|
|
7
|
+
open: (url?: string | URL, target?: string, features?: string) => void;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rainte/js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
|
-
"dist"
|
|
7
|
-
"index.d.ts"
|
|
6
|
+
"dist"
|
|
8
7
|
],
|
|
9
8
|
"main": "./dist/index.umd.cjs",
|
|
10
9
|
"module": "./dist/index.js",
|
|
11
10
|
"types": "./dist/types/lib/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
"types": "./dist/types/lib/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.umd.cjs"
|
|
15
|
+
},
|
|
12
16
|
"scripts": {
|
|
13
17
|
"dev": "vite",
|
|
14
|
-
"build": "
|
|
18
|
+
"build": "vite build && tsc",
|
|
15
19
|
"release": "pnpm build && npm version patch && npm publish --access public --registry=https://registry.npmjs.org"
|
|
16
20
|
},
|
|
17
21
|
"dependencies": {
|