{"id":19057424,"url":"https://github.com/femessage/types","last_synced_at":"2026-04-17T09:31:16.347Z","repository":{"id":100171780,"uuid":"311566106","full_name":"FEMessage/types","owner":"FEMessage","description":"🆃 FEMessage basic Typescript type declaration files","archived":false,"fork":false,"pushed_at":"2020-11-11T09:23:02.000Z","size":119,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2025-02-02T15:35:34.459Z","etag":null,"topics":["femessage","type-declarations","typescript"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FEMessage.png","metadata":{"files":{"readme":"README-zh.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-10T06:26:03.000Z","updated_at":"2020-11-11T09:23:05.000Z","dependencies_parsed_at":"2023-05-11T21:30:28.415Z","dependency_job_id":null,"html_url":"https://github.com/FEMessage/types","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FEMessage%2Ftypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FEMessage%2Ftypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FEMessage%2Ftypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FEMessage%2Ftypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FEMessage","download_url":"https://codeload.github.com/FEMessage/types/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240113944,"owners_count":19749829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["femessage","type-declarations","typescript"],"created_at":"2024-11-08T23:57:05.431Z","updated_at":"2025-11-12T09:04:01.791Z","avatar_url":"https://github.com/FEMessage.png","language":"Shell","readme":"# types\n\n[![Build Status](https://badgen.net/travis/FEMessage/types/main)](https://travis-ci.com/FEMessage/types)\n[![NPM Download](https://badgen.net/npm/dm/@femessage/types)](https://www.npmjs.com/package/@femessage/types)\n[![NPM Version](https://badgen.net/npm/v/@femessage/types)](https://www.npmjs.com/package/@femessage/types)\n[![NPM License](https://badgen.net/npm/license/@femessage/types)](https://github.com/FEMessage/types/blob/main/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/FEMessage/types/pulls)\n[![Automated Release Notes by gren](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg)](https://github-tools.github.io/github-release-notes/)\n\nFEMessage 基础 TypeScript 类型声明文件\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Install](#install)\n- [Usage](#Usage)\n- [FAQ](#FAQ)\n- [Contributors](#contributors)\n- [License](#license)\n\n## Introduction\n\n主要用于存放 FEMessage 组件库的底层依赖包的 TypeScript 类型声明，让 FEMessage 组件库的使用者无论安装哪个 Fork 版的底层依赖，都能正常使用类型声明。\n\n目前已有的依赖库类型声明：\n- [Element](https://github.com/ElemeFE/element/tree/dev/types)\n- 后续有需要会增加其它...\n\n此仓库的类型声明文件是由官方包复制出来的，没有作任何修改。\n\n## Install\n\n```bash\nyarn add -D @femessage/types\n```\n\n[⬆ Back to Top](#table-of-contents)\n\n## Usage\n\n```js\nimport { Table,Form } from '@femessage/types/element-ui'\n```\n\n## FAQ\n\n### 这个仓库解决了什么问题？\n\n给 FEMessage 组件库增加 `.d.ts` 文件时发现存在这个问题：由于有部分组件需要依赖 Element 导出的类型声明，FEMessage 组件库依赖的是官方的 Element，但有可能 FEMessage 组件库的使用者在使用其它 Fork 出来的 Element（例如 [@femessage/element-ui](https://github.com/FEMessage/element)），这将导致部分 FEMessage 的类型声明无法正常使用。 \n\n综合考虑，解决方案是将 Element 的类型声明文件拷贝到此仓库，FEMessage 组件库需要依赖 Element 导出的类型，则使用这里的类型文件。\n\n这就意味着，无论 FEMessage 的使用者安装的是官方 Element 还是 Fork 的 Element，都不会影响 FEMessage 组件的类型声明。\n\n上面只是拿 Element 举个例子，实际上 FEMessage 组件库所依赖到的 UI 库都会存在该问题，例如：Vant。\n\n### 如果底层依赖库 API 与官方 API 不一致要怎么做？\n而如果 FEMessage 的使用者安装的 Element 是一个进行较大改动，影响到 `API`，那应该怎么办呢？\n\n举个例子，假设使用者安装的是一个对 `el-table` 组件进行过 `API` 改动的 Fork Element，由于 `API` 已经不一致，这也导致类型声明对应不上，所以无法正常使用依赖了此仓库的 FEMessage 组件。\n\n如果出现这种情况，解决方案的操作步骤：\n1. 将类型声明对应不上的 FEMessage 组件的 `.d.ts` 文件拷贝到项目本地\n2. 将本地的 `.d.ts` 文件中的 `@femessage/types` 替换成项目使用的 Element 路径\n\n```diff\n- import { Table } from '@femessage/types/element-ui'\n+ import { Table } from 'element-ui'\n```\n\n### 哪些 FEMessage 组件在依赖这里？\n目前有以下组件在依赖：\n- el-data-table\n- el-data-tree\n- el-form-renderer\n\n注意：此列表不一定能够及时更新，实际情况可以看组件的 `package.json`\n\n[⬆ Back to Top](#table-of-contents)\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n[⬆ Back to Top](#table-of-contents)\n\n## License\n\n[MIT](./LICENSE)\n\n[⬆ Back to Top](#table-of-contents)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffemessage%2Ftypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffemessage%2Ftypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffemessage%2Ftypes/lists"}