<div align="center">
<br>
<br>
<img src="media/logo.svg" alt="type-fest" height="300">
<br>
<br>
<b>A collection of essential TypeScript types</b>
<br>
<br>
<br>
<br>
<div align="center">
<p>
<p>
<sup>
<a href="https://github.com/sponsors/sindresorhus">Sindre Sorhus' open source work is supported by the community</a>
</sup>
</p>
<sup>Special thanks to:</sup>
<br>
<br>
<a href="https://standardresume.co/tech">
<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="180"/>
</a>
</p>
</div>
<br>
<hr>
</div>
<br>
<br>
[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://giphy.com/gifs/illustration-rainbow-unicorn-26AHG5KGFxSkUWw1i)
[![npm dependents](https://badgen.net/npm/dependents/type-fest)](https://www.npmjs.com/package/type-fest?activeTab=dependents) [![npm downloads](https://badgen.net/npm/dt/type-fest)](https://www.npmjs.com/package/type-fest)
Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
Either add this package as a dependency or copy-paste the needed types. No credit required. ð
PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first.
## Install
```
$ npm install type-fest
```
*Requires TypeScript >=3.4*
## Usage
```ts
import {Except} from 'type-fest';
type Foo = {
unicorn: string;
rainbow: boolean;
};
type FooWithoutRainbow = Except<Foo, 'rainbow'>;
//=> {unicorn: string}
```
## API
Click the type names for complete docs.
### Basic
- [`Primitive`](source/basic.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
- [`TypedArray`](source/typed-array.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
- [`JsonObject`](source/basic.d.ts) - Matches a JSON object.
- [`JsonArray`](source/basic.d.ts) - Matches a JSON array.
- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value.
- [`ObservableLike`](source/basic.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).
### Utilities
- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type).
- [`Mutable`](source/mutable.d.ts) - Create a type that strips `readonly` from all or some of an object's keys. The inverse of `Readonly<T>`.
- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type.
- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys.
- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys.
- [`RequireExactlyOne`](source/require-exactly-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more.
- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep.
- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly<T>`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep.
- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729).
- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`.
- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/).
- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional.
- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required.
- [`ValueOf`](source/value-of.d.ts) - Create a union of the given object's values, and optionally specify which keys to get the values from.
- [`PromiseValue`](source/promise-value.d.ts) - Returns the type that is wrapped inside a `Promise`.
- [`AsyncReturnType`](source/async-return-type.d.ts) - Unwrap the return type of a function that returns a `Promise`.
- [`ConditionalKeys`](source/conditional-keys.d.ts) - Extract keys from a shape where values extend the given `Condition` type.
- [`ConditionalPick`](source/conditional-pick.d.ts) - Like `Pick` except it selects properties from a shape where the values extend the given `Condition` type.
- [`ConditionalExcept`](source/conditional-except.d.ts) - Like `Omit` except it removes properties from a shape where the values extend the given `Condition` type.
- [`UnionToIntersection`](source/union-to-intersection.d.ts) - Convert a union type to an intersection type.
- [`Stringified`](source/stringified.d.ts) - Create a type with the keys of the given type changed to `string` type.
- [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length.
- [`IterableElement`](source/iterable-element.d.ts) - Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator.
- [`Entry`](source/entry.d.ts) - Create a type that represents the type of an entry of a collection.
- [`Entries`](source/entries.d.ts) - Create a type that represents the type of the entries of a collection.
- [`SetReturnType`](source/set-return-type.d.ts) - Create a function type with a return type of your choice and the same parameters as the given function type.
- [`Asyncify`](source/asyncify.d.ts) - Create an async version of the given function type.
### Template literal types
*Note:* These require [TypeScript 4.1 or newer](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#template-literal-types).
- [`CamelCase`](ts41/camel-case.d.ts) â Convert a string literal to camel-case (`fooBar`).
- [`KebabCase`](ts41/kebab-case.d.ts) â Convert a string literal to kebab-case (`foo-bar`).
- [`PascalCase`](ts41/pascal-case.d.ts) â Converts a string literal to pascal-case (`FooBar`)
- [`SnakeCase`](ts41/snake-case.d.ts) â Convert a string literal to snake-case (`foo_bar`).
- [`DelimiterCase`](ts41/delimiter-case.d.ts) â Convert a string literal to a custom string delimiter casing.
- [`Get`](ts41/get.d.ts) - Get a deeply-nested property from an object using a key path, like [Lodash's `.get()`](https://lodash.com/docs/latest#get) function.
### Miscellaneous
- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file).
- [`TsConfigJson`](source/tsconfig-json.d.ts) - Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7).
## Declined types
*If we decline a type addition, we will make sure to document the better solution here.*
- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider.
- [`Dictionary`](https://github.com/sindresorhus/type-fest/i
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
项目资源包含:可运行源码+sql文件+文档 适用人群:学习不同技术领域的小白或进阶学习者;可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 项目具有较高的学习借鉴价值,也可拿来修改、二次开发。 有任何使用上的问题,欢迎随时与博主沟通,博主看到后会第一时间及时解答。 开发语言:Java 框架:ssm 技术:Vue JDK版本:JDK1.8 服务器:tomcat7 数据库:mysql 5.7(一定要5.7版本) 数据库工具:Navicat11 开发软件:eclipse/myeclipse/idea Maven包:Maven3.3.9 ssm+vue 系统是一个很好的项目,使用了SSM(Spring + Spring MVC + MyBatis)框架 和 前端(Vue.js)技术,实现了前后端分离。 后台地址:localhost:8080/项目名称/admin/dist/index.html 前台地址:localhost:8080/项目名称/front/index.html
资源推荐
资源详情
资源评论
收起资源包目录
ssm526班级事务管理系统+vue.zip (1885个子文件)
.babelrc 55B
3-build.bat 16B
2-run.bat 14B
1-install.bat 12B
browserslist 378B
browserslist 378B
browserslist.cmd 369B
browserslist.cmd 369B
cssesc.cmd 360B
sha.js.cmd 357B
mime.cmd 352B
openssl.cnf 11KB
PrettyError.coffee 7KB
ParsedError.coffee 5KB
object.coffee 3KB
array.coffee 2KB
defaultStyle.coffee 1KB
nodePaths.coffee 813B
_prepare.coffee 102B
app.c4c828ca.css 265KB
bootstrap.css 149KB
bootstrap.min.css 118KB
chunk-vendors.1f0a25b2.css 37KB
style.css 5KB
style.css 2KB
keyframes.css 1KB
expected.css 743B
keyframes.post.css 662B
counter-style.css 595B
counter-style.post.css 343B
expected.css 240B
expected.css 191B
expected.css 156B
main.css 133B
expected.css 34B
expected-orange.css 32B
expected-red.css 29B
cssesc 360B
论文.doc 1.75MB
.DS_Store 14KB
.editorconfig 286B
.editorconfig 286B
.editorconfig 239B
.editorconfig 208B
glyphicons-halflings-regular.eot 20KB
.eslintignore 10B
.eslintignore 10B
.eslintrc 303B
.eslintrc 246B
.eslintrc 162B
.eslintrc 31B
.gitattributes 35B
index.html 2KB
directory.html 2KB
index.html 1KB
index.html 930B
index.html 625B
index.html 582B
demo.html 275B
demo.html 186B
logo.ico 17KB
logo.ico 17KB
favicon.ico 4KB
favicon.ico 4KB
CommonController.java 23KB
XueshengController.java 18KB
LaoshiController.java 15KB
ZuoyeController.java 12KB
DictionaryController.java 11KB
QingjiaController.java 11KB
JiangchengController.java 11KB
ChengjiController.java 10KB
KaoqinController.java 9KB
HuidaController.java 9KB
ClazzController.java 8KB
QingjiaEntity.java 7KB
JiangchengEntity.java 6KB
XueshengEntity.java 6KB
ZuoyeEntity.java 6KB
QingjiaVO.java 5KB
HuidaView.java 5KB
MPUtil.java 5KB
DictionaryServiceImpl.java 5KB
LaoshiEntity.java 5KB
CommonServiceImpl.java 5KB
ChengjiEntity.java 5KB
UsersController.java 5KB
QingjiaModel.java 5KB
JiangchengVO.java 5KB
XueshengVO.java 5KB
DictionaryEntity.java 4KB
KaoqinEntity.java 4KB
ZuoyeVO.java 4KB
JiangchengModel.java 4KB
XueshengModel.java 4KB
ZuoyeModel.java 4KB
LaoshiVO.java 4KB
CommonDao.java 4KB
BaiduUtil.java 4KB
ChengjiVO.java 4KB
共 1885 条
- 1
- 2
- 3
- 4
- 5
- 6
- 19
资源评论
大叔_爱编程
- 粉丝: 5457
- 资源: 3528
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功