{"id":30180641,"url":"https://github.com/denoserverless/type-fest","last_synced_at":"2025-08-12T08:02:01.901Z","repository":{"id":62421628,"uuid":"196019332","full_name":"denofn/type-fest","owner":"denofn","description":"A collection of essential TypeScript types","archived":true,"fork":true,"pushed_at":"2020-08-19T07:57:23.000Z","size":1083,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-09T22:04:57.853Z","etag":null,"topics":["deno","types","typescript","typescript-definitions","utility"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"sindresorhus/type-fest","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denofn.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":".github/contributing.md","funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null},"funding":{"github":"sindresorhus","tidelift":"npm/type-fest"}},"created_at":"2019-07-09T13:56:53.000Z","updated_at":"2024-10-31T17:56:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/denofn/type-fest","commit_stats":null,"previous_names":["denoserverless/type-fest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/denofn/type-fest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denofn%2Ftype-fest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denofn%2Ftype-fest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denofn%2Ftype-fest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denofn%2Ftype-fest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denofn","download_url":"https://codeload.github.com/denofn/type-fest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denofn%2Ftype-fest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270024697,"owners_count":24514054,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["deno","types","typescript","typescript-definitions","utility"],"created_at":"2025-08-12T08:01:30.075Z","updated_at":"2025-08-12T08:02:01.871Z","avatar_url":"https://github.com/denofn.png","language":"TypeScript","funding_links":["https://github.com/sponsors/sindresorhus","https://tidelift.com/funding/github/npm/type-fest","https://tidelift.com/subscription/pkg/npm-type-fest?utm_source=npm-type-fest\u0026utm_medium=referral\u0026utm_campaign=readme"],"categories":["Modules","Uncategorized"],"sub_categories":["Online Playgrounds","Assistants","Uncategorized","Utils"],"readme":"\u003cdiv align=\"center\"\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\t\u003cimg src=\"media/logo.svg\" alt=\"type-fest\" height=\"300\"\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\t\u003cb\u003eA collection of essential TypeScript types\u003c/b\u003e\n\t\u003cbr\u003e\n\t\u003chr\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n[![Build Status](https://travis-ci.com/sindresorhus/type-fest.svg?branch=master)](https://travis-ci.com/sindresorhus/type-fest)\n[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://giphy.com/gifs/illustration-rainbow-unicorn-26AHG5KGFxSkUWw1i)\n\u003c!-- Commented out until they actually show anything\n[![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)\n--\u003e\n\n**NOTE: this is a maintained fork for Deno of the [original](https://github.com/sindresorhus/type-fest)! Go support [sindresorhus](https://github.com/sindresorhus) for creating this project!**\n\n## Deno Example\n```ts\nimport type {Except} from 'https://cdn.jsdelivr.net/gh/denofn/type-fest@latest/mod.ts';\n\ntype Foo = {\n\tunicorn: string;\n\trainbow: boolean;\n};\n\ntype FooWithoutRainbow = Except\u003cFoo, 'rainbow'\u003e;\n//=\u003e {unicorn: string}\n```\n\nMany 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).\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/contributing.md) first.\n\n## Install\n\n```\n$ npm install type-fest\n```\n\n*Requires TypeScript \u003e=3.2*\n\n## Usage\n\n```ts\nimport {Except} from 'type-fest';\n\ntype Foo = {\n\tunicorn: string;\n\trainbow: boolean;\n};\n\ntype FooWithoutRainbow = Except\u003cFoo, 'rainbow'\u003e;\n//=\u003e {unicorn: string}\n```\n\n## API\n\nClick the type names for complete docs.\n\n### Basic\n\n- [`Primitive`](source/basic.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).\n- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).\n- [`TypedArray`](source/basic.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.\n- [`JsonObject`](source/basic.d.ts) - Matches a JSON object.\n- [`JsonArray`](source/basic.d.ts) - Matches a JSON array.\n- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value.\n- [`ObservableLike`](source/basic.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).\n\n### Utilities\n\n- [`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).\n- [`Mutable`](source/mutable.d.ts) - Convert an object with `readonly` keys into a mutable object. The inverse of `Readonly\u003cT\u003e`.\n- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type.\n- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys.\n- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys.\n- [`RequireExactlyOne`](source/require-exactly-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more.\n- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial\u003cT\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep.\n- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly\u003cT\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep.\n- [`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).\n- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`.\n- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/).\n- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional.\n- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required.\n- [`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.\n- [`PromiseValue`](source/promise-value.d.ts) - Returns the type that is wrapped inside a `Promise`.\n- [`AsyncReturnType`](source/async-return-type.d.ts) - Unwrap the return type of a function that returns a `Promise`.\n- [`ConditionalKeys`](source/conditional-keys.d.ts) - Extract keys from a shape where values extend the given `Condition` type.\n- [`ConditionalPick`](source/conditional-pick.d.ts) - Like `Pick` except it selects properties from a shape where the values extend the given `Condition` type.\n- [`ConditionalExcept`](source/conditional-except.d.ts) - Like `Omit` except it removes properties from a shape where the values extend the given `Condition` type.\n- [`UnionToIntersection`](source/union-to-intersection.d.ts) - Convert a union type to an intersection type.\n- [`Stringified`](source/stringified.d.ts) - Create a type with the keys of the given type changed to `string` type.\n- [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length.\n\n### Miscellaneous\n\n- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file).\n- [`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).\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://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.\n- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary\u003cnumber\u003e` vs `Record\u003cstring, number\u003e`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now.\n- [`SubType`](https://github.com/sindresorhus/type-fest/issues/22) - The type is powerful, but lacks good use-cases and is prone to misuse.\n- [`ExtractProperties` and `ExtractMethods`](https://github.com/sindresorhus/type-fest/pull/4) - The types violate the single responsibility principle. Instead, refine your types into more granular type hierarchies.\n\n## Tips\n\n### Built-in types\n\nThere are many advanced types most users don't know about.\n\n- [`Partial\u003cT\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgHIHsAmEDC6QzADmyA3gLABQyycADnanALYQBcyAzmFKEQNxUaddFDAcQAV2YAjaIMoBfKlQQAbOJ05osEAIIMAQpOBrsUMkOR1eANziRkCfISKSoD4Pg4ZseAsTIALyW1DS0DEysHADkvvoMMQA0VsKi4sgAzAAMuVaKClY2wPaOknSYDrguADwA0sgQAB6QIJjaANYQAJ7oMDp+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\u003e(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\u003e) {\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// `Partial\u003cNodeConfig\u003e`` allows us to provide only a part of the\n\t// NodeConfig interface.\n\tnew NodeAppBuilder().config({appName: 'ToDoApp'});\n\t```\n\t\u003c/details\u003e\n\n- [`Required\u003cT\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-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\u003e) {\n\t\t\t// 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// TypeScript error: missing property 'message'\n\tsubmitContactForm({\n\t\t\temail: 'ex@mple.com',\n\t});\n\t```\n\t\u003c/details\u003e\n\n- [`Readonly\u003cT\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+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\u003e;\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// TypeScript Error: cannot assign to read-only property.\n\tlogger.config.level = LogLevel.Error;\n\n\t// We are able to edit config variable as we please.\n\tconfig.level = LogLevel.Error;\n\t```\n\t\u003c/details\u003e\n\n- [`Pick\u003cT, K\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+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// Creates new type out of the `Article` interface composed\n\t// from the Articles' two properties: `title` and `thumbnail`.\n\t// `ArticlePreview = {title: string; thumbnail: string}`\n\ttype ArticlePreview = Pick\u003cArticle, 'title' | 'thumbnail'\u003e;\n\n\t// 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// 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: '/assets/ts.jpg'\n\t\t\t}\n\t]);\n\t```\n\t\u003c/details\u003e\n\n- [`Record\u003cK, T\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA)\n\n\t```ts\n\t// Positions of employees in our company.\n\ttype MemberPosition = 'intern' | 'developer' | 'tech-lead';\n\n\t// 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// Create an object that has all possible `MemberPosition` values set as keys.\n\t// Those keys will store a collection of Employees of the same position.\n\tconst team: Record\u003cMemberPosition, Employee[]\u003e = {\n\t\t\tintern: [],\n\t\t\tdeveloper: [],\n\t\t\t'tech-lead': [],\n\t};\n\n\t// 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// `Record` forces you to initialize all of the property keys.\n\t// TypeScript Error: \"tech-lead\" property is missing\n\tconst teamEmpty: Record\u003cMemberPosition, null\u003e = {\n\t\t\tintern: null,\n\t\t\tdeveloper: null,\n\t};\n\t```\n\t\u003c/details\u003e\n\n- [`Exclude\u003cT, U\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+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) =\u003e void;\n\n\t// Exclude `null` type from `null | string | number`.\n\t// In case the port is equal to `null`, we will use default value.\n\tfunction getPortValue(port: Exclude\u003cServerConfig['port'], null\u003e): 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/details\u003e\n\n- [`Extract\u003cT, U\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+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// 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\u003e,\n\t\tValue extends Obj[Key]\n\t\u003e (obj: Obj, key: Key, value: Value): void {\n\t\tobj[key] = value;\n\t}\n\n\t// 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// Cool, we're fine with that.\n\tchangePersonData(andrew, 'name', 'Pony');\n\n\t// Goverment didn't like the fact that you wanted to change your identity.\n\tchangePersonData(andrew, ID, uniqueId());\n\t```\n\t\u003c/details\u003e\n\n- [`NonNullable\u003cT\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\tWorks with \u003ccode\u003estrictNullChecks\u003c/code\u003e set to \u003ccode\u003etrue\u003c/code\u003e. (Read more \u003ca href=\"https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html\"\u003ehere\u003c/a\u003e)\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA)\n\n\t```ts\n\ttype PortNumber = string | number | null;\n\n\t/** Part of a class definition that is used to build a server */\n\tclass ServerBuilder {\n\t\t\tportNumber!: NonNullable\u003cPortNumber\u003e;\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')   // portNumber = '8000'\n\t\t\t.port(null)     // portNumber =  8000\n\t\t\t.port(3000);    // portNumber =  3000\n\n\t// TypeScript error\n\tserverBuilder.portNumber = null;\n\t```\n\t\u003c/details\u003e\n\n- [`Parameters\u003cT\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA)\n\n\t```ts\n\tfunction shuffle(input: any[]): void {\n\t\t// Mutate array randomly changing its' elements indexes.\n\t}\n\n\tfunction callNTimes\u003cFn extends (...args: any[]) =\u003e any\u003e (func: Fn, callCount: number) {\n\t\t// Type that represents the type of the received function parameters.\n\t\ttype FunctionParameters = Parameters\u003cFn\u003e;\n\n\t\treturn function (...args: FunctionParameters) {\n\t\t\tfor (let i = 0; i \u003c callCount; i++) {\n\t\t\t\tfunc(...args);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst shuffleTwice = callNTimes(shuffle, 2);\n\t```\n\t\u003c/details\u003e\n\n- [`ConstructorParameters\u003cT\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+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 (...args: any[]) =\u003e any)\u003e {\n\t\tprivate ClassConstructor: T;\n\t\tprivate cache: Map\u003cstring, InstanceType\u003cT\u003e\u003e = new Map();\n\n\t\tconstructor (ctr: T) {\n\t\t\tthis.ClassConstructor = ctr;\n\t\t}\n\n\t\tgetInstance (...args: ConstructorParameters\u003cT\u003e): InstanceType\u003cT\u003e {\n\t\t\tconst hash = this.calculateArgumentsHash(...args);\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(...args);\n\t\t}\n\n\t\tprivate calculateArgumentsHash(...args: any[]): string {\n\t\t\t// 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 burining!');\n\t```\n\t\u003c/details\u003e\n\n- [`ReturnType\u003cT\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA)\n\n\t```ts\n\t/** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */\n\tfunction mapIter\u003c\n\t\t\tElem,\n\t\t\tFunc extends (elem: Elem) =\u003e any,\n\t\t\tRet extends ReturnType\u003cFunc\u003e\n\t\u003e(iter: Iterable\u003cElem\u003e, 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\u003e = new Set();\n\tconst mapObject: Map\u003cnumber, string\u003e = new Map();\n\n\tmapIter(setObject, (value: string) =\u003e value.indexOf('Foo')); // number[]\n\n\tmapIter(mapObject, ([key, value]: [number, string]) =\u003e {\n\t\t\treturn key % 2 === 0 ? value : 'Odd';\n\t}); // string[]\n\t```\n\t\u003c/details\u003e\n\n- [`InstanceType\u003cT\u003e`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+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\u003e = new Map();\n\n\tinterface Constructor {\n\t\t\tnew(...args: any[]): any;\n\t}\n\n\t// Keep track how many instances of `Constr` constructor have been created.\n\tfunction getInstance\u003c\n\t\t\tConstr extends Constructor,\n\t\t\tArgs extends ConstructorParameters\u003cConstr\u003e\n\t\u003e(constructor: Constr, ...args: Args): InstanceType\u003cConstr\u003e {\n\t\t\tlet count = instanceCounter.get(constructor) || 0;\n\n\t\t\tconst instance = new constructor(...args);\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// Will log: `Created 1 instances of IdleService class`\n\tconst newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...');\n\t// Will log: `Created 1 instances of News class`\n\t```\n\t\u003c/details\u003e\n\n- [`Omit\u003cT, K\u003e`](https://github.com/microsoft/TypeScript/blob/71af02f7459dc812e85ac31365bfe23daf14b4e4/src/lib/es5.d.ts#L1446) – Constructs a type by picking all properties from T and then removing K.\n\t\u003cdetails\u003e\n\t\u003csummary\u003e\n\t\t\tExample\n\t\u003c/summary\u003e\n\n\t[Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+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// Creates new type with all properties of the `Animal` interface\n\t// except 'images' and 'paragraphs' properties. We can use this\n\t// type to render small hover tooltip for a wiki entry list.\n\ttype AnimalShortInfo = Omit\u003cAnimal, 'images' | 'paragraphs'\u003e;\n\n\tfunction renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement {\n\t\t\tconst container =  document.createElement('div');\n\t\t\t// Internal implementation.\n\t\t\treturn container;\n\t}\n\t```\n\t\u003c/details\u003e\n\nYou can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types).\n\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [Jarek Radosz](https://github.com/CvX)\n- [Dimitri Benin](https://github.com/BendingBender)\n\n## License\n\n(MIT OR CC0-1.0)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cb\u003e\n\t\t\u003ca href=\"https://tidelift.com/subscription/pkg/npm-type-fest?utm_source=npm-type-fest\u0026utm_medium=referral\u0026utm_campaign=readme\"\u003eGet professional support for this package with a Tidelift subscription\u003c/a\u003e\n\t\u003c/b\u003e\n\t\u003cbr\u003e\n\t\u003csub\u003e\n\t\tTidelift helps make open source sustainable for maintainers while giving companies\u003cbr\u003eassurances about security, maintenance, and licensing for their dependencies.\n\t\u003c/sub\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenoserverless%2Ftype-fest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenoserverless%2Ftype-fest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenoserverless%2Ftype-fest/lists"}