{"componentChunkName":"component---src-templates-documentation-tsx","path":"/docs/handbook/utility-types.html","result":{"data":{"allSitePage":{"nodes":[{"path":"/dev-404-page/"},{"path":"/docs/handbook/nightly-builds.html"},{"path":"/docs/handbook/declaration-files/by-example.html"},{"path":"/docs/handbook/declaration-files/consumption.html"},{"path":"/docs/handbook/declaration-files/deep-dive.html"},{"path":"/docs/handbook/declaration-files/do-s-and-don-ts.html"},{"path":"/docs/handbook/declaration-files/introduction.html"},{"path":"/docs/handbook/declaration-files/library-structures.html"},{"path":"/docs/handbook/declaration-files/publishing.html"},{"path":"/docs/handbook/declaration-files/templates.html"},{"path":"/docs/handbook/typescript-in-5-minutes-func.html"},{"path":"/docs/handbook/typescript-in-5-minutes.html"},{"path":"/docs/handbook/typescript-in-5-minutes-oop.html"},{"path":"/docs/handbook/typescript-from-scratch.html"},{"path":"/docs/handbook/basic-types.html"},{"path":"/docs/handbook/classes.html"},{"path":"/docs/handbook/enums.html"},{"path":"/docs/handbook/functions.html"},{"path":"/docs/handbook/generics.html"},{"path":"/docs/handbook/interfaces.html"},{"path":"/docs/handbook/literal-types.html"},{"path":"/docs/handbook/intro.html"},{"path":"/docs/handbook/unions-and-intersections.html"},{"path":"/docs/handbook/declaration-files/dts-from-js.html"},{"path":"/docs/handbook/intro-to-js-ts.html"},{"path":"/docs/handbook/jsdoc-supported-types.html"},{"path":"/docs/handbook/type-checking-javascript-files.html"},{"path":"/docs/handbook/compiler-options-in-msbuild.html"},{"path":"/docs/handbook/compiler-options.html"},{"path":"/docs/handbook/configuring-watch.html"},{"path":"/docs/handbook/integrating-with-build-tools.html"},{"path":"/docs/handbook/project-references.html"},{"path":"/docs/handbook/tsconfig-json.html"},{"path":"/docs/handbook/advanced-types.html"},{"path":"/docs/handbook/declaration-merging.html"},{"path":"/docs/handbook/decorators.html"},{"path":"/docs/handbook/iterators-and-generators.html"},{"path":"/docs/handbook/jsx.html"},{"path":"/docs/handbook/mixins.html"},{"path":"/docs/handbook/module-resolution.html"},{"path":"/docs/handbook/modules.html"},{"path":"/docs/handbook/namespaces-and-modules.html"},{"path":"/docs/handbook/namespaces.html"},{"path":"/docs/handbook/symbols.html"},{"path":"/docs/handbook/triple-slash-directives.html"},{"path":"/docs/handbook/type-compatibility.html"},{"path":"/docs/handbook/type-inference.html"},{"path":"/docs/handbook/utility-types.html"},{"path":"/docs/handbook/variable-declarations.html"},{"path":"/docs/handbook/release-notes/typescript-1-1.html"},{"path":"/docs/handbook/release-notes/typescript-1-3.html"},{"path":"/docs/handbook/release-notes/typescript-1-4.html"},{"path":"/docs/handbook/release-notes/typescript-1-5.html"},{"path":"/docs/handbook/release-notes/typescript-1-6.html"},{"path":"/docs/handbook/release-notes/typescript-1-7.html"},{"path":"/docs/handbook/release-notes/typescript-1-8.html"},{"path":"/docs/handbook/release-notes/typescript-2-0.html"},{"path":"/docs/handbook/release-notes/typescript-2-1.html"},{"path":"/docs/handbook/release-notes/typescript-2-2.html"},{"path":"/docs/handbook/release-notes/typescript-2-3.html"},{"path":"/docs/handbook/release-notes/typescript-2-4.html"},{"path":"/docs/handbook/release-notes/typescript-2-5.html"},{"path":"/docs/handbook/release-notes/typescript-2-6.html"},{"path":"/docs/handbook/release-notes/typescript-2-7.html"},{"path":"/docs/handbook/release-notes/typescript-2-8.html"},{"path":"/docs/handbook/release-notes/typescript-2-9.html"},{"path":"/docs/handbook/release-notes/typescript-3-0.html"},{"path":"/docs/handbook/release-notes/typescript-3-1.html"},{"path":"/docs/handbook/release-notes/typescript-3-2.html"},{"path":"/docs/handbook/release-notes/typescript-3-3.html"},{"path":"/docs/handbook/release-notes/typescript-3-4.html"},{"path":"/docs/handbook/release-notes/typescript-3-5.html"},{"path":"/docs/handbook/release-notes/typescript-3-6.html"},{"path":"/docs/handbook/release-notes/typescript-3-7.html"},{"path":"/docs/handbook/release-notes/typescript-3-8.html"},{"path":"/docs/handbook/release-notes/typescript-3-9.html"},{"path":"/docs/handbook/asp-net-core.html"},{"path":"/docs/handbook/angular.html"},{"path":"/docs/handbook/babel-with-typescript.html"},{"path":"/docs/handbook/dom-manipulation.html"},{"path":"/docs/handbook/gulp.html"},{"path":"/docs/handbook/migrating-from-javascript.html"},{"path":"/docs/handbook/react.html"},{"path":"/docs/handbook/typescript-tooling-in-5-minutes.html"},{"path":"/vo/docs/handbook/basic-types.html"},{"path":"/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/global-plugin-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/global-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-class-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-function-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-plugin-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-d-ts.html"},{"path":"/docs/handbook/release-notes/overview.html"},{"path":"/tsconfig"},{"path":"/en/tsconfig"},{"path":"/vo/tsconfig"},{"path":"/ja/tsconfig"},{"path":"/pt/tsconfig"},{"path":"/play"},{"path":"/en/play"},{"path":"/es/play"},{"path":"/ja/play"},{"path":"/pt/play"},{"path":"/vo/play"},{"path":"/zh/play"},{"path":"/fa/play"},{"path":"/play/3-7/fixits/big-number-literals.ts"},{"path":"/play/3-7/fixits/const-to-let.ts"},{"path":"/play/3-7/fixits/infer-from-usage-changes.ts"},{"path":"/play/3-7/syntax-and-messaging/flattened-error-reporting.ts"},{"path":"/play/3-7/syntax-and-messaging/nullish-coalescing.ts"},{"path":"/play/3-7/syntax-and-messaging/optional-chaining.ts"},{"path":"/play/3-7/types-and-code-flow/assertion-functions.ts"},{"path":"/play/3-7/types-and-code-flow/recursive-type-references.ts"},{"path":"/play/3-7/types-and-code-flow/uncalled-function-checks.ts"},{"path":"/play/3-8/breaking-changes/checking-unions-with-index-signatures.ts"},{"path":"/play/3-8/jsdoc-improvements/accessibility-modifiers.js"},{"path":"/play/3-8/syntax-and-messaging/export-modules-from.ts"},{"path":"/play/3-8/syntax-and-messaging/private-class-fields.ts"},{"path":"/play/4-0/new-checks/class-constructor-code-flow.ts"},{"path":"/play/4-0/new-js-features/jsdoc-deprecated.ts"},{"path":"/play/4-0/new-js-features/logical-operators-and-assignment.ts"},{"path":"/play/4-0/new-js-features/nullish-coalescing.ts"},{"path":"/play/4-0/new-ts-features/named-tuples.ts"},{"path":"/play/4-0/new-ts-features/unknown-in-catch.ts"},{"path":"/play/4-0/new-ts-features/variadic-tuples.ts"},{"path":"/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/play/javascript/external-apis/typescript-with-node.js"},{"path":"/play/javascript/external-apis/typescript-with-web.js"},{"path":"/play/javascript/external-apis/typescript-with-webgl.js"},{"path":"/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/play/javascript/functions-with-javascript/typing-functions.ts"},{"path":"/play/javascript/helping-with-javascript/errors.ts"},{"path":"/play/javascript/helping-with-javascript/quick-fixes.ts"},{"path":"/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/play/javascript/javascript-essentials/functions.ts"},{"path":"/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/play/javascript/modern-javascript/async-await.ts"},{"path":"/play/javascript/modern-javascript/immutability.ts"},{"path":"/play/javascript/modern-javascript/import-export.ts"},{"path":"/play/javascript/modern-javascript/jsdoc-support.js"},{"path":"/play/javascript/working-with-classes/classes-101.ts"},{"path":"/play/javascript/working-with-classes/generic-classes.ts"},{"path":"/play/javascript/working-with-classes/mixins.ts"},{"path":"/play/javascript/working-with-classes/this.ts"},{"path":"/play/playground/config/javascript-playgrounds.js"},{"path":"/play/playground/config/new-compiler-defaults.ts"},{"path":"/play/playground/language/automatic-type-acquisition.ts"},{"path":"/play/playground/language/fixits.ts"},{"path":"/play/playground/tooling/mobile-support.ts"},{"path":"/play/playground/tooling/sharable-urls.ts"},{"path":"/play/playground/tooling/typescript-versions.ts"},{"path":"/play/typescript/language/soundness.ts"},{"path":"/play/typescript/language/structural-typing.ts"},{"path":"/play/typescript/language/type-guards.ts"},{"path":"/play/typescript/language/type-widening-and-narrowing.ts"},{"path":"/play/typescript/language-extensions/enums.ts"},{"path":"/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/play/typescript/meta-types/conditional-types.ts"},{"path":"/play/typescript/meta-types/discriminate-types.ts"},{"path":"/play/typescript/meta-types/indexed-types.ts"},{"path":"/play/typescript/meta-types/mapped-types.ts"},{"path":"/play/typescript/primitives/any.ts"},{"path":"/play/typescript/primitives/literals.ts"},{"path":"/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/play/typescript/primitives/unknown-and-never.ts"},{"path":"/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/play/typescript/type-primitives/nullable-types.ts"},{"path":"/play/typescript/type-primitives/tuples.ts"},{"path":"/es/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/es/play/javascript/external-apis/typescript-with-node.js"},{"path":"/es/play/javascript/external-apis/typescript-with-web.js"},{"path":"/es/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/es/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/es/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/es/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/es/play/typescript/language/soundness.ts"},{"path":"/es/play/typescript/language/structural-typing.ts"},{"path":"/es/play/typescript/language/type-guards.ts"},{"path":"/es/play/typescript/language/type-widening-and-narrowing.ts"},{"path":"/es/play/typescript/meta-types/conditional-types.ts"},{"path":"/es/play/typescript/meta-types/discriminate-types.ts"},{"path":"/es/play/typescript/meta-types/indexed-types.ts"},{"path":"/es/play/typescript/meta-types/mapped-types.ts"},{"path":"/es/play/typescript/primitives/any.ts"},{"path":"/es/play/typescript/primitives/literals.ts"},{"path":"/es/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/es/play/typescript/primitives/unknown-and-never.ts"},{"path":"/es/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/es/play/typescript/type-primitives/nullable-types.ts"},{"path":"/es/play/typescript/type-primitives/tuples.ts"},{"path":"/fa/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/ja/play/3-7/fixits/big-number-literals.ts"},{"path":"/ja/play/3-7/syntax-and-messaging/nullish-coalescing.ts"},{"path":"/ja/play/3-7/syntax-and-messaging/optional-chaining.ts"},{"path":"/ja/play/3-8/breaking-changes/checking-unions-with-index-signatures.ts"},{"path":"/ja/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/ja/play/typescript/language-extensions/enums.ts"},{"path":"/ja/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/ja/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/ja/play/typescript/primitives/any.ts"},{"path":"/ja/play/typescript/primitives/literals.ts"},{"path":"/ja/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/ja/play/typescript/primitives/unknown-and-never.ts"},{"path":"/ja/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/ja/play/typescript/type-primitives/nullable-types.ts"},{"path":"/ja/play/typescript/type-primitives/tuples.ts"},{"path":"/pt/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/pt/play/javascript/javascript-essentials/functions.ts"},{"path":"/pt/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/pt/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/vo/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/vo/play/javascript/javascript-essentials/functions.ts"},{"path":"/vo/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/vo/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/zh/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/zh/play/javascript/external-apis/typescript-with-node.js"},{"path":"/zh/play/javascript/external-apis/typescript-with-web.js"},{"path":"/zh/play/javascript/external-apis/typescript-with-webgl.js"},{"path":"/zh/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/zh/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/zh/play/javascript/functions-with-javascript/typing-functions.ts"},{"path":"/zh/play/javascript/helping-with-javascript/errors.ts"},{"path":"/zh/play/javascript/helping-with-javascript/quick-fixes.ts"},{"path":"/zh/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/zh/play/javascript/javascript-essentials/functions.ts"},{"path":"/zh/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/zh/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/zh/play/javascript/modern-javascript/async-await.ts"},{"path":"/zh/play/javascript/modern-javascript/immutability.ts"},{"path":"/zh/play/javascript/modern-javascript/import-export.ts"},{"path":"/zh/play/javascript/modern-javascript/jsdoc-support.js"},{"path":"/zh/play/javascript/working-with-classes/classes-101.ts"},{"path":"/zh/play/javascript/working-with-classes/generic-classes.ts"},{"path":"/zh/play/javascript/working-with-classes/mixins.ts"},{"path":"/zh/play/javascript/working-with-classes/this.ts"},{"path":"/zh/play/playground/config/javascript-playgrounds.js"},{"path":"/zh/play/playground/config/new-compiler-defaults.ts"},{"path":"/zh/play/playground/language/automatic-type-acquisition.ts"},{"path":"/zh/play/playground/language/fixits.ts"},{"path":"/zh/play/playground/tooling/mobile-support.ts"},{"path":"/zh/play/playground/tooling/sharable-urls.ts"},{"path":"/zh/play/playground/tooling/typescript-versions.ts"},{"path":"/zh/play/typescript/language/soundness.ts"},{"path":"/zh/play/typescript/language/structural-typing.ts"},{"path":"/zh/play/typescript/language/type-guards.ts"},{"path":"/zh/play/typescript/language/type-widening-and-narrowing.ts"},{"path":"/zh/play/typescript/language-extensions/enums.ts"},{"path":"/zh/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/zh/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/zh/play/typescript/meta-types/conditional-types.ts"},{"path":"/zh/play/typescript/meta-types/discriminate-types.ts"},{"path":"/zh/play/typescript/meta-types/indexed-types.ts"},{"path":"/zh/play/typescript/meta-types/mapped-types.ts"},{"path":"/zh/play/typescript/primitives/any.ts"},{"path":"/zh/play/typescript/primitives/literals.ts"},{"path":"/zh/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/zh/play/typescript/primitives/unknown-and-never.ts"},{"path":"/zh/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/zh/play/typescript/type-primitives/nullable-types.ts"},{"path":"/zh/play/typescript/type-primitives/tuples.ts"},{"path":"/ja/play/3-7/syntax-and-messaging/flattened-error-reporting.ts"},{"path":"/ja/play/3-7/fixits/infer-from-usage-changes.ts"},{"path":"/ja/play/3-7/fixits/const-to-let.ts"},{"path":"/community"},{"path":"/es/community"},{"path":"/ja/community"},{"path":"/vo/community"},{"path":"/zh/community"},{"path":"/download"},{"path":"/es/download"},{"path":"/ja/download"},{"path":"/vo/download"},{"path":"/zh/download"},{"path":"/empty"},{"path":"/es/empty"},{"path":"/ja/empty"},{"path":"/vo/empty"},{"path":"/zh/empty"},{"path":"/"},{"path":"/es/"},{"path":"/ja/"},{"path":"/vo/"},{"path":"/zh/"},{"path":"/tools"},{"path":"/es/tools"},{"path":"/ja/tools"},{"path":"/vo/tools"},{"path":"/zh/tools"},{"path":"/why-create-typescript"},{"path":"/es/why-create-typescript"},{"path":"/ja/why-create-typescript"},{"path":"/vo/why-create-typescript"},{"path":"/zh/why-create-typescript"},{"path":"/docs/bootstrap"},{"path":"/es/docs/bootstrap"},{"path":"/ja/docs/bootstrap"},{"path":"/vo/docs/bootstrap"},{"path":"/zh/docs/bootstrap"},{"path":"/docs/"},{"path":"/es/docs/"},{"path":"/ja/docs/"},{"path":"/vo/docs/"},{"path":"/zh/docs/"},{"path":"/docs/handbook/"},{"path":"/es/docs/handbook/"},{"path":"/ja/docs/handbook/"},{"path":"/vo/docs/handbook/"},{"path":"/zh/docs/handbook/"},{"path":"/branding/"},{"path":"/dev/bug-workbench/"},{"path":"/dev/playground-plugins/"},{"path":"/dev/sandbox/"},{"path":"/dev/twoslash/"},{"path":"/dev/typescript-vfs/"},{"path":"/upcoming/"}]},"markdownRemark":{"id":"3656b1d3-78ba-527c-bae0-0491cb4e682d","excerpt":"TypeScript provides several utility types to facilitate common type transformations. These utilities are available globally. Partial<Type> Constructs a type…","html":"<p>TypeScript provides several utility types to facilitate common type transformations. These utilities are available globally.</p>\n<h2 id=\"partialtype\" style=\"position:relative;\"><a href=\"#partialtype\" aria-label=\"partialtype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Partial&#x3C;Type></code></h2>\n<p>Constructs a type with all properties of <code>Type</code> set to optional. This utility will return a type that represents all subsets of a given type.</p>\n<h5 id=\"example\" style=\"position:relative;\"><a href=\"#example\" aria-label=\"example permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> <data-lsp lsp='interface Todo'>Todo</data-lsp> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Todo.title: string'>title</data-lsp></span><span style=\"color: #000000\">: string;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Todo.description: string'>description</data-lsp></span><span style=\"color: #000000\">: string;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <data-lsp lsp='function updateTodo(todo: Todo, fieldsToUpdate: Partial&amp;lt;Todo>): {&amp;#13;    title: string;&amp;#13;    description: string;&amp;#13;}'>updateTodo</data-lsp>(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) todo: Todo'>todo</data-lsp></span><span style=\"color: #000000\">: <data-lsp lsp='interface Todo'>Todo</data-lsp>, </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) fieldsToUpdate: Partial&amp;lt;Todo>'>fieldsToUpdate</data-lsp></span><span style=\"color: #000000\">: <data-lsp lsp='type Partial&amp;lt;T> = { [P in keyof T]?: T[P] | undefined; }'>Partial</data-lsp>&lt;<data-lsp lsp='interface Todo'>Todo</data-lsp>>) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { ...</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) todo: Todo'>todo</data-lsp></span><span style=\"color: #000000\">, ...</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) fieldsToUpdate: Partial&amp;lt;Todo>'>fieldsToUpdate</data-lsp></span><span style=\"color: #000000\"> };</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='const todo1: {&amp;#13;    title: string;&amp;#13;    description: string;&amp;#13;}'>todo1</data-lsp> </span><span style=\"color: #000000\">= {</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) title: string'>title</data-lsp>: </span><span style=\"color: #A31515\">\"organize desk\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) description: string'>description</data-lsp>: </span><span style=\"color: #A31515\">\"clear clutter\"</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='const todo2: {&amp;#13;    title: string;&amp;#13;    description: string;&amp;#13;}'>todo2</data-lsp> </span><span style=\"color: #000000\">= <data-lsp lsp='function updateTodo(todo: Todo, fieldsToUpdate: Partial&amp;lt;Todo>): {&amp;#13;    title: string;&amp;#13;    description: string;&amp;#13;}'>updateTodo</data-lsp>(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='const todo1: {&amp;#13;    title: string;&amp;#13;    description: string;&amp;#13;}'>todo1</data-lsp></span><span style=\"color: #000000\">, {</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) description?: string | undefined'>description</data-lsp>: </span><span style=\"color: #A31515\">\"throw out trash\"</span>\n<span style=\"color: #000000\">});</span></code><a href='https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgCoHsAm7kG8BQyyYwYANhAFzIDOYUoA5gNyHKYQ0IMAOJ6IanQYgW+AL758MAK4gE-EMhk9McSBmwAKMFnTVN6ADTIYwCGUw0MAVVXqqyAApwoJOGQA8hgHwBKPDYoCDAZKCVcZAA6GN1sExioswsrW3tIZHFWSXwEATpiPQBGZABeQKISckcAInQoRjgQYAAvFA4aAGsaozYO7mA+YAFqGoQKV2RxmTBIKBqJVlz8sELsACYy5XSIQx1ikwIift5FUbAACyh0AHdkdBniKDgaC4XxP2YgA'>Try</a></div></pre>\n<h2 id=\"readonlytype\" style=\"position:relative;\"><a href=\"#readonlytype\" aria-label=\"readonlytype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Readonly&#x3C;Type></code></h2>\n<p>Constructs a type with all properties of <code>Type</code> set to <code>readonly</code>, meaning the properties of the constructed type cannot be reassigned.</p>\n<h5 id=\"example-1\" style=\"position:relative;\"><a href=\"#example-1\" aria-label=\"example 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> <data-lsp lsp='interface Todo'>Todo</data-lsp> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Todo.title: string'>title</data-lsp></span><span style=\"color: #000000\">: string;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='const todo: Readonly&amp;lt;Todo>'>todo</data-lsp></span><span style=\"color: #000000\">:</span><span style=\"color: #1A1A1A\"> <data-lsp lsp='type Readonly&amp;lt;T> = { readonly [P in keyof T]: T[P]; }'>Readonly</data-lsp>&lt;<data-lsp lsp='interface Todo'>Todo</data-lsp>> </span><span style=\"color: #000000\">= {</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) title: string'>title</data-lsp>: </span><span style=\"color: #A31515\">\"Delete inactive users\"</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #1A1A1A\"><data-lsp lsp='const todo: Readonly&amp;lt;Todo>'>todo</data-lsp></span><span style=\"color: #000000\"><data-err>.<data-lsp lsp='(property) title: string'>title</data-lsp> = </data-err></span><span style=\"color: #A31515\">\"Hello\"</span><span style=\"color: #000000\">;</span>\n<span class=\"error\"><span>Cannot assign to 'title' because it is a read-only property.</span><span class=\"code\">2540</span></span><span class=\"error-behind\">Cannot assign to 'title' because it is a read-only property.</span></code><a href='https://www.typescriptlang.org/play/#code/PTAEAEFMCdoe2gZwFygEwFYAsAGAUAJYB2ALjAGYCGAxpKACpwAmcoA3nqKCQSQDaRUiEtGIBzANx4AvnjzU4RYd2ZxUAJUiUWRPgE8APIxYA+UAF52nbrwGoARABFIAsqGI0eANzoBXRDCI9jJSeCSqAHQ8-HSW9gASLnxw9hJAA'>Try</a></div></pre>\n<p>This utility is useful for representing assignment expressions that will fail at runtime (i.e. when attempting to reassign properties of a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\">frozen object</a>).</p>\n<h5 id=\"objectfreeze\" style=\"position:relative;\"><a href=\"#objectfreeze\" aria-label=\"objectfreeze permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Object.freeze</code></h5>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> freeze&lt;Type&gt;(</span><span style=\"color: #1A1A1A\">obj</span><span style=\"color: #000000\">: Type): Readonly&lt;Type&gt;;</span></code></div></pre>\n<h2 id=\"recordkeystype\" style=\"position:relative;\"><a href=\"#recordkeystype\" aria-label=\"recordkeystype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Record&#x3C;Keys,Type></code></h2>\n<p>Constructs a type with a set of properties <code>Keys</code> of type <code>Type</code>. This utility can be used to map the properties of a type to another type.</p>\n<h5 id=\"example-2\" style=\"position:relative;\"><a href=\"#example-2\" aria-label=\"example 2 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> <data-lsp lsp='interface PageInfo'>PageInfo</data-lsp> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) PageInfo.title: string'>title</data-lsp></span><span style=\"color: #000000\">: string;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type Page = &amp;quot;home&amp;quot; | &amp;quot;about&amp;quot; | &amp;quot;contact&amp;quot;'>Page</data-lsp> = </span><span style=\"color: #A31515\">\"home\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"about\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"contact\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='const nav: Record&amp;lt;Page, PageInfo>'>nav</data-lsp></span><span style=\"color: #000000\">:</span><span style=\"color: #1A1A1A\"> <data-lsp lsp='type Record&amp;lt;K extends string | number | symbol, T> = { [P in K]: T; }'>Record</data-lsp>&lt;<data-lsp lsp='type Page = &amp;quot;home&amp;quot; | &amp;quot;about&amp;quot; | &amp;quot;contact&amp;quot;'>Page</data-lsp>, <data-lsp lsp='interface PageInfo'>PageInfo</data-lsp>> </span><span style=\"color: #000000\">= {</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) about: PageInfo'>about</data-lsp>: { <data-lsp lsp='(property) PageInfo.title: string'>title</data-lsp>: </span><span style=\"color: #A31515\">\"about\"</span><span style=\"color: #000000\"> },</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) contact: PageInfo'>contact</data-lsp>: { <data-lsp lsp='(property) PageInfo.title: string'>title</data-lsp>: </span><span style=\"color: #A31515\">\"contact\"</span><span style=\"color: #000000\"> },</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) home: PageInfo'>home</data-lsp>: { <data-lsp lsp='(property) PageInfo.title: string'>title</data-lsp>: </span><span style=\"color: #A31515\">\"home\"</span><span style=\"color: #000000\"> }</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #1A1A1A\"><data-lsp lsp='const nav: Record&amp;lt;Page, PageInfo>'>nav</data-lsp></span><span style=\"color: #000000\">.</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) about: PageInfo'>about</data-lsp></span>\n<span class='query'>//      ^ = Could not get LSP result: bou>t<\n//</span></code><a href='https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgApwOYQJIhge2QG8AoZZMYMAGwgC5kBnMKUDAbhIF8SSwBPAA4p0WZAF5kAIgAW+ALYQpyAD7S4AI3wBXMMrVSE+cIj2cSRkM2Qg4ANwYAlCEagATADyiIAGjSYcPHwAPgliMmRNHTAGIgoqWgYpKN1lLh8IyzBTWPiaemks0zSM8jlFXMp8pPKlZB4uc1s7ADoUsBIAek7yXuQAPQB+IA'>Try</a></div></pre>\n<h2 id=\"picktype-keys\" style=\"position:relative;\"><a href=\"#picktype-keys\" aria-label=\"picktype keys permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Pick&#x3C;Type, Keys></code></h2>\n<p>Constructs a type by picking the set of properties <code>Keys</code> from <code>Type</code>.</p>\n<h5 id=\"example-3\" style=\"position:relative;\"><a href=\"#example-3\" aria-label=\"example 3 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> <data-lsp lsp='interface Todo'>Todo</data-lsp> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Todo.title: string'>title</data-lsp></span><span style=\"color: #000000\">: string;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Todo.description: string'>description</data-lsp></span><span style=\"color: #000000\">: string;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Todo.completed: boolean'>completed</data-lsp></span><span style=\"color: #000000\">: boolean;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type TodoPreview = {&amp;#13;    title: string;&amp;#13;    completed: boolean;&amp;#13;}'>TodoPreview</data-lsp> = <data-lsp lsp='type Pick&amp;lt;T, K extends keyof T> = { [P in K]: T[P]; }'>Pick</data-lsp>&lt;<data-lsp lsp='interface Todo'>Todo</data-lsp>, </span><span style=\"color: #A31515\">\"title\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"completed\"</span><span style=\"color: #000000\">&gt;;</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='const todo: Pick&amp;lt;Todo, &amp;quot;title&amp;quot; | &amp;quot;completed&amp;quot;>'>todo</data-lsp></span><span style=\"color: #000000\">:</span><span style=\"color: #1A1A1A\"> <data-lsp lsp='type TodoPreview = {&amp;#13;    title: string;&amp;#13;    completed: boolean;&amp;#13;}'>TodoPreview</data-lsp> </span><span style=\"color: #000000\">= {</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) title: string'>title</data-lsp>: </span><span style=\"color: #A31515\">\"Clean room\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) completed: boolean'>completed</data-lsp>: </span><span style=\"color: #0000FF\">false</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #1A1A1A\"><data-lsp lsp='const todo: Pick&amp;lt;Todo, &amp;quot;title&amp;quot; | &amp;quot;completed&amp;quot;>'>todo</data-lsp></span>\n<span class='query'>// ^ = const todo: Pick<Todo, \"title\" | \"completed\"></span></code><a href='https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgCoHsAm7kG8BQyyYwYANhAFzIDOYUoA5gNyHKYQ0IMAOJ6IanQYgWbBOgC2PCpEzUARunQU4IVgF98+MAE8eKDNgAKUCADdgEAO7IAvMmPAEAawA8R9ABpkAIhLkEL7IAD5+EtKyEJi+AHys+BIgdMRY6NSephZWtg4ERAEU1L4AwqogyFDKkr5e4lIyEHLU8GQ0EPgaCWBp+AD0fcgAegD8QA'>Try</a></div></pre>\n<h2 id=\"omittype-keys\" style=\"position:relative;\"><a href=\"#omittype-keys\" aria-label=\"omittype keys permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Omit&#x3C;Type, Keys></code></h2>\n<p>Constructs a type by picking all properties from <code>Type</code> and then removing <code>Keys</code>.</p>\n<h5 id=\"example-4\" style=\"position:relative;\"><a href=\"#example-4\" aria-label=\"example 4 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> <data-lsp lsp='interface Todo'>Todo</data-lsp> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Todo.title: string'>title</data-lsp></span><span style=\"color: #000000\">: string;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Todo.description: string'>description</data-lsp></span><span style=\"color: #000000\">: string;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Todo.completed: boolean'>completed</data-lsp></span><span style=\"color: #000000\">: boolean;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type TodoPreview = {&amp;#13;    title: string;&amp;#13;    completed: boolean;&amp;#13;}'>TodoPreview</data-lsp> = <data-lsp lsp='type Omit&amp;lt;T, K extends string | number | symbol> = { [P in Exclude&amp;lt;keyof T, K>]: T[P]; }'>Omit</data-lsp>&lt;<data-lsp lsp='interface Todo'>Todo</data-lsp>, </span><span style=\"color: #A31515\">\"description\"</span><span style=\"color: #000000\">&gt;;</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='const todo: Pick&amp;lt;Todo, &amp;quot;title&amp;quot; | &amp;quot;completed&amp;quot;>'>todo</data-lsp></span><span style=\"color: #000000\">:</span><span style=\"color: #1A1A1A\"> <data-lsp lsp='type TodoPreview = {&amp;#13;    title: string;&amp;#13;    completed: boolean;&amp;#13;}'>TodoPreview</data-lsp> </span><span style=\"color: #000000\">= {</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) title: string'>title</data-lsp>: </span><span style=\"color: #A31515\">\"Clean room\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) completed: boolean'>completed</data-lsp>: </span><span style=\"color: #0000FF\">false</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #1A1A1A\"><data-lsp lsp='const todo: Pick&amp;lt;Todo, &amp;quot;title&amp;quot; | &amp;quot;completed&amp;quot;>'>todo</data-lsp></span>\n<span class='query'>// ^ = const todo: Pick<Todo, \"title\" | \"completed\"></span></code><a href='https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgCoHsAm7kG8BQyyYwYANhAFzIDOYUoA5gNyHKYQ0IMAOJ6IanQYgWbBOgC2PCpEzUARunQU4IVgF98+MAE8eKDNgAKUCADdgEAO7IAvMgDyk0gB4j6ADTIARBy68-CA+AHys+BIgdMRY6NQephZWtg4ERCTkVL4AwqogyFDKkj6e4lIyEHLU8GQ0EPga4WCx+AD0rcgAegD8QA'>Try</a></div></pre>\n<h2 id=\"excludetype-excludedunion\" style=\"position:relative;\"><a href=\"#excludetype-excludedunion\" aria-label=\"excludetype excludedunion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Exclude&#x3C;Type, ExcludedUnion></code></h2>\n<p>Constructs a type by excluding from <code>Type</code> all union members that are assignable to <code>ExcludedUnion</code>.</p>\n<h5 id=\"example-5\" style=\"position:relative;\"><a href=\"#example-5\" aria-label=\"example 5 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T0 = &amp;quot;b&amp;quot; | &amp;quot;c&amp;quot;'>T0</data-lsp> = <data-lsp lsp='type Exclude&amp;lt;T, U> = T extends U ? never : T'>Exclude</data-lsp>&lt;</span><span style=\"color: #A31515\">\"a\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"b\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"c\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"a\"</span><span style=\"color: #000000\">&gt;;</span>\n<span class='query'>//    ^ = type T0 = \"b\" | \"c\"</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T1 = &amp;quot;c&amp;quot;'>T1</data-lsp> = <data-lsp lsp='type Exclude&amp;lt;T, U> = T extends U ? never : T'>Exclude</data-lsp>&lt;</span><span style=\"color: #A31515\">\"a\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"b\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"c\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"a\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"b\"</span><span style=\"color: #000000\">&gt;;</span>\n<span class='query'>//    ^ = type T1 = \"c\"</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T2 = string | number'>T2</data-lsp> = <data-lsp lsp='type Exclude&amp;lt;T, U> = T extends U ? never : T'>Exclude</data-lsp>&lt;string | number | (() </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> void), <data-lsp lsp='interface Function'>Function</data-lsp>>;</span>\n<span class='query'>//    ^ = type T2 = string | number</span></code><a href='https://www.typescriptlang.org/play/#code/C4TwDgpgBAKgDFAvFAogDwMYBsCuATCAHgCIBDYqAHymICMLriNiAaG8gPgG4AoAej5QhUAHoB+HqEiwAjElSZcBEuSo16apq3YN1xbv0HDxk8NBgAmeemz4iAZ2AAnAJYA7AOZq3OALa0IJzUACmCASiQOKAA3AHsXPDC2ADEcNwxgF1i3AwFhUTEgA'>Try</a></div></pre>\n<h2 id=\"extracttype-union\" style=\"position:relative;\"><a href=\"#extracttype-union\" aria-label=\"extracttype union permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Extract&#x3C;Type, Union></code></h2>\n<p>Constructs a type by extracting from <code>Type</code> all union members that are assignable to <code>Union</code>.</p>\n<h5 id=\"example-6\" style=\"position:relative;\"><a href=\"#example-6\" aria-label=\"example 6 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T0 = &amp;quot;a&amp;quot;'>T0</data-lsp> = <data-lsp lsp='type Extract&amp;lt;T, U> = T extends U ? T : never'>Extract</data-lsp>&lt;</span><span style=\"color: #A31515\">\"a\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"b\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"c\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"a\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"f\"</span><span style=\"color: #000000\">&gt;;</span>\n<span class='query'>//    ^ = type T0 = \"a\"</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T1 = () => void'>T1</data-lsp> = <data-lsp lsp='type Extract&amp;lt;T, U> = T extends U ? T : never'>Extract</data-lsp>&lt;string | number | (() </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> void), <data-lsp lsp='interface Function'>Function</data-lsp>>;</span>\n<span class='query'>//    ^ = type T1 = () => void</span></code><a href='https://www.typescriptlang.org/play/#code/C4TwDgpgBAKgDFAvFAogD2AJwIYGNgA8ARNkVAD5REBGZlRuRANFaRVQGZEB8A3AFAB6QVFFQAegH5+oSLACMSVBhz4CAZywBLAHYBzdjoCuAW2oRM7ABRWAlEm5QAbgHstAE1ssAYkZ34tFx0+IRExKSA'>Try</a></div></pre>\n<h2 id=\"nonnullabletype\" style=\"position:relative;\"><a href=\"#nonnullabletype\" aria-label=\"nonnullabletype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>NonNullable&#x3C;Type></code></h2>\n<p>Constructs a type by excluding <code>null</code> and <code>undefined</code> from <code>Type</code>.</p>\n<h5 id=\"example-7\" style=\"position:relative;\"><a href=\"#example-7\" aria-label=\"example 7 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T0 = string | number'>T0</data-lsp> = <data-lsp lsp='type NonNullable&amp;lt;T> = T extends null | undefined ? never : T'>NonNullable</data-lsp>&lt;string | number | undefined>;</span>\n<span class='query'>//    ^ = type T0 = string | number</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T1 = string[]'>T1</data-lsp> = <data-lsp lsp='type NonNullable&amp;lt;T> = T extends null | undefined ? never : T'>NonNullable</data-lsp>&lt;string[] | null | undefined>;</span>\n<span class='query'>//    ^ = type T1 = string[]</span></code><a href='https://www.typescriptlang.org/play/#code/C4TwDgpgBAKgDFAvFAcgewHYoK4BtcCGARrhADwDOwATgJYYDmUAPlBtgLZETUtTYYAJhABm9CIIB8AbgBQAenlRlUAHoB+WaEiwAjElSYc+YqUo16DANoBdPu3x8BwsRgkyFSlRqA'>Try</a></div></pre>\n<h2 id=\"parameterstype\" style=\"position:relative;\"><a href=\"#parameterstype\" aria-label=\"parameterstype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Parameters&#x3C;Type></code></h2>\n<p>Constructs a tuple type from the types used in the parameters of a function type <code>Type</code>.</p>\n<h5 id=\"example-8\" style=\"position:relative;\"><a href=\"#example-8\" aria-label=\"example 8 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <data-lsp lsp='function f1(arg: {&amp;#13;    a: number;&amp;#13;    b: string;&amp;#13;}): void'>f1</data-lsp>(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) arg: {&amp;#13;    a: number;&amp;#13;    b: string;&amp;#13;}'>arg</data-lsp></span><span style=\"color: #000000\">: { </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) a: number'>a</data-lsp></span><span style=\"color: #000000\">: number; </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) b: string'>b</data-lsp></span><span style=\"color: #000000\">: string }): void;</span>\n\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T0 = []'>T0</data-lsp> = <data-lsp lsp='type Parameters&amp;lt;T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never'>Parameters</data-lsp>&lt;() </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> string&gt;;</span>\n<span class='query'>//    ^ = type T0 = []</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T1 = [s: string]'>T1</data-lsp> = <data-lsp lsp='type Parameters&amp;lt;T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never'>Parameters</data-lsp>&lt;(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) s: string'>s</data-lsp></span><span style=\"color: #000000\">: string) </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> void&gt;;</span>\n<span class='query'>//    ^ = type T1 = [s: string]</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T2 = [arg: unknown]'>T2</data-lsp> = <data-lsp lsp='type Parameters&amp;lt;T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never'>Parameters</data-lsp>&lt;&lt;<data-lsp lsp='(type parameter) T in &amp;lt;T>(arg: T): T'>T</data-lsp>>(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) arg: T'>arg</data-lsp></span><span style=\"color: #000000\">: <data-lsp lsp='(type parameter) T in &amp;lt;T>(arg: T): T'>T</data-lsp>) </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> <data-lsp lsp='(type parameter) T in &amp;lt;T>(arg: T): T'>T</data-lsp>>;</span>\n<span class='query'>//    ^ = type T2 = [arg: unknown]</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T3 = [arg: {&amp;#13;    a: number;&amp;#13;    b: string;&amp;#13;}]'>T3</data-lsp> = <data-lsp lsp='type Parameters&amp;lt;T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never'>Parameters</data-lsp>&lt;</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> <data-lsp lsp='function f1(arg: {&amp;#13;    a: number;&amp;#13;    b: string;&amp;#13;}): void'>f1</data-lsp>>;</span>\n<span class='query'>//    ^ = type T3 = [arg: {\n    a: number;\n    b: string;\n}]</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T4 = unknown[]'>T4</data-lsp> = <data-lsp lsp='type Parameters&amp;lt;T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never'>Parameters</data-lsp>&lt;any>;</span>\n<span class='query'>//    ^ = type T4 = unknown[]</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T5 = never'>T5</data-lsp> = <data-lsp lsp='type Parameters&amp;lt;T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never'>Parameters</data-lsp>&lt;never>;</span>\n<span class='query'>//    ^ = type T5 = never</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"><data-err> <data-lsp lsp='type T6 = never'>T6</data-lsp> = <data-lsp lsp='type Parameters&amp;lt;T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never'>Parameters</data-lsp>&lt;string>;</data-err></span>\n<span class=\"error\"><span>Type 'string' does not satisfy the constraint '(...args: any) =&gt; any'.</span><span class=\"code\">2344</span></span><span class=\"error-behind\">Type 'string' does not satisfy the constraint '(...args: any) =&gt; any'.</span><span class='query'>//    ^ = type T6 = never</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"><data-err> <data-lsp lsp='type T7 = never'>T7</data-lsp> = <data-lsp lsp='type Parameters&amp;lt;T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never'>Parameters</data-lsp>&lt;<data-lsp lsp='interface Function'>Function</data-lsp>>;</data-err></span>\n<span class=\"error\"><span>Type 'Function' does not satisfy the constraint '(...args: any) =&gt; any'.\n  Type 'Function' provides no match for the signature '(...args: any): any'.</span><span class=\"code\">2344</span></span><span class=\"error-behind\">Type 'Function' does not satisfy the constraint '(...args: any) =&gt; any'.\n  Type 'Function' provides no match for the signature '(...args: any): any'.</span><span class='query'>//    ^ = type T7 = never</span></code><a href='https://www.typescriptlang.org/play/#code/PTAEAEFMCdoe2gZwFygEwGYAsWBQATSAYwBsBDaSUAMwFcA7IgFwEs56aBGACgoHNUAb1BlU9WgFsARjADcoKakRNoLen1ABfAJSoAbnBb5ZuXEwCeAByoAVAAygAvKAAKFMhMhMYiADzdtJwA+UGVVdSCTEFAY0AA9AH4zK1tOJ1d3T28kfxRQlTU+QMcQgyNI3GjYxOTrUBs0dLdoDy8fX18bIN5oAXrikK6osGqkizqbDCbMtpzxyDhqLgqqmJr5+qxplqz2snpzFZG1sZT6gFZt1uy-ekg9GCPY+NOJgDYr3ZywwqfR2tsAHZPrM-AAxBjMNj0P4nIA'>Try</a></div></pre>\n<h2 id=\"constructorparameterstype\" style=\"position:relative;\"><a href=\"#constructorparameterstype\" aria-label=\"constructorparameterstype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>ConstructorParameters&#x3C;Type></code></h2>\n<p>Constructs a tuple or array type from the types of a constructor function type. It produces a tuple type with all the parameter types (or the type <code>never</code> if <code>Type</code> is not a function).</p>\n<h5 id=\"example-9\" style=\"position:relative;\"><a href=\"#example-9\" aria-label=\"example 9 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T0 = [message?: string]'>T0</data-lsp> = <data-lsp lsp='type ConstructorParameters&amp;lt;T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never'>ConstructorParameters</data-lsp>&lt;<data-lsp lsp='interface ErrorConstructor'>ErrorConstructor</data-lsp>>;</span>\n<span class='query'>//    ^ = type T0 = [message?: string]</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T1 = string[]'>T1</data-lsp> = <data-lsp lsp='type ConstructorParameters&amp;lt;T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never'>ConstructorParameters</data-lsp>&lt;<data-lsp lsp='interface FunctionConstructor'>FunctionConstructor</data-lsp>>;</span>\n<span class='query'>//    ^ = type T1 = string[]</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T2 = [pattern: string | RegExp, flags?: string]'>T2</data-lsp> = <data-lsp lsp='type ConstructorParameters&amp;lt;T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never'>ConstructorParameters</data-lsp>&lt;<data-lsp lsp='interface RegExpConstructor'>RegExpConstructor</data-lsp>>;</span>\n<span class='query'>//    ^ = type T2 = [pattern: string | RegExp, flags?: string]</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T3 = unknown[]'>T3</data-lsp> = <data-lsp lsp='type ConstructorParameters&amp;lt;T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never'>ConstructorParameters</data-lsp>&lt;any></span>\n<span class='query'>//    ^ = type T3 = unknown[]</span>\n\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"><data-err> <data-lsp lsp='type T4 = never'>T4</data-lsp> = <data-lsp lsp='type ConstructorParameters&amp;lt;T extends new (...args: any) => any> = T extends new (...args: infer P) => any ? P : never'>ConstructorParameters</data-lsp>&lt;<data-lsp lsp='interface Function'>Function</data-lsp>></data-err></span>\n<span class=\"error\"><span>Type 'Function' does not satisfy the constraint 'new (...args: any) =&gt; any'.\n  Type 'Function' provides no match for the signature 'new (...args: any): any'.</span><span class=\"code\">2344</span></span><span class=\"error-behind\">Type 'Function' does not satisfy the constraint 'new (...args: any) =&gt; any'.\n  Type 'Function' provides no match for the signature 'new (...args: any): any'.</span><span class='query'>//    ^ = type T4 = never</span></code><a href='https://www.typescriptlang.org/play/#code/PTAEAEFMCdoe2gZwFygEwGYAsWBQIJEAXaASwGMjUAzAQwBtFJciBPAB0lABUAGUALygAwnAB2xaAFdKCAAq1otALaQiMRAB4AorASiJJGUQQA+ANz4woGwD0A-Cw5duARkEjxk4-MUq1GpoAYlJilKTiBt6y0BZWNnaObJw8aB5RRjEKSqrqSJoASpAA5toAHuwZ0jFxBAkOTincGOlemSbQ2f55WrRirKbx9Y6NLlithtUdXbmBIWFEEWKDdYlAA'>Try</a></div></pre>\n<h2 id=\"returntypetype\" style=\"position:relative;\"><a href=\"#returntypetype\" aria-label=\"returntypetype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>ReturnType&#x3C;Type></code></h2>\n<p>Constructs a type consisting of the return type of function <code>Type</code>.</p>\n<h5 id=\"example-10\" style=\"position:relative;\"><a href=\"#example-10\" aria-label=\"example 10 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <data-lsp lsp='function f1(): {&amp;#13;    a: number;&amp;#13;    b: string;&amp;#13;}'>f1</data-lsp>(): { </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) a: number'>a</data-lsp></span><span style=\"color: #000000\">: number; </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) b: string'>b</data-lsp></span><span style=\"color: #000000\">: string };</span>\n\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T0 = string'>T0</data-lsp> = <data-lsp lsp='type ReturnType&amp;lt;T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any'>ReturnType</data-lsp>&lt;() </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> string&gt;;</span>\n<span class='query'>//    ^ = type T0 = string</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T1 = void'>T1</data-lsp> = <data-lsp lsp='type ReturnType&amp;lt;T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any'>ReturnType</data-lsp>&lt;(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) s: string'>s</data-lsp></span><span style=\"color: #000000\">: string) </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> void&gt;;</span>\n<span class='query'>//    ^ = type T1 = void</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T2 = unknown'>T2</data-lsp> = <data-lsp lsp='type ReturnType&amp;lt;T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any'>ReturnType</data-lsp>&lt;&lt;<data-lsp lsp='(type parameter) T in &amp;lt;T>(): T'>T</data-lsp>>() </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> <data-lsp lsp='(type parameter) T in &amp;lt;T>(): T'>T</data-lsp>>;</span>\n<span class='query'>//    ^ = type T2 = unknown</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T3 = number[]'>T3</data-lsp> = <data-lsp lsp='type ReturnType&amp;lt;T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any'>ReturnType</data-lsp>&lt;&lt;<data-lsp lsp='(type parameter) T in &amp;lt;T extends U, U extends number[]>(): T'>T</data-lsp> </span><span style=\"color: #0000FF\">extends</span><span style=\"color: #000000\"> <data-lsp lsp='(type parameter) U in &amp;lt;T extends U, U extends number[]>(): T'>U</data-lsp>, <data-lsp lsp='(type parameter) U in &amp;lt;T extends U, U extends number[]>(): T'>U</data-lsp> </span><span style=\"color: #0000FF\">extends</span><span style=\"color: #000000\"> number[]&gt;() </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> <data-lsp lsp='(type parameter) T in &amp;lt;T extends U, U extends number[]>(): T'>T</data-lsp>>;</span>\n<span class='query'>//    ^ = type T3 = number[]</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T4 = {&amp;#13;    a: number;&amp;#13;    b: string;&amp;#13;}'>T4</data-lsp> = <data-lsp lsp='type ReturnType&amp;lt;T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any'>ReturnType</data-lsp>&lt;</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> <data-lsp lsp='function f1(): {&amp;#13;    a: number;&amp;#13;    b: string;&amp;#13;}'>f1</data-lsp>>;</span>\n<span class='query'>//    ^ = type T4 = {\n    a: number;\n    b: string;\n}</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T5 = any'>T5</data-lsp> = <data-lsp lsp='type ReturnType&amp;lt;T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any'>ReturnType</data-lsp>&lt;any>;</span>\n<span class='query'>//    ^ = type T5 = any</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T6 = never'>T6</data-lsp> = <data-lsp lsp='type ReturnType&amp;lt;T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any'>ReturnType</data-lsp>&lt;never>;</span>\n<span class='query'>//    ^ = type T6 = never</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"><data-err> <data-lsp lsp='type T7 = any'>T7</data-lsp> = <data-lsp lsp='type ReturnType&amp;lt;T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any'>ReturnType</data-lsp>&lt;string>;</data-err></span>\n<span class=\"error\"><span>Type 'string' does not satisfy the constraint '(...args: any) =&gt; any'.</span><span class=\"code\">2344</span></span><span class=\"error-behind\">Type 'string' does not satisfy the constraint '(...args: any) =&gt; any'.</span><span class='query'>//    ^ = type T7 = any</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"><data-err> <data-lsp lsp='type T8 = any'>T8</data-lsp> = <data-lsp lsp='type ReturnType&amp;lt;T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any'>ReturnType</data-lsp>&lt;<data-lsp lsp='interface Function'>Function</data-lsp>>;</data-err></span>\n<span class=\"error\"><span>Type 'Function' does not satisfy the constraint '(...args: any) =&gt; any'.\n  Type 'Function' provides no match for the signature '(...args: any): any'.</span><span class=\"code\">2344</span></span><span class=\"error-behind\">Type 'Function' does not satisfy the constraint '(...args: any) =&gt; any'.\n  Type 'Function' provides no match for the signature '(...args: any): any'.</span><span class='query'>//    ^ = type T8 = any</span></code><a href='https://www.typescriptlang.org/play/#code/PTAEAEFMCdoe2gZwFygEwGYAsX3awFAAmkAxgDYCG0koAZgK4B2pALgJZxP0CMAFAEpUAb1CVUTBgFsARjADcoGakSto7JgHNQAX3kECrAJ4AHWgBUADKAC8oAEqRWDaE3OnIAHkG2AfKFV1LV99EFBw0AA9AH5DD1BzHlsHJxc3D28UALUNTQE-UAA3OHYiEIIwiJi4swS0ZMdnV3czT09zXx8bfw7QsCrY41rzDAbU5oz20EgAD1ZIJiJEUABVABpV6bmFpdBJWRgAbQBdTvzuhPLK8Oqhi1w7RrSWrzu4Ol4r-pvB+PMAVjGTXSrUoTCMXwiUV+wwAbEDnhkmJBCjBIQMahYAOwIiatQK5dE-TEJAAcuJBXgAYsw2JwmEToUA'>Try</a></div></pre>\n<h2 id=\"instancetypetype\" style=\"position:relative;\"><a href=\"#instancetypetype\" aria-label=\"instancetypetype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>InstanceType&#x3C;Type></code></h2>\n<p>Constructs a type consisting of the instance type of a constructor function in <code>Type</code>.</p>\n<h5 id=\"example-11\" style=\"position:relative;\"><a href=\"#example-11\" aria-label=\"example 11 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> <data-lsp lsp='class C'>C</data-lsp> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) C.x: number'>x</data-lsp></span><span style=\"color: #000000\"> = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) C.y: number'>y</data-lsp></span><span style=\"color: #000000\"> = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T0 = C'>T0</data-lsp> = <data-lsp lsp='type InstanceType&amp;lt;T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any'>InstanceType</data-lsp>&lt;</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> <data-lsp lsp='class C'>C</data-lsp>>;</span>\n<span class='query'>//    ^ = type T0 = C</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T1 = any'>T1</data-lsp> = <data-lsp lsp='type InstanceType&amp;lt;T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any'>InstanceType</data-lsp>&lt;any>;</span>\n<span class='query'>//    ^ = type T1 = any</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type T2 = never'>T2</data-lsp> = <data-lsp lsp='type InstanceType&amp;lt;T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any'>InstanceType</data-lsp>&lt;never>;</span>\n<span class='query'>//    ^ = type T2 = never</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"><data-err> <data-lsp lsp='type T3 = any'>T3</data-lsp> = <data-lsp lsp='type InstanceType&amp;lt;T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any'>InstanceType</data-lsp>&lt;string>;</data-err></span>\n<span class=\"error\"><span>Type 'string' does not satisfy the constraint 'new (...args: any) =&gt; any'.</span><span class=\"code\">2344</span></span><span class=\"error-behind\">Type 'string' does not satisfy the constraint 'new (...args: any) =&gt; any'.</span><span class='query'>//    ^ = type T3 = any</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"><data-err> <data-lsp lsp='type T4 = any'>T4</data-lsp> = <data-lsp lsp='type InstanceType&amp;lt;T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any'>InstanceType</data-lsp>&lt;<data-lsp lsp='interface Function'>Function</data-lsp>>;</data-err></span>\n<span class=\"error\"><span>Type 'Function' does not satisfy the constraint 'new (...args: any) =&gt; any'.\n  Type 'Function' provides no match for the signature 'new (...args: any): any'.</span><span class=\"code\">2344</span></span><span class=\"error-behind\">Type 'Function' does not satisfy the constraint 'new (...args: any) =&gt; any'.\n  Type 'Function' provides no match for the signature 'new (...args: any): any'.</span><span class='query'>//    ^ = type T4 = any</span></code><a href='https://www.typescriptlang.org/play/#code/PTAEAEFMCdoe2gZwFygEwGYAsX3awFAgSIAu0AlgMamoBmAhgDaKQFVMOKKgDCoAbwKhQAD1ABeUAAYA3MNABPSTPkBfAgVKKADpFAAVaSoCSAOzIMzVSAd2QAPNr1w6fAHzziI0AD0A-Fr2hgCMphakVjZ2eg5Wip5EYD4BQXqGaOGW1rb2DmaQAG4wid4iqc76BhhZkTkxjmSUZgDmpcnlgZWGuFLm2dF5AGIArtakFHBm7T5+-kA'>Try</a></div></pre>\n<h2 id=\"requiredtype\" style=\"position:relative;\"><a href=\"#requiredtype\" aria-label=\"requiredtype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>Required&#x3C;Type></code></h2>\n<p>Constructs a type consisting of all properties of <code>T</code> set to required. The opposite of <a href=\"#partialtype\"><code>Partial</code></a>.</p>\n<h5 id=\"example-12\" style=\"position:relative;\"><a href=\"#example-12\" aria-label=\"example 12 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> <data-lsp lsp='interface Props'>Props</data-lsp> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Props.a?: number | undefined'>a</data-lsp></span><span style=\"color: #000000\">?: number;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) Props.b?: string | undefined'>b</data-lsp></span><span style=\"color: #000000\">?: string;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='const obj: Props'>obj</data-lsp></span><span style=\"color: #000000\">:</span><span style=\"color: #1A1A1A\"> <data-lsp lsp='interface Props'>Props</data-lsp> </span><span style=\"color: #000000\">= { <data-lsp lsp='(property) Props.a?: number | undefined'>a</data-lsp>: </span><span style=\"color: #09835A\">5</span><span style=\"color: #000000\"> };</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-err><data-lsp lsp='const obj2: Required&amp;lt;Props>'>obj2</data-lsp></data-err></span><span style=\"color: #000000\">:</span><span style=\"color: #1A1A1A\"> <data-lsp lsp='type Required&amp;lt;T> = { [P in keyof T]-?: T[P]; }'>Required</data-lsp>&lt;<data-lsp lsp='interface Props'>Props</data-lsp>> </span><span style=\"color: #000000\">= { <data-lsp lsp='(property) a: number'>a</data-lsp>: </span><span style=\"color: #09835A\">5</span><span style=\"color: #000000\"> };</span>\n<span class=\"error\"><span>Property 'b' is missing in type '{ a: number; }' but required in type 'Required&lt;Props&gt;'.</span><span class=\"code\">2741</span></span><span class=\"error-behind\">Property 'b' is missing in type '{ a: number; }' but required in type 'Required&lt;Props&gt;'.</span></code><a href='https://www.typescriptlang.org/play/#code/PTAEAEFMCdoe2gZwFygEwHYAsBGAUAJYB2ALjAGYCGAxpKAArwAOioA3nqKJQPypEBXALYAjGAG5OoEX1CIS0YgHNJAXzx5qcIvNBwRAK1SM4LUAF523VAFZQqyZu279BtKgBKkAI4CC0SAATAB4TFgA+CytKW3txIA'>Try</a></div></pre>\n<h2 id=\"thisparametertypetype\" style=\"position:relative;\"><a href=\"#thisparametertypetype\" aria-label=\"thisparametertypetype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>ThisParameterType&#x3C;Type></code></h2>\n<p>Extracts the type of the <a href=\"/docs/handbook/functions.html#this-parameters\">this</a> parameter for a function type, or <a href=\"/docs/handbook/release-notes/typescript-3-0.html#new-unknown-top-type\">unknown</a> if the function type has no <code>this</code> parameter.</p>\n<h5 id=\"example-13\" style=\"position:relative;\"><a href=\"#example-13\" aria-label=\"example 13 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <data-lsp lsp='function toHex(this: Number): string'>toHex</data-lsp>(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) this: Number'>this</data-lsp></span><span style=\"color: #000000\">: <data-lsp lsp='interface Number'>Number</data-lsp>) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.<data-lsp lsp='(method) Number.toString(radix?: number | undefined): string'>toString</data-lsp>(</span><span style=\"color: #09835A\">16</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <data-lsp lsp='function numberToString(n: ThisParameterType&amp;lt;typeof toHex>): string'>numberToString</data-lsp>(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) n: Number'>n</data-lsp></span><span style=\"color: #000000\">: <data-lsp lsp='type ThisParameterType&amp;lt;T> = T extends (this: infer U, ...args: any[]) => any ? U : unknown'>ThisParameterType</data-lsp>&lt;</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> <data-lsp lsp='function toHex(this: Number): string'>toHex</data-lsp>>) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='function toHex(this: Number): string'>toHex</data-lsp></span><span style=\"color: #000000\">.<data-lsp lsp='(method) CallableFunction.apply&amp;lt;Number, string>(this: (this: Number) => string, thisArg: Number): string (+1 overload)'>apply</data-lsp>(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) n: Number'>n</data-lsp></span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">}</span></code><a href='https://www.typescriptlang.org/play/#code/GYVwdgxgLglg9mABFOAJApgDwBRQBYwDOAXIgHIgC2ARugE4CUiA3gFCKJ3pQh1L5EAdCgDKUOjDABzbAEYAbAwDcrAL6tWoSLASIwVWnQAqcMROnYwpIwUIAFAIZ0HlbvSMBPAA7oAPFG90OGBkNCwAPiY2Di4ePlCMTEEHLy8AGw9LZTUgA'>Try</a></div></pre>\n<h2 id=\"omitthisparametertype\" style=\"position:relative;\"><a href=\"#omitthisparametertype\" aria-label=\"omitthisparametertype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>OmitThisParameter&#x3C;Type></code></h2>\n<p>Removes the <a href=\"/docs/handbook/functions.html#this-parameters\"><code>this</code></a> parameter from <code>Type</code>. If <code>Type</code> has no explicitly declared <code>this</code> parameter, the result is simply <code>Type</code>. Otherwise, a new function type with no <code>this</code> parameter is created from <code>Type</code>. Generics are erased and only the last overload signature is propagated into the new function type.</p>\n<h5 id=\"example-14\" style=\"position:relative;\"><a href=\"#example-14\" aria-label=\"example 14 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <data-lsp lsp='function toHex(this: Number): string'>toHex</data-lsp>(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) this: Number'>this</data-lsp></span><span style=\"color: #000000\">: <data-lsp lsp='interface Number'>Number</data-lsp>) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.<data-lsp lsp='(method) Number.toString(radix?: number | undefined): string'>toString</data-lsp>(</span><span style=\"color: #09835A\">16</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='const fiveToHex: () => string'>fiveToHex</data-lsp></span><span style=\"color: #000000\">:</span><span style=\"color: #1A1A1A\"> <data-lsp lsp='type OmitThisParameter&amp;lt;T> = unknown extends ThisParameterType&amp;lt;T> ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T'>OmitThisParameter</data-lsp>&lt;</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #1A1A1A\"> <data-lsp lsp='function toHex(this: Number): string'>toHex</data-lsp>> </span><span style=\"color: #000000\">= </span><span style=\"color: #1A1A1A\"><data-lsp lsp='function toHex(this: Number): string'>toHex</data-lsp></span><span style=\"color: #000000\">.<data-lsp lsp='(method) CallableFunction.bind&amp;lt;(this: Number) => string>(this: (this: Number) => string, thisArg: Number): () => string (+5 overloads)'>bind</data-lsp>(</span><span style=\"color: #09835A\">5</span><span style=\"color: #000000\">);</span>\n\n<span style=\"color: #000000\"><data-lsp lsp='var console: Console'>console</data-lsp>.<data-lsp lsp='(method) Console.log(...data: any[]): void'>log</data-lsp>(<data-lsp lsp='const fiveToHex: () => string'>fiveToHex</data-lsp>());</span></code><a href='https://www.typescriptlang.org/play/#code/GYVwdgxgLglg9mABFOAJApgDwBRQBYwDOAXIgHIgC2ARugE4CUiA3gFCKJ3pQh1L5EAdCgDKUOjDABzbAEYAbAwDcrAL6tWEBISiJgMAG7oAKmiykA8pRhRjBQgAUAhnSeVu9ADxQAngAd0OGBkM0wAPkQAXhCMTEFqSQATbABWZQ0tMEI4ABt0QRy4GX0jU1jsBmUgA'>Try</a></div></pre>\n<h2 id=\"thistypetype\" style=\"position:relative;\"><a href=\"#thistypetype\" aria-label=\"thistypetype permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>ThisType&#x3C;Type></code></h2>\n<p>This utility does not return a transformed type. Instead, it serves as a marker for a contextual <a href=\"/docs/handbook/functions.html#this\"><code>this</code></a> type. Note that the <code>--noImplicitThis</code> flag must be enabled to use this utility.</p>\n<h5 id=\"example-15\" style=\"position:relative;\"><a href=\"#example-15\" aria-label=\"example 15 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <data-lsp lsp='type ObjectDescriptor&amp;lt;D, M> = {&amp;#13;    data?: D | undefined;&amp;#13;    methods?: (M &amp;amp; ThisType&amp;lt;D &amp;amp; M>) | undefined;&amp;#13;}'>ObjectDescriptor</data-lsp>&lt;<data-lsp lsp='(type parameter) D in type ObjectDescriptor&amp;lt;D, M>'>D</data-lsp>, <data-lsp lsp='(type parameter) M in type ObjectDescriptor&amp;lt;D, M>'>M</data-lsp>> = {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) data?: D | undefined'>data</data-lsp></span><span style=\"color: #000000\">?: <data-lsp lsp='(type parameter) D in type ObjectDescriptor&amp;lt;D, M>'>D</data-lsp>;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) methods?: (M &amp;amp; ThisType&amp;lt;D &amp;amp; M>) | undefined'>methods</data-lsp></span><span style=\"color: #000000\">?: <data-lsp lsp='(type parameter) M in type ObjectDescriptor&amp;lt;D, M>'>M</data-lsp> &amp; <data-lsp lsp='interface ThisType&amp;lt;T>'>ThisType</data-lsp>&lt;<data-lsp lsp='(type parameter) D in type ObjectDescriptor&amp;lt;D, M>'>D</data-lsp> &amp; <data-lsp lsp='(type parameter) M in type ObjectDescriptor&amp;lt;D, M>'>M</data-lsp>>; </span><span style=\"color: #008000\">// Type of &apos;this&apos; in methods is D & M</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <data-lsp lsp='function makeObject&amp;lt;D, M>(desc: ObjectDescriptor&amp;lt;D, M>): D &amp;amp; M'>makeObject</data-lsp>&lt;<data-lsp lsp='(type parameter) D in makeObject&amp;lt;D, M>(desc: ObjectDescriptor&amp;lt;D, M>): D &amp;amp; M'>D</data-lsp>, <data-lsp lsp='(type parameter) M in makeObject&amp;lt;D, M>(desc: ObjectDescriptor&amp;lt;D, M>): D &amp;amp; M'>M</data-lsp>>(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) desc: ObjectDescriptor&amp;lt;D, M>'>desc</data-lsp></span><span style=\"color: #000000\">: <data-lsp lsp='type ObjectDescriptor&amp;lt;D, M> = {&amp;#13;    data?: D | undefined;&amp;#13;    methods?: (M &amp;amp; ThisType&amp;lt;D &amp;amp; M>) | undefined;&amp;#13;}'>ObjectDescriptor</data-lsp>&lt;<data-lsp lsp='(type parameter) D in makeObject&amp;lt;D, M>(desc: ObjectDescriptor&amp;lt;D, M>): D &amp;amp; M'>D</data-lsp>, <data-lsp lsp='(type parameter) M in makeObject&amp;lt;D, M>(desc: ObjectDescriptor&amp;lt;D, M>): D &amp;amp; M'>M</data-lsp>>): <data-lsp lsp='(type parameter) D in makeObject&amp;lt;D, M>(desc: ObjectDescriptor&amp;lt;D, M>): D &amp;amp; M'>D</data-lsp> &amp; <data-lsp lsp='(type parameter) M in makeObject&amp;lt;D, M>(desc: ObjectDescriptor&amp;lt;D, M>): D &amp;amp; M'>M</data-lsp> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='let data: object'>data</data-lsp></span><span style=\"color: #000000\">:</span><span style=\"color: #1A1A1A\"> object </span><span style=\"color: #000000\">= </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) desc: ObjectDescriptor&amp;lt;D, M>'>desc</data-lsp></span><span style=\"color: #000000\">.<data-lsp lsp='(property) data?: D | undefined'>data</data-lsp> || {};</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='let methods: object'>methods</data-lsp></span><span style=\"color: #000000\">:</span><span style=\"color: #1A1A1A\"> object </span><span style=\"color: #000000\">= </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) desc: ObjectDescriptor&amp;lt;D, M>'>desc</data-lsp></span><span style=\"color: #000000\">.</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(property) methods?: (M &amp;amp; ThisType&amp;lt;D &amp;amp; M>) | undefined'>methods</data-lsp></span><span style=\"color: #000000\"> || {};</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { ...</span><span style=\"color: #1A1A1A\"><data-lsp lsp='let data: object'>data</data-lsp></span><span style=\"color: #000000\">, ...</span><span style=\"color: #1A1A1A\"><data-lsp lsp='let methods: object'>methods</data-lsp></span><span style=\"color: #000000\"> } </span><span style=\"color: #0000FF\">as</span><span style=\"color: #000000\"> <data-lsp lsp='(type parameter) D in makeObject&amp;lt;D, M>(desc: ObjectDescriptor&amp;lt;D, M>): D &amp;amp; M'>D</data-lsp> &amp; <data-lsp lsp='(type parameter) M in makeObject&amp;lt;D, M>(desc: ObjectDescriptor&amp;lt;D, M>): D &amp;amp; M'>M</data-lsp>;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> </span><span style=\"color: #1A1A1A\"><data-lsp lsp='let obj: {&amp;#13;    x: number;&amp;#13;    y: number;&amp;#13;} &amp;amp; {&amp;#13;    moveBy(dx: number, dy: number): void;&amp;#13;}'>obj</data-lsp> </span><span style=\"color: #000000\">= <data-lsp lsp='function makeObject&amp;lt;{&amp;#13;    x: number;&amp;#13;    y: number;&amp;#13;}, {&amp;#13;    moveBy(dx: number, dy: number): void;&amp;#13;}>(desc: ObjectDescriptor&amp;lt;{&amp;#13;    x: number;&amp;#13;    y: number;&amp;#13;}, {&amp;#13;    moveBy(dx: number, dy: number): void;&amp;#13;}>): {&amp;#13;    x: number;&amp;#13;    y: number;&amp;#13;} &amp;amp; {&amp;#13;    moveBy(dx: number, dy: number): void;&amp;#13;}'>makeObject</data-lsp>({</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) data?: {&amp;#13;    x: number;&amp;#13;    y: number;&amp;#13;} | undefined'>data</data-lsp>: { <data-lsp lsp='(property) x: number'>x</data-lsp>: </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, <data-lsp lsp='(property) y: number'>y</data-lsp>: </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\"> },</span>\n<span style=\"color: #000000\">  <data-lsp lsp='(property) methods?: ({&amp;#13;    moveBy(dx: number, dy: number): void;&amp;#13;} &amp;amp; ThisType&amp;lt;{&amp;#13;    x: number;&amp;#13;    y: number;&amp;#13;} &amp;amp; {&amp;#13;    moveBy(dx: number, dy: number): void;&amp;#13;}>) | undefined'>methods</data-lsp>: {</span>\n<span style=\"color: #000000\">    <data-lsp lsp='(method) moveBy(dx: number, dy: number): void'>moveBy</data-lsp>(</span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) dx: number'>dx</data-lsp></span><span style=\"color: #000000\">: number, </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) dy: number'>dy</data-lsp></span><span style=\"color: #000000\">: number) {</span>\n<span style=\"color: #000000\">      </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.<data-lsp lsp='any'>x</data-lsp> += </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) dx: number'>dx</data-lsp></span><span style=\"color: #000000\">; </span><span style=\"color: #008000\">// Strongly typed this</span>\n<span style=\"color: #000000\">      </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.<data-lsp lsp='any'>y</data-lsp> += </span><span style=\"color: #1A1A1A\"><data-lsp lsp='(parameter) dy: number'>dy</data-lsp></span><span style=\"color: #000000\">; </span><span style=\"color: #008000\">// Strongly typed this</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">});</span>\n\n<span style=\"color: #1A1A1A\"><data-lsp lsp='let obj: {&amp;#13;    x: number;&amp;#13;    y: number;&amp;#13;} &amp;amp; {&amp;#13;    moveBy(dx: number, dy: number): void;&amp;#13;}'>obj</data-lsp></span><span style=\"color: #000000\">.<data-lsp lsp='(property) x: number'>x</data-lsp> = </span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #1A1A1A\"><data-lsp lsp='let obj: {&amp;#13;    x: number;&amp;#13;    y: number;&amp;#13;} &amp;amp; {&amp;#13;    moveBy(dx: number, dy: number): void;&amp;#13;}'>obj</data-lsp></span><span style=\"color: #000000\">.<data-lsp lsp='(property) y: number'>y</data-lsp> = </span><span style=\"color: #09835A\">20</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #1A1A1A\"><data-lsp lsp='let obj: {&amp;#13;    x: number;&amp;#13;    y: number;&amp;#13;} &amp;amp; {&amp;#13;    moveBy(dx: number, dy: number): void;&amp;#13;}'>obj</data-lsp></span><span style=\"color: #000000\">.<data-lsp lsp='(method) moveBy(dx: number, dy: number): void'>moveBy</data-lsp>(</span><span style=\"color: #09835A\">5</span><span style=\"color: #000000\">, </span><span style=\"color: #09835A\">5</span><span style=\"color: #000000\">);</span></code><a href='https://www.typescriptlang.org/play/#code/PTAEAEDsHsEkFsAOAbAlgY1QFwCoAtUBnALlADMBDZQgUwCgsBPRG0AeQCMArG9LAERqF0AJ1SIs0EQB5+AGlABZAHygAvKADedUKAAmFLBQD8pfgG4doeDSx5oewqaWgAZKHxEczGrLdLlc1AQDx9QaDJQAHI7IijQVEhrW3tHBMJQfn9FOgBfSzoyAFdIPlRoJPgKAGsaTh4+WQUVAAo9IXRSet4BDrEJKSaAgEozbK0rZFt9QwpSaG4e9X0OgDoDI1AAHy2tfMnpmzsHEnDFvmX24VWj1IydvctdEVsikSTNUFXvjYoFb5uKROoFyoAoGSy7kUllydDoUywZy4yyqtW6fBa2l0v1InwAHqQAAwKRhEkFyKy3E64qy6eDQABuNAAQow2gTQJAivAODQRAo9KTOdzeSJhhNdJLQLFCKs8aAANQaPR4oIhADKWBEFQA5shGNKfHppQRCLTJTLVgalfpGGqwJrtZA9QamCxjTLzbDdLDcsMCgsuHLlgBGQmWQNW5YAJnDdEj9KZrJaAFYFCn-UA'>Try</a></div></pre>\n<p>In the example above, the <code>methods</code> object in the argument to <code>makeObject</code> has a contextual type that includes <code>ThisType&#x3C;D &#x26; M></code> and therefore the type of <a href=\"/docs/handbook/functions.html#this\">this</a> in methods within the <code>methods</code> object is <code>{ x: number, y: number } &#x26; { moveBy(dx: number, dy: number): number }</code>. Notice how the type of the <code>methods</code> property simultaneously is an inference target and a source for the <code>this</code> type in methods.</p>\n<p>The <code>ThisType&#x3C;T></code> marker interface is simply an empty interface declared in <code>lib.d.ts</code>. Beyond being recognized in the contextual type of an object literal, the interface acts like any empty interface.</p>","headings":[{"value":"Partial<Type>","depth":2},{"value":"Example","depth":5},{"value":"Readonly<Type>","depth":2},{"value":"Example","depth":5},{"value":"Object.freeze","depth":5},{"value":"Record<Keys,Type>","depth":2},{"value":"Example","depth":5},{"value":"Pick<Type, Keys>","depth":2},{"value":"Example","depth":5},{"value":"Omit<Type, Keys>","depth":2},{"value":"Example","depth":5},{"value":"Exclude<Type, ExcludedUnion>","depth":2},{"value":"Example","depth":5},{"value":"Extract<Type, Union>","depth":2},{"value":"Example","depth":5},{"value":"NonNullable<Type>","depth":2},{"value":"Example","depth":5},{"value":"Parameters<Type>","depth":2},{"value":"Example","depth":5},{"value":"ConstructorParameters<Type>","depth":2},{"value":"Example","depth":5},{"value":"ReturnType<Type>","depth":2},{"value":"Example","depth":5},{"value":"InstanceType<Type>","depth":2},{"value":"Example","depth":5},{"value":"Required<Type>","depth":2},{"value":"Example","depth":5},{"value":"ThisParameterType<Type>","depth":2},{"value":"Example","depth":5},{"value":"OmitThisParameter<Type>","depth":2},{"value":"Example","depth":5},{"value":"ThisType<Type>","depth":2},{"value":"Example","depth":5}],"frontmatter":{"permalink":"/docs/handbook/utility-types.html","title":"Utility Types","disable_toc":null,"oneline":"Types which are globally included in TypeScript"}},"prev":null,"next":null},"pageContext":{"id":"utility-types","slug":"/docs/handbook/utility-types.html","repoPath":"/packages/documentation/copy/en/reference/Utility Types.md","lang":"en","modifiedTime":"2020-08-07T17:00:36.339Z"}}}