@techui/utils
v0.2.0
Published
TechUI utils, used to support TechuUI component library
Readme
@techui/utils
English
🚀 Features
- DOM Utilities - Efficient DOM manipulation and query methods
- DOM Rect & Overlap - Layout-first element rectangle and overlap helpers
- Monitor - Event monitoring and observation tools
- Animation - Frame scheduling, Web Animations API wrapper, and view transition helpers
- Storage - LocalStorage and SessionStorage wrapper utilities
- Style Utilities - CSS class and style management helpers
- Type Checking - Comprehensive type detection and validation functions
- File Downloads - Download text, Blob, or binary content as a browser file
- Lightweight - Minimal dependencies, optimized for performance
File Downloads
downloadFile starts a browser download and returns whether the download was successfully triggered. Serialization remains the caller's responsibility.
import { downloadFile } from "@techui/utils";
downloadFile(JSON.stringify(data, null, 2), {
fileName: "flow.json",
mimeType: "application/json;charset=utf-8",
});👤 Author
Ayin
- Email: [email protected]
- WeChat: jay1986cn
- China Site: https://techui.cn/
- Global Site: https://techui.net/
🤝 Contributing
Contributions, issues, and feature requests are welcome!
💡 Support TechUI
This library is part of the TechUI ecosystem. Visit techui.cn or techui.net for more information about TechUI components and tools.
Made with ❤️ by Ayin
中文
🚀 特性
- DOM 工具 - 高效的 DOM 操作和查询方法
- DOM 矩形与碰撞 - 布局优先的元素矩形和重叠判断辅助函数
- 监视器 - 事件监听和观察工具
- 动画工具 - 帧调度、Web Animations API 封装与视图转场辅助
- 存储管理 - LocalStorage 和 SessionStorage 封装工具
- 样式工具 - CSS 类和样式管理辅助函数
- 类型检查 - 全面的类型检测和验证函数
- 文件下载 - 将文本、Blob 或二进制内容下载为浏览器文件
- 轻量级 - 最小化依赖,性能优化
文件下载
downloadFile 用于触发浏览器文件下载,并返回是否成功发起下载。数据序列化仍由调用方负责。
import { downloadFile } from "@techui/utils";
downloadFile(JSON.stringify(data, null, 2), {
fileName: "flow.json",
mimeType: "application/json;charset=utf-8",
});👤 作者
Ayin
- 邮箱:[email protected]
- 微信:jay1986cn
- 中国站:https://techui.cn/
- 全球站:https://techui.net/
🤝 贡献
欢迎提交贡献、问题反馈和功能建议!
💡 支持 TechUI
此库是 TechUI 生态系统的一部分。访问 techui.cn 或 techui.net 了解更多关于 TechUI 组件和工具的信息。
用 ❤️ 制作 by Ayin
