files-getter 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/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # tool
2
+
3
+ 一个使用 TypeScript 构建的 JavaScript 工具库
4
+
5
+ ## 特性
6
+
7
+ - TypeScript 支持
8
+ - ESM + UMD 格式
9
+ - 带 HMR 的开发服务器
10
+ - ESLint + Prettier 代码规范
11
+
12
+ ## 安装
13
+
14
+ ```bash
15
+ pnpm install
16
+ ```
17
+
18
+ ## 开发
19
+
20
+ | 命令 | 说明 |
21
+ | -------------------- | ------------------- |
22
+ | `pnpm run dev` | 启动开发服务器 |
23
+ | `pnpm run build` | 构建生产版本 |
24
+ | `pnpm run lint` | 运行 ESLint 检查 |
25
+ | `pnpm run format` | 格式化代码 |
26
+ | `pnpm run typecheck` | TypeScript 类型检查 |
27
+
28
+ ## 输出
29
+
30
+ - `dist/tool.umd.js` - UMD 格式
31
+ - `dist/tool.esm.js` - ESM 格式
32
+
33
+ ## 许可证
34
+
35
+ MIT
@@ -0,0 +1,3 @@
1
+ import { type InputOptions } from './utils';
2
+ declare function uploader(options?: InputOptions): Promise<File[]>;
3
+ export default uploader;
@@ -0,0 +1 @@
1
+ function e(e){var n=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{multiple:!1,accept:"*"},c=document.createElement("input");return c.multiple=null!==(e=t.multiple)&&void 0!==e&&e,c.accept=null!==(n=t.accept)&&void 0!==n?n:"*",c.type="file",c}(e);return n.click(),new Promise(function(e,t){n.addEventListener("change",function(){e(Array.from(n.files||[])),n.remove()}),n.addEventListener("cancel",function(){t([]),n.remove()})})}export{e as default};
@@ -0,0 +1 @@
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):(e="undefined"!=typeof globalThis?globalThis:e||self).uploader=n()}(this,function(){return function(e){var n=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{multiple:!1,accept:"*"},i=document.createElement("input");return i.multiple=null!==(e=t.multiple)&&void 0!==e&&e,i.accept=null!==(n=t.accept)&&void 0!==n?n:"*",i.type="file",i}(e);return n.click(),new Promise(function(e,t){n.addEventListener("change",function(){e(Array.from(n.files||[])),n.remove()}),n.addEventListener("cancel",function(){t([]),n.remove()})})}});
@@ -0,0 +1,5 @@
1
+ export interface InputOptions {
2
+ multiple?: boolean;
3
+ accept?: string;
4
+ }
5
+ export declare function getInput(options?: InputOptions): HTMLInputElement;
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "files-getter",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "A JavaScript utility library",
6
+ "main": "dist/uploader.umd.js",
7
+ "module": "dist/uploader.esm.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "dev": "vite",
14
+ "build": "rolldown -c && tsc --emitDeclarationOnly",
15
+ "preview": "vite preview",
16
+ "lint": "eslint src --ext .ts",
17
+ "format": "prettier --write \"src/**/*.{ts,json}\" \"examples/**/*.{ts,json}\"",
18
+ "typecheck": "tsc --noEmit"
19
+ },
20
+ "keywords": [],
21
+ "author": "",
22
+ "license": "MIT",
23
+ "devDependencies": {
24
+ "@babel/core": "^7.29.0",
25
+ "@babel/preset-env": "^7.29.0",
26
+ "@babel/preset-typescript": "^7.28.5",
27
+ "@rollup/plugin-babel": "^6.1.0",
28
+ "@rollup/plugin-terser": "^0.4.4",
29
+ "@typescript-eslint/eslint-plugin": "^8.56.0",
30
+ "@typescript-eslint/parser": "^8.56.0",
31
+ "eslint": "^9.0.0",
32
+ "eslint-plugin-unused-imports": "^4.4.1",
33
+ "prettier": "^3.8.1",
34
+ "rolldown": "^1.0.0-rc.5",
35
+ "rolldown-plugin-dts": "^0.22.3",
36
+ "typescript": "^5.9.3",
37
+ "vite": "^8.0.0-beta.15"
38
+ },
39
+ "dependencies": {
40
+ "dem-file-getter": "^1.0.0"
41
+ }
42
+ }