@pawover/kit 0.0.0-beta.41 → 0.0.0-beta.43
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/enums.d.ts +1 -1
- package/dist/enums.js +144 -2
- package/dist/enums.js.map +1 -0
- package/dist/{except-MacUK44u.d.ts → except-6l9Qdmn1.d.ts} +53 -38
- package/dist/except-6l9Qdmn1.d.ts.map +1 -0
- package/dist/hooks-alova.d.ts.map +1 -1
- package/dist/hooks-alova.js +1 -4
- package/dist/hooks-alova.js.map +1 -1
- package/dist/hooks-react.d.ts +43 -12
- package/dist/hooks-react.d.ts.map +1 -1
- package/dist/hooks-react.js +52 -49
- package/dist/hooks-react.js.map +1 -1
- package/dist/{index-DBPmnr4a.d.ts → index-D0_YLsqN.d.ts} +2 -5
- package/dist/index-D0_YLsqN.d.ts.map +1 -0
- package/dist/index-JKtXbRi8.d.ts +149 -0
- package/dist/index-JKtXbRi8.d.ts.map +1 -0
- package/dist/index.d.ts +400 -111
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/patches-fetchEventSource.d.ts +2 -2
- package/dist/patches-fetchEventSource.d.ts.map +1 -1
- package/dist/patches-fetchEventSource.js +2 -4
- package/dist/patches-fetchEventSource.js.map +1 -1
- package/dist/{utils-_dtCs-qa.js → utils-DvWLCdYR.js} +282 -356
- package/dist/utils-DvWLCdYR.js.map +1 -0
- package/dist/{value-of-DUmTbnuw.d.ts → value-of-Dz22arsm.d.ts} +2 -2
- package/dist/value-of-Dz22arsm.d.ts.map +1 -0
- package/dist/vite.d.ts +0 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +2 -2
- package/dist/vite.js.map +1 -1
- package/dist/zod.d.ts.map +1 -1
- package/dist/zod.js +31 -69
- package/dist/zod.js.map +1 -1
- package/metadata.json +0 -3
- package/package.json +18 -12
- package/dist/enums-BL6w5-mS.js +0 -148
- package/dist/enums-BL6w5-mS.js.map +0 -1
- package/dist/except-MacUK44u.d.ts.map +0 -1
- package/dist/index-Bn_PNnsM.d.ts +0 -212
- package/dist/index-Bn_PNnsM.d.ts.map +0 -1
- package/dist/index-DBPmnr4a.d.ts.map +0 -1
- package/dist/utils-_dtCs-qa.js.map +0 -1
- package/dist/value-of-DUmTbnuw.d.ts.map +0 -1
package/dist/enums.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MIME, c as DATE_FORMAT, i as THEME_TYPE, n as THEME_MODE_ENUM, o as BREAK_POINT_TOKEN_ENUM, r as THEME_MODE_TYPE, s as BREAK_POINT_TOKEN_TYPE, t as THEME_ENUM } from "./index-
|
|
1
|
+
import { a as MIME, c as DATE_FORMAT, i as THEME_TYPE, n as THEME_MODE_ENUM, o as BREAK_POINT_TOKEN_ENUM, r as THEME_MODE_TYPE, s as BREAK_POINT_TOKEN_TYPE, t as THEME_ENUM } from "./index-JKtXbRi8.js";
|
|
2
2
|
export { BREAK_POINT_TOKEN_ENUM, BREAK_POINT_TOKEN_TYPE, DATE_FORMAT, MIME, THEME_ENUM, THEME_MODE_ENUM, THEME_MODE_TYPE, THEME_TYPE };
|
package/dist/enums.js
CHANGED
|
@@ -1,3 +1,145 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/enums/date.ts
|
|
2
|
+
const DATE_FORMAT = {
|
|
3
|
+
ISO_DATE: "yyyy-MM-dd",
|
|
4
|
+
ISO_TIME: "HH:mm:ss",
|
|
5
|
+
ISO_DATE_TIME: "yyyy-MM-dd HH:mm:ss",
|
|
6
|
+
ISO_DATE_TIME_MS: "yyyy-MM-dd HH:mm:ss.SSS",
|
|
7
|
+
ISO_DATETIME_TZ: "yyyy-MM-dd'T'HH:mm:ssXXX",
|
|
8
|
+
ISO_DATETIME_TZ_MS: "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
|
|
9
|
+
US_DATE: "MM/dd/yyyy",
|
|
10
|
+
US_DATE_TIME: "MM/dd/yyyy HH:mm:ss",
|
|
11
|
+
US_DATE_SHORT_YEAR: "MM/dd/yy",
|
|
12
|
+
EU_DATE: "dd/MM/yyyy",
|
|
13
|
+
EU_DATE_TIME: "dd/MM/yyyy HH:mm:ss",
|
|
14
|
+
CN_DATE: "yyyy年MM月dd日",
|
|
15
|
+
CN_DATE_TIME: "yyyy年MM月dd日 HH时mm分ss秒",
|
|
16
|
+
CN_DATE_WEEKDAY: "yyyy年MM月dd日 EEE",
|
|
17
|
+
CN_WEEKDAY_FULL: "EEEE",
|
|
18
|
+
SHORT_DATE: "yy-MM-dd",
|
|
19
|
+
SHORT_DATE_SLASH: "yy/MM/dd",
|
|
20
|
+
MONTH_DAY: "MM-dd",
|
|
21
|
+
MONTH_DAY_CN: "MM月dd日",
|
|
22
|
+
DATE_WITH_WEEKDAY_SHORT: "yyyy-MM-dd (EEE)",
|
|
23
|
+
DATE_WITH_WEEKDAY_FULL: "yyyy-MM-dd (EEEE)",
|
|
24
|
+
TIME_24: "HH:mm:ss",
|
|
25
|
+
TIME_24_NO_SEC: "HH:mm",
|
|
26
|
+
TIME_12: "hh:mm:ss a",
|
|
27
|
+
TIME_12_NO_SEC: "hh:mm a",
|
|
28
|
+
TIMESTAMP: "yyyyMMddHHmmss",
|
|
29
|
+
TIMESTAMP_MS: "yyyyMMddHHmmssSSS",
|
|
30
|
+
RFC2822: "EEE, dd MMM yyyy HH:mm:ss xxx",
|
|
31
|
+
READABLE_DATE: "MMM dd, yyyy",
|
|
32
|
+
READABLE_DATE_TIME: "MMM dd, yyyy HH:mm",
|
|
33
|
+
COMPACT_DATETIME: "yyyyMMdd_HHmmss"
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/enums/grid.ts
|
|
37
|
+
/** 屏幕响应断点 token 配置 */
|
|
38
|
+
const BREAK_POINT_TOKEN_ENUM = {
|
|
39
|
+
XS: 480,
|
|
40
|
+
XSMax: 575,
|
|
41
|
+
XSMin: 480,
|
|
42
|
+
SM: 576,
|
|
43
|
+
SMMax: 767,
|
|
44
|
+
SMMin: 576,
|
|
45
|
+
MD: 768,
|
|
46
|
+
MDMax: 991,
|
|
47
|
+
MDMin: 768,
|
|
48
|
+
LG: 992,
|
|
49
|
+
LGMax: 1199,
|
|
50
|
+
LGMin: 992,
|
|
51
|
+
XL: 1200,
|
|
52
|
+
XLMax: 1599,
|
|
53
|
+
XLMin: 1200,
|
|
54
|
+
XXL: 1600,
|
|
55
|
+
XXLMax: 1919,
|
|
56
|
+
XXLMin: 1600,
|
|
57
|
+
XXXL: 1920,
|
|
58
|
+
XXXLMin: 1920
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/enums/mime.ts
|
|
62
|
+
/**
|
|
63
|
+
* 标准 MIME 类型常量,用于文件类型标识和 HTTP Content-Type 头部
|
|
64
|
+
* 基于 IANA 注册标准和浏览器兼容性验证
|
|
65
|
+
*/
|
|
66
|
+
const MIME = {
|
|
67
|
+
TEXT: "text/plain",
|
|
68
|
+
HTML: "text/html",
|
|
69
|
+
CSS: "text/css",
|
|
70
|
+
CSV: "text/csv",
|
|
71
|
+
TSV: "text/tab-separated-values",
|
|
72
|
+
XML: "text/xml",
|
|
73
|
+
XHTML: "application/xhtml+xml",
|
|
74
|
+
JS: "text/javascript",
|
|
75
|
+
MARKDOWN: "text/markdown",
|
|
76
|
+
RTF: "application/rtf",
|
|
77
|
+
CALENDAR: "text/calendar",
|
|
78
|
+
JPEG: "image/jpeg",
|
|
79
|
+
PNG: "image/png",
|
|
80
|
+
GIF: "image/gif",
|
|
81
|
+
BMP: "image/bmp",
|
|
82
|
+
SVG: "image/svg+xml",
|
|
83
|
+
APNG: "image/apng",
|
|
84
|
+
AVIF: "image/avif",
|
|
85
|
+
ICO: "image/vnd.microsoft.icon",
|
|
86
|
+
WEBP: "image/webp",
|
|
87
|
+
MP3: "audio/mpeg",
|
|
88
|
+
AAC: "audio/aac",
|
|
89
|
+
MIDI: "audio/midi",
|
|
90
|
+
OGG_AUDIO: "audio/ogg",
|
|
91
|
+
OPUS: "audio/opus",
|
|
92
|
+
WAV: "audio/wav",
|
|
93
|
+
REAL_AUDIO: "audio/x-pn-realaudio",
|
|
94
|
+
MP4: "video/mp4",
|
|
95
|
+
MPEG: "video/mpeg",
|
|
96
|
+
OGG_VIDEO: "video/ogg",
|
|
97
|
+
AVI: "video/x-msvideo",
|
|
98
|
+
THREE_GPP: "video/3gpp",
|
|
99
|
+
THREE_GPP2: "video/3gpp2",
|
|
100
|
+
WEBM: "video/webm",
|
|
101
|
+
PDF: "application/pdf",
|
|
102
|
+
DOC: "application/msword",
|
|
103
|
+
DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
104
|
+
XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
105
|
+
XLSM: "application/vnd.ms-excel.sheet.macroEnabled.12",
|
|
106
|
+
XLTX: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
|
|
107
|
+
PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
108
|
+
PPT: "application/vnd.ms-powerpoint",
|
|
109
|
+
ODT: "application/vnd.oasis.opendocument.text",
|
|
110
|
+
ODS: "application/vnd.oasis.opendocument.spreadsheet",
|
|
111
|
+
ODP: "application/vnd.oasis.opendocument.presentation",
|
|
112
|
+
EPUB: "application/epub+zip",
|
|
113
|
+
AZW: "application/vnd.amazon.ebook",
|
|
114
|
+
ZIP: "application/zip",
|
|
115
|
+
GZIP: "application/gzip",
|
|
116
|
+
X_GZIP: "application/x-gzip",
|
|
117
|
+
TAR: "application/x-tar",
|
|
118
|
+
BZIP: "application/x-bzip",
|
|
119
|
+
BZIP2: "application/x-bzip2",
|
|
120
|
+
SEVEN_Z: "application/x-7z-compressed",
|
|
121
|
+
OCTET_STREAM: "application/octet-stream",
|
|
122
|
+
JSON: "application/json",
|
|
123
|
+
LD_JSON: "application/ld+json",
|
|
124
|
+
JAR: "application/java-archive",
|
|
125
|
+
EOT: "application/vnd.ms-fontobject",
|
|
126
|
+
OTF: "font/otf",
|
|
127
|
+
XLS: "application/vnd.ms-excel",
|
|
128
|
+
XPS: "application/vnd.ms-xpsdocument",
|
|
129
|
+
DOCM: "application/vnd.ms-word.document.macroEnabled.12"
|
|
130
|
+
};
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/enums/theme.ts
|
|
133
|
+
const THEME_ENUM = {
|
|
134
|
+
LIGHT: "light",
|
|
135
|
+
DARK: "dark"
|
|
136
|
+
};
|
|
137
|
+
const THEME_MODE_ENUM = {
|
|
138
|
+
LIGHT: "light",
|
|
139
|
+
DARK: "dark",
|
|
140
|
+
SYSTEM: "system"
|
|
141
|
+
};
|
|
142
|
+
//#endregion
|
|
143
|
+
export { BREAK_POINT_TOKEN_ENUM, DATE_FORMAT, MIME, THEME_ENUM, THEME_MODE_ENUM };
|
|
2
144
|
|
|
3
|
-
|
|
145
|
+
//# sourceMappingURL=enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.js","names":[],"sources":["../src/enums/date.ts","../src/enums/grid.ts","../src/enums/mime.ts","../src/enums/theme.ts"],"sourcesContent":["export const DATE_FORMAT = {\n // ISO 8601\n ISO_DATE: \"yyyy-MM-dd\",\n ISO_TIME: \"HH:mm:ss\",\n ISO_DATE_TIME: \"yyyy-MM-dd HH:mm:ss\",\n ISO_DATE_TIME_MS: \"yyyy-MM-dd HH:mm:ss.SSS\",\n ISO_DATETIME_TZ: \"yyyy-MM-dd'T'HH:mm:ssXXX\",\n ISO_DATETIME_TZ_MS: \"yyyy-MM-dd'T'HH:mm:ss.SSSXXX\",\n\n // US\n US_DATE: \"MM/dd/yyyy\",\n US_DATE_TIME: \"MM/dd/yyyy HH:mm:ss\",\n US_DATE_SHORT_YEAR: \"MM/dd/yy\",\n\n // EU\n EU_DATE: \"dd/MM/yyyy\",\n EU_DATE_TIME: \"dd/MM/yyyy HH:mm:ss\",\n\n // CN\n CN_DATE: \"yyyy年MM月dd日\",\n CN_DATE_TIME: \"yyyy年MM月dd日 HH时mm分ss秒\",\n CN_DATE_WEEKDAY: \"yyyy年MM月dd日 EEE\",\n CN_WEEKDAY_FULL: \"EEEE\",\n\n // 简洁\n SHORT_DATE: \"yy-MM-dd\",\n SHORT_DATE_SLASH: \"yy/MM/dd\",\n MONTH_DAY: \"MM-dd\",\n MONTH_DAY_CN: \"MM月dd日\",\n\n // 带星期\n DATE_WITH_WEEKDAY_SHORT: \"yyyy-MM-dd (EEE)\",\n DATE_WITH_WEEKDAY_FULL: \"yyyy-MM-dd (EEEE)\",\n\n // 时间\n TIME_24: \"HH:mm:ss\",\n TIME_24_NO_SEC: \"HH:mm\",\n TIME_12: \"hh:mm:ss a\",\n TIME_12_NO_SEC: \"hh:mm a\",\n\n // 时间戳\n TIMESTAMP: \"yyyyMMddHHmmss\",\n TIMESTAMP_MS: \"yyyyMMddHHmmssSSS\",\n\n // RFC\n RFC2822: \"EEE, dd MMM yyyy HH:mm:ss xxx\",\n\n // 其他\n READABLE_DATE: \"MMM dd, yyyy\",\n READABLE_DATE_TIME: \"MMM dd, yyyy HH:mm\",\n COMPACT_DATETIME: \"yyyyMMdd_HHmmss\",\n} as const;\n","export type BREAK_POINT_TOKEN_TYPE = Record<keyof typeof BREAK_POINT_TOKEN_ENUM, number>;\n/** 屏幕响应断点 token 配置 */\nexport const BREAK_POINT_TOKEN_ENUM = {\n XS: 480,\n XSMax: 575,\n XSMin: 480,\n\n SM: 576,\n SMMax: 767,\n SMMin: 576,\n\n MD: 768,\n MDMax: 991,\n MDMin: 768,\n\n LG: 992,\n LGMax: 1199,\n LGMin: 992,\n\n XL: 1200,\n XLMax: 1599,\n XLMin: 1200,\n\n XXL: 1600,\n XXLMax: 1919,\n XXLMin: 1600,\n\n XXXL: 1920,\n XXXLMin: 1920,\n} as const;\n","/**\n * 标准 MIME 类型常量,用于文件类型标识和 HTTP Content-Type 头部\n * 基于 IANA 注册标准和浏览器兼容性验证\n */\nexport const MIME = {\n /** 普通文本文件 */\n TEXT: \"text/plain\",\n /** 超文本标记语言文档 */\n HTML: \"text/html\",\n /** 层叠样式表文件 */\n CSS: \"text/css\",\n /** 逗号分隔值文件(表格数据) */\n CSV: \"text/csv\",\n /** 制表符分隔值文件 */\n TSV: \"text/tab-separated-values\",\n /** XML 文档 */\n XML: \"text/xml\",\n /** XHTML 文档(XML 严格格式的 HTML) */\n XHTML: \"application/xhtml+xml\",\n /** JavaScript 脚本文件(标准推荐) */\n JS: \"text/javascript\",\n /** Markdown 格式文档 */\n MARKDOWN: \"text/markdown\",\n /** 富文本格式文档(.rtf) */\n RTF: \"application/rtf\",\n /** iCalendar 日历格式(.ics) */\n CALENDAR: \"text/calendar\",\n /** JPEG 图像(.jpg/.jpeg) */\n JPEG: \"image/jpeg\",\n /** PNG 图像(无损压缩,支持透明) */\n PNG: \"image/png\",\n /** GIF 图像(支持动画) */\n GIF: \"image/gif\",\n /** Windows 位图(.bmp) */\n BMP: \"image/bmp\",\n /** SVG 向量图形(.svg) */\n SVG: \"image/svg+xml\",\n /** APNG 动态图像(.apng) */\n APNG: \"image/apng\",\n /** AVIF 图像(高效压缩) */\n AVIF: \"image/avif\",\n /** 图标文件格式(.ico) */\n ICO: \"image/vnd.microsoft.icon\",\n /** WebP 图像(高效压缩) */\n WEBP: \"image/webp\",\n /** MP3 音频(.mp3) */\n MP3: \"audio/mpeg\",\n /** AAC 音频(.aac) */\n AAC: \"audio/aac\",\n /** MIDI 音乐文件(.mid/.midi) */\n MIDI: \"audio/midi\",\n /** OGG 音频(.oga) */\n OGG_AUDIO: \"audio/ogg\",\n /** Opus 音频(.opus) */\n OPUS: \"audio/opus\",\n /** WAV 音频(.wav) */\n WAV: \"audio/wav\",\n /** RealAudio 音频(.ra/.ram) */\n REAL_AUDIO: \"audio/x-pn-realaudio\",\n /** MP4 视频(.mp4) */\n MP4: \"video/mp4\",\n /** MPEG 视频(.mpeg/.mpg) */\n MPEG: \"video/mpeg\",\n /** OGG 视频(.ogv) */\n OGG_VIDEO: \"video/ogg\",\n /** AVI 视频(.avi) */\n AVI: \"video/x-msvideo\",\n /** 3GPP 视频(.3gp) */\n THREE_GPP: \"video/3gpp\",\n /** 3GPP2 视频(.3g2) */\n THREE_GPP2: \"video/3gpp2\",\n /** WebM 视频(.webm) */\n WEBM: \"video/webm\",\n /** PDF 文档 */\n PDF: \"application/pdf\",\n /** Word 97-2003 文档(.doc) */\n DOC: \"application/msword\",\n /** Word 2007+ 文档(.docx) */\n DOCX: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n /** Excel 2007+ 工作簿(.xlsx) */\n XLSX: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n /** 启用宏的Excel工作簿(.xlsm) */\n XLSM: \"application/vnd.ms-excel.sheet.macroEnabled.12\",\n /** Excel模板文件(.xltx) */\n XLTX: \"application/vnd.openxmlformats-officedocument.spreadsheetml.template\",\n /** PowerPoint 2007+ 演示文稿(.pptx) */\n PPTX: \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n /** PowerPoint 97-2003 演示文稿(.ppt) */\n PPT: \"application/vnd.ms-powerpoint\",\n /** OpenDocument 文本文档(.odt) */\n ODT: \"application/vnd.oasis.opendocument.text\",\n /** OpenDocument 表格文档(.ods) */\n ODS: \"application/vnd.oasis.opendocument.spreadsheet\",\n /** OpenDocument 演示文稿(.odp) */\n ODP: \"application/vnd.oasis.opendocument.presentation\",\n /** EPUB 电子书(.epub) */\n EPUB: \"application/epub+zip\",\n /** Kindle 电子书(.azw) */\n AZW: \"application/vnd.amazon.ebook\",\n /** ZIP 压缩文件(.zip) */\n ZIP: \"application/zip\",\n /** GZIP 压缩文件(.gz) */\n GZIP: \"application/gzip\",\n /** GZIP 压缩文件(旧格式) */\n X_GZIP: \"application/x-gzip\",\n /** TAR 归档文件(.tar) */\n TAR: \"application/x-tar\",\n /** BZip 归档(.bz) */\n BZIP: \"application/x-bzip\",\n /** BZip2 归档(.bz2) */\n BZIP2: \"application/x-bzip2\",\n /** 7-Zip 压缩文件(.7z) */\n SEVEN_Z: \"application/x-7z-compressed\",\n /** 通用二进制数据(默认类型) */\n OCTET_STREAM: \"application/octet-stream\",\n /** JSON 数据格式(.json) */\n JSON: \"application/json\",\n /** JSON-LD 格式(.jsonld) */\n LD_JSON: \"application/ld+json\",\n /** Java 归档文件(.jar) */\n JAR: \"application/java-archive\",\n /** MS 嵌入式 OpenType 字体(.eot) */\n EOT: \"application/vnd.ms-fontobject\",\n /** OpenType 字体(.otf) */\n OTF: \"font/otf\",\n /** Excel 97-2003 工作簿(.xls) */\n XLS: \"application/vnd.ms-excel\",\n /** Microsoft XPS 文档(.xps) */\n XPS: \"application/vnd.ms-xpsdocument\",\n /** Word 启用宏文档(.docm) */\n DOCM: \"application/vnd.ms-word.document.macroEnabled.12\",\n} as const;\n","import type { ValueOf } from \"type-fest\";\n\nexport type THEME_TYPE = ValueOf<typeof THEME_ENUM>;\nexport const THEME_ENUM = {\n LIGHT: \"light\",\n DARK: \"dark\",\n} as const;\n\nexport type THEME_MODE_TYPE = ValueOf<typeof THEME_MODE_ENUM>;\nexport const THEME_MODE_ENUM = {\n LIGHT: \"light\",\n DARK: \"dark\",\n SYSTEM: \"system\",\n} as const;\n"],"mappings":";AAAA,MAAa,cAAc;CAEzB,UAAU;CACV,UAAU;CACV,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,oBAAoB;CAGpB,SAAS;CACT,cAAc;CACd,oBAAoB;CAGpB,SAAS;CACT,cAAc;CAGd,SAAS;CACT,cAAc;CACd,iBAAiB;CACjB,iBAAiB;CAGjB,YAAY;CACZ,kBAAkB;CAClB,WAAW;CACX,cAAc;CAGd,yBAAyB;CACzB,wBAAwB;CAGxB,SAAS;CACT,gBAAgB;CAChB,SAAS;CACT,gBAAgB;CAGhB,WAAW;CACX,cAAc;CAGd,SAAS;CAGT,eAAe;CACf,oBAAoB;CACpB,kBAAkB;CACnB;;;;ACjDD,MAAa,yBAAyB;CACpC,IAAI;CACJ,O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type-fest/source/union-to-intersection.d.ts
|
|
2
2
|
/**
|
|
3
3
|
Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
|
|
4
4
|
|
|
@@ -16,23 +16,18 @@ type Intersection = UnionToIntersection<Union>;
|
|
|
16
16
|
|
|
17
17
|
@category Type
|
|
18
18
|
*/
|
|
19
|
-
type UnionToIntersection<Union> = (
|
|
20
|
-
// `extends unknown` is always going to be the case and is used to convert the
|
|
19
|
+
type UnionToIntersection<Union> = (// `extends unknown` is always going to be the case and is used to convert the
|
|
21
20
|
// `Union` into a [distributive conditional
|
|
22
21
|
// type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
|
|
23
|
-
Union extends unknown
|
|
24
|
-
// The union type is used as the only argument to a function since the union
|
|
22
|
+
Union extends unknown // The union type is used as the only argument to a function since the union
|
|
25
23
|
// of function arguments is an intersection.
|
|
26
|
-
? (distributedUnion: Union) => void
|
|
27
|
-
//
|
|
28
|
-
: never
|
|
29
|
-
// Infer the `Intersection` type since TypeScript represents the positional
|
|
24
|
+
? (distributedUnion: Union) => void // This won't happen.
|
|
25
|
+
: never // Infer the `Intersection` type since TypeScript represents the positional
|
|
30
26
|
// arguments of unions of functions as an intersection of the union.
|
|
31
|
-
) extends ((mergedIntersection: infer Intersection) => void)
|
|
32
|
-
// The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
|
|
27
|
+
) extends ((mergedIntersection: infer Intersection) => void) // The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
|
|
33
28
|
? Intersection & Union : never;
|
|
34
29
|
//#endregion
|
|
35
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
30
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/keys-of-union.d.ts
|
|
36
31
|
/**
|
|
37
32
|
Create a union of all keys from a given type, even those exclusive to specific union members.
|
|
38
33
|
|
|
@@ -70,11 +65,10 @@ type AllKeys = KeysOfUnion<Union>;
|
|
|
70
65
|
|
|
71
66
|
@category Object
|
|
72
67
|
*/
|
|
73
|
-
type KeysOfUnion<ObjectType> =
|
|
74
|
-
// Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
|
|
68
|
+
type KeysOfUnion<ObjectType> = // Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
|
|
75
69
|
keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
|
|
76
70
|
//#endregion
|
|
77
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
71
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/is-any.d.ts
|
|
78
72
|
/**
|
|
79
73
|
Returns a boolean for whether the given type is `any`.
|
|
80
74
|
|
|
@@ -105,7 +99,7 @@ const anyA = get(anyObject, 'a');
|
|
|
105
99
|
*/
|
|
106
100
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
107
101
|
//#endregion
|
|
108
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
102
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
109
103
|
/**
|
|
110
104
|
Returns a boolean for whether the given key is an optional key of type.
|
|
111
105
|
|
|
@@ -146,9 +140,9 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
146
140
|
@category Type Guard
|
|
147
141
|
@category Utilities
|
|
148
142
|
*/
|
|
149
|
-
type IsOptionalKeyOf<Type extends object, Key
|
|
143
|
+
type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
|
|
150
144
|
//#endregion
|
|
151
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
145
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
152
146
|
/**
|
|
153
147
|
Extract all optional keys from the given type.
|
|
154
148
|
|
|
@@ -186,7 +180,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
186
180
|
? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
187
181
|
: never;
|
|
188
182
|
//#endregion
|
|
189
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
183
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
190
184
|
/**
|
|
191
185
|
Extract all required keys from the given type.
|
|
192
186
|
|
|
@@ -220,7 +214,7 @@ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
|
220
214
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
221
215
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
222
216
|
//#endregion
|
|
223
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
217
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/is-never.d.ts
|
|
224
218
|
/**
|
|
225
219
|
Returns a boolean for whether the given type is `never`.
|
|
226
220
|
|
|
@@ -276,7 +270,7 @@ type B = IsTrueFixed<never>;
|
|
|
276
270
|
*/
|
|
277
271
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
278
272
|
//#endregion
|
|
279
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
273
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/if.d.ts
|
|
280
274
|
/**
|
|
281
275
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
282
276
|
|
|
@@ -371,7 +365,7 @@ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
|
371
365
|
*/
|
|
372
366
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
373
367
|
//#endregion
|
|
374
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
368
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/unknown-array.d.ts
|
|
375
369
|
/**
|
|
376
370
|
Represents an array with `unknown` value.
|
|
377
371
|
|
|
@@ -398,7 +392,7 @@ type C = IsArray<string>;
|
|
|
398
392
|
*/
|
|
399
393
|
type UnknownArray = readonly unknown[];
|
|
400
394
|
//#endregion
|
|
401
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
395
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/internal/type.d.ts
|
|
402
396
|
/**
|
|
403
397
|
Returns a boolean for whether A is false.
|
|
404
398
|
|
|
@@ -456,13 +450,13 @@ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
|
|
|
456
450
|
//=> ''
|
|
457
451
|
```
|
|
458
452
|
*/
|
|
459
|
-
type IfNotAnyOrNever<T, IfNotAnyOrNever
|
|
453
|
+
type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>;
|
|
460
454
|
/**
|
|
461
455
|
Indicates the value of `exactOptionalPropertyTypes` compiler option.
|
|
462
456
|
*/
|
|
463
457
|
type IsExactOptionalPropertyTypesEnabled = [(string | undefined)?] extends [string?] ? false : true;
|
|
464
458
|
//#endregion
|
|
465
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
459
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/simplify.d.ts
|
|
466
460
|
/**
|
|
467
461
|
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
|
|
468
462
|
|
|
@@ -523,7 +517,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
523
517
|
*/
|
|
524
518
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
525
519
|
//#endregion
|
|
526
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
520
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/is-equal.d.ts
|
|
527
521
|
/**
|
|
528
522
|
Returns a boolean for whether the two given types are equal.
|
|
529
523
|
|
|
@@ -554,7 +548,7 @@ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false
|
|
|
554
548
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
555
549
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
556
550
|
//#endregion
|
|
557
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
551
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
558
552
|
/**
|
|
559
553
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
560
554
|
|
|
@@ -648,7 +642,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
648
642
|
*/
|
|
649
643
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
650
644
|
//#endregion
|
|
651
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
645
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
652
646
|
/**
|
|
653
647
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
654
648
|
|
|
@@ -696,13 +690,37 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
696
690
|
*/
|
|
697
691
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
698
692
|
//#endregion
|
|
699
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
693
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/merge.d.ts
|
|
700
694
|
// Merges two objects without worrying about index signatures.
|
|
701
695
|
type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>;
|
|
702
|
-
|
|
703
696
|
/**
|
|
704
697
|
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
705
698
|
|
|
699
|
+
This is different from the TypeScript `&` (intersection) operator. With `&`, conflicting property types are intersected, which often results in `never`. For example, `{a: string} & {a: number}` makes `a` become `string & number`, which resolves to `never`. With `Merge`, the second type's keys cleanly override the first, so `Merge<{a: string}, {a: number}>` gives `{a: number}` as expected. `Merge` also produces a flattened type (via `Simplify`), making it more readable in IDE tooltips compared to `A & B`.
|
|
700
|
+
|
|
701
|
+
@example
|
|
702
|
+
```
|
|
703
|
+
import type {Merge} from 'type-fest';
|
|
704
|
+
|
|
705
|
+
type Foo = {
|
|
706
|
+
a: string;
|
|
707
|
+
b: number;
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
type Bar = {
|
|
711
|
+
a: number; // Conflicts with Foo['a']
|
|
712
|
+
c: boolean;
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
// With `&`, `a` becomes `string & number` which is `never`. Not what you want.
|
|
716
|
+
type WithIntersection = (Foo & Bar)['a'];
|
|
717
|
+
//=> never
|
|
718
|
+
|
|
719
|
+
// With `Merge`, `a` is cleanly overridden to `number`.
|
|
720
|
+
type WithMerge = Merge<Foo, Bar>['a'];
|
|
721
|
+
//=> number
|
|
722
|
+
```
|
|
723
|
+
|
|
706
724
|
@example
|
|
707
725
|
```
|
|
708
726
|
import type {Merge} from 'type-fest';
|
|
@@ -742,10 +760,9 @@ type Merge<Destination, Source> = Destination extends unknown // For distributin
|
|
|
742
760
|
? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
|
|
743
761
|
: never;
|
|
744
762
|
// Should never happen
|
|
745
|
-
|
|
746
763
|
type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
747
764
|
//#endregion
|
|
748
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
765
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/internal/object.d.ts
|
|
749
766
|
/**
|
|
750
767
|
Works similar to the built-in `Pick` utility type, except for the following differences:
|
|
751
768
|
- Distributes over union types and allows picking keys from any member of the union type.
|
|
@@ -838,7 +855,6 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
838
855
|
*/
|
|
839
856
|
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
|
|
840
857
|
// `& Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
|
|
841
|
-
|
|
842
858
|
/**
|
|
843
859
|
Collapses literal types in a union into their corresponding primitive types, when possible. For example, `CollapseLiterals<'foo' | 'bar' | (string & {})>` returns `string`.
|
|
844
860
|
|
|
@@ -868,7 +884,7 @@ type E = CollapseLiterals<LiteralUnion<'foo' | 'bar', string> | null | undefined
|
|
|
868
884
|
*/
|
|
869
885
|
type CollapseLiterals<T> = {} extends T ? T : T extends infer U & {} ? U : T;
|
|
870
886
|
//#endregion
|
|
871
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
887
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/except.d.ts
|
|
872
888
|
/**
|
|
873
889
|
Filter out keys from an object.
|
|
874
890
|
|
|
@@ -896,7 +912,7 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
896
912
|
|
|
897
913
|
@see {Except}
|
|
898
914
|
*/
|
|
899
|
-
type Filter<KeyType
|
|
915
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
900
916
|
type ExceptOptions = {
|
|
901
917
|
/**
|
|
902
918
|
Disallow assigning non-specified properties.
|
|
@@ -908,7 +924,6 @@ type ExceptOptions = {
|
|
|
908
924
|
type DefaultExceptOptions = {
|
|
909
925
|
requireExactProps: false;
|
|
910
926
|
};
|
|
911
|
-
|
|
912
927
|
/**
|
|
913
928
|
Create a type from an object type without certain keys.
|
|
914
929
|
|
|
@@ -967,5 +982,5 @@ type PostPayloadFixed = Except<UserData, 'email'>;
|
|
|
967
982
|
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
968
983
|
type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
|
|
969
984
|
//#endregion
|
|
970
|
-
export {
|
|
971
|
-
//# sourceMappingURL=except-
|
|
985
|
+
export { IsEqual as a, IsExactOptionalPropertyTypesEnabled as c, If as d, IsNever as f, UnionToIntersection as h, HomomorphicPick as i, Not as l, IsAny as m, ApplyDefaultOptions as n, Simplify as o, OptionalKeysOf as p, CollapseLiterals as r, IfNotAnyOrNever as s, Except as t, UnknownArray as u };
|
|
986
|
+
//# sourceMappingURL=except-6l9Qdmn1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"except-6l9Qdmn1.d.ts","names":["UnionToIntersection","Union","Intersection","distributedUnion","mergedIntersection","UnionToIntersection","KeysOfUnion","ObjectType","Record","IsAny","T","NoInfer","IsAny","IsOptionalKeyOf","Type","Key","Record","IsOptionalKeyOf","OptionalKeysOf","Type","Key","OptionalKeysOf","RequiredKeysOf","Type","Exclude","IsNever","T","IsNever","If","Type","IfBranch","ElseBranch","UnknownArray","If","IsAny","IsNever","Primitive","UnknownArray","UnionToIntersection","BuiltIns","Date","RegExp","NonRecursiveType","Function","Promise","arguments_","MapsSetsOrArrays","ReadonlyMap","WeakKey","WeakMap","ReadonlySet","WeakSet","IsBothExtends","BaseType","FirstType","SecondType","HasMultipleCallSignatures","T","A","B","IsNotFalse","IsPrimitive","Not","IfNotAnyOrNever","IfAny","IfNever","IsAnyOrNever","IsExactOptionalPropertyTypesEnabled","Simplify","T","KeyType","IsEqual","A","B","_IsEqual","G","OmitIndexSignature","ObjectType","KeyType","Record","PickIndexSignature","ObjectType","KeyType","Record","OmitIndexSignature","PickIndexSignature","Simplify","If","IsEqual","SimpleMerge","Destination","Source","Key","Merge","_Merge","Simplify","IsEqual","KeysOfUnion","RequiredKeysOf","Merge","OptionalKeysOf","IsAny","If","IsNever","FilterDefinedKeys","FilterOptionalKeys","MapsSetsOrArrays","NonRecursiveType","StringToNumber","ToString","BuildObject","Key","Value","CopiedFrom","PropertyKey","Pick","NumberKey","_","IsPlainObject","T","ObjectValue","K","NumberK","UndefinedToOptional","Exclude","HomomorphicPick","Keys","P","Extract","ValueOfUnion","Union","ReadonlyKeysOfUnion","ApplyDefaultOptions","Options","Defaults","SpecifiedOptions","Required","Omit","Record","Partial","CollapseLiterals","U","NormalizedKeys","ApplyDefaultOptions","IsEqual","Filter","KeyType","ExcludeType","ExceptOptions","requireExactProps","DefaultExceptOptions","Except","ObjectType","KeysType","Options","_Except","Required","Record","Partial"],"sources":["../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/union-to-intersection.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/keys-of-union.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/is-any.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/is-optional-key-of.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/optional-keys-of.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/required-keys-of.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/is-never.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/if.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/unknown-array.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/internal/type.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/simplify.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/is-equal.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/omit-index-signature.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/pick-index-signature.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/merge.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/internal/object.d.ts","../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/except.d.ts"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"mappings":";;AAiBA;;;;;;;;;;;;;;;;KAAYA,mBAAAA;AAAAA;AAAAA;AAIXC,KAAAA;AAAAA;AAAAA,GAGIE,gBAAAA,EAAkBF,KAAAA;AAAAA;AAAAA;AAAAA,YAKXG,kBAAAA;AAAAA,EAETF,YAAAA,GAAeD,KAAAA;;;;;;;;;;;;;;;;;;;;;;;;ACQlB;;;;;;;;;;;;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MA,GAAAA,GAC9FwB,gBAAAA,CAAiBxB,GAAAA,OAChByB,QAAAA,CAASH,OAAAA;AAAAA;;;;;;;AJ9MjB;;;;;;;;;;;;;;;;;;;;;KI2OYO,gBAAAA,iBAAiCrB,CAAAA,GAC1CA,CAAAA,GACAA,CAAAA,wBACCsB,CAAAA,GACAtB,CAAAA;;;;;;;;;;;;;;;;;;;;;;;AdlOJ;;;;;;;KeTK0B,MAAAA,yBAA+BD,OAAAA,CAAQE,OAAAA,EAASC,WAAAA,0BAAqCD,OAAAA,SAAgBC,WAAAA,WAAsBD,OAAAA;AAAAA,KAEpHE,aAAAA;;;;;;EAQXC,iBAAAA;AAAAA;AAAAA,KAGIC,oBAAAA;EACJD,iBAAAA;AAAAA;;;;;;;;AbFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACPA;;;;;;;;;;;;;;KYmEYE,MAAAA,oCAA0CC,UAAAA,kBAA4BJ,aAAAA,SACjFO,OAAAA,CAAQH,UAAAA,EAAYC,QAAAA,EAAUV,mBAAAA,CAAoBK,aAAAA,EAAeE,oBAAAA,EAAsBI,OAAAA;AAAAA,KAEnFC,OAAAA,oCAA2CH,UAAAA,kBAA4BI,QAAAA,CAASR,aAAAA,yBAClEI,UAAAA,IAAcP,MAAAA,CAAOC,OAAAA,EAASO,QAAAA,IAAYD,UAAAA,CAAWN,OAAAA,OACnEQ,OAAAA,qCACFI,OAAAA,CAAQD,MAAAA,CAAOJ,QAAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-alova.d.ts","names":[],"sources":["../src/hooks/alova/useAlovaPagination.ts","../src/hooks/alova/useAlovaRequest.ts","../src/hooks/alova/useAlovaWatcher.ts"],"
|
|
1
|
+
{"version":3,"file":"hooks-alova.d.ts","names":[],"sources":["../src/hooks/alova/useAlovaPagination.ts","../src/hooks/alova/useAlovaRequest.ts","../src/hooks/alova/useAlovaWatcher.ts"],"mappings":";;;;;UAYU,aAAA,YAAuB,a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AAAA,iBAGnB,eAAA,YAA2B,aAAA,6BAAA,CACzC,aAAA,EAAe,MAAA,CAAO,EAAA,IAAM,kBAAA,CAAmB,EAAA,EAAI,IAAA,GACnD,cAAA,EAAgB,EAAA,+BAChB,WAAA,GAAa,WAAA,CAAY,EAAA,EAAI,IAAA,IAAU,aAAA,CAAA,eAAA,CAAA,EAAA,EAAA,IAAA"}
|
package/dist/hooks-alova.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { usePagination, useRequest, useWatcher } from "alova/client";
|
|
2
|
-
|
|
3
2
|
//#region src/hooks/alova/useAlovaPagination.ts
|
|
4
3
|
function useAlovaPagination(methodHandler, hookOptions) {
|
|
5
4
|
const options = {
|
|
@@ -25,7 +24,6 @@ function useAlovaPagination(methodHandler, hookOptions) {
|
|
|
25
24
|
if (options.onComplete) exposure.onComplete(options.onComplete);
|
|
26
25
|
return exposure;
|
|
27
26
|
}
|
|
28
|
-
|
|
29
27
|
//#endregion
|
|
30
28
|
//#region src/hooks/alova/useAlovaRequest.ts
|
|
31
29
|
function useAlovaRequest(methodHandler, hookOptions) {
|
|
@@ -52,7 +50,6 @@ function useAlovaRequest(methodHandler, hookOptions) {
|
|
|
52
50
|
if (options.onComplete) exposure.onComplete(options.onComplete);
|
|
53
51
|
return exposure;
|
|
54
52
|
}
|
|
55
|
-
|
|
56
53
|
//#endregion
|
|
57
54
|
//#region src/hooks/alova/useAlovaWatcher.ts
|
|
58
55
|
function useAlovaWatcher(methodHandler, watchingStates, hookOptions = {}) {
|
|
@@ -63,7 +60,7 @@ function useAlovaWatcher(methodHandler, watchingStates, hookOptions = {}) {
|
|
|
63
60
|
if (options.onComplete) exposure.onComplete(options.onComplete);
|
|
64
61
|
return exposure;
|
|
65
62
|
}
|
|
66
|
-
|
|
67
63
|
//#endregion
|
|
68
64
|
export { useAlovaPagination, useAlovaRequest, useAlovaWatcher };
|
|
65
|
+
|
|
69
66
|
//# sourceMappingURL=hooks-alova.js.map
|
package/dist/hooks-alova.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-alova.js","names":[],"sources":["../src/hooks/alova/useAlovaPagination.ts","../src/hooks/alova/useAlovaRequest.ts","../src/hooks/alova/useAlovaWatcher.ts"],"sourcesContent":["/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n usePagination,\n type AlovaFrontMiddlewareContext,\n type CompleteHandler,\n type ErrorHandler,\n type PaginationHookConfig,\n type SuccessHandler,\n} from \"alova/client\";\n\ninterface HookOptions<AG extends AlovaGenerics, L extends any[], Args extends any[]> extends PaginationHookConfig<AG, L> {\n onBeforeRequest?: ((context: AlovaFrontMiddlewareContext<AG, any[]>) => void) | undefined;\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaPagination<AG extends AlovaGenerics, L extends any[], Args extends any[]> (\n methodHandler: (page: number, pageSize: number, ...args: Args) => Method<AG>,\n hookOptions?: HookOptions<AG, L, Args> | undefined,\n) {\n const options = { ...hookOptions, immediate: hookOptions?.immediate ?? true };\n let isBeforeExecuted = false;\n let isMiddlewareExecuted = false;\n\n if (options.onBeforeRequest) {\n const middleware = options.middleware;\n options.middleware = async (context, next) => {\n !isBeforeExecuted && options.onBeforeRequest?.(context);\n isBeforeExecuted = true;\n\n if (middleware && !isMiddlewareExecuted) {\n isMiddlewareExecuted = true;\n await middleware?.(context, next);\n } else {\n await next();\n }\n };\n }\n\n const exposure = usePagination(methodHandler, options);\n\n if (options.onSuccess) {\n exposure.onSuccess(options.onSuccess);\n }\n if (options.onError) {\n exposure.onError(options.onError);\n }\n if (options.onComplete) {\n exposure.onComplete(options.onComplete);\n }\n\n return exposure;\n}\n","/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n type AlovaFrontMiddlewareContext,\n type AlovaMethodHandler,\n type CompleteHandler,\n type ErrorHandler,\n type RequestHookConfig,\n type SuccessHandler,\n useRequest,\n} from \"alova/client\";\n\ninterface HookOptions<AG extends AlovaGenerics, Args extends any[]> extends RequestHookConfig<AG, Args> {\n onBeforeRequest?: ((context: AlovaFrontMiddlewareContext<AG, Args>) => void) | undefined;\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaRequest<AG extends AlovaGenerics, Args extends any[] = any[]> (\n methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>,\n hookOptions?: HookOptions<AG, Args> | undefined,\n) {\n const options = { ...hookOptions, immediate: hookOptions?.immediate ?? true };\n let isBeforeExecuted = false;\n let isMiddlewareExecuted = false;\n\n if (options.onBeforeRequest) {\n const middleware = options.middleware;\n options.middleware = async (context, next) => {\n !isBeforeExecuted && options.onBeforeRequest?.(context);\n isBeforeExecuted = true;\n\n if (middleware && !isMiddlewareExecuted) {\n isMiddlewareExecuted = true;\n await middleware?.(context, next);\n } else {\n await next();\n }\n };\n }\n\n const exposure = useRequest(methodHandler, options);\n\n if (options.onSuccess) {\n exposure.onSuccess(options.onSuccess);\n }\n if (options.onError) {\n exposure.onError(options.onError);\n }\n if (options.onComplete) {\n exposure.onComplete(options.onComplete);\n }\n\n return exposure;\n}\n","/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n type AlovaMethodHandler,\n type CompleteHandler,\n type ErrorHandler,\n type SuccessHandler,\n type WatcherHookConfig,\n useWatcher,\n} from \"alova/client\";\n\ninterface HookOptions<AG extends AlovaGenerics, Args extends any[]> extends WatcherHookConfig<AG, Args> {\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaWatcher<AG extends AlovaGenerics, Args extends any[] = any[]> (\n methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>,\n watchingStates: AG[\"StatesExport\"][\"Watched\"][],\n hookOptions: HookOptions<AG, Args> = {},\n) {\n const options = hookOptions || {};\n const exposure = useWatcher(methodHandler, watchingStates, options);\n\n if (options.onSuccess) {\n exposure.onSuccess(options.onSuccess);\n }\n if (options.onError) {\n exposure.onError(options.onError);\n }\n if (options.onComplete) {\n exposure.onComplete(options.onComplete);\n }\n\n return exposure;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"hooks-alova.js","names":[],"sources":["../src/hooks/alova/useAlovaPagination.ts","../src/hooks/alova/useAlovaRequest.ts","../src/hooks/alova/useAlovaWatcher.ts"],"sourcesContent":["/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n usePagination,\n type AlovaFrontMiddlewareContext,\n type CompleteHandler,\n type ErrorHandler,\n type PaginationHookConfig,\n type SuccessHandler,\n} from \"alova/client\";\n\ninterface HookOptions<AG extends AlovaGenerics, L extends any[], Args extends any[]> extends PaginationHookConfig<AG, L> {\n onBeforeRequest?: ((context: AlovaFrontMiddlewareContext<AG, any[]>) => void) | undefined;\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaPagination<AG extends AlovaGenerics, L extends any[], Args extends any[]> (\n methodHandler: (page: number, pageSize: number, ...args: Args) => Method<AG>,\n hookOptions?: HookOptions<AG, L, Args> | undefined,\n) {\n const options = { ...hookOptions, immediate: hookOptions?.immediate ?? true };\n let isBeforeExecuted = false;\n let isMiddlewareExecuted = false;\n\n if (options.onBeforeRequest) {\n const middleware = options.middleware;\n options.middleware = async (context, next) => {\n !isBeforeExecuted && options.onBeforeRequest?.(context);\n isBeforeExecuted = true;\n\n if (middleware && !isMiddlewareExecuted) {\n isMiddlewareExecuted = true;\n await middleware?.(context, next);\n } else {\n await next();\n }\n };\n }\n\n const exposure = usePagination(methodHandler, options);\n\n if (options.onSuccess) {\n exposure.onSuccess(options.onSuccess);\n }\n if (options.onError) {\n exposure.onError(options.onError);\n }\n if (options.onComplete) {\n exposure.onComplete(options.onComplete);\n }\n\n return exposure;\n}\n","/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n type AlovaFrontMiddlewareContext,\n type AlovaMethodHandler,\n type CompleteHandler,\n type ErrorHandler,\n type RequestHookConfig,\n type SuccessHandler,\n useRequest,\n} from \"alova/client\";\n\ninterface HookOptions<AG extends AlovaGenerics, Args extends any[]> extends RequestHookConfig<AG, Args> {\n onBeforeRequest?: ((context: AlovaFrontMiddlewareContext<AG, Args>) => void) | undefined;\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaRequest<AG extends AlovaGenerics, Args extends any[] = any[]> (\n methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>,\n hookOptions?: HookOptions<AG, Args> | undefined,\n) {\n const options = { ...hookOptions, immediate: hookOptions?.immediate ?? true };\n let isBeforeExecuted = false;\n let isMiddlewareExecuted = false;\n\n if (options.onBeforeRequest) {\n const middleware = options.middleware;\n options.middleware = async (context, next) => {\n !isBeforeExecuted && options.onBeforeRequest?.(context);\n isBeforeExecuted = true;\n\n if (middleware && !isMiddlewareExecuted) {\n isMiddlewareExecuted = true;\n await middleware?.(context, next);\n } else {\n await next();\n }\n };\n }\n\n const exposure = useRequest(methodHandler, options);\n\n if (options.onSuccess) {\n exposure.onSuccess(options.onSuccess);\n }\n if (options.onError) {\n exposure.onError(options.onError);\n }\n if (options.onComplete) {\n exposure.onComplete(options.onComplete);\n }\n\n return exposure;\n}\n","/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n type AlovaMethodHandler,\n type CompleteHandler,\n type ErrorHandler,\n type SuccessHandler,\n type WatcherHookConfig,\n useWatcher,\n} from \"alova/client\";\n\ninterface HookOptions<AG extends AlovaGenerics, Args extends any[]> extends WatcherHookConfig<AG, Args> {\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaWatcher<AG extends AlovaGenerics, Args extends any[] = any[]> (\n methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>,\n watchingStates: AG[\"StatesExport\"][\"Watched\"][],\n hookOptions: HookOptions<AG, Args> = {},\n) {\n const options = hookOptions || {};\n const exposure = useWatcher(methodHandler, watchingStates, options);\n\n if (options.onSuccess) {\n exposure.onSuccess(options.onSuccess);\n }\n if (options.onError) {\n exposure.onError(options.onError);\n }\n if (options.onComplete) {\n exposure.onComplete(options.onComplete);\n }\n\n return exposure;\n}\n"],"mappings":";;AAmBA,SAAgB,mBACd,eACA,aACA;CACA,MAAM,UAAU;EAAE,GAAG;EAAa,WAAW,aAAa,aAAa;EAAM;CAC7E,IAAI,mBAAmB;CACvB,IAAI,uBAAuB;AAE3B,KAAI,QAAQ,iBAAiB;EAC3B,MAAM,aAAa,QAAQ;AAC3B,UAAQ,aAAa,OAAO,SAAS,SAAS;AAC5C,IAAC,oBAAoB,QAAQ,kBAAkB,QAAQ;AACvD,sBAAmB;AAEnB,OAAI,cAAc,CAAC,sBAAsB;AACvC,2BAAuB;AACvB,UAAM,aAAa,SAAS,KAAK;SAEjC,OAAM,MAAM;;;CAKlB,MAAM,WAAW,cAAc,eAAe,QAAQ;AAEtD,KAAI,QAAQ,UACV,UAAS,UAAU,QAAQ,UAAU;AAEvC,KAAI,QAAQ,QACV,UAAS,QAAQ,QAAQ,QAAQ;AAEnC,KAAI,QAAQ,WACV,UAAS,WAAW,QAAQ,WAAW;AAGzC,QAAO;;;;AClCT,SAAgB,gBACd,eACA,aACA;CACA,MAAM,UAAU;EAAE,GAAG;EAAa,WAAW,aAAa,aAAa;EAAM;CAC7E,IAAI,mBAAmB;CACvB,IAAI,uBAAuB;AAE3B,KAAI,QAAQ,iBAAiB;EAC3B,MAAM,aAAa,QAAQ;AAC3B,UAAQ,aAAa,OAAO,SAAS,SAAS;AAC5C,IAAC,oBAAoB,QAAQ,kBAAkB,QAAQ;AACvD,sBAAmB;AAEnB,OAAI,cAAc,CAAC,sBAAsB;AACvC,2BAAuB;AACvB,UAAM,aAAa,SAAS,KAAK;SAEjC,OAAM,MAAM;;;CAKlB,MAAM,WAAW,WAAW,eAAe,QAAQ;AAEnD,KAAI,QAAQ,UACV,UAAS,UAAU,QAAQ,UAAU;AAEvC,KAAI,QAAQ,QACV,UAAS,QAAQ,QAAQ,QAAQ;AAEnC,KAAI,QAAQ,WACV,UAAS,WAAW,QAAQ,WAAW;AAGzC,QAAO;;;;ACrCT,SAAgB,gBACd,eACA,gBACA,cAAqC,EAAE,EACvC;CACA,MAAM,UAAU,eAAe,EAAE;CACjC,MAAM,WAAW,WAAW,eAAe,gBAAgB,QAAQ;AAEnE,KAAI,QAAQ,UACV,UAAS,UAAU,QAAQ,UAAU;AAEvC,KAAI,QAAQ,QACV,UAAS,QAAQ,QAAQ,QAAQ;AAEnC,KAAI,QAAQ,WACV,UAAS,WAAW,QAAQ,WAAW;AAGzC,QAAO"}
|
package/dist/hooks-react.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { s as BREAK_POINT_TOKEN_TYPE } from "./index-
|
|
2
|
-
import { r as AnyFunction, t as AnyAsyncFunction } from "./index-
|
|
1
|
+
import { s as BREAK_POINT_TOKEN_TYPE } from "./index-JKtXbRi8.js";
|
|
2
|
+
import { r as AnyFunction, t as AnyAsyncFunction } from "./index-D0_YLsqN.js";
|
|
3
3
|
import { DependencyList, EffectCallback, RefObject } from "react";
|
|
4
4
|
|
|
5
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
6
|
-
|
|
5
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/tuple-to-union.d.ts
|
|
7
6
|
/**
|
|
8
7
|
Convert a tuple/array into a union type of its elements.
|
|
9
8
|
|
|
@@ -77,27 +76,59 @@ declare function useCreation<T>(factory: () => T, deps: DependencyList): T;
|
|
|
77
76
|
declare function useLatest<T>(value: T): RefObject<T>;
|
|
78
77
|
//#endregion
|
|
79
78
|
//#region src/hooks/react/useMount.d.ts
|
|
80
|
-
type MountCallback = EffectCallback | AnyAsyncFunction;
|
|
81
79
|
/**
|
|
82
80
|
* 在组件初始化时执行的 Hook
|
|
83
|
-
* -
|
|
81
|
+
* - 即使在严格模式(React StrictMode)也只执行一次
|
|
82
|
+
* - 自动使用最新版 effect 函数
|
|
84
83
|
*
|
|
85
|
-
* @param effect
|
|
84
|
+
* @param effect 副作用函数(必须为同步函数;若为异步函数,清理逻辑需自行处理)
|
|
85
|
+
* @example
|
|
86
|
+
* useMount(() => {
|
|
87
|
+
* console.log('组件挂载');
|
|
88
|
+
* return () => console.log('组件卸载');
|
|
89
|
+
* });
|
|
90
|
+
*
|
|
91
|
+
* useMount(async () => {
|
|
92
|
+
* const data = await fetchData();
|
|
93
|
+
* // 清理逻辑需通过 ref/AbortController 自行管理
|
|
94
|
+
* // ❌ 不要 return cleanupFn(async 函数返回 Promise,无法作为清理函数)
|
|
95
|
+
* });
|
|
86
96
|
*/
|
|
87
|
-
declare function useMount(effect:
|
|
97
|
+
declare function useMount(effect: EffectCallback | AnyAsyncFunction): void;
|
|
88
98
|
//#endregion
|
|
89
99
|
//#region src/hooks/react/useResponsive.d.ts
|
|
90
|
-
type Breakpoint = TupleToUnion<typeof
|
|
100
|
+
type Breakpoint = TupleToUnion<typeof BREAK_POINTS>;
|
|
91
101
|
type ResponsiveValues = Record<Breakpoint, boolean>;
|
|
92
|
-
declare const
|
|
102
|
+
declare const BREAK_POINTS: readonly ["xxxl", "xxl", "xl", "lg", "md", "sm", "xs"];
|
|
93
103
|
interface ResponsiveHookOptions {
|
|
94
104
|
/** 屏幕响应断点 token 配置 */
|
|
95
105
|
breakPointTokens?: BREAK_POINT_TOKEN_TYPE;
|
|
96
106
|
}
|
|
97
|
-
declare function useResponsive(options?: ResponsiveHookOptions): {
|
|
107
|
+
declare function useResponsive(options?: ResponsiveHookOptions | undefined): {
|
|
98
108
|
responsive: ResponsiveValues;
|
|
99
109
|
current: "xxxl" | "xxl" | "xl" | "lg" | "md" | "sm" | "xs";
|
|
100
|
-
breakPointTokens:
|
|
110
|
+
breakPointTokens: {
|
|
111
|
+
XS: 480;
|
|
112
|
+
XSMax: 575;
|
|
113
|
+
XSMin: 480;
|
|
114
|
+
SM: 576;
|
|
115
|
+
SMMax: 767;
|
|
116
|
+
SMMin: 576;
|
|
117
|
+
MD: 768;
|
|
118
|
+
MDMax: 991;
|
|
119
|
+
MDMin: 768;
|
|
120
|
+
LG: 992;
|
|
121
|
+
LGMax: 1199;
|
|
122
|
+
LGMin: 992;
|
|
123
|
+
XL: 1200;
|
|
124
|
+
XLMax: 1599;
|
|
125
|
+
XLMin: 1200;
|
|
126
|
+
XXL: 1600;
|
|
127
|
+
XXLMax: 1919;
|
|
128
|
+
XXLMin: 1600;
|
|
129
|
+
XXXL: 1920;
|
|
130
|
+
XXXLMin: 1920;
|
|
131
|
+
};
|
|
101
132
|
};
|
|
102
133
|
//#endregion
|
|
103
134
|
//#region src/hooks/react/useTitle.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-react.d.ts","names":["TupleToUnion","ArrayType"],"sources":["../node_modules/.pnpm/type-fest@5.
|
|
1
|
+
{"version":3,"file":"hooks-react.d.ts","names":["TupleToUnion","ArrayType"],"sources":["../node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/tuple-to-union.d.ts","../src/hooks/react/useCreation.ts","../src/hooks/react/useLatest.ts","../src/hooks/react/useMount.ts","../src/hooks/react/useResponsive.ts","../src/hooks/react/useTitle.ts","../src/hooks/react/useUnmount.ts"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAmDA;;;;;;;;;;;;ACnCA;;;;;;;;;;;;;;;;;;;ACRA;;;;;;;;;;;;;;;KF2CYA,YAAAA,cAA0BC,SAAAA,8BAAuCA,SAAAA;;;;;;;AAA7E;;;iBCnCgB,WAAA,GAAA,CAAgB,OAAA,QAAe,CAAA,EAAG,IAAA,EAAM,cAAA,GAAc,CAAA;;;;;;;ADmCtE;;iBE3CgB,SAAA,GAAA,CAAc,KAAA,EAAO,CAAA,GAAI,SAAA,CAAU,CAAA;;;;;;AF2CnD;;;;;;;;;;;;ACnCA;;;iBEOgB,QAAA,CAAU,MAAA,EAAQ,cAAA,GAAiB,gBAAA;;;KCjB9C,UAAA,GAAa,YAAA,QAAoB,YAAA;AAAA,KACjC,gBAAA,GAAmB,MAAA,CAAO,UAAA;AAAA,cAGzB,YAAA;AAAA,UAKW,qBAAA;EJoCO;EIlCtB,gBAAA,GAAmB,sBAAA;AAAA;AAAA,iBAEL,aAAA,CAAe,OAAA,GAAU,qBAAA;cAAA,gBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;UCf/B,gBAAA;;EAER,kBAAA;AAAA;;AL6CF;;;;;;;;iBKjCgB,QAAA,CAAU,KAAA,UAAe,OAAA,GAAU,gBAAA;;;;;;;ALiCnD;;iBMxCgB,UAAA,CAAY,MAAA,EAAQ,WAAA"}
|