[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3809":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},3809,"type-fest","sindresorhus\u002Ftype-fest","sindresorhus","A collection of essential TypeScript types","",null,"TypeScript",17186,708,50,186,0,9,62,1,79.25,"Creative Commons Zero v1.0 Universal",false,"main",[25,26,27,28,29],"npm-package","types","typescript","typescript-definitions","utilities","2026-06-12 04:00:19","\u003Cdiv align=\"center\">\n\t\u003Cbr>\n\t\u003Cbr>\n\t\u003Cimg src=\"media\u002Flogo.svg\" alt=\"type-fest\" height=\"300\">\n\t\u003Cbr>\n\t\u003Cbr>\n\t\u003Cb>A collection of essential TypeScript types\u003C\u002Fb>\n\t\u003Cbr>\n\t\u003Cbr>\n\t\u003Cbr>\n\t\u003Cbr>\n\t\u003Chr>\n\t\u003Cdiv align=\"center\">\n\t\t\u003Cp>\n\t\t\t\u003Cp>\n\t\t\t\t\u003Csup>\n\t\t\t\t\t\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fsindresorhus\">Sindre Sorhus' open source work is supported by the community\u003C\u002Fa>\n\t\t\t\t\u003C\u002Fsup>\n\t\t\t\u003C\u002Fp>\n\t\t\t\u003Csup>Special thanks to:\u003C\u002Fsup>\n\t\t\t\u003Cbr>\n\t\t\t\u003Cbr>\n\t\t\t\u003Ca href=\"https:\u002F\u002Fnitric.io\u002F?utm_campaign=github_repo&utm_medium=referral&utm_content=sindresorhus&utm_source=github\">\n\t\t\t\t\u003Cdiv>\n\t\t\t\t\t\u003Cimg width=\"230\" src=\"https:\u002F\u002Fsindresorhus.com\u002Fassets\u002Fthanks\u002Fnitric-logo.svg\" alt=\"nitric logo\">\n\t\t\t\t\u003C\u002Fdiv>\n\t\t\t\t\u003Cb>Effortless backends with infrastructure from code\u003C\u002Fb>\n\t\t\t\t\u003Cdiv>\n\t\t\t\t\t\u003Csup>An open-source framework that supports any programming language, cloud provider, or deployment automation tool.\u003C\u002Fsup>\n\t\t\t\t\u003C\u002Fdiv>\n\t\t\t\u003C\u002Fa>\n\t\t\t\u003Cbr>\n\t\t\t\u003Cbr>\n\t\t\t\u003Ca href=\"https:\u002F\u002Fcircleback.ai?utm_source=sindresorhus&utm_medium=sponsorship&utm_campaign=awesome-list&utm_id=type-fest\">\n\t\t\t\t\u003Cdiv>\n\t\t\t\t\t\u003Cimg width=\"300\" src=\"https:\u002F\u002Fsindresorhus.com\u002Fassets\u002Fthanks\u002Fcircleback-logo.png?x\" alt=\"Circleback logo\">\n\t\t\t\t\u003C\u002Fdiv>\n\t\t\t\t\u003Cb>Get the most out of every conversation.\u003C\u002Fb>\n\t\t\t\t\u003Cdiv>\n\t\t\t\t\t\u003Csup>AI-powered meeting notes, automations, and search. Give AI agents the context they need to get things done.\u003C\u002Fsup>\n\t\t\t\t\u003C\u002Fdiv>\n\t\t\t\u003C\u002Fa>\n\t\t\u003C\u002Fp>\n\t\u003C\u002Fdiv>\n\t\u003Cbr>\n\t\u003Chr>\n\u003C\u002Fdiv>\n\u003Cbr>\n\u003Cbr>\n\n[![](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Funicorn-approved-ff69b4.svg)](https:\u002F\u002Fgiphy.com\u002Fgifs\u002Fillustration-rainbow-unicorn-26AHG5KGFxSkUWw1i)\n[![npm dependents](https:\u002F\u002Fbadgen.net\u002Fnpm\u002Fdependents\u002Ftype-fest)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Ftype-fest?activeTab=dependents)\n[![npm downloads](https:\u002F\u002Fbadgen.net\u002Fnpm\u002Fdt\u002Ftype-fest)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Ftype-fest)\n\nMany of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https:\u002F\u002Fgithub.com\u002FMicrosoft\u002FTypeScript\u002Fblob\u002Fmain\u002FCONTRIBUTING.md).\n\nEither add this package as a dependency or copy-paste the needed types. No credit required. 👌\n\nPR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github\u002Fcontributing.md) first.\n\n**Help wanted with reviewing [proposals](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fissues) and [pull requests](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fpulls).**\n\n## Install\n\n```sh\nnpm install type-fest\n```\n\n*Requires TypeScript >=5.9, [ESM](https:\u002F\u002Fgist.github.com\u002Fsindresorhus\u002Fa39789f98801d908bbc7ff3ecc99d99c), and [`{strict: true}`](https:\u002F\u002Fwww.typescriptlang.org\u002Ftsconfig#strict) in your tsconfig.*\n\n> [!NOTE]\n> This readme shows the current development version. For docs about the latest version, see the [npm page](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Ftype-fest).\n\n*You may also like my [`ts-extras`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Fts-extras) package which provides runtime functions for some of these types.*\n\n## Usage\n\n```ts\nimport type {Except} from 'type-fest';\n\ntype Foo = {\n\tunicorn: string;\n\trainbow: boolean;\n};\n\ntype FooWithoutRainbow = Except\u003CFoo, 'rainbow'>;\n\u002F\u002F=> {unicorn: string}\n```\n\n## API\n\nClick the type names for complete docs.\n\n### Basic\n\n- [`Primitive`](source\u002Fprimitive.d.ts) - Matches any [primitive value](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FGlossary\u002FPrimitive).\n- [`Class`](source\u002Fbasic.d.ts) - Matches a [`class`](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FClasses).\n- [`Constructor`](source\u002Fbasic.d.ts) - Matches a [`class` constructor](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FClasses).\n- [`AbstractClass`](source\u002Fbasic.d.ts) - Matches an [`abstract class`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Fclasses.html#abstract-classes-and-members).\n- [`AbstractConstructor`](source\u002Fbasic.d.ts) - Matches an [`abstract class`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Frelease-notes\u002Ftypescript-4-2.html#abstract-construct-signatures) constructor.\n- [`TypedArray`](source\u002Ftyped-array.d.ts) - Matches any [typed array](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FGlobal_Objects\u002FTypedArray), like `Uint8Array` or `Float64Array`.\n- [`ObservableLike`](source\u002Fglobals\u002Fobservable-like.d.ts) - Matches a value that is like an [Observable](https:\u002F\u002Fgithub.com\u002Ftc39\u002Fproposal-observable).\n- [`LowercaseLetter`](source\u002Fcharacters.d.ts) - Matches any lowercase letter in the basic Latin alphabet (a-z).\n- [`UppercaseLetter`](source\u002Fcharacters.d.ts) - Matches any uppercase letter in the basic Latin alphabet (A-Z).\n- [`DigitCharacter`](source\u002Fcharacters.d.ts) - Matches any digit as a string ('0'-'9').\n- [`Alphanumeric`](source\u002Fcharacters.d.ts) - Matches any lowercase letter (a-z), uppercase letter (A-Z), or digit ('0'-'9') in the basic Latin alphabet.\n\n### Utilities\n\n- [`EmptyObject`](source\u002Fempty-object.d.ts) - Represents a strictly empty plain object, the `{}` value.\n- [`NonEmptyObject`](source\u002Fnon-empty-object.d.ts) - Represents an object with at least 1 non-optional key.\n- [`UnknownRecord`](source\u002Funknown-record.d.ts) - Represents an object with `unknown` value. You probably want this instead of `{}`.\n- [`UnknownArray`](source\u002Funknown-array.d.ts) - Represents an array with `unknown` value.\n- [`UnknownMap`](source\u002Funknown-map.d.ts) - Represents a map with `unknown` key and value.\n- [`UnknownSet`](source\u002Funknown-set.d.ts) - Represents a set with `unknown` value.\n- [`Except`](source\u002Fexcept.d.ts) - Create a type from an object type without certain keys.\n- [`Writable`](source\u002Fwritable.d.ts) - Create a type that strips `readonly` from the given type. Inverse of `Readonly\u003CT>`.\n- [`WritableDeep`](source\u002Fwritable-deep.d.ts) - Create a deeply mutable version of an `object`\u002F`ReadonlyMap`\u002F`ReadonlySet`\u002F`ReadonlyArray` type. The inverse of `ReadonlyDeep\u003CT>`. Use `Writable\u003CT>` if you only need one level deep.\n- [`Merge`](source\u002Fmerge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type.\n- [`ObjectMerge`](source\u002Fobject-merge.d.ts) - Merge two object types into a new object type, where keys from the second override keys from the first.\n- [`MergeDeep`](source\u002Fmerge-deep.d.ts) - Merge two objects or two arrays\u002Ftuples recursively into a new type.\n- [`MergeExclusive`](source\u002Fmerge-exclusive.d.ts) - Create a type that has mutually exclusive keys.\n- [`OverrideProperties`](source\u002Foverride-properties.d.ts) - Override existing properties of the given type. Similar to `Merge`, but enforces that the original type has the properties you want to override.\n- [`RequireAtLeastOne`](source\u002Frequire-at-least-one.d.ts) - Create a type that requires at least one of the given keys, while keeping the remaining keys as is.\n- [`RequireExactlyOne`](source\u002Frequire-exactly-one.d.ts) - Create a type that requires exactly one of the given keys and disallows more, while keeping the remaining keys as is.\n- [`RequireAllOrNone`](source\u002Frequire-all-or-none.d.ts) - Create a type that requires all of the given keys or none of the given keys, while keeping the remaining keys as is.\n- [`RequireOneOrNone`](source\u002Frequire-one-or-none.d.ts) - Create a type that requires exactly one of the given keys or none of the given keys, while keeping the remaining keys as is.\n- [`SingleKeyObject`](source\u002Fsingle-key-object.d.ts) - Create a type that only accepts an object with a single key.\n- [`RequiredDeep`](source\u002Frequired-deep.d.ts) - Create a deeply required version of another type.\n- [`PickDeep`](source\u002Fpick-deep.d.ts) - Pick properties from a deeply-nested object.\n- [`OmitDeep`](source\u002Fomit-deep.d.ts) - Omit properties from a deeply-nested object.\n- [`OmitIndexSignature`](source\u002Fomit-index-signature.d.ts) - Omit any index signatures from the given object type, leaving only explicitly defined properties.\n- [`PickIndexSignature`](source\u002Fpick-index-signature.d.ts) - Pick only index signatures from the given object type, leaving out all explicitly defined properties.\n- [`PartialDeep`](source\u002Fpartial-deep.d.ts) - Create a deeply optional version of another type.\n- [`PartialOnUndefinedDeep`](source\u002Fpartial-on-undefined-deep.d.ts) - Create a deep version of another type where all keys accepting `undefined` type are set to optional.\n- [`UndefinedOnPartialDeep`](source\u002Fundefined-on-partial-deep.d.ts) - Create a deep version of another type where all optional keys are set to also accept `undefined`.\n- [`UnwrapPartial`](source\u002Funwrap-partial.d.ts) - Revert the `Partial` modifier on an object type.\n- [`ReadonlyDeep`](source\u002Freadonly-deep.d.ts) - Create a deeply immutable version of another type.\n- [`LiteralUnion`](source\u002Fliteral-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.\n- [`Tagged`](source\u002Ftagged.d.ts) - Create a [tagged type](https:\u002F\u002Fmedium.com\u002F@KevinBGreene\u002Fsurviving-the-typescript-ecosystem-branding-and-type-tagging-6cf6e516523d) that can support [multiple tags](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fissues\u002F665) and [per-tag metadata](https:\u002F\u002Fmedium.com\u002F@ethanresnick\u002Fadvanced-typescript-tagged-types-improved-with-type-level-metadata-5072fc125fcf).\n- [`UnwrapTagged`](source\u002Ftagged.d.ts) - Get the untagged portion of a tagged type created with `Tagged`.\n- [`InvariantOf`](source\u002Finvariant-of.d.ts) - Create an [invariant type](https:\u002F\u002Fbasarat.gitbook.io\u002Ftypescript\u002Ftype-system\u002Ftype-compatibility#footnote-invariance), which is a type that does not accept supertypes and subtypes.\n- [`SetOptional`](source\u002Fset-optional.d.ts) - Create a type that makes the given keys optional, while keeping the remaining keys as is.\n- [`SetReadonly`](source\u002Fset-readonly.d.ts) - Create a type that makes the given keys readonly, while keeping the remaining keys as is.\n- [`SetRequired`](source\u002Fset-required.d.ts) - Create a type that makes the given keys required, while keeping the remaining keys as is.\n- [`SetRequiredDeep`](source\u002Fset-required-deep.d.ts) - Create a type that makes the given keys required, with support for deeply nested key paths, while keeping the remaining keys as is.\n- [`SetNonNullable`](source\u002Fset-non-nullable.d.ts) - Create a type that makes the given keys non-nullable, while keeping the remaining keys as is.\n- [`SetNonNullableDeep`](source\u002Fset-non-nullable-deep.d.ts) - Create a type that makes the specified keys non-nullable (removes `null` and `undefined`), supports deeply nested key paths, and leaves all other keys unchanged.\n- [`NonNullableDeep`](source\u002Fnon-nullable-deep.d.ts) - Recursively removes `null` and `undefined` from the specified type.\n- [`ValueOf`](source\u002Fvalue-of.d.ts) - Create a union of the given object's values, and optionally specify which keys to get the values from.\n- [`ConditionalKeys`](source\u002Fconditional-keys.d.ts) - Extract the keys from a type where the value type of the key extends the given `Condition`.\n- [`ConditionalPick`](source\u002Fconditional-pick.d.ts) - Pick keys from the shape that matches the given `Condition`.\n- [`ConditionalPickDeep`](source\u002Fconditional-pick-deep.d.ts) - Pick keys recursively from the shape that matches the given condition.\n- [`ConditionalExcept`](source\u002Fconditional-except.d.ts) - Exclude keys from a shape that matches the given `Condition`.\n- [`UnionToIntersection`](source\u002Funion-to-intersection.d.ts) - Convert a union type to an intersection type.\n- [`LiteralToPrimitive`](source\u002Fliteral-to-primitive.d.ts) - Given a [literal type](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Feveryday-types.html#literal-types) return the [primitive type](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FGlossary\u002FPrimitive) it belongs to, or `never` if it's not a primitive.\n- [`LiteralToPrimitiveDeep`](source\u002Fliteral-to-primitive-deep.d.ts) - Like `LiteralToPrimitive` except it converts literal types inside an object or array deeply.\n- [`Stringified`](source\u002Fstringified.d.ts) - Create a type with the keys of the given type changed to `string` type.\n- [`IterableElement`](source\u002Fiterable-element.d.ts) - Get the element type of an `Iterable`\u002F`AsyncIterable`. For example, `Array`, `Set`, `Map`, generator, stream, etc.\n- [`Entry`](source\u002Fentry.d.ts) - Create a type that describes a single key-value pair produced when calling a collection’s `entries` method.\n- [`Entries`](source\u002Fentries.d.ts) - Create a type that describes the key-value pairs produced when calling a collection’s `entries` method.\n- [`SetReturnType`](source\u002Fset-return-type.d.ts) - Create a function type with a return type of your choice and the same parameters as the given function type.\n- [`SetParameterType`](source\u002Fset-parameter-type.d.ts) - Create a function that replaces some parameters with the given parameters.\n- [`Simplify`](source\u002Fsimplify.d.ts) - Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.\n- [`SimplifyDeep`](source\u002Fsimplify-deep.d.ts) - Deeply simplifies an object type.\n- [`Get`](source\u002Fget.d.ts) - Get a deeply-nested property from an object using a key path, like [Lodash's `.get()`](https:\u002F\u002Flodash.com\u002Fdocs\u002Flatest#get) function.\n- [`KeyAsString`](source\u002Fkey-as-string.d.ts) - Get keys of the given type as strings.\n- [`Schema`](source\u002Fschema.d.ts) - Create a deep version of another object type where property values are recursively replaced into a given value type.\n- [`Exact`](source\u002Fexact.d.ts) - Create a type that does not allow extra properties, meaning it only allows properties that are explicitly declared.\n- [`KeysOfUnion`](source\u002Fkeys-of-union.d.ts) - Create a union of all keys from a given type, even those exclusive to specific union members.\n- [`OptionalKeysOf`](source\u002Foptional-keys-of.d.ts) - Extract all optional keys from the given type.\n- [`HasOptionalKeys`](source\u002Fhas-optional-keys.d.ts) - Returns a boolean for whether the given type has any optional fields.\n- [`RequiredKeysOf`](source\u002Frequired-keys-of.d.ts) - Extract all required keys from the given type.\n- [`HasRequiredKeys`](source\u002Fhas-required-keys.d.ts) - Returns a boolean for whether the given type has any required fields.\n- [`ReadonlyKeysOf`](source\u002Freadonly-keys-of.d.ts) - Extract all readonly keys from the given type.\n- [`HasReadonlyKeys`](source\u002Fhas-readonly-keys.d.ts) - Returns a boolean for whether the given type has any readonly fields.\n- [`WritableKeysOf`](source\u002Fwritable-keys-of.d.ts) - Extract all writable keys from the given type.\n- [`HasWritableKeys`](source\u002Fhas-writable-keys.d.ts) - Returns a boolean for whether the given type has any writable fields.\n- [`Spread`](source\u002Fspread.d.ts) - Mimic the type inferred by TypeScript when merging two objects or two arrays\u002Ftuples using the spread syntax.\n- [`IsEqual`](source\u002Fis-equal.d.ts) - Returns a boolean for whether the two given types are equal.\n- [`TaggedUnion`](source\u002Ftagged-union.d.ts) - Create a union of types that share a common discriminant property.\n- [`IntRange`](source\u002Fint-range.d.ts) - Generate a union of numbers between a specified start (inclusive) and end (exclusive), with an optional step.\n- [`IntClosedRange`](source\u002Fint-closed-range.d.ts) - Generate a union of numbers between a specified start and end (both inclusive), with an optional step.\n- [`ArrayIndices`](source\u002Farray-indices.d.ts) - Provides valid indices for a constant array or tuple.\n- [`ArrayValues`](source\u002Farray-values.d.ts) - Provides all values for a constant array or tuple.\n- [`ArraySplice`](source\u002Farray-splice.d.ts) - Create a new array type by adding or removing elements at a specified index range in the original array.\n- [`ArrayTail`](source\u002Farray-tail.d.ts) - Extract the type of an array or tuple minus the first element.\n- [`SetFieldType`](source\u002Fset-field-type.d.ts) - Create a type that changes the type of the given keys.\n- [`Paths`](source\u002Fpaths.d.ts) - Generate a union of all possible paths to properties in the given object.\n- [`SharedUnionFields`](source\u002Fshared-union-fields.d.ts) - Create a type with shared fields from a union of object types.\n- [`SharedUnionFieldsDeep`](source\u002Fshared-union-fields-deep.d.ts) - Create a type with shared fields from a union of object types, deeply traversing nested structures.\n- [`AllUnionFields`](source\u002Fall-union-fields.d.ts) - Create a type with all fields from a union of object types.\n- [`DistributedOmit`](source\u002Fdistributed-omit.d.ts) - Omits keys from a type, distributing the operation over a union.\n- [`DistributedPick`](source\u002Fdistributed-pick.d.ts) - Pick keys from a type, distributing the operation over a union.\n- [`And`](source\u002Fand.d.ts) - Returns a boolean for whether two given types are both `true`.\n- [`Or`](source\u002For.d.ts) - Returns a boolean for whether either of two given types is `true`.\n- [`Xor`](source\u002Fxor.d.ts) - Returns a boolean for whether only one of two given types is `true`.\n- [`AndAll`](source\u002Fand-all.d.ts) - Returns a boolean for whether all of the given elements are `true`.\n- [`OrAll`](source\u002For-all.d.ts) - Returns a boolean for whether any of the given elements is `true`.\n- [`AllExtend`](source\u002Fall-extend.d.ts) - Returns a boolean for whether every element in an array type extends another type.\n- [`SomeExtend`](source\u002Fsome-extend.d.ts) - Returns a boolean for whether some element in an array type extends another type.\n- [`NonEmptyTuple`](source\u002Fnon-empty-tuple.d.ts) - Matches any non-empty tuple.\n- [`NonEmptyString`](source\u002Fnon-empty-string.d.ts) - Matches any non-empty string.\n- [`FindGlobalType`](source\u002Ffind-global-type.d.ts) - Tries to find the type of a global with the given name.\n- [`FindGlobalInstanceType`](source\u002Ffind-global-type.d.ts) - Tries to find one or more types from their globally-defined constructors.\n- [`ConditionalSimplify`](source\u002Fconditional-simplify.d.ts) - Simplifies a type while including and\u002For excluding certain types from being simplified.\n- [`ConditionalSimplifyDeep`](source\u002Fconditional-simplify-deep.d.ts) - Recursively simplifies a type while including and\u002For excluding certain types from being simplified.\n- [`ExclusifyUnion`](source\u002Fexclusify-union.d.ts) - Ensure mutual exclusivity in object unions by adding other members’ keys as `?: never`.\n- [`Optional`](source\u002Foptional.d.ts) - Create a type that represents either the value or `undefined`, while stripping `null` from the type.\n- [`UnionMember`](source\u002Funion-member.d.ts) - Returns an arbitrary member of a union type.\n- [`UnionLength`](source\u002Funion-length.d.ts) - Returns the length of a union type.\n\n### Type Guard\n\n- [`If`](source\u002Fif.d.ts) - An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.\n- [`IsLiteral`](source\u002Fis-literal.d.ts) - Returns a boolean for whether the given type is a [literal type](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Feveryday-types.html#literal-types).\n- [`IsStringLiteral`](source\u002Fis-literal.d.ts) - Returns a boolean for whether the given type is a `string` [literal type](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Feveryday-types.html#literal-types).\n- [`IsNumericLiteral`](source\u002Fis-literal.d.ts) - Returns a boolean for whether the given type is a `number` or `bigint` [literal type](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Feveryday-types.html#literal-types).\n- [`IsBooleanLiteral`](source\u002Fis-literal.d.ts) - Returns a boolean for whether the given type is a `true` or `false` [literal type](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Feveryday-types.html#literal-types).\n- [`IsSymbolLiteral`](source\u002Fis-literal.d.ts) - Returns a boolean for whether the given type is a `symbol` [literal type](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Feveryday-types.html#literal-types).\n- [`IsAny`](source\u002Fis-any.d.ts) - Returns a boolean for whether the given type is `any`.\n- [`IsNever`](source\u002Fis-never.d.ts) - Returns a boolean for whether the given type is `never`.\n- [`IsUnknown`](source\u002Fis-unknown.d.ts) - Returns a boolean for whether the given type is `unknown`.\n- [`IsEmptyObject`](source\u002Fempty-object.d.ts) - Returns a boolean for whether the type is strictly equal to an empty plain object, the `{}` value.\n- [`IsNull`](source\u002Fis-null.d.ts) - Returns a boolean for whether the given type is `null`.\n- [`IsUndefined`](source\u002Fis-undefined.d.ts) - Returns a boolean for whether the given type is `undefined`.\n- [`IsTuple`](source\u002Fis-tuple.d.ts) - Returns a boolean for whether the given array is a tuple.\n- [`IsUnion`](source\u002Fis-union.d.ts) - Returns a boolean for whether the given type is a union.\n- [`IsLowercase`](source\u002Fis-lowercase.d.ts) - Returns a boolean for whether the given string literal is lowercase.\n- [`IsUppercase`](source\u002Fis-uppercase.d.ts) - Returns a boolean for whether the given string literal is uppercase.\n- [`IsOptional`](source\u002Fis-optional.d.ts) - Returns a boolean for whether the given type includes `undefined`.\n- [`IsNullable`](source\u002Fis-nullable.d.ts) - Returns a boolean for whether the given type includes `null`.\n- [`IsOptionalKeyOf`](source\u002Fis-optional-key-of.d.ts) - Returns a boolean for whether the given key is an optional key of type.\n- [`IsRequiredKeyOf`](source\u002Fis-required-key-of.d.ts) - Returns a boolean for whether the given key is a required key of type.\n- [`IsReadonlyKeyOf`](source\u002Fis-readonly-key-of.d.ts) - Returns a boolean for whether the given key is a readonly key of type.\n- [`IsWritableKeyOf`](source\u002Fis-writable-key-of.d.ts) - Returns a boolean for whether the given key is a writable key of type.\n\n### JSON\n\n- [`Jsonify`](source\u002Fjsonify.d.ts) - Transform a type to one that is assignable to the `JsonValue` type.\n- [`Jsonifiable`](source\u002Fjsonifiable.d.ts) - Matches a value that can be losslessly converted to JSON.\n- [`JsonPrimitive`](source\u002Fjson-value.d.ts) - Matches any valid JSON primitive value.\n- [`JsonObject`](source\u002Fjson-value.d.ts) - Matches a JSON object.\n- [`JsonArray`](source\u002Fjson-value.d.ts) - Matches a JSON array.\n- [`JsonValue`](source\u002Fjson-value.d.ts) - Matches any valid JSON value.\n\n### Structured clone\n\n- [`StructuredCloneable`](source\u002Fstructured-cloneable.d.ts) - Matches a value that can be losslessly cloned using `structuredClone`.\n\n### Async\n\n- [`Promisable`](source\u002Fpromisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`.\n- [`AsyncReturnType`](source\u002Fasync-return-type.d.ts) - Unwrap the return type of a function that returns a `Promise`.\n- [`Asyncify`](source\u002Fasyncify.d.ts) - Create an async version of the given function type, by boxing the return type in `Promise` while keeping the same parameter types.\n\n### String\n\n- [`Trim`](source\u002Ftrim.d.ts) - Remove leading and trailing spaces from a string.\n- [`Split`](source\u002Fsplit.d.ts) - Represents an array of strings split using a given character or character set.\n- [`Words`](source\u002Fwords.d.ts) - Split a string similar to Lodash's `_.words()` function.\n- [`Replace`](source\u002Freplace.d.ts) - Represents a string with some or all matches replaced by a replacement.\n- [`StringSlice`](source\u002Fstring-slice.d.ts) - Returns a string slice of a given range, just like `String#slice()`.\n- [`StringRepeat`](source\u002Fstring-repeat.d.ts) - Returns a new string which contains the specified number of copies of a given string, just like `String#repeat()`.\n- [`RemovePrefix`](source\u002Fremove-prefix.d.ts) - Remove the specified prefix from the start of a string.\n\n### Array\n\n- [`Arrayable`](source\u002Farrayable.d.ts) - Create a type that represents either the value or an array of the value.\n- [`Includes`](source\u002Fincludes.d.ts) - Returns a boolean for whether the given array includes the given item.\n- [`Join`](source\u002Fjoin.d.ts) - Join an array of strings and\u002For numbers using the given string as a delimiter.\n- [`ArraySlice`](source\u002Farray-slice.d.ts) - Returns an array slice of a given range, just like `Array#slice()`.\n- [`ArrayElement`](source\u002Farray-element.d.ts) - Extracts the element type of an array or tuple.\n- [`LastArrayElement`](source\u002Flast-array-element.d.ts) - Extract the type of the last element of an array.\n- [`FixedLengthArray`](source\u002Ffixed-length-array.d.ts) - Create a type that represents an array of the given type and length. The `Array` prototype methods that manipulate its length are excluded from the resulting type.\n- [`MultidimensionalArray`](source\u002Fmultidimensional-array.d.ts) - Create a type that represents a multidimensional array of the given type and dimension.\n- [`MultidimensionalReadonlyArray`](source\u002Fmultidimensional-readonly-array.d.ts) - Create a type that represents a multidimensional readonly array of the given type and dimension.\n- [`ReadonlyTuple`](source\u002Freadonly-tuple.d.ts) - Create a type that represents a read-only tuple of the given type and length.\n- [`TupleToUnion`](source\u002Ftuple-to-union.d.ts) - Convert a tuple\u002Farray into a union type of its elements.\n- [`UnionToTuple`](source\u002Funion-to-tuple.d.ts) - Convert a union type into an unordered tuple type of its elements.\n- [`TupleToObject`](source\u002Ftuple-to-object.d.ts) - Transforms a tuple into an object, mapping each tuple index to its corresponding type as a key-value pair.\n- [`TupleOf`](source\u002Ftuple-of.d.ts) - Create a tuple type of the specified length with elements of the specified type.\n- [`SplitOnRestElement`](source\u002Fsplit-on-rest-element.d.ts) - Splits an array into three parts, where the first contains all elements before the rest element, the second is the [`rest`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Fobjects.html#tuple-types) element itself, and the third contains all elements after the rest element.\n- [`ExtractRestElement`](source\u002Fextract-rest-element.d.ts) - Extract the [`rest`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Fobjects.html#tuple-types) element type from an array.\n- [`ExcludeRestElement`](source\u002Fexclude-rest-element.d.ts) - Create a tuple with the [`rest`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F2\u002Fobjects.html#tuple-types) element removed.\n- [`ArrayReverse`](source\u002Farray-reverse.d.ts) - Reverse the order of elements in a tuple type.\n- [`ArrayLength`](source\u002Farray-length.d.ts) - Return the length of an array. Equivalent to `T['length']` where `T` extends any array.\n\n### Numeric\n\n- [`PositiveInfinity`](source\u002Fnumeric.d.ts) - Matches the hidden `Infinity` type.\n- [`NegativeInfinity`](source\u002Fnumeric.d.ts) - Matches the hidden `-Infinity` type.\n- [`Finite`](source\u002Fnumeric.d.ts) - A finite `number`.\n- [`Integer`](source\u002Fnumeric.d.ts) - A `number` that is an integer.\n- [`Float`](source\u002Fnumeric.d.ts) - A `number` that is not an integer.\n- [`NegativeFloat`](source\u002Fnumeric.d.ts) - A negative (`-∞ \u003C x \u003C 0`) `number` that is not an integer.\n- [`Negative`](source\u002Fnumeric.d.ts) - A negative `number`\u002F`bigint` (`-∞ \u003C x \u003C 0`)\n- [`NonNegative`](source\u002Fnumeric.d.ts) - A non-negative `number`\u002F`bigint` (`0 \u003C= x \u003C ∞`).\n- [`NegativeInteger`](source\u002Fnumeric.d.ts) - A negative (`-∞ \u003C x \u003C 0`) `number` that is an integer.\n- [`NonNegativeInteger`](source\u002Fnumeric.d.ts) - A non-negative (`0 \u003C= x \u003C ∞`) `number` that is an integer.\n- [`IsNegative`](source\u002Fnumeric.d.ts) - Returns a boolean for whether the given number is a negative number.\n- [`IsFloat`](source\u002Fis-float.d.ts) - Returns a boolean for whether the given number is a float, like `1.5` or `-1.5`.\n- [`IsInteger`](source\u002Fis-integer.d.ts) - Returns a boolean for whether the given number is an integer, like `-5`, `1.0`, or `100`.\n- [`GreaterThan`](source\u002Fgreater-than.d.ts) - Returns a boolean for whether a given number is greater than another number.\n- [`GreaterThanOrEqual`](source\u002Fgreater-than-or-equal.d.ts) - Returns a boolean for whether a given number is greater than or equal to another number.\n- [`LessThan`](source\u002Fless-than.d.ts) - Returns a boolean for whether a given number is less than another number.\n- [`LessThanOrEqual`](source\u002Fless-than-or-equal.d.ts) - Returns a boolean for whether a given number is less than or equal to another number.\n- [`Sum`](source\u002Fsum.d.ts) - Returns the sum of two numbers.\n- [`Subtract`](source\u002Fsubtract.d.ts) - Returns the difference between two numbers.\n- [`Absolute`](source\u002Fabsolute.d.ts) - Returns the absolute value of the specified number or bigint.\n\n### Change case\n\n- [`CamelCase`](source\u002Fcamel-case.d.ts) - Convert a string literal to camel-case.\n- [`CamelCasedProperties`](source\u002Fcamel-cased-properties.d.ts) - Convert top-level object properties to camel case.\n- [`CamelCasedPropertiesDeep`](source\u002Fcamel-cased-properties-deep.d.ts) - Convert object properties to camel case recursively.\n- [`KebabCase`](source\u002Fkebab-case.d.ts) - Convert a string literal to kebab-case.\n- [`KebabCasedProperties`](source\u002Fkebab-cased-properties.d.ts) - Convert top-level object properties to kebab case.\n- [`KebabCasedPropertiesDeep`](source\u002Fkebab-cased-properties-deep.d.ts) - Convert object properties to kebab case recursively.\n- [`PascalCase`](source\u002Fpascal-case.d.ts) - Convert a string literal to pascal-case.\n- [`PascalCasedProperties`](source\u002Fpascal-cased-properties.d.ts) - Convert top-level object properties to pascal case.\n- [`PascalCasedPropertiesDeep`](source\u002Fpascal-cased-properties-deep.d.ts) - Convert object properties to pascal case recursively.\n- [`SnakeCase`](source\u002Fsnake-case.d.ts) - Convert a string literal to snake-case.\n- [`SnakeCasedProperties`](source\u002Fsnake-cased-properties.d.ts) - Convert top-level object properties to snake case.\n- [`SnakeCasedPropertiesDeep`](source\u002Fsnake-cased-properties-deep.d.ts) - Convert object properties to snake case recursively.\n- [`ScreamingSnakeCase`](source\u002Fscreaming-snake-case.d.ts) - Convert a string literal to screaming-snake-case.\n- [`DelimiterCase`](source\u002Fdelimiter-case.d.ts) - Convert a string literal to a custom string delimiter casing.\n- [`DelimiterCasedProperties`](source\u002Fdelimiter-cased-properties.d.ts) - Convert object properties to a custom string delimiter casing.\n- [`DelimiterCasedPropertiesDeep`](source\u002Fdelimiter-cased-properties-deep.d.ts) - Convert object properties to a custom string delimiter casing recursively.\n\n### Miscellaneous\n\n- [`GlobalThis`](source\u002Fglobal-this.d.ts) - Declare locally scoped properties on `globalThis`.\n- [`PackageJson`](source\u002Fpackage-json.d.ts) - Type for [npm's `package.json` file](https:\u002F\u002Fdocs.npmjs.com\u002Fcreating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn.\n- [`TsConfigJson`](source\u002Ftsconfig-json.d.ts) - Type for [TypeScript's `tsconfig.json` file](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Ftsconfig-json.html).\n\n### Improved built-in\n\n- [`ExtendsStrict`](source\u002Fextends-strict.d.ts) - A customizable version of `extends` for checking whether one type is assignable to another.\n- [`ExtractStrict`](source\u002Fextract-strict.d.ts) - A stricter version of `Extract\u003CT, U>` that ensures every member of `U` can successfully extract something from `T`.\n- [`ExcludeStrict`](source\u002Fexclude-strict.d.ts) - A stricter version of `Exclude\u003CT, U>` that ensures every member of `U` can successfully exclude something from `T`.\n- [`ExcludeExactly`](source\u002Fexclude-exactly.d.ts) - A stricter version of `Exclude\u003CT, U>` that excludes types only when they are exactly identical.\n\n## Declined types\n\n*If we decline a type addition, we will make sure to document the better solution here.*\n\n- [`Diff` and `Spread`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fpull\u002F7) - The pull request 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.\n- [`Dictionary`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fissues\u002F33) - You only save a few characters (`Dictionary\u003Cnumber>` vs `Record\u003Cstring, number>`) from [`Record`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#recordkeys-type), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now.\n- [`ExtractProperties` and `ExtractMethods`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fpull\u002F4) - The types violate the single responsibility principle. Instead, refine your types into more granular type hierarchies.\n- [`Url2Json`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fpull\u002F262) - Inferring search parameters from a URL string is a cute idea, but not very useful in practice, since search parameters are usually dynamic and defined separately.\n- [`Nullish`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fpull\u002F318) - The type only saves a couple of characters, not everyone knows what \"nullish\" means, and I'm also trying to [get away from `null`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Fmeta\u002Fdiscussions\u002F7).\n- [`TitleCase`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fpull\u002F303) - It's not solving a common need and is a better fit for a separate package.\n- [`ExtendOr` and `ExtendAnd`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fpull\u002F247) - The benefits don't outweigh having to learn what they mean.\n- [`PackageJsonExtras`](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Ftype-fest\u002Fissues\u002F371) - There are too many possible configurations that can be put into `package.json`. If you would like to extend `PackageJson` to support an additional configuration in your project, please see the *Extending existing types* section below.\n\n## Alternative type names\n\n*If you know one of our types by a different name, add it here for discovery.*\n\n- `Prettify`- See [`Simplify`](source\u002Fsimplify.d.ts)\n- `Expand`- See [`Simplify`](source\u002Fsimplify.d.ts)\n- `PartialBy` - See [`SetOptional`](source\u002Fset-optional.d.ts)\n- `RecordDeep`- See [`Schema`](source\u002Fschema.d.ts)\n- `Mutable`- See [`Writable`](source\u002Fwritable.d.ts)\n- `RequireOnlyOne`, `OneOf` - See [`RequireExactlyOne`](source\u002Frequire-exactly-one.d.ts)\n- `AtMostOne` - See [`RequireOneOrNone`](source\u002Frequire-one-or-none.d.ts)\n- `AllKeys` - See [`KeysOfUnion`](source\u002Fkeys-of-union.d.ts)\n- `Branded` - See [`Tagged`](source\u002Ftagged.d.ts)\n- `Opaque` - See [`Tagged`](source\u002Ftagged.d.ts)\n- `SetElement` - See [`IterableElement`](source\u002Fiterable-element.d.ts)\n- `SetEntry` - See [`IterableElement`](source\u002Fiterable-element.d.ts)\n- `SetValues` - See [`IterableElement`](source\u002Fiterable-element.d.ts)\n- `PickByTypes` - See [`ConditionalPick`](source\u002Fconditional-pick.d.ts)\n- `HomomorphicOmit` - See [`Except`](source\u002Fexcept.d.ts)\n- `IfAny`, `IfNever`, `If*` - See [`If`](source\u002Fif.d.ts)\n- `Maybe`, `Option` - See [`Optional`](source\u002Foptional.d.ts)\n- `MaybePromise` - See [`Promisable`](source\u002Fpromisable.d.ts)\n- `ReadonlyTuple` - See [`TupleOf`](source\u002Ftuple-of.d.ts)\n- `LastOfUnion` - See [`UnionMember`](source\u002Funion-member.d.ts)\n- `FirstOfUnion` - See [`UnionMember`](source\u002Funion-member.d.ts)\n\n## Tips\n\n### Extending existing types\n\n\u003C!-- eslint-disable-next-line type-fest\u002Freadme-jsdoc-sync -->\n- [`PackageJson`](source\u002Fpackage-json.d.ts) - There are a lot of tools that place extra configurations inside the `package.json` file. You can extend `PackageJson` to support these additional configurations.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Fwww.typescriptlang.org\u002Fplay?#code\u002FJYWwDg9gTgLgBDAnmApnA3gBQIYGMDW2A5igFIDOEAdnNuXAEJ0o4HFmVUC+cAZlBBBwA5ElQBaXinIxhAbgCwAKFCRYCZGnQAZYFRgooPfoJHSANntmKlysWlaESFanAC8jZo-YuaAMgwLKwBhal5gIgB+AC44XX1DADpQqnCiLhsgA)\n\n\t```ts\n\timport type {PackageJson as BasePackageJson} from 'type-fest';\n\timport type {Linter} from 'eslint';\n\n\ttype PackageJson = BasePackageJson & {eslintConfig?: Linter.Config};\n\t```\n\t\u003C\u002Fdetails>\n\n### Related\n\n- [typed-query-selector](https:\u002F\u002Fgithub.com\u002Fg-plane\u002Ftyped-query-selector) - Enhances `document.querySelector` and `document.querySelectorAll` with a template literal type that matches element types returned from an HTML element query selector.\n- [`Linter.Config`](https:\u002F\u002Fgithub.com\u002Feslint\u002Feslint\u002Fblob\u002Fmain\u002Flib\u002Ftypes\u002Findex.d.ts) - Definitions for the [ESLint configuration schema](https:\u002F\u002Feslint.org\u002Fdocs\u002Fuser-guide\u002Fconfiguring\u002Flanguage-options).\n\n### Built-in types\n\nThere are many advanced types most users don't know about.\n\n\n- [`Awaited\u003CT>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#awaitedtype) - Extract the type of a value that a `Promise` resolves to.\n  \u003Cdetails>\n  \u003Csummary>\n  \tExample\n  \u003C\u002Fsummary>\n\n  [Playground](https:\u002F\u002Fwww.typescriptlang.org\u002Fplay\u002F?#code\u002FJYOwLgpgTgZghgYwgAgKoGdrIN4FgBQyyAkMACYBcyIArgLYBG0A3AUcSHHRFemFKADmrQiTiCe1ekygiiAXwJtkCADZx06NJigBBAA7AAytABuwJDmXENATxAJkMCGAQALDNAAUNHQElKKUZoAEoqAAUoAHs6YEwAHk8oAD4rUWJiAHpM5AAxF3dkMDcUXywyODA4J2i6IpLkCqqGDQgAOmssnIAVBsQwGjhVZGA6fVUIbnBK4CiQZFjBNzBkVSiogGtV4A2UYriKTuyVOb5kKAh0fVOUAF5kOAB3OGAV51c3LwAiTLhDTLKUEyABJsICAvIQnISF0TiAzk1qvcLlcbm0AFboOZeKFHHIXAZQeaI6EZAk0Ik4EaBACMABpqFxJF8AFJRNzzAAiUQgXwZ4kkAGYAAzIeSkxSiSXKMC2fQofIfCBkJLIe66Z6vZXxABKLgpIG6cogiR0BmMZgsEAA2l93u4kl8ALrJZIiZR2BxOGgOMCzeZuOAgMgTJKcypwLx-C1QcxIKhJc0mWNWhngwK0YJQEJpdj8Wy5mEIU4rQFURXuZWq+5PF4raPJuPte0eHQ+fxkXHpWG6GCQKBOApuITIQGNCMM2xRGgqIPIeWwKJQOqmOACadafr+rToGiFDSj-RNEfFUo6EbgaDwJB0vGz9wnhqImpRb2Es8QBlLhZwDYjuBkGQrz+kMyC6OEfjnBAACONCXGAm5aCAEDKsqHTpPIs4fMgXjQNE2aFhkxx4d+gbBqoQjWJKChKKIxbwqWZqGI2VpqtQECPNo0BJpaSA4tCZEhhAYYRu23HMbxn7IDSUJAA)\n\n  ```ts\n  interface User {\n  \tid: number;\n  \tname: string;\n  \tage: number;\n  }\n\n  class UserApiService {\n  \tasync fetchUser(userId: number): Promise\u003CUser> {\n  \t\t\u002F\u002F Fetch the user data from the database.\n  \t\t\u002F\u002F The actual implementation might look like this:\n  \t\t\u002F\u002F const response = await fetch('\u002Fapi\u002Fuser\u002F${userId}');\n  \t\t\u002F\u002F const data = response.json();\n  \t\t\u002F\u002F return data;\n  \t\treturn {\n  \t\t\tid: 1,\n  \t\t\tname: 'John Doe',\n  \t\t\tage: 30\n  \t\t};\n  \t}\n  }\n\n  type FetchedUser = Awaited\u003CReturnType\u003CUserApiService['fetchUser']>>;\n\n  async function handleUserData(apiService: UserApiService, userId: number) {\n  \ttry {\n  \t\tconst user: FetchedUser = await apiService.fetchUser(userId);\n  \t\t\u002F\u002F After fetching user data, you can perform various actions such as updating the user interface,\n  \t\t\u002F\u002F caching the data for future use, or making additional API requests as needed.\n  \t} catch (error) {\n  \t\t\u002F\u002F Error handling\n  \t}\n  }\n\n  const userApiService = new UserApiService();\n  handleUserData(userApiService, 1);\n  ```\n\n- [`Partial\u003CT>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#partialtype) - Make all properties in `T` optional.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Fwww.typescriptlang.org\u002Fplay\u002F#code\u002FJYOwLgpgTgZghgYwgAgHIHsAmEDC6QzADmyA3gLABQyycADnanALYQBcyAzmFKEQNxUaddFDAcQAV2YAjaIMoBfKlQQAbOJ05osEAIIMAQpOBrsUMkOR1eANziRkCfISKSoD4Pg4ZseAsTIALyW1DS0DEysHADkvvoMMQA0VsKi4sgAzAAMuVaKClY2wPaOknSYDrguADwA0sgQAB6QIJjaANYQAJ7oMDp+LsQAfAAUXd0cdUnI9mo+uv6uANp1ALoAlKHhyGAAFsCcAHTOAW4eYF4gyxNrwbNwago0ypRWp66jH8QcAApwYmAjxq8SWIy2FDCNDA3ToKFBQyIdR69wmfQG1TOhShyBgomQX3w3GQE2Q6IA8jIAFYQBBgI4TTiEs5bTQYsFInrLTbbHZOIlgZDlSqQABqj0kKBC3yINx6a2xfOQwH6o2FVXFaklwSCIUkbQghBAEEwENSfNOlykEGefNe5uhB2O6sgS3GPRmLogmslG1tLxUOKgEDA7hAuydtteryAA)\n\n\t```ts\n\tinterface NodeConfig {\n\t\t\tappName: string;\n\t\t\tport: number;\n\t}\n\n\tclass NodeAppBuilder {\n\t\t\tprivate configuration: NodeConfig = {\n\t\t\t\t\tappName: 'NodeApp',\n\t\t\t\t\tport: 3000\n\t\t\t};\n\n\t\t\tprivate updateConfig\u003CKey extends keyof NodeConfig>(key: Key, value: NodeConfig[Key]) {\n\t\t\t\t\tthis.configuration[key] = value;\n\t\t\t}\n\n\t\t\tconfig(config: Partial\u003CNodeConfig>) {\n\t\t\t\t\ttype NodeConfigKey = keyof NodeConfig;\n\n\t\t\t\t\tfor (const key of Object.keys(config) as NodeConfigKey[]) {\n\t\t\t\t\t\t\tconst updateValue = config[key];\n\n\t\t\t\t\t\t\tif (updateValue === undefined) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.updateConfig(key, updateValue);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\t\t\t}\n\t}\n\n\t\u002F\u002F `Partial\u003CNodeConfig>`` allows us to provide only a part of the\n\t\u002F\u002F NodeConfig interface.\n\tnew NodeAppBuilder().config({appName: 'ToDoApp'});\n\t```\n\n\t`Partial\u003CT>` can be reverted with [`UnwrapPartial`](source\u002Funwrap-partial.d.ts).\n\t\u003C\u002Fdetails>\n\n- [`Required\u003CT>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#requiredtype) - Make all properties in `T` required.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FAQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA)\n\n\t```ts\n\tinterface ContactForm {\n\t\t\temail?: string;\n\t\t\tmessage?: string;\n\t}\n\n\tfunction submitContactForm(formData: Required\u003CContactForm>) {\n\t\t\t\u002F\u002F Send the form data to the server.\n\t}\n\n\tsubmitContactForm({\n\t\t\temail: 'ex@mple.com',\n\t\t\tmessage: 'Hi! Could you tell me more about…',\n\t});\n\n\t\u002F\u002F TypeScript error: missing property 'message'\n\tsubmitContactForm({\n\t\t\temail: 'ex@mple.com',\n\t});\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Readonly\u003CT>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#readonlytype) - Make all properties in `T` readonly.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FAQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA)\n\n\t```ts\n\tenum LogLevel {\n\t\t\tOff,\n\t\t\tDebug,\n\t\t\tError,\n\t\t\tFatal\n\t};\n\n\tinterface LoggerConfig {\n\t\t\tname: string;\n\t\t\tlevel: LogLevel;\n\t}\n\n\tclass Logger {\n\t\t\tconfig: Readonly\u003CLoggerConfig>;\n\n\t\t\tconstructor({name, level}: LoggerConfig) {\n\t\t\t\t\tthis.config = {name, level};\n\t\t\t\t\tObject.freeze(this.config);\n\t\t\t}\n\t}\n\n\tconst config: LoggerConfig = {\n\t\tname: 'MyApp',\n\t\tlevel: LogLevel.Debug\n\t};\n\n\tconst logger = new Logger(config);\n\n\t\u002F\u002F TypeScript Error: cannot assign to read-only property.\n\tlogger.config.level = LogLevel.Error;\n\n\t\u002F\u002F We are able to edit config variable as we please.\n\tconfig.level = LogLevel.Error;\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Pick\u003CT, K>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#picktype-keys) - From `T`, pick a set of properties whose keys are in the union `K`.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FAQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA)\n\n\t```ts\n\tinterface Article {\n\t\t\ttitle: string;\n\t\t\tthumbnail: string;\n\t\t\tcontent: string;\n\t}\n\n\t\u002F\u002F Creates new type out of the `Article` interface composed\n\t\u002F\u002F from the Articles' two properties: `title` and `thumbnail`.\n\t\u002F\u002F `ArticlePreview = {title: string; thumbnail: string}`\n\ttype ArticlePreview = Pick\u003CArticle, 'title' | 'thumbnail'>;\n\n\t\u002F\u002F Render a list of articles using only title and description.\n\tfunction renderArticlePreviews(previews: ArticlePreview[]): HTMLElement {\n\t\t\tconst articles = document.createElement('div');\n\n\t\t\tfor (const preview of previews) {\n\t\t\t\t\t\u002F\u002F Append preview to the articles.\n\t\t\t}\n\n\t\t\treturn articles;\n\t}\n\n\tconst articles = renderArticlePreviews([\n\t\t\t{\n\t\t\t\ttitle: 'TypeScript tutorial!',\n\t\t\t\tthumbnail: '\u002Fassets\u002Fts.jpg'\n\t\t\t}\n\t]);\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Record\u003CK, T>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#recordkeys-type) - Construct a type with a set of properties `K` of type `T`.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FAQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA)\n\n\t```ts\n\t\u002F\u002F Positions of employees in our company.\n\ttype MemberPosition = 'intern' | 'developer' | 'tech-lead';\n\n\t\u002F\u002F Interface describing properties of a single employee.\n\tinterface Employee {\n\t\t\tfirstName: string;\n\t\t\tlastName: string;\n\t\t\tyearsOfExperience: number;\n\t}\n\n\t\u002F\u002F Create an object that has all possible `MemberPosition` values set as keys.\n\t\u002F\u002F Those keys will store a collection of Employees of the same position.\n\tconst team: Record\u003CMemberPosition, Employee[]> = {\n\t\t\tintern: [],\n\t\t\tdeveloper: [],\n\t\t\t'tech-lead': [],\n\t};\n\n\t\u002F\u002F Our team has decided to help John with his dream of becoming Software Developer.\n\tteam.intern.push({\n\t\tfirstName: 'John',\n\t\tlastName: 'Doe',\n\t\tyearsOfExperience: 0\n\t});\n\n\t\u002F\u002F `Record` forces you to initialize all of the property keys.\n\t\u002F\u002F TypeScript Error: \"tech-lead\" property is missing\n\tconst teamEmpty: Record\u003CMemberPosition, null> = {\n\t\t\tintern: null,\n\t\t\tdeveloper: null,\n\t};\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Exclude\u003CT, U>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#excludetype-excludedunion) - Exclude from `T` those types that are assignable to `U`.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FJYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA)\n\n\t```ts\n\tinterface ServerConfig {\n\t\tport: null | string | number;\n\t}\n\n\ttype RequestHandler = (request: Request, response: Response) => void;\n\n\t\u002F\u002F Exclude `null` type from `null | string | number`.\n\t\u002F\u002F In case the port is equal to `null`, we will use default value.\n\tfunction getPortValue(port: Exclude\u003CServerConfig['port'], null>): number {\n\t\tif (typeof port === 'string') {\n\t\t\treturn parseInt(port, 10);\n\t\t}\n\n\t\treturn port;\n\t}\n\n\tfunction startServer(handler: RequestHandler, config: ServerConfig): void {\n\t\tconst server = require('http').createServer(handler);\n\n\t\tconst port = config.port === null ? 3000 : getPortValue(config.port);\n\t\tserver.listen(port);\n\t}\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Extract\u003CT, U>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#extracttype-union) - Extract from `T` those types that are assignable to `U`.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FCYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA)\n\n\t```ts\n\tdeclare function uniqueId(): number;\n\n\tconst ID = Symbol('ID');\n\n\tinterface Person {\n\t\t[ID]: number;\n\t\tname: string;\n\t\tage: number;\n\t}\n\n\t\u002F\u002F Allows changing the person data as long as the property key is of string type.\n\tfunction changePersonData\u003C\n\t\tObj extends Person,\n\t\tKey extends Extract\u003Ckeyof Person, string>,\n\t\tValue extends Obj[Key]\n\t> (obj: Obj, key: Key, value: Value): void {\n\t\tobj[key] = value;\n\t}\n\n\t\u002F\u002F Tiny Andrew was born.\n\tconst andrew = {\n\t\t[ID]: uniqueId(),\n\t\tname: 'Andrew',\n\t\tage: 0,\n\t};\n\n\t\u002F\u002F Cool, we're fine with that.\n\tchangePersonData(andrew, 'name', 'Pony');\n\n\t\u002F\u002F Government didn't like the fact that you wanted to change your identity.\n\tchangePersonData(andrew, ID, uniqueId());\n\t```\n\t\u003C\u002Fdetails>\n\n- [`NonNullable\u003CT>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#nonnullabletype) - Exclude `null` and `undefined` from `T`.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\tWorks with \u003Ca href=\"https:\u002F\u002Fwww.typescriptlang.org\u002Ftsconfig#strictNullChecks\">\u003Ccode>strictNullChecks\u003C\u002Fcode>\u003C\u002Fa> set to \u003Ccode>true\u003C\u002Fcode>.\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FC4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA)\n\n\t```ts\n\ttype PortNumber = string | number | null;\n\n\t\u002F** Part of a class definition that is used to build a server *\u002F\n\tclass ServerBuilder {\n\t\t\tportNumber!: NonNullable\u003CPortNumber>;\n\n\t\t\tport(this: ServerBuilder, port: PortNumber): ServerBuilder {\n\t\t\t\t\tif (port == null) {\n\t\t\t\t\t\t\tthis.portNumber = 8000;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.portNumber = port;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\t\t\t}\n\t}\n\n\tconst serverBuilder = new ServerBuilder();\n\n\tserverBuilder\n\t\t\t.port('8000')   \u002F\u002F portNumber = '8000'\n\t\t\t.port(null)     \u002F\u002F portNumber =  8000\n\t\t\t.port(3000);    \u002F\u002F portNumber =  3000\n\n\t\u002F\u002F TypeScript error\n\tserverBuilder.portNumber = null;\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Parameters\u003CT>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#parameterstype) - Obtain the parameters of a function type in a tuple.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FGYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA)\n\n\t```ts\n\tfunction shuffle(input: any[]): void {\n\t\t\u002F\u002F Mutate array randomly changing its' elements indexes.\n\t}\n\n\tfunction callNTimes\u003CFn extends (...arguments_: any[]) => any> (func: Fn, callCount: number) {\n\t\t\u002F\u002F Type that represents the type of the received function parameters.\n\t\ttype FunctionParameters = Parameters\u003CFn>;\n\n\t\treturn function (...arguments_: FunctionParameters) {\n\t\t\tfor (let i = 0; i \u003C callCount; i++) {\n\t\t\t\tfunc(...arguments_);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst shuffleTwice = callNTimes(shuffle, 2);\n\t```\n\t\u003C\u002Fdetails>\n\n- [`ConstructorParameters\u003CT>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#constructorparameterstype) - Obtain the parameters of a constructor function type in a tuple.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FMYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA)\n\n\t```ts\n\tclass ArticleModel {\n\t\ttitle: string;\n\t\tcontent?: string;\n\n\t\tconstructor(title: string) {\n\t\t\tthis.title = title;\n\t\t}\n\t}\n\n\tclass InstanceCache\u003CT extends (new (...arguments_: any[]) => any)> {\n\t\tprivate ClassConstructor: T;\n\t\tprivate cache: Map\u003Cstring, InstanceType\u003CT>> = new Map();\n\n\t\tconstructor (ctr: T) {\n\t\t\tthis.ClassConstructor = ctr;\n\t\t}\n\n\t\tgetInstance (...arguments_: ConstructorParameters\u003CT>): InstanceType\u003CT> {\n\t\t\tconst hash = this.calculateArgumentsHash(...arguments_);\n\n\t\t\tconst existingInstance = this.cache.get(hash);\n\t\t\tif (existingInstance !== undefined) {\n\t\t\t\treturn existingInstance;\n\t\t\t}\n\n\t\t\treturn new this.ClassConstructor(...arguments_);\n\t\t}\n\n\t\tprivate calculateArgumentsHash(...arguments_: any[]): string {\n\t\t\t\u002F\u002F Calculate hash.\n\t\t\treturn 'hash';\n\t\t}\n\t}\n\n\tconst articleCache = new InstanceCache(ArticleModel);\n\tconst amazonArticle = articleCache.getInstance('Amazon forests burning!');\n\t```\n\t\u003C\u002Fdetails>\n\n- [`ReturnType\u003CT>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#returntypetype) - Obtain the return type of a function type.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FMYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA)\n\n\t```ts\n\t\u002F** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. *\u002F\n\tfunction mapIter\u003C\n\t\t\tElem,\n\t\t\tFunc extends (elem: Elem) => any,\n\t\t\tRet extends ReturnType\u003CFunc>\n\t>(iter: Iterable\u003CElem>, callback: Func): Ret[] {\n\t\t\tconst mapped: Ret[] = [];\n\n\t\t\tfor (const elem of iter) {\n\t\t\t\t\tmapped.push(callback(elem));\n\t\t\t}\n\n\t\t\treturn mapped;\n\t}\n\n\tconst setObject: Set\u003Cstring> = new Set();\n\tconst mapObject: Map\u003Cnumber, string> = new Map();\n\n\tmapIter(setObject, (value: string) => value.indexOf('Foo')); \u002F\u002F number[]\n\n\tmapIter(mapObject, ([key, value]: [number, string]) => {\n\t\t\treturn key % 2 === 0 ? value : 'Odd';\n\t}); \u002F\u002F string[]\n\t```\n\t\u003C\u002Fdetails>\n\n- [`InstanceType\u003CT>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#instancetypetype) - Obtain the instance type of a constructor function type.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FMYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA)\n\n\t```ts\n\tclass IdleService {\n\t\t\tdoNothing (): void {}\n\t}\n\n\tclass News {\n\t\t\ttitle: string;\n\t\t\tcontent: string;\n\n\t\t\tconstructor(title: string, content: string) {\n\t\t\t\t\tthis.title = title;\n\t\t\t\t\tthis.content = content;\n\t\t\t}\n\t}\n\n\tconst instanceCounter: Map\u003CFunction, number> = new Map();\n\n\tinterface Constructor {\n\t\t\tnew(...arguments_: any[]): any;\n\t}\n\n\t\u002F\u002F Keep track how many instances of `Constr` constructor have been created.\n\tfunction getInstance\u003C\n\t\t\tConstr extends Constructor,\n\t\t\tArguments extends ConstructorParameters\u003CConstr>\n\t>(constructor: Constr, ...arguments_: Arguments): InstanceType\u003CConstr> {\n\t\t\tlet count = instanceCounter.get(constructor) || 0;\n\n\t\t\tconst instance = new constructor(...arguments_);\n\n\t\t\tinstanceCounter.set(constructor, count + 1);\n\n\t\t\tconsole.log(`Created ${count + 1} instances of ${Constr.name} class`);\n\n\t\t\treturn instance;\n\t}\n\n\n\tconst idleService = getInstance(IdleService);\n\t\u002F\u002F Will log: `Created 1 instances of IdleService class`\n\tconst newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...');\n\t\u002F\u002F Will log: `Created 1 instances of News class`\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Omit\u003CT, K>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#omittype-keys) - Constructs a type by picking all properties from T and then removing K.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\t\tExample\n\t\u003C\u002Fsummary>\n\n\t[Playground](https:\u002F\u002Ftypescript-play.js.org\u002F?target=6#code\u002FJYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA)\n\n\t```ts\n\tinterface Animal {\n\t\t\timageUrl: string;\n\t\t\tspecies: string;\n\t\t\timages: string[];\n\t\t\tparagraphs: string[];\n\t}\n\n\t\u002F\u002F Creates new type with all properties of the `Animal` interface\n\t\u002F\u002F except 'images' and 'paragraphs' properties. We can use this\n\t\u002F\u002F type to render small hover tooltip for a wiki entry list.\n\ttype AnimalShortInfo = Omit\u003CAnimal, 'images' | 'paragraphs'>;\n\n\tfunction renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement {\n\t\t\tconst container = document.createElement('div');\n\t\t\t\u002F\u002F Internal implementation.\n\t\t\treturn container;\n\t}\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Uppercase\u003CS extends string>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#uppercasestringtype) - Transforms every character in a string into uppercase.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\tExample\n\t\u003C\u002Fsummary>\n\n\t```ts\n\ttype T = Uppercase\u003C'hello'>;  \u002F\u002F 'HELLO'\n\n\ttype T2 = Uppercase\u003C'foo' | 'bar'>;  \u002F\u002F 'FOO' | 'BAR'\n\n\ttype T3\u003CS extends string> = Uppercase\u003C`aB${S}`>;\n\ttype T4 = T3\u003C'xYz'>;  \u002F\u002F 'ABXYZ'\n\n\ttype T5 = Uppercase\u003Cstring>;  \u002F\u002F string\n\ttype T6 = Uppercase\u003Cany>;  \u002F\u002F any\n\ttype T7 = Uppercase\u003Cnever>;  \u002F\u002F never\n\ttype T8 = Uppercase\u003C42>;  \u002F\u002F Error, type 'number' does not satisfy the constraint 'string'\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Lowercase\u003CS extends string>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#lowercasestringtype) - Transforms every character in a string into lowercase.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\tExample\n\t\u003C\u002Fsummary>\n\n\t```ts\n\ttype T = Lowercase\u003C'HELLO'>;  \u002F\u002F 'hello'\n\n\ttype T2 = Lowercase\u003C'FOO' | 'BAR'>;  \u002F\u002F 'foo' | 'bar'\n\n\ttype T3\u003CS extends string> = Lowercase\u003C`aB${S}`>;\n\ttype T4 = T3\u003C'xYz'>;  \u002F\u002F 'abxyz'\n\n\ttype T5 = Lowercase\u003Cstring>;  \u002F\u002F string\n\ttype T6 = Lowercase\u003Cany>;  \u002F\u002F any\n\ttype T7 = Lowercase\u003Cnever>;  \u002F\u002F never\n\ttype T8 = Lowercase\u003C42>;  \u002F\u002F Error, type 'number' does not satisfy the constraint 'string'\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Capitalize\u003CS extends string>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#capitalizestringtype) - Transforms the first character in a string into uppercase.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\tExample\n\t\u003C\u002Fsummary>\n\n\t```ts\n\ttype T = Capitalize\u003C'hello'>;  \u002F\u002F 'Hello'\n\n\ttype T2 = Capitalize\u003C'foo' | 'bar'>;  \u002F\u002F 'Foo' | 'Bar'\n\n\ttype T3\u003CS extends string> = Capitalize\u003C`aB${S}`>;\n\ttype T4 = T3\u003C'xYz'>;  \u002F\u002F 'ABxYz'\n\n\ttype T5 = Capitalize\u003Cstring>;  \u002F\u002F string\n\ttype T6 = Capitalize\u003Cany>;  \u002F\u002F any\n\ttype T7 = Capitalize\u003Cnever>;  \u002F\u002F never\n\ttype T8 = Capitalize\u003C42>;  \u002F\u002F Error, type 'number' does not satisfy the constraint 'string'\n\t```\n\t\u003C\u002Fdetails>\n\n- [`Uncapitalize\u003CS extends string>`](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html#uncapitalizestringtype) - Transforms the first character in a string into lowercase.\n\t\u003Cdetails>\n\t\u003Csummary>\n\t\tExample\n\t\u003C\u002Fsummary>\n\n\t```ts\n\ttype T = Uncapitalize\u003C'Hello'>;  \u002F\u002F 'hello'\n\n\ttype T2 = Uncapitalize\u003C'Foo' | 'Bar'>;  \u002F\u002F 'foo' | 'bar'\n\n\ttype T3\u003CS extends string> = Uncapitalize\u003C`AB${S}`>;\n\ttype T4 = T3\u003C'xYz'>;  \u002F\u002F 'aBxYz'\n\n\ttype T5 = Uncapitalize\u003Cstring>;  \u002F\u002F string\n\ttype T6 = Uncapitalize\u003Cany>;  \u002F\u002F any\n\ttype T7 = Uncapitalize\u003Cnever>;  \u002F\u002F never\n\ttype T8 = Uncapitalize\u003C42>;  \u002F\u002F Error, type 'number' does not satisfy the constraint 'string'\n\t```\n\t\u003C\u002Fdetails>\n\nYou can find some examples in the [TypeScript docs](https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002Futility-types.html).\n\n## Maintainers\n\n- [Sindre Sorhus](https:\u002F\u002Fgithub.com\u002Fsindresorhus)\n- [Haozheng Li](https:\u002F\u002Fgithub.com\u002FEmiyaaaaa)\n- [Som Shekhar Mukherjee](https:\u002F\u002Fgithub.com\u002Fsom-sm)\n- [Jarek Radosz](https:\u002F\u002Fgithub.com\u002FCvX)\n- [Dimitri Benin](https:\u002F\u002Fgithub.com\u002FBendingBender)\n- [Pelle Wessman](https:\u002F\u002Fgithub.com\u002Fvoxpelli)\n- [Sébastien Mischler](https:\u002F\u002Fgithub.com\u002Fskarab42)\n\n## License\n\n- [MIT](license-mit)\n- [CC0-1.0](license-cc0)\n\nSPDX-License-Identifier: (MIT OR CC0-1.0)\n","type-fest 是一个提供一系列常用 TypeScript 类型的集合。该项目的核心功能是为开发者提供了一系列实用且高质量的类型定义，这些类型定义在许多场景下都非常有用，但并未被 TypeScript 官方内置支持。技术特点上，它以模块化的方式提供了多种类型的定义，使得开发者可以按需引入或直接复制粘贴使用。适用于需要增强 TypeScript 项目类型安全性的场合，特别是在处理复杂数据结构时能显著提升代码质量和开发效率。此外，type-fest 鼓励社区贡献新的类型定义和文档改进，是一个开放且活跃的开源项目。",2,"2026-06-11 02:56:24","top_language"]