@wzyjs/types 0.2.4 → 0.2.6

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/.fatherrc.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from 'father'
2
+
3
+ export default defineConfig({
4
+ esm: { input: 'src' },
5
+ cjs: { input: 'src' },
6
+ prebundle: {
7
+ deps: {}
8
+ },
9
+ })
@@ -0,0 +1,33 @@
1
+ import { KeyValue } from './other';
2
+ export interface RequestRes<D = any> {
3
+ success: boolean;
4
+ message: string;
5
+ data: D;
6
+ }
7
+ export interface Pagination {
8
+ current?: number;
9
+ pageSize?: number;
10
+ }
11
+ export type Order = {
12
+ [key: string]: 'asc' | 'desc';
13
+ };
14
+ export declare enum OperatorType {
15
+ In = "In",
16
+ Like = "Like",
17
+ Between = "Between",
18
+ Equal = "Equal",
19
+ LessThan = "LessThan",
20
+ MoreThan = "MoreThan",
21
+ LessThanOrEqual = "LessThanOrEqual",
22
+ MoreThanOrEqual = "MoreThanOrEqual",
23
+ IsNull = "IsNull"
24
+ }
25
+ export type WhereItem = {
26
+ _type?: OperatorType;
27
+ _value: any;
28
+ };
29
+ export type Where = KeyValue | {
30
+ [key: string]: WhereItem;
31
+ };
32
+ export type SortParams<D extends object | string = string> = Record<D extends string ? string : keyof D, 'ascend' | 'descend' | null>;
33
+ export type FilterParams = Record<string, (string | number)[] | null>;
@@ -0,0 +1,40 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/api.ts
20
+ var api_exports = {};
21
+ __export(api_exports, {
22
+ OperatorType: () => OperatorType
23
+ });
24
+ module.exports = __toCommonJS(api_exports);
25
+ var OperatorType = /* @__PURE__ */ ((OperatorType2) => {
26
+ OperatorType2["In"] = "In";
27
+ OperatorType2["Like"] = "Like";
28
+ OperatorType2["Between"] = "Between";
29
+ OperatorType2["Equal"] = "Equal";
30
+ OperatorType2["LessThan"] = "LessThan";
31
+ OperatorType2["MoreThan"] = "MoreThan";
32
+ OperatorType2["LessThanOrEqual"] = "LessThanOrEqual";
33
+ OperatorType2["MoreThanOrEqual"] = "MoreThanOrEqual";
34
+ OperatorType2["IsNull"] = "IsNull";
35
+ return OperatorType2;
36
+ })(OperatorType || {});
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ OperatorType
40
+ });
@@ -0,0 +1,2 @@
1
+ export type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
2
+ export type Set<T, OmitK extends keyof T = never, OptionalK extends Exclude<keyof T, OmitK> = never> = Optional<Omit<T, OmitK>, OptionalK>;
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/base.ts
16
+ var base_exports = {};
17
+ module.exports = __toCommonJS(base_exports);
@@ -0,0 +1,3 @@
1
+ export * from './base';
2
+ export * from './api';
3
+ export * from './other';
@@ -0,0 +1,27 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/index.ts
17
+ var src_exports = {};
18
+ module.exports = __toCommonJS(src_exports);
19
+ __reExport(src_exports, require("./base"), module.exports);
20
+ __reExport(src_exports, require("./api"), module.exports);
21
+ __reExport(src_exports, require("./other"), module.exports);
22
+ // Annotate the CommonJS export names for ESM import in node:
23
+ 0 && (module.exports = {
24
+ ...require("./base"),
25
+ ...require("./api"),
26
+ ...require("./other")
27
+ });
@@ -0,0 +1,6 @@
1
+ export type KeyValue<D extends object | string = string, V = any> = Partial<Record<D extends string ? string : keyof D, V>>;
2
+ export interface Option<V extends string | number = string> {
3
+ label: string;
4
+ value: V;
5
+ children?: Option<V>[];
6
+ }
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/other.ts
16
+ var other_exports = {};
17
+ module.exports = __toCommonJS(other_exports);
@@ -0,0 +1,33 @@
1
+ import { KeyValue } from './other';
2
+ export interface RequestRes<D = any> {
3
+ success: boolean;
4
+ message: string;
5
+ data: D;
6
+ }
7
+ export interface Pagination {
8
+ current?: number;
9
+ pageSize?: number;
10
+ }
11
+ export type Order = {
12
+ [key: string]: 'asc' | 'desc';
13
+ };
14
+ export declare enum OperatorType {
15
+ In = "In",
16
+ Like = "Like",
17
+ Between = "Between",
18
+ Equal = "Equal",
19
+ LessThan = "LessThan",
20
+ MoreThan = "MoreThan",
21
+ LessThanOrEqual = "LessThanOrEqual",
22
+ MoreThanOrEqual = "MoreThanOrEqual",
23
+ IsNull = "IsNull"
24
+ }
25
+ export type WhereItem = {
26
+ _type?: OperatorType;
27
+ _value: any;
28
+ };
29
+ export type Where = KeyValue | {
30
+ [key: string]: WhereItem;
31
+ };
32
+ export type SortParams<D extends object | string = string> = Record<D extends string ? string : keyof D, 'ascend' | 'descend' | null>;
33
+ export type FilterParams = Record<string, (string | number)[] | null>;
@@ -0,0 +1,23 @@
1
+ // 接口响应的类型
2
+
3
+ // 分页的类型
4
+
5
+ // 后端排序参数的类型
6
+
7
+ // 后端查询参数的类型
8
+ export var OperatorType = /*#__PURE__*/function (OperatorType) {
9
+ OperatorType["In"] = "In";
10
+ OperatorType["Like"] = "Like";
11
+ OperatorType["Between"] = "Between";
12
+ OperatorType["Equal"] = "Equal";
13
+ OperatorType["LessThan"] = "LessThan";
14
+ OperatorType["MoreThan"] = "MoreThan";
15
+ OperatorType["LessThanOrEqual"] = "LessThanOrEqual";
16
+ OperatorType["MoreThanOrEqual"] = "MoreThanOrEqual";
17
+ OperatorType["IsNull"] = "IsNull";
18
+ return OperatorType;
19
+ }({});
20
+
21
+ // 前端排序参数的类型
22
+
23
+ // 前端查询参数的类型
@@ -0,0 +1,2 @@
1
+ export type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
2
+ export type Set<T, OmitK extends keyof T = never, OptionalK extends Exclude<keyof T, OmitK> = never> = Optional<Omit<T, OmitK>, OptionalK>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './base';
2
+ export * from './api';
3
+ export * from './other';
@@ -0,0 +1,3 @@
1
+ export * from "./base";
2
+ export * from "./api";
3
+ export * from "./other";
@@ -0,0 +1,6 @@
1
+ export type KeyValue<D extends object | string = string, V = any> = Partial<Record<D extends string ? string : keyof D, V>>;
2
+ export interface Option<V extends string | number = string> {
3
+ label: string;
4
+ value: V;
5
+ children?: Option<V>[];
6
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,10 +1,22 @@
1
1
  {
2
2
  "name": "@wzyjs/types",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "description",
5
5
  "author": "wzy",
6
6
  "license": "ISC",
7
- "main": "./index.ts",
7
+ "scripts": {
8
+ "dev": "father dev",
9
+ "build": "father build"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/esm/index.js",
14
+ "require": "./dist/cjs/index.js"
15
+ }
16
+ },
17
+ "dependencies": {
18
+ "father": "^4.4.5"
19
+ },
8
20
  "publishConfig": {
9
21
  "access": "public"
10
22
  },
@@ -12,5 +24,5 @@
12
24
  "type": "git",
13
25
  "url": "https://gitee.com/wang-zhenyu/app.git"
14
26
  },
15
- "gitHead": "dc14007bf39ae88c7195134b8cee8bb2deea9cae"
27
+ "gitHead": "2565d4515688050b8257c9f9e5468a1de11291d2"
16
28
  }
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './base'
2
+ export * from './api'
3
+ export * from './other'
package/tsconfig.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../tsconfig.json"
3
+ }
package/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './src/base'
2
- export * from './src/api'
3
- export * from './src/other'