@maxax/types 1.0.0
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/index.cjs +19 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +88 -0
- package/dist/index.d.ts +88 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +43 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/index.ts
|
|
17
|
+
var index_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(index_exports);
|
|
19
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './core'\nexport * from './emit'\nexport * from './file'\nexport * from './option'\nexport * from './props'\nexport * from './ref'\nexport * from './search'\nexport * from './tree'\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { defineEmits, Ref, ComputedRef } from 'vue';
|
|
2
|
+
|
|
3
|
+
type Writable<T> = {
|
|
4
|
+
-readonly [P in keyof T]: T[P];
|
|
5
|
+
};
|
|
6
|
+
type Mutable<T> = {
|
|
7
|
+
-readonly [P in keyof T]: T[P];
|
|
8
|
+
};
|
|
9
|
+
type Arrayable<T> = T | T[];
|
|
10
|
+
type MaybeArray<T> = T | T[];
|
|
11
|
+
type Awaitable<T> = Promise<T> | T;
|
|
12
|
+
type Nullable<T> = T | null;
|
|
13
|
+
type NonNull<T> = T extends null | undefined ? never : T;
|
|
14
|
+
interface Recordable<T = any> {
|
|
15
|
+
[key: string]: T;
|
|
16
|
+
}
|
|
17
|
+
interface ReadonlyRecordable<T = any> {
|
|
18
|
+
readonly [key: string]: T;
|
|
19
|
+
}
|
|
20
|
+
interface Indexable<T = any> {
|
|
21
|
+
[key: string]: T;
|
|
22
|
+
}
|
|
23
|
+
type DeepPartial<T> = {
|
|
24
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
25
|
+
};
|
|
26
|
+
type TimeoutHandle = ReturnType<typeof setTimeout>;
|
|
27
|
+
type IntervalHandle = ReturnType<typeof setInterval>;
|
|
28
|
+
type TargetContext = '_self' | '_blank';
|
|
29
|
+
interface Fn<T = any, R = T> {
|
|
30
|
+
(...arg: T[]): R;
|
|
31
|
+
}
|
|
32
|
+
interface PromiseFn<T = any, R = T> {
|
|
33
|
+
(...arg: T[]): Promise<R>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type EmitType = (event: string, ...args: any[]) => void;
|
|
37
|
+
type ReturnEmitType = ReturnType<typeof defineEmits>;
|
|
38
|
+
|
|
39
|
+
interface OpenWindowOptions {
|
|
40
|
+
noopener?: boolean;
|
|
41
|
+
noreferrer?: boolean;
|
|
42
|
+
target?: '_blank' | '_self' | string;
|
|
43
|
+
}
|
|
44
|
+
interface DownloadByUrlOptions {
|
|
45
|
+
fileName?: string;
|
|
46
|
+
target?: '_blank' | '_self';
|
|
47
|
+
url: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type ValueAtom = string | number;
|
|
51
|
+
type SelectValue = ValueAtom | string[] | number[] | ValueAtom[] | null;
|
|
52
|
+
type KeyValueType = ValueAtom | ((data: any) => string) | ((data: any) => number);
|
|
53
|
+
interface LabelValueOption {
|
|
54
|
+
label: string;
|
|
55
|
+
value: any;
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
}
|
|
58
|
+
type LabelValueOptions = LabelValueOption[];
|
|
59
|
+
interface RenderOpts {
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type DynamicProps<T> = {
|
|
65
|
+
[P in keyof T]: Ref<T[P]> | T[P] | ComputedRef<T[P]>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type RefType<T> = T | null;
|
|
69
|
+
interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {
|
|
70
|
+
$el: T;
|
|
71
|
+
}
|
|
72
|
+
type ComponentRef<T extends HTMLElement = HTMLDivElement> = ComponentElRef<T> | null;
|
|
73
|
+
type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
|
|
74
|
+
|
|
75
|
+
interface FuseOptions {
|
|
76
|
+
keys?: string[];
|
|
77
|
+
shouldSort?: boolean;
|
|
78
|
+
threshold?: number;
|
|
79
|
+
isCaseSensitive?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface TreeData {
|
|
83
|
+
id: string | number;
|
|
84
|
+
children?: TreeData[];
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type { Arrayable, Awaitable, ComponentElRef, ComponentRef, DeepPartial, DownloadByUrlOptions, DynamicProps, ElRef, EmitType, Fn, FuseOptions, Indexable, IntervalHandle, KeyValueType, LabelValueOption, LabelValueOptions, MaybeArray, Mutable, NonNull, Nullable, OpenWindowOptions, PromiseFn, ReadonlyRecordable, Recordable, RefType, RenderOpts, ReturnEmitType, SelectValue, TargetContext, TimeoutHandle, TreeData, ValueAtom, Writable };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { defineEmits, Ref, ComputedRef } from 'vue';
|
|
2
|
+
|
|
3
|
+
type Writable<T> = {
|
|
4
|
+
-readonly [P in keyof T]: T[P];
|
|
5
|
+
};
|
|
6
|
+
type Mutable<T> = {
|
|
7
|
+
-readonly [P in keyof T]: T[P];
|
|
8
|
+
};
|
|
9
|
+
type Arrayable<T> = T | T[];
|
|
10
|
+
type MaybeArray<T> = T | T[];
|
|
11
|
+
type Awaitable<T> = Promise<T> | T;
|
|
12
|
+
type Nullable<T> = T | null;
|
|
13
|
+
type NonNull<T> = T extends null | undefined ? never : T;
|
|
14
|
+
interface Recordable<T = any> {
|
|
15
|
+
[key: string]: T;
|
|
16
|
+
}
|
|
17
|
+
interface ReadonlyRecordable<T = any> {
|
|
18
|
+
readonly [key: string]: T;
|
|
19
|
+
}
|
|
20
|
+
interface Indexable<T = any> {
|
|
21
|
+
[key: string]: T;
|
|
22
|
+
}
|
|
23
|
+
type DeepPartial<T> = {
|
|
24
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
25
|
+
};
|
|
26
|
+
type TimeoutHandle = ReturnType<typeof setTimeout>;
|
|
27
|
+
type IntervalHandle = ReturnType<typeof setInterval>;
|
|
28
|
+
type TargetContext = '_self' | '_blank';
|
|
29
|
+
interface Fn<T = any, R = T> {
|
|
30
|
+
(...arg: T[]): R;
|
|
31
|
+
}
|
|
32
|
+
interface PromiseFn<T = any, R = T> {
|
|
33
|
+
(...arg: T[]): Promise<R>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type EmitType = (event: string, ...args: any[]) => void;
|
|
37
|
+
type ReturnEmitType = ReturnType<typeof defineEmits>;
|
|
38
|
+
|
|
39
|
+
interface OpenWindowOptions {
|
|
40
|
+
noopener?: boolean;
|
|
41
|
+
noreferrer?: boolean;
|
|
42
|
+
target?: '_blank' | '_self' | string;
|
|
43
|
+
}
|
|
44
|
+
interface DownloadByUrlOptions {
|
|
45
|
+
fileName?: string;
|
|
46
|
+
target?: '_blank' | '_self';
|
|
47
|
+
url: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type ValueAtom = string | number;
|
|
51
|
+
type SelectValue = ValueAtom | string[] | number[] | ValueAtom[] | null;
|
|
52
|
+
type KeyValueType = ValueAtom | ((data: any) => string) | ((data: any) => number);
|
|
53
|
+
interface LabelValueOption {
|
|
54
|
+
label: string;
|
|
55
|
+
value: any;
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
}
|
|
58
|
+
type LabelValueOptions = LabelValueOption[];
|
|
59
|
+
interface RenderOpts {
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type DynamicProps<T> = {
|
|
65
|
+
[P in keyof T]: Ref<T[P]> | T[P] | ComputedRef<T[P]>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type RefType<T> = T | null;
|
|
69
|
+
interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {
|
|
70
|
+
$el: T;
|
|
71
|
+
}
|
|
72
|
+
type ComponentRef<T extends HTMLElement = HTMLDivElement> = ComponentElRef<T> | null;
|
|
73
|
+
type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
|
|
74
|
+
|
|
75
|
+
interface FuseOptions {
|
|
76
|
+
keys?: string[];
|
|
77
|
+
shouldSort?: boolean;
|
|
78
|
+
threshold?: number;
|
|
79
|
+
isCaseSensitive?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface TreeData {
|
|
83
|
+
id: string | number;
|
|
84
|
+
children?: TreeData[];
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type { Arrayable, Awaitable, ComponentElRef, ComponentRef, DeepPartial, DownloadByUrlOptions, DynamicProps, ElRef, EmitType, Fn, FuseOptions, Indexable, IntervalHandle, KeyValueType, LabelValueOption, LabelValueOptions, MaybeArray, Mutable, NonNull, Nullable, OpenWindowOptions, PromiseFn, ReadonlyRecordable, Recordable, RefType, RenderOpts, ReturnEmitType, SelectValue, TargetContext, TimeoutHandle, TreeData, ValueAtom, Writable };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxax/types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shared TypeScript helper types for Maxax packages",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"keywords": [
|
|
21
|
+
"types",
|
|
22
|
+
"typescript",
|
|
23
|
+
"vue",
|
|
24
|
+
"maxax"
|
|
25
|
+
],
|
|
26
|
+
"author": "",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"vue": "^3.0.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"tsup": "^8.0.1",
|
|
33
|
+
"typescript": "^5.3.3"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"dev": "tsup --watch",
|
|
40
|
+
"build": "tsup",
|
|
41
|
+
"clean": "rm -rf dist"
|
|
42
|
+
}
|
|
43
|
+
}
|