{"_id":"wechat-emojis","_rev":"7-91441d58586fd8e1942a5c8457b12793","name":"wechat-emojis","dist-tags":{"latest":"2.2.0"},"versions":{"1.0.0":{"name":"wechat-emojis","version":"1.0.0","keywords":["wechat","emoji","emojis","微信","表情包","typescript","react","vue","angular"],"author":{"name":"xxk8"},"license":"MIT","_id":"wechat-emojis@1.0.0","maintainers":[{"name":"xiandanhuang","email":"1821655660@qq.com"}],"homepage":"https://github.com/xxk8/wechat-emojis#readme","bugs":{"url":"https://github.com/xxk8/wechat-emojis/issues"},"dist":{"shasum":"61dfab16bd9e732030847e9c1aaaa7270a144f1a","tarball":"https://registry.npmjs.org/wechat-emojis/-/wechat-emojis-1.0.0.tgz","fileCount":120,"integrity":"sha512-crLlS56wT6CG6Qyo+W7hgIEaEECU5W5r0vJh9dND4jhrlP6Nj55pAVyyE2Ah8eyX27S/JpQlElp4TNF+2rOdlg==","signatures":[{"sig":"MEUCIQCXHT1AFSwHsYUu3WmMsG60xVIqP3nhJ22rNQfvEO290QIgG/+PZf/aaaYlesJDNkFruoVOlpI2KWsiFcOwfut5kr4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":860784},"main":"wechatEmoji.js","types":"wechatEmoji.d.ts","module":"wechatEmoji.js","engines":{"node":">=14.0.0"},"gitHead":"057d3a2350da509aea884cb137f5f13c4c5036a3","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"xiandanhuang","email":"1821655660@qq.com"},"repository":{"url":"git+https://github.com/xxk8/wechat-emojis.git","type":"git"},"_npmVersion":"10.8.2","description":"完整的微信内置表情资源库，包含 109 个高清 PNG 图片和类型安全的 TypeScript API","directories":{},"_nodeVersion":"18.20.5","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/wechat-emojis_1.0.0_1753529110283_0.08993757113020329","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"wechat-emojis","version":"1.0.2","keywords":["wechat","emoji","emojis","微信","表情包","typescript","react","vue","angular"],"author":{"name":"xxk8"},"license":"MIT","_id":"wechat-emojis@1.0.2","maintainers":[{"name":"xiandanhuang","email":"1821655660@qq.com"}],"homepage":"https://github.com/xxk8/wechat-emojis#readme","bugs":{"url":"https://github.com/xxk8/wechat-emojis/issues"},"dist":{"shasum":"506deb0b427bb6c110769ea5bc7b220ac64743da","tarball":"https://registry.npmjs.org/wechat-emojis/-/wechat-emojis-1.0.2.tgz","fileCount":115,"integrity":"sha512-T1drHGy92rKm/Vo7LRkU4D4wdREpVTjAMEa4gR1NB9IAyck3qmmewFSrnEEIyZfsv3SXTA7X1kt6Smt0UKVCyw==","signatures":[{"sig":"MEUCIQCED4TpUUuQ7Xvyz57oSvyW+82V/cGJQOqaKZPNDKnbUQIgYGTGwtQ3Wx2oDfh5Oihrgt5Zmx6IpttbZssf3sguZYI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":802694},"main":"wechatEmoji.js","types":"wechatEmoji.d.ts","module":"wechatEmoji.js","engines":{"node":">=14.0.0"},"gitHead":"58b70fbc3b96644348b85757950fe7b54b876ba5","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"xiandanhuang","email":"1821655660@qq.com"},"repository":{"url":"git+https://github.com/xxk8/wechat-emojis.git","type":"git"},"_npmVersion":"10.8.2","description":"完整的微信内置表情资源库，包含 109 个高清 PNG 图片和类型安全的 TypeScript API","directories":{},"_nodeVersion":"18.20.5","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/wechat-emojis_1.0.2_1755261445827_0.6379633498536703","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"wechat-emojis","version":"2.0.0","keywords":["wechat","emoji","emojis","微信","表情包","typescript","react","vue","angular"],"author":{"name":"xxk8"},"license":"MIT","_id":"wechat-emojis@2.0.0","maintainers":[{"name":"xiandanhuang","email":"1821655660@qq.com"}],"homepage":"https://xxk8.github.io/wechat-emojis/","bugs":{"url":"https://github.com/xxk8/wechat-emojis/issues"},"dist":{"shasum":"c9d4df7a2da996ef472f6f01e6849fac86155450","tarball":"https://registry.npmjs.org/wechat-emojis/-/wechat-emojis-2.0.0.tgz","fileCount":116,"integrity":"sha512-wSQEoTQHiTwE8JXyefZByVtfKgFnBZb3oABikmDu7b2/ileoEfjRx01JuOzwrFNoMKhi84fwxwXdl3CBfEecCg==","signatures":[{"sig":"MEUCIQDvMhUBK0KppVgbEwN3UCnjSJ7EvLZcIck4X3Kz1mM2LAIgeHcrpYZ7NJ6xwbqEvhG9rmB0a0wqdMNUrMoQJsb30nE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQC/huEiLTfU4thwH4zdHIFKru/fhCJOAZUf+Zf6T6q7qAIgKPfQTN+Y19XUVLfZdmJIuEDKxg3BCkaVJxC5n/hq0Mo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":759820},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.0.0"},"gitHead":"fd280c0d956b29dc48fa4b925d0431b2f8d4ec44","scripts":{"test":"npm run build && npm run typecheck:scripts && npm run typecheck:examples && npm run verify:assets && npm run check:package","build":"tsc","prepare":"node scripts/prepare.ts","typecheck":"tsc --noEmit","build:site":"node scripts/build-site.ts","check:site":"node scripts/check-site.ts","check:package":"node scripts/check-package.ts","verify:assets":"node scripts/verify-assets.ts","typecheck:scripts":"tsc -p tsconfig.scripts.json","typecheck:examples":"tsc --noEmit --target es2017 --module commonjs --moduleResolution node --strict examples/typescript/example.ts"},"_npmUser":{"name":"xiandanhuang","email":"1821655660@qq.com"},"repository":{"url":"git+https://github.com/xxk8/wechat-emojis.git","type":"git"},"_npmVersion":"11.12.1","description":"完整的微信内置表情资源库，包含 109 个高清 PNG 图片和类型安全的 TypeScript API","directories":{},"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.28.2","typescript":"^5.9.2","@types/node":"^22.20.5"},"_npmOperationalInternal":{"tmp":"tmp/wechat-emojis_2.0.0_1792949064004_0.5607426613759414","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"wechat-emojis","version":"2.1.0","keywords":["wechat","emoji","emojis","微信","表情包","typescript","react","vue","angular"],"author":{"name":"xxk8"},"license":"MIT","_id":"wechat-emojis@2.1.0","maintainers":[{"name":"xiandanhuang","email":"1821655660@qq.com"}],"homepage":"https://xxk8.github.io/wechat-emojis/","bugs":{"url":"https://github.com/xxk8/wechat-emojis/issues"},"dist":{"shasum":"99d04974d7d8d930ef3766a7058080796687d9a7","tarball":"https://registry.npmjs.org/wechat-emojis/-/wechat-emojis-2.1.0.tgz","fileCount":116,"integrity":"sha512-FCI7UlVKUSGj8azZaMJGOvYvsUAlZc7sVFWKwrlhBtGSbnI7vvMtVE4x7tPjok0OxQnjyJie25L2WoW77OMtFg==","signatures":[{"sig":"MEUCIGLEKmDjecyAGTIYOIpOVKc1B8PNnjLqRPH26RAGZ4ubAiEAmv3Gwv1kEi9fGW71St/u7HaAW4Gn7ErQ/BdyBm65Qdc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDGyfc6b7l8hldQFx0rnNeVuH8GHbtFJIVW9wXE7WOVMgIgTI9C04JmqkIyE5NkT2oF1Ufh4OrC/l5uuCuPLvPR0bY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":763376},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=14.0.0"},"gitHead":"29e9d645d98f008bfc5aecc312ac28bb524a1a77","scripts":{"test":"npm run build && npm run typecheck:scripts && npm run typecheck:examples && npm run verify:assets && npm run check:package","build":"tsc","prepare":"node scripts/prepare.ts","typecheck":"tsc --noEmit","build:site":"node scripts/build-site.ts","check:site":"node scripts/check-site.ts","check:package":"node scripts/check-package.ts","verify:assets":"node scripts/verify-assets.ts","typecheck:scripts":"tsc -p tsconfig.scripts.json","typecheck:examples":"tsc --noEmit --target es2017 --module commonjs --moduleResolution node --strict examples/typescript/example.ts"},"_npmUser":{"name":"xiandanhuang","email":"1821655660@qq.com"},"repository":{"url":"git+https://github.com/xxk8/wechat-emojis.git","type":"git"},"_npmVersion":"11.12.1","description":"完整的微信内置表情资源库，包含 109 个高清 PNG 图片和类型安全的 TypeScript API","directories":{},"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.28.2","typescript":"^5.9.2","@types/node":"^22.20.5"},"_npmOperationalInternal":{"tmp":"tmp/wechat-emojis_2.1.0_1792955511593_0.8347375787110147","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"_id":"wechat-emojis@2.2.0","bugs":{"url":"https://github.com/xxk8/wechat-emojis/issues"},"dist":{"shasum":"95d3088596b6aefc75b7e3e58ba3adc28396aeb4","tarball":"https://registry.npmjs.org/wechat-emojis/-/wechat-emojis-2.2.0.tgz","fileCount":117,"integrity":"sha512-1eniknPnIsQL3cfhGfyITPf2AZkEpvVxprRcVraASzwKsHwkOz5+OGokGcuq1/s2M1Qrox+ly9pu+sYjIkYj4g==","signatures":[{"sig":"MEYCIQCexnFoEEluKhVxdmKuws/kbN6tfPiYd3Ou9hy8GVnX2wIhALq4VpP9Xnyx+Fj2DRF/GklH1Mcn/KcB0yplQoHnOul3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAGPLLyWoYszcz9ymrjXbZyVhXIE25BkaVExPbnpWT7PAiEA+NPcY6p7PQkTpQeIc7T8hSikhx4ZDAS0DVQ2vCX9TGs="}],"unpackedSize":766748},"main":"dist/index.js","name":"wechat-emojis","types":"dist/index.d.ts","author":{"name":"xxk8"},"engines":{"node":">=14.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.js"},"./dist/*":"./dist/*","./assets/*":"./assets/*","./package.json":"./package.json"},"gitHead":"7546b8c294095c9d18adb72cbde96abdaf4ba980","license":"MIT","scripts":{"test":"npm run build && npm run typecheck:scripts && npm run typecheck:examples && npm run verify:assets && npm run check:package && npm run test:unit","build":"tsc","prepare":"node scripts/prepare.ts","test:unit":"node --test test/*.test.mts","typecheck":"tsc --noEmit","build:site":"node scripts/build-site.ts","check:site":"node scripts/check-site.ts","check:package":"node scripts/check-package.ts","verify:assets":"node scripts/verify-assets.ts","typecheck:scripts":"tsc -p tsconfig.scripts.json","typecheck:examples":"tsc --noEmit --target es2017 --module commonjs --moduleResolution node --strict examples/typescript/example.ts"},"version":"2.2.0","_npmUser":{"name":"xiandanhuang","email":"1821655660@qq.com"},"homepage":"https://xxk8.github.io/wechat-emojis/","keywords":["wechat","emoji","emojis","微信","表情包","typescript","react","vue","angular"],"repository":{"url":"git+https://github.com/xxk8/wechat-emojis.git","type":"git"},"_npmVersion":"11.12.1","description":"109 个微信内置表情 PNG（100×100）与类型安全的 TypeScript API，非官方整理","directories":{},"maintainers":[{"name":"xiandanhuang","email":"1821655660@qq.com"}],"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.28.2","typescript":"^5.9.2","@types/node":"^22.20.5"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wechat-emojis_2.2.0_1792991907826_0.3262800513273998"}}},"time":{"created":"2025-07-26T11:25:10.283Z","modified":"2026-10-26T05:18:28.189Z","1.0.1":"2025-07-25T02:53:01.910Z","1.0.0":"2025-07-26T11:25:10.541Z","1.0.2":"2025-08-15T12:37:26.078Z","2.0.0":"2026-10-25T17:24:24.126Z","2.1.0":"2026-10-25T19:11:51.691Z","2.2.0":"2026-10-26T05:18:27.926Z"},"bugs":{"url":"https://github.com/xxk8/wechat-emojis/issues"},"author":{"name":"xxk8"},"license":"MIT","homepage":"https://xxk8.github.io/wechat-emojis/","keywords":["wechat","emoji","emojis","微信","表情包","typescript","react","vue","angular"],"repository":{"url":"git+https://github.com/xxk8/wechat-emojis.git","type":"git"},"description":"109 个微信内置表情 PNG（100×100）与类型安全的 TypeScript API，非官方整理","maintainers":[{"name":"xiandanhuang","email":"1821655660@qq.com"}],"readme":"# 微信表情包\n\n109 个微信内置表情的 PNG（100×100，透明背景）与类型安全的 TypeScript API，非官方整理，图片版权归腾讯公司所有。\n\n## 在线浏览\n\n[https://xxk8.github.io/wechat-emojis/](https://xxk8.github.io/wechat-emojis/)\n\n网站是纯静态的：`index.html` 由 `site/index.template.html`、`site/app.ts` 和 `src/index.ts` 生成，表情图片直接复用 `assets/`。视觉与交互规范记录在仓库的 `design.md`。\n\n```bash\nnpm run build:site   # 重新生成 index.html（含内联的页面脚本）\nnpm run check:site   # 校验表情数量、资源引用和页面结构\n```\n\n修改表情映射或 `site/` 下的模板、样式、脚本后，重新运行 `build:site` 并提交 `index.html`。GitHub Pages 直接从 `main` 分支根目录发布，不需要构建流水线。\n\n### 全部源码为 TypeScript\n\n仓库里没有手写的 `.js` / `.mjs`：`src/`、`scripts/`、`site/app.ts` 都是 TypeScript。脚本由 Node 的类型剥离直接运行，不产出中间文件；页面脚本由构建时用 esbuild 编译并内联进 `index.html`，所以站点没有额外的 JS 请求。\n\n运行脚本需要 **Node.js ≥ 22.6**（类型剥离）；已发布的 npm 包本身仍支持 Node 14+，因为消费者只用 `dist/` 与 PNG。\n\n```bash\nnpm run typecheck:scripts   # 校验 scripts/ 与 site/app.ts 的类型\n```\n\n迁移细节与取舍记录在仓库的 `docs/TYPESCRIPT.md`。\n\n### npm 包里装的是什么\n\n只装运行时需要的东西，网站源码不随包发布：\n\n| 内容 | 路径 |\n| --- | --- |\n| 运行时 | `dist/index.js`、`dist/index.d.ts` |\n| 表情资源 | `assets/**/*.png`（109 张） |\n| 使用文档 | `docs/API.md`、`docs/NPM_USAGE.md`、`docs/REACT_USAGE.md` |\n| 包说明 | `README.md`、`package.json`、`LICENSE` |\n\n**不会**包含 `site/`、`scripts/`、`src/`、`examples/`、`index.html`、`design.md`、`docs/TYPESCRIPT.md`、`tsconfig*`、`.github/`。白名单在 `package.json` 的 `files` 字段，已显式列到单个文件而不是通配目录。\n\n```bash\nnpm run check:package   # 实际跑 npm pack，断言包内没有开发文件与死链\n```\n\n#### 从本地目录安装时的注意\n\n`files` 字段只作用于 `npm pack` / `publish`。如果直接 `npm install ../wechat-emojis` 指向本地仓库，npm 会以**软链接**把整个仓库接进项目（包括 `site/`、`scripts/`、`index.html`）。这是 npm 对本地路径的固有行为。\n\n要拿到与发布版一致的内容：\n\n```bash\nnpm install ../wechat-emojis --install-links   # 按 files 白名单打包后安装\n# 或者先打包再装\nnpm pack ../wechat-emojis && npm install ./wechat-emojis-2.0.0.tgz\n```\n\n从 npm registry 或 Git 地址安装不受此影响，实际内容仍是上表那 117 个文件。\n\n## 功能特性\n\n- 🎯 **收录 109 个** - 微信内置表情的 PNG 整理，按类别组织\n- 🔧 **TypeScript 支持** - 完整类型定义，编译时错误检查\n- 🚀 **即插即用** - 支持 React、Vue、Angular 等主流框架\n- 📦 **多种导入方式** - ES6 模块、CommonJS、直接文件引用\n- 🔍 **强大 API** - 搜索、分类、随机获取等功能\n- 📱 **统一尺寸** - 全部 PNG 都是 100×100 透明背景，整套 690.3 KB\n- 📚 **详细文档** - 完整 API 文档和使用示例\n\n## 快速开始\n\n### 安装使用\n\n#### 通过 NPM 安装（推荐）\n\n```bash\nnpm install wechat-emojis\n```\n\n就这一步。图片由 jsDelivr 直接从 npm 包提供，用 `getEmojiUrl` 拿到的就是可用的 `<img src>`：\n\n```tsx\nimport { getEmojiUrl } from 'wechat-emojis';\n\n<img src={getEmojiUrl('旺柴')!} alt=\"旺柴\" width={48} height={48} />\n```\n\n**可选：离线 / 自托管**。如果不想依赖 CDN，把图片复制到你的静态目录，改用 `getEmojiPath`：\n\n```bash\nmkdir -p public/assets\ncp -r node_modules/wechat-emojis/assets/* public/assets/\n```\n\n```tsx\nimport { getEmojiPath } from 'wechat-emojis';\n\n<img src={getEmojiPath('旺柴')!} alt=\"旺柴\" width={48} height={48} />\n```\n\n### 基础用法\n\n```typescript\nimport {\n  getEmojiPath,\n  getEmojiUrl,\n  getEmojisByCategory,\n  EmojiCategory,\n  searchEmojis,\n} from 'wechat-emojis';\n\n// 远程 URL，装完就能用\nconst smileUrl = getEmojiUrl('微笑');  // 'https://cdn.jsdelivr.net/npm/wechat-emojis@2/assets/face/%E5%BE%AE%E7%AC%91.png'\n\n// 包内相对路径，配合 public/assets 使用\nconst smilePath = getEmojiPath('微笑');  // 'assets/face/微笑.png'\n\n// 获取分类表情\nconst faceEmojis = getEmojisByCategory(EmojiCategory.FACE);  // 75 个人脸表情\n\n// 搜索表情\nconst laughEmojis = searchEmojis('笑');  // 包含\"笑\"的所有表情\n```\n\n## 项目结构\n\n```text\nwechat-emojis/\n├── index.html          # GitHub Pages 站点（由 scripts/build-site.ts 生成）\n├── design.md           # 站点设计规范与检查清单\n├── site/               # 站点模板、品牌样式、页面样式与 app.ts\n├── src/\n│   └── index.ts        # TypeScript API模块（源码）\n├── dist/               # 构建产物（npm run build 生成，含 index.js 和 index.d.ts）\n├── assets/             # 表情图片资源 (109个PNG文件)\n│   ├── face/          # 人脸表情 (75个)\n│   ├── gesture/       # 手势表情 (10个)\n│   ├── animal/        # 动物表情 (4个)\n│   ├── blessing/      # 祝福表情 (7个)\n│   └── other/         # 其他表情 (13个)\n├── examples/           # 使用示例（TypeScript 和 React）\n├── docs/               # API.md、REACT_USAGE.md、NPM_USAGE.md\n├── scripts/            # 资源校验、站点生成、站点检查与图片优化脚本（全部 .ts）\n└── tsconfig.json       # TypeScript配置\n```\n\n## 使用指南\n\n### React 组件\n\n```tsx\nimport React from 'react';\nimport { getEmojiPath, getEmojisByCategory, EmojiCategory } from 'wechat-emojis';\n\nconst EmojiPicker: React.FC = () => {\n  const faceEmojis = getEmojisByCategory(EmojiCategory.FACE);\n\n  return (\n    <div className=\"emoji-grid\">\n      {faceEmojis.map(emoji => (\n        <img\n          key={emoji.name}\n          src={getEmojiPath(emoji.name)}\n          alt={emoji.name}\n          className=\"emoji-item\"\n          onClick={() => console.log(`选择: ${emoji.name}`)}\n        />\n      ))}\n    </div>\n  );\n};\n```\n\n### Vue 组件\n\n```vue\n<template>\n  <div class=\"emoji-picker\">\n    <img\n      v-for=\"emoji in emojis\"\n      :key=\"emoji.name\"\n      :src=\"getEmojiPath(emoji.name)\"\n      :alt=\"emoji.name\"\n      @click=\"selectEmoji(emoji)\"\n    />\n  </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { getEmojisByCategory, getEmojiPath, EmojiCategory } from 'wechat-emojis';\n\nconst emojis = getEmojisByCategory(EmojiCategory.FACE);\nconst selectEmoji = (emoji) => console.log(`选择: ${emoji.name}`);\n</script>\n```\n\n### 原生 JavaScript\n\n```javascript\n// NPM 包使用\nconst { getEmojiPath, EmojiCategory, searchEmojis } = require('wechat-emojis');\n\n// 创建表情选择器\nfunction createEmojiPicker(containerId) {\n  const container = document.getElementById(containerId);\n  const emojis = searchEmojis('笑');\n\n  emojis.forEach(emoji => {\n    const img = document.createElement('img');\n    img.src = getEmojiPath(emoji.name);\n    img.alt = emoji.name;\n    img.onclick = () => console.log(`选择: ${emoji.name}`);\n    container.appendChild(img);\n  });\n}\n```\n\n### 直接使用图片\n\n```html\n<!-- 直接引用图片文件 -->\n<img src=\"assets/face/微笑.png\" alt=\"微笑\" />\n<img src=\"assets/gesture/OK.png\" alt=\"OK\" />\n<img src=\"assets/animal/猪头.png\" alt=\"猪头\" />\n```\n\n## API 参考\n\n### 核心函数\n\n| 函数 | 参数 | 返回值 | 说明 |\n|------|------|--------|------|\n| `getEmojiPath(name)` | `EmojiName` | `string \\| null` | 获取表情图片路径 |\n| `getEmojiInfo(name)` | `EmojiName` | `EmojiInfo \\| null` | 获取表情详细信息 |\n| `getEmojisByCategory(category)` | `EmojiCategory` | `EmojiInfo[]` | 按类别获取表情列表 |\n| `getAllEmojis()` | - | `EmojiInfo[]` | 获取所有表情 |\n| `searchEmojis(keyword)` | `string` | `EmojiInfo[]` | 按名字子串搜索表情 |\n| `hasEmoji(name)` | `string` | `boolean` | 检查表情是否存在 |\n| `getRandomEmoji(category?)` | `EmojiCategory?` | `EmojiInfo` | 随机获取表情 |\n\n### 类型定义\n\n```typescript\nenum EmojiCategory {\n  FACE = 'face',      // 人脸表情\n  GESTURE = 'gesture', // 手势表情\n  ANIMAL = 'animal',   // 动物表情\n  BLESSING = 'blessing', // 祝福表情\n  OTHER = 'other'      // 其他表情\n}\n\ninterface EmojiInfo {\n  name: string;           // 表情名称\n  category: EmojiCategory; // 表情类别\n  path: string;           // 图片路径\n}\n```\n\n## 数据统计\n\n| 类别 | 数量 | 示例 |\n|------|------|------|\n| 人脸表情 | 75个 | 微笑、大哭、呲牙、捂脸、奸笑、加油 |\n| 手势表情 | 10个 | OK、握手、胜利、抱拳、合十、强、弱 |\n| 动物表情 | 4个 | 猪头、跳跳、发抖、转圈 |\n| 祝福表情 | 7个 | 庆祝、红包、烟花、爆竹 |\n| 其他表情 | 13个 | 爱心、啤酒、蛋糕、太阳、炸弹 |\n| **总计** | **109个** | 非官方整理的微信内置表情 PNG |\n\n## 技术要求\n\n- **TypeScript**: 5.9+（仓库开发需要；使用包时可选用任意 4.0+）\n- **Node.js**: 消费者 14+；运行本仓库的脚本需要 22.6+（类型剥离）\n- **浏览器**: 支持 ES2017+ 的现代浏览器\n- **框架**: React 16+, Vue 3+, Angular 12+ 或原生 JavaScript\n\n## 编译和构建\n\n```bash\n# 编译到 dist/（同时生成 index.d.ts）\nnpm run build\n\n# 仅做类型检查\nnpm run typecheck\n\n# 构建、类型检查、校验 assets 与表情映射，并检查发布包内容\nnpm test\n\n# 重新生成静态站点并校验\nnpm run build:site && npm run check:site\n```\n\n## 常见问题\n\n**Q: 如何在 Webpack 项目中使用？**\n\n```javascript\n// webpack.config.js\nmodule.exports = {\n  resolve: {\n    extensions: ['.ts', '.js']\n  }\n};\n```\n\n**Q: 如何自定义表情路径？**\n\n```typescript\nconst customPath = getEmojiPath('微笑')?.replace('assets/', 'my-assets/');\n```\n\n**Q: 支持哪些图片格式？**\n所有表情均为 PNG 格式，透明背景，适合各种使用场景。\n\n## 版权声明\n\n- 本项目为非官方项目，与腾讯公司及微信团队无关\n- 表情图片版权归腾讯公司所有\n- 本项目仅供个人学习和非商业用途使用\n- 任何商业用途请事先获得腾讯公司的授权\n- 如有侵权问题，请联系作者删除\n\n## 贡献\n\n欢迎提交 Issue 和 Pull Request 来改进项目。\n\n# wechat-emojis\n\n# 请我喝杯茶 | buy me a cup of tea\n\n<div style=\"display: flex; justify-content: center; gap: 20px;\">\n  <img src=\"docs/images/alipay.png\" alt=\"支付宝\" width=\"300\" />\n  <img src=\"docs/images/wechat.png\" alt=\"微信\" width=\"300\" />\n</div>\n","readmeFilename":"README.md"}