Full Code of sindresorhus/type-fest for AI

main 0329b2b2dc56 cached
449 files
1.2 MB
363.6k tokens
1372 symbols
1 requests
Download .txt
Showing preview only (1,299K chars total). Download the full file or copy to clipboard to get everything.
Repository: sindresorhus/type-fest
Branch: main
Commit: 0329b2b2dc56
Files: 449
Total size: 1.2 MB

Directory structure:
gitextract__kzp05im/

├── .editorconfig
├── .gitattributes
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── 1 new type.yml
│   │   ├── 2 bug report.yml
│   │   └── 3 enhancement.md
│   ├── contributing.md
│   ├── dependabot.yml
│   ├── funding.yml
│   ├── pull_request_template.md
│   ├── security.md
│   └── workflows/
│       ├── claude-code-review.yml
│       ├── claude.yml
│       ├── main.yml
│       └── ts-canary.yml
├── .gitignore
├── .npmrc
├── CLAUDE.md
├── index.d.ts
├── license-cc0
├── license-mit
├── lint-processors/
│   ├── fixtures/
│   │   └── eslint.config.js
│   ├── jsdoc-codeblocks.js
│   └── jsdoc-codeblocks.test.js
├── lint-rules/
│   ├── import-path.js
│   ├── import-path.test.js
│   ├── require-export.js
│   ├── require-export.test.js
│   ├── require-exported-types.js
│   ├── require-exported-types.test.js
│   ├── source-files-extension.js
│   ├── source-files-extension.test.js
│   ├── test-utils.js
│   ├── validate-jsdoc-codeblocks.js
│   └── validate-jsdoc-codeblocks.test.js
├── media/
│   ├── logo.sketch
│   └── readme.md
├── package.json
├── readme.md
├── source/
│   ├── all-extend.d.ts
│   ├── all-union-fields.d.ts
│   ├── and-all.d.ts
│   ├── and.d.ts
│   ├── array-element.d.ts
│   ├── array-indices.d.ts
│   ├── array-length.d.ts
│   ├── array-reverse.d.ts
│   ├── array-slice.d.ts
│   ├── array-splice.d.ts
│   ├── array-tail.d.ts
│   ├── array-values.d.ts
│   ├── arrayable.d.ts
│   ├── async-return-type.d.ts
│   ├── asyncify.d.ts
│   ├── basic.d.ts
│   ├── camel-case.d.ts
│   ├── camel-cased-properties-deep.d.ts
│   ├── camel-cased-properties.d.ts
│   ├── characters.d.ts
│   ├── conditional-except.d.ts
│   ├── conditional-keys.d.ts
│   ├── conditional-pick-deep.d.ts
│   ├── conditional-pick.d.ts
│   ├── conditional-simplify-deep.d.ts
│   ├── conditional-simplify.d.ts
│   ├── delimiter-case.d.ts
│   ├── delimiter-cased-properties-deep.d.ts
│   ├── delimiter-cased-properties.d.ts
│   ├── distributed-omit.d.ts
│   ├── distributed-pick.d.ts
│   ├── empty-object.d.ts
│   ├── entries.d.ts
│   ├── entry.d.ts
│   ├── exact.d.ts
│   ├── except.d.ts
│   ├── exclude-exactly.d.ts
│   ├── exclude-rest-element.d.ts
│   ├── exclude-strict.d.ts
│   ├── exclusify-union.d.ts
│   ├── extends-strict.d.ts
│   ├── extract-rest-element.d.ts
│   ├── extract-strict.d.ts
│   ├── find-global-type.d.ts
│   ├── fixed-length-array.d.ts
│   ├── get.d.ts
│   ├── global-this.d.ts
│   ├── globals/
│   │   ├── index.d.ts
│   │   └── observable-like.d.ts
│   ├── greater-than-or-equal.d.ts
│   ├── greater-than.d.ts
│   ├── has-optional-keys.d.ts
│   ├── has-readonly-keys.d.ts
│   ├── has-required-keys.d.ts
│   ├── has-writable-keys.d.ts
│   ├── if-any.d.ts
│   ├── if-empty-object.d.ts
│   ├── if-never.d.ts
│   ├── if-null.d.ts
│   ├── if-unknown.d.ts
│   ├── if.d.ts
│   ├── includes.d.ts
│   ├── int-closed-range.d.ts
│   ├── int-range.d.ts
│   ├── internal/
│   │   ├── array.d.ts
│   │   ├── characters.d.ts
│   │   ├── enforce-optional.d.ts
│   │   ├── index.d.ts
│   │   ├── keys.d.ts
│   │   ├── numeric.d.ts
│   │   ├── object.d.ts
│   │   ├── string.d.ts
│   │   ├── tuple.d.ts
│   │   └── type.d.ts
│   ├── invariant-of.d.ts
│   ├── is-any.d.ts
│   ├── is-equal.d.ts
│   ├── is-float.d.ts
│   ├── is-integer.d.ts
│   ├── is-literal.d.ts
│   ├── is-lowercase.d.ts
│   ├── is-never.d.ts
│   ├── is-null.d.ts
│   ├── is-nullable.d.ts
│   ├── is-optional-key-of.d.ts
│   ├── is-optional.d.ts
│   ├── is-readonly-key-of.d.ts
│   ├── is-required-key-of.d.ts
│   ├── is-tuple.d.ts
│   ├── is-undefined.d.ts
│   ├── is-union.d.ts
│   ├── is-unknown.d.ts
│   ├── is-uppercase.d.ts
│   ├── is-writable-key-of.d.ts
│   ├── iterable-element.d.ts
│   ├── join.d.ts
│   ├── json-value.d.ts
│   ├── jsonifiable.d.ts
│   ├── jsonify.d.ts
│   ├── kebab-case.d.ts
│   ├── kebab-cased-properties-deep.d.ts
│   ├── kebab-cased-properties.d.ts
│   ├── key-as-string.d.ts
│   ├── keys-of-union.d.ts
│   ├── last-array-element.d.ts
│   ├── less-than-or-equal.d.ts
│   ├── less-than.d.ts
│   ├── literal-to-primitive-deep.d.ts
│   ├── literal-to-primitive.d.ts
│   ├── literal-union.d.ts
│   ├── merge-deep.d.ts
│   ├── merge-exclusive.d.ts
│   ├── merge.d.ts
│   ├── multidimensional-array.d.ts
│   ├── multidimensional-readonly-array.d.ts
│   ├── non-empty-object.d.ts
│   ├── non-empty-string.d.ts
│   ├── non-empty-tuple.d.ts
│   ├── numeric.d.ts
│   ├── object-merge.d.ts
│   ├── omit-deep.d.ts
│   ├── omit-index-signature.d.ts
│   ├── opaque.d.ts
│   ├── optional-keys-of.d.ts
│   ├── optional.d.ts
│   ├── or-all.d.ts
│   ├── or.d.ts
│   ├── override-properties.d.ts
│   ├── package-json.d.ts
│   ├── partial-deep.d.ts
│   ├── partial-on-undefined-deep.d.ts
│   ├── pascal-case.d.ts
│   ├── pascal-cased-properties-deep.d.ts
│   ├── pascal-cased-properties.d.ts
│   ├── paths.d.ts
│   ├── pick-deep.d.ts
│   ├── pick-index-signature.d.ts
│   ├── primitive.d.ts
│   ├── promisable.d.ts
│   ├── readonly-deep.d.ts
│   ├── readonly-keys-of.d.ts
│   ├── readonly-tuple.d.ts
│   ├── remove-prefix.d.ts
│   ├── replace.d.ts
│   ├── require-all-or-none.d.ts
│   ├── require-at-least-one.d.ts
│   ├── require-exactly-one.d.ts
│   ├── require-one-or-none.d.ts
│   ├── required-deep.d.ts
│   ├── required-keys-of.d.ts
│   ├── schema.d.ts
│   ├── screaming-snake-case.d.ts
│   ├── set-field-type.d.ts
│   ├── set-non-nullable-deep.d.ts
│   ├── set-non-nullable.d.ts
│   ├── set-optional.d.ts
│   ├── set-parameter-type.d.ts
│   ├── set-readonly.d.ts
│   ├── set-required-deep.d.ts
│   ├── set-required.d.ts
│   ├── set-return-type.d.ts
│   ├── shared-union-fields-deep.d.ts
│   ├── shared-union-fields.d.ts
│   ├── simplify-deep.d.ts
│   ├── simplify.d.ts
│   ├── single-key-object.d.ts
│   ├── snake-case.d.ts
│   ├── snake-cased-properties-deep.d.ts
│   ├── snake-cased-properties.d.ts
│   ├── some-extend.d.ts
│   ├── split-on-rest-element.d.ts
│   ├── split.d.ts
│   ├── spread.d.ts
│   ├── string-repeat.d.ts
│   ├── string-slice.d.ts
│   ├── stringified.d.ts
│   ├── structured-cloneable.d.ts
│   ├── subtract.d.ts
│   ├── sum.d.ts
│   ├── tagged-union.d.ts
│   ├── tagged.d.ts
│   ├── trim.d.ts
│   ├── tsconfig-json.d.ts
│   ├── tuple-of.d.ts
│   ├── tuple-to-object.d.ts
│   ├── tuple-to-union.d.ts
│   ├── typed-array.d.ts
│   ├── undefined-on-partial-deep.d.ts
│   ├── union-member.d.ts
│   ├── union-to-intersection.d.ts
│   ├── union-to-tuple.d.ts
│   ├── unknown-array.d.ts
│   ├── unknown-map.d.ts
│   ├── unknown-record.d.ts
│   ├── unknown-set.d.ts
│   ├── unwrap-partial.d.ts
│   ├── value-of.d.ts
│   ├── words.d.ts
│   ├── writable-deep.d.ts
│   ├── writable-keys-of.d.ts
│   ├── writable.d.ts
│   └── xor.d.ts
├── test-d/
│   ├── abstract-class.ts
│   ├── all-extend.ts
│   ├── all-union-fields.ts
│   ├── and-all.ts
│   ├── and.ts
│   ├── array-element.ts
│   ├── array-indices.ts
│   ├── array-length.ts
│   ├── array-reverse.ts
│   ├── array-slice.ts
│   ├── array-splice.ts
│   ├── array-tail.ts
│   ├── array-values.ts
│   ├── arrayable.ts
│   ├── async-return-type.ts
│   ├── asyncify.ts
│   ├── camel-case.ts
│   ├── camel-cased-properties-deep.ts
│   ├── camel-cased-properties.ts
│   ├── class.ts
│   ├── conditional-except.ts
│   ├── conditional-keys.ts
│   ├── conditional-pick-deep.ts
│   ├── conditional-pick.ts
│   ├── conditional-simplify-deep.ts
│   ├── conditional-simplify.ts
│   ├── delimiter-case.ts
│   ├── delimiter-cased-properties-deep.ts
│   ├── delimiter-cased-properties.ts
│   ├── distributed-omit.ts
│   ├── distributed-pick.ts
│   ├── empty-object.ts
│   ├── entries.ts
│   ├── exact.ts
│   ├── except.ts
│   ├── exclude-exactly.ts
│   ├── exclude-rest-element.ts
│   ├── exclude-strict.ts
│   ├── exclusify-union.ts
│   ├── extends-strict.ts
│   ├── extract-rest-element.ts
│   ├── extract-strict.ts
│   ├── find-global-type.ts
│   ├── fixed-length-array.ts
│   ├── get.ts
│   ├── global-this.ts
│   ├── greater-than-or-equal.ts
│   ├── greater-than.ts
│   ├── has-optional-keys.ts
│   ├── has-readonly-keys.ts
│   ├── has-required-keys.ts
│   ├── has-writable-keys.ts
│   ├── if-any.ts
│   ├── if-never.ts
│   ├── if-unknown.ts
│   ├── if.ts
│   ├── includes.ts
│   ├── int-closed-range.ts
│   ├── int-range.ts
│   ├── internal/
│   │   ├── apply-default-options.ts
│   │   ├── collapse-literals-in-union.ts
│   │   ├── collapse-rest-element.ts
│   │   ├── enforce-optional.ts
│   │   ├── has-multiple-call-signatures.ts
│   │   ├── homomorphic-pick.ts
│   │   ├── if-not-any-or-never.ts
│   │   ├── is-array-readonly.ts
│   │   ├── is-not-false.ts
│   │   ├── is-number-like.ts
│   │   ├── is-numeric.ts
│   │   ├── is-whitespace.ts
│   │   ├── normalized-keys.ts
│   │   ├── not.ts
│   │   ├── number-absolute.ts
│   │   ├── object-value.ts
│   │   ├── readonly-keys-of-union.ts
│   │   ├── require-none.ts
│   │   ├── tuple-max.ts
│   │   ├── tuple-min.ts
│   │   ├── union-max.ts
│   │   ├── union-min.ts
│   │   └── value-of-union.ts
│   ├── invariant-of.ts
│   ├── is-any.ts
│   ├── is-equal.ts
│   ├── is-float.ts
│   ├── is-integer.ts
│   ├── is-literal.ts
│   ├── is-lowercase.ts
│   ├── is-never.ts
│   ├── is-null.ts
│   ├── is-nullable.ts
│   ├── is-optional-key-of.ts
│   ├── is-optional.ts
│   ├── is-readonly-key-of.ts
│   ├── is-required-key-of.ts
│   ├── is-tuple.ts
│   ├── is-undefined.ts
│   ├── is-union.ts
│   ├── is-unknown.ts
│   ├── is-uppercase.ts
│   ├── is-writable-key-of.ts
│   ├── iterable-element.ts
│   ├── join.ts
│   ├── jsonifiable.ts
│   ├── jsonify.ts
│   ├── kebab-case.ts
│   ├── kebab-cased-properties-deep.ts
│   ├── kebab-cased-properties.ts
│   ├── key-as-string.ts
│   ├── keys-of-union.ts
│   ├── last-array-element.ts
│   ├── less-than-or-equal.ts
│   ├── less-than.ts
│   ├── literal-to-primitive-deep.ts
│   ├── literal-to-primitive.ts
│   ├── merge-deep.ts
│   ├── merge-exclusive.ts
│   ├── merge.ts
│   ├── multidimensional-array.ts
│   ├── multidimensional-readonly-array.ts
│   ├── non-empty-object.ts
│   ├── non-empty-string.ts
│   ├── non-empty-tuple.ts
│   ├── numeric.ts
│   ├── object-merge.ts
│   ├── observable-like.ts
│   ├── omit-deep.ts
│   ├── omit-index-signature.ts
│   ├── opaque.ts
│   ├── optional-keys-of.ts
│   ├── optional.ts
│   ├── or-all.ts
│   ├── or.ts
│   ├── override-properties.ts
│   ├── package-json.ts
│   ├── partial-deep.ts
│   ├── partial-on-undefined-deep.ts
│   ├── pascal-case.ts
│   ├── pascal-cased-properties-deep.ts
│   ├── pascal-cased-properties.ts
│   ├── paths.ts
│   ├── pick-deep.ts
│   ├── pick-index-signature.ts
│   ├── promisable.ts
│   ├── readonly-deep.ts
│   ├── readonly-keys-of.ts
│   ├── readonly-tuple.ts
│   ├── remove-prefix.ts
│   ├── replace.ts
│   ├── require-all-or-none.ts
│   ├── require-at-least-one.ts
│   ├── require-exactly-one.ts
│   ├── require-one-or-none.ts
│   ├── required-deep.ts
│   ├── required-keys-of.ts
│   ├── schema.ts
│   ├── screaming-snake-case.ts
│   ├── set-field-type.ts
│   ├── set-non-nullable-deep.ts
│   ├── set-non-nullable.ts
│   ├── set-optional.ts
│   ├── set-parameter-type.ts
│   ├── set-readonly.ts
│   ├── set-required-deep.ts
│   ├── set-required.ts
│   ├── set-return-type.ts
│   ├── shared-union-fields-deep.ts
│   ├── shared-union-fields.ts
│   ├── simplify-deep.ts
│   ├── simplify.ts
│   ├── single-key-object.ts
│   ├── snake-case.ts
│   ├── snake-cased-properties-deep.ts
│   ├── snake-cased-properties.ts
│   ├── some-extend.ts
│   ├── split-on-rest-element.ts
│   ├── split.ts
│   ├── spread.ts
│   ├── string-repeat.ts
│   ├── string-slice.ts
│   ├── stringified.ts
│   ├── structured-cloneable.ts
│   ├── subtract.ts
│   ├── sum.ts
│   ├── tagged-union.ts
│   ├── trim.ts
│   ├── ts41.ts
│   ├── tsconfig-json.ts
│   ├── tuple-of.ts
│   ├── tuple-to-object.ts
│   ├── tuple-to-union.ts
│   ├── undefined-on-partial-deep.ts
│   ├── union-member.ts
│   ├── union-to-intersection.ts
│   ├── union-to-tuple.ts
│   ├── unknown-array.ts
│   ├── unknown-map.ts
│   ├── unknown-record.ts
│   ├── unknown-set.ts
│   ├── unwrap-partial.ts
│   ├── value-of.ts
│   ├── words.ts
│   ├── writable-deep.ts
│   ├── writable-keys-of.ts
│   ├── writable.ts
│   └── xor.ts
├── tsconfig.json
└── xo.config.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
indent_size = 2


================================================
FILE: .gitattributes
================================================
* text=auto eol=lf


================================================
FILE: .github/ISSUE_TEMPLATE/1 new type.yml
================================================
name: 💡 Suggest new type
description: '​‌‍⁠ ' # Magic whitespace to hide this required field
labels: 'type addition'

body:
  - type: textarea
    id: description
    validations:
      required: true
    attributes:
      label: Type description + examples

  - type: textarea
    id: type
    attributes:
      label: Type source
      description: If you already have the type source, enter it here as a starting point for a the discussion

  - id: requirements
    type: checkboxes
    attributes:
      label: Search existing types and issues first
      options:
        - label: I tried my best to look for it
          required: true


================================================
FILE: .github/ISSUE_TEMPLATE/2 bug report.yml
================================================
name: 🐛 Report bug
description: '​‌‍⁠ ' # Magic whitespace to hide this required field
labels: bug

body:
  - type: textarea
    id: description
    validations:
      required: true
    attributes:
      label: Bug description

  - type: input
    id: repro
    validations:
      required: true
    attributes:
      label: Repro
      description: |
        Open [this playground](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3gUQB4GMVgwC+cAZlBCHAORKoC0pKAzjNQNwCwAUD3WgDEIEOAF4MPAJABXAHbBc0WQC44rKMFkBzLt0lQAhpoBGEAO6rTEADYoDs3UV19kaAHIQASkdmmzYuBx8QgAeIQgAGhpDE3NqAD5dOGS4AHpUuAA9AH4eIA), write a piece of code that fails your expectations, click "Share", and paste the URL here


================================================
FILE: .github/ISSUE_TEMPLATE/3 enhancement.md
================================================
---
name: ♻️ Propose change or improvement to existing types
about: '​‌‍⁠ ' # Magic whitespace to hide this required field
labels: 'enhancement'
---


================================================
FILE: .github/contributing.md
================================================
# Contributing guidelines

## Submitting a new type

- One type addition per pull request, unless they are connected.
- **Please help review the other open pull requests.**
	- If there are no open pull requests, provide some feedback on some of the open issues.
- [Example of a type contribution.](https://github.com/sindresorhus/type-fest/commit/5374588a88ee643893784f66367bc26b8e6509ec)
- Create a new file in the `test-d` directory and write at least one type test.
	- See the other tests for inspiration.
	- If it makes sense, also write a negative test using [`expectNotAssignable()`](https://github.com/SamVerschueren/tsd#expectnotassignabletexpression-any) or, to test other diagnostics, [`expectError()`](https://github.com/SamVerschueren/tsd#expecterrort--anyexpression-t).
- Don't use one-character type names like `T` and `U`. Use descriptive names. See the existing types for inspiration.
- Follow the existing code style, even in documentation code examples.
	- Don't prefix each line in documentation comments with `*`.
- Write a good documentation comment that includes:
	- Write a short and clear description of what the type does.
		- The first line should match the description in the readme.
	- Write about some real-world use-cases where it can be useful. (It can be hard sometimes for users to see where they would use something)
	- Example code block with a realistic example.
	- At the bottom, explain how the type works. Some types can be quite advanced and hard to understand. We can use this opportunity to teach users.
	- If there has been any discussion somewhere about this type, include a link to it. For example, a discussion on the TypeScript issue tracker.
	- Add relevant `@category` tags. See other types for examples.
- If you add any internal helper types, they should still be properly documented and tested.
- Add the type to the readme.
- Make sure the file in the `source` directory uses a `.d.ts` extension and not `.ts`.
- **Use AI (like ChatGPT) to catch type bugs, improve docs, spot typos, validate examples, and suggest more tests.** Include all relevant code (type, tests, helpers, etc.) in the prompt, and also provide a couple of existing types as examples of how it's done. Try this prompt: “Review this TypeScript type for correctness, edge cases, naming, docs, and test coverage. Suggest improvements and realistic succinct examples.”
- Run `$ npm test` before submitting and make sure it passes.
- Name the pull request ```Add `TypeName` type```.


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: 'github-actions'
    directory: '/'
    schedule:
      interval: 'weekly'
    groups:
      github-actions:
        patterns:
          - '*'
  - package-ecosystem: 'npm'
    directory: '/'
    schedule:
      interval: 'monthly'
    versioning-strategy: 'increase-if-necessary'
    groups:
      development-dependencies:
        dependency-type: 'development'


================================================
FILE: .github/funding.yml
================================================
github: [sindresorhus, som-sm, Emiyaaaaa, voxpelli]


================================================
FILE: .github/pull_request_template.md
================================================
<!--

Thanks for submitting a pull request 🙌

If you're submitting a new type, please review the contribution guidelines:
https://github.com/sindresorhus/type-fest/blob/main/.github/contributing.md

-->


================================================
FILE: .github/security.md
================================================
# Security Policy

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.


================================================
FILE: .github/workflows/claude-code-review.yml
================================================
name: Claude Code Review
on:
  pull_request:
    types: [opened, synchronize]
jobs:
  claude-review:
    runs-on: ubuntu-latest
    # Only run if the PR is from the same repository (not a fork), because forks are not supported yet: https://github.com/anthropics/claude-code-action/issues/339
    if: github.event.pull_request.head.repo.full_name == github.repository
    permissions:
      contents: read
      pull-requests: write
      issues: read
      id-token: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5
        with:
          fetch-depth: 1
      - name: Run Claude Code Review
        id: claude-review
        uses: anthropics/claude-code-action@v1
        with:
          claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
          prompt: |
            REPO: ${{ github.repository }}
            PR NUMBER: ${{ github.event.pull_request.number }}

            Please review this pull request and provide feedback on:
            - Code quality and best practices
            - Potential bugs or issues
            - Performance considerations
            - Security concerns
            - Test coverage
            - Be succinct
            - Only comment about things that needs to be fixed/improved
            - Review thoroughly

            Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.

            Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.

          # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
          # or https://docs.claude.com/en/docs/claude-code/sdk#command-line for available options
          claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'


================================================
FILE: .github/workflows/claude.yml
================================================
name: Claude Code
on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]
  issues:
    types: [opened, assigned]
  pull_request_review:
    types: [submitted]
jobs:
  claude:
    if: |
      (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
      (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
      (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
      (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      issues: read
      id-token: write
      actions: read # Required for Claude to read CI results on PRs
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 1
      - name: Run Claude Code
        id: claude
        uses: anthropics/claude-code-action@v1
        with:
          claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
          additional_permissions: |
            actions: read


================================================
FILE: .github/workflows/main.yml
================================================
name: CI
on:
  push:
    branches:
      - main
    tags:
      - '*'
  pull_request:
    branches:
      - main
jobs:
  test:
    name: Node.js ${{ matrix.node-version }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        node-version:
          - 24
          - 22
          - 20
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-node@v5
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm install
      - run: npm test
  types:
    name: TypeScript ${{ matrix.typescript-version }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        typescript-version:
          - 'latest'
          - '~5.9.0'
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-node@v5
        with:
          node-version: 24
      - run: npm install
      - run: npm install typescript@${{ matrix.typescript-version }}
      - run: NODE_OPTIONS="--max-old-space-size=6144" npx tsc


================================================
FILE: .github/workflows/ts-canary.yml
================================================
name: TypeScript Canary
on:
  schedule:
    # Every Thursday at 21.15
    - cron: '15 21 * * 4'
  workflow_dispatch:
jobs:
  types:
    name: TypeScript ${{ matrix.typescript-version }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        typescript-version:
          - next
          - latest
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-node@v5
        with:
          node-version: lts/*
      - run: npm install
      - run: npm install typescript@${{ matrix.typescript-version }}
      - name: show installed typescript version
        run: npm list typescript --depth=0
      - run: NODE_OPTIONS="--max-old-space-size=6144" npx tsc


================================================
FILE: .gitignore
================================================
node_modules
yarn.lock


================================================
FILE: .npmrc
================================================
package-lock=false


================================================
FILE: CLAUDE.md
================================================
# type-fest

TypeScript utility types library. Pure type-level programming—no runtime code.

**Read `.github/contributing.md` for complete guidelines.**

## Commands

```bash
npm test         # MUST pass before committing (runs all below)
npm run test:tsc # TypeScript compiler
npm run test:tsd # Type tests (tsd)
npm run test:xo  # Linter
```

## File Structure

```
source/type-name.d.ts → Type definition (.d.ts REQUIRED)
test-d/type-name.ts   → Tests (tsd)
index.d.ts            → Export (MUST add, lint enforces)
readme.md             → API docs (add to category)
source/internal/      → Shared helpers (not exported)
```

## Code Patterns

```ts
// ✅ CORRECT
import type {IsNever} from './is-never.d.ts';  // Include .d.ts
export type MyType<Value extends string> = ... // Descriptive names (not T/U)
export {};                                      // REQUIRED at end

// ❌ WRONG
import type {IsNever} from './is-never';       // Missing .d.ts
export type MyType<T> = ...;                   // Single-letter

/**
Creates a tuple type of specified length with elements of specified type.

Use-cases:
- Define fixed-length arrays with specific types

@example
```
import type {TupleOf} from 'type-fest';
type RGB = TupleOf<3, number>; //=> [number, number, number]
```

@category Array
*/
export type TupleOf<Length extends number, Fill = unknown> = ...;
export {};
```

Type params: `Value`, `Target`, `Item`, `Length`, `Element`, `Key` (not `T`, `U`, `V`, `K`)
Docs: No `*` prefix. First line → readme. Include use-cases, examples, `@category`.

## Testing

**ALWAYS test edge cases** (`any`, `never`, `unknown`).

```ts
expectType<string>('' as MyType<'foo'>);           // Basic
expectType<any>('' as MyType<any>);                // any/never/unknown
expectNotAssignable<MyType<'foo'>>({wrong: true}); // Negative
expectError<MyType<number>>();                     // Should error
```

Study: `source/tuple-of.d.ts`, `is-equal.d.ts`, `literal-union.d.ts`, `internal/*.d.ts`

## Workflow

1. Research - Study `source/` similar types + online research
2. Define - `source/type-name.d.ts` with docs
3. Test - `test-d/type-name.ts` with edge cases
4. Export - Add to `index.d.ts` + readme.md
5. Verify - `npm test` must pass
6. Commit - ``Add `TypeName` type`` or ``  `TypeName`: Fix description``

## Critical Rules

1. Import paths MUST include `.d.ts` extension
2. Files MUST end with `export {};`
3. Types MUST be exported from `index.d.ts`
4. Type params MUST use descriptive names (not `T`/`U`)
5. MUST test `any`, `never`, `unknown` edge cases
6. First doc line MUST be concise (goes in readme)
7. Use realistic examples with `//=>` comments
8. Include `@category` tags
9. Fix lint issues, don't disable rules

## Type Programming

- Conditionals: `T extends U ? X : Y`
- Recursion: `type Loop<T, Acc> = ... Loop<...> ...`
- Extract: `infer Item`
- Distribute: `T extends any ? ... : never`
- Count via tuple `['length']`
- Union distribution is tricky—test it

## Philosophy

- Correctness > cleverness
- Real problems only
- Docs teach how, not what
- Edge cases mandatory
- One concept per PR
- Descriptive names > brevity
- No unrelated changes

## Troubleshooting

- Tests fail? Check `.d.ts` imports, `export {};`, edge cases (`any`, `never`, `unknown`)
- Lint errors? Add to `index.d.ts`, fix issues (don't disable rules)


================================================
FILE: index.d.ts
================================================
// Basic
export type * from './source/primitive.d.ts';
export type * from './source/typed-array.d.ts';
export type * from './source/basic.d.ts';
export type * from './source/json-value.d.ts';
export type * from './source/characters.d.ts';

// Utilities
export type {KeysOfUnion} from './source/keys-of-union.d.ts';
export type {DistributedOmit} from './source/distributed-omit.d.ts';
export type {DistributedPick} from './source/distributed-pick.d.ts';
export type {EmptyObject, IsEmptyObject} from './source/empty-object.d.ts';
export type {IfEmptyObject} from './source/if-empty-object.d.ts';
export type {NonEmptyObject} from './source/non-empty-object.d.ts';
export type {NonEmptyString} from './source/non-empty-string.d.ts';
export type {UnknownRecord} from './source/unknown-record.d.ts';
export type {UnknownArray} from './source/unknown-array.d.ts';
export type {UnknownSet} from './source/unknown-set.d.ts';
export type {UnknownMap} from './source/unknown-map.d.ts';
export type {Except, ExceptOptions} from './source/except.d.ts';
export type {TaggedUnion} from './source/tagged-union.d.ts';
export type {Writable} from './source/writable.d.ts';
export type {WritableDeep} from './source/writable-deep.d.ts';
export type {Merge} from './source/merge.d.ts';
export type {ObjectMerge} from './source/object-merge.d.ts';
export type {MergeDeep, MergeDeepOptions} from './source/merge-deep.d.ts';
export type {MergeExclusive} from './source/merge-exclusive.d.ts';
export type {RequireAtLeastOne} from './source/require-at-least-one.d.ts';
export type {RequireExactlyOne} from './source/require-exactly-one.d.ts';
export type {RequireAllOrNone} from './source/require-all-or-none.d.ts';
export type {RequireOneOrNone} from './source/require-one-or-none.d.ts';
export type {SingleKeyObject} from './source/single-key-object.d.ts';
export type {OmitIndexSignature} from './source/omit-index-signature.d.ts';
export type {PickIndexSignature} from './source/pick-index-signature.d.ts';
export type {PartialDeep, PartialDeepOptions} from './source/partial-deep.d.ts';
export type {UnwrapPartial} from './source/unwrap-partial.d.ts';
export type {RequiredDeep} from './source/required-deep.d.ts';
export type {PickDeep} from './source/pick-deep.d.ts';
export type {OmitDeep} from './source/omit-deep.d.ts';
export type {PartialOnUndefinedDeep, PartialOnUndefinedDeepOptions} from './source/partial-on-undefined-deep.d.ts';
export type {UndefinedOnPartialDeep} from './source/undefined-on-partial-deep.d.ts';
export type {ReadonlyDeep} from './source/readonly-deep.d.ts';
export type {LiteralUnion} from './source/literal-union.d.ts';
export type {Promisable} from './source/promisable.d.ts';
export type {Arrayable} from './source/arrayable.d.ts';
export type {Optional} from './source/optional.d.ts';
export type {Opaque, UnwrapOpaque, Tagged, GetTagMetadata, UnwrapTagged} from './source/tagged.d.ts';
export type {InvariantOf} from './source/invariant-of.d.ts';
export type {SetOptional} from './source/set-optional.d.ts';
export type {SetReadonly} from './source/set-readonly.d.ts';
export type {SetRequired} from './source/set-required.d.ts';
export type {SetRequiredDeep} from './source/set-required-deep.d.ts';
export type {SetNonNullable} from './source/set-non-nullable.d.ts';
export type {SetNonNullableDeep} from './source/set-non-nullable-deep.d.ts';
export type {ValueOf} from './source/value-of.d.ts';
export type {AsyncReturnType} from './source/async-return-type.d.ts';
export type {ConditionalExcept} from './source/conditional-except.d.ts';
export type {ConditionalKeys} from './source/conditional-keys.d.ts';
export type {ConditionalPick} from './source/conditional-pick.d.ts';
export type {ConditionalPickDeep, ConditionalPickDeepOptions} from './source/conditional-pick-deep.d.ts';
export type {UnionToIntersection} from './source/union-to-intersection.d.ts';
export type {Stringified} from './source/stringified.d.ts';
export type {StringSlice} from './source/string-slice.d.ts';
export type {FixedLengthArray} from './source/fixed-length-array.d.ts';
export type {MultidimensionalArray} from './source/multidimensional-array.d.ts';
export type {MultidimensionalReadonlyArray} from './source/multidimensional-readonly-array.d.ts';
export type {IterableElement} from './source/iterable-element.d.ts';
export type {Entry} from './source/entry.d.ts';
export type {Entries} from './source/entries.d.ts';
export type {SetReturnType} from './source/set-return-type.d.ts';
export type {SetParameterType} from './source/set-parameter-type.d.ts';
export type {Asyncify} from './source/asyncify.d.ts';
export type {Simplify} from './source/simplify.d.ts';
export type {SimplifyDeep} from './source/simplify-deep.d.ts';
export type {Jsonify} from './source/jsonify.d.ts';
export type {Jsonifiable} from './source/jsonifiable.d.ts';
export type {StructuredCloneable} from './source/structured-cloneable.d.ts';
export type {Schema, SchemaOptions} from './source/schema.d.ts';
export type {LiteralToPrimitive} from './source/literal-to-primitive.d.ts';
export type {LiteralToPrimitiveDeep} from './source/literal-to-primitive-deep.d.ts';
export type {
	PositiveInfinity,
	NegativeInfinity,
	Finite,
	Integer,
	Float,
	NegativeFloat,
	Negative,
	NonNegative,
	NegativeInteger,
	NonNegativeInteger,
	IsNegative,
} from './source/numeric.d.ts';
export type {GreaterThan} from './source/greater-than.d.ts';
export type {GreaterThanOrEqual} from './source/greater-than-or-equal.d.ts';
export type {LessThan} from './source/less-than.d.ts';
export type {LessThanOrEqual} from './source/less-than-or-equal.d.ts';
export type {Sum} from './source/sum.d.ts';
export type {Subtract} from './source/subtract.d.ts';
export type {KeyAsString} from './source/key-as-string.d.ts';
export type {Exact} from './source/exact.d.ts';
export type {ReadonlyTuple} from './source/readonly-tuple.d.ts';
export type {OverrideProperties} from './source/override-properties.d.ts';
export type {OptionalKeysOf} from './source/optional-keys-of.d.ts';
export type {IsOptionalKeyOf} from './source/is-optional-key-of.d.ts';
export type {HasOptionalKeys} from './source/has-optional-keys.d.ts';
export type {RequiredKeysOf} from './source/required-keys-of.d.ts';
export type {IsRequiredKeyOf} from './source/is-required-key-of.d.ts';
export type {HasRequiredKeys} from './source/has-required-keys.d.ts';
export type {ReadonlyKeysOf} from './source/readonly-keys-of.d.ts';
export type {IsReadonlyKeyOf} from './source/is-readonly-key-of.d.ts';
export type {HasReadonlyKeys} from './source/has-readonly-keys.d.ts';
export type {WritableKeysOf} from './source/writable-keys-of.d.ts';
export type {IsWritableKeyOf} from './source/is-writable-key-of.d.ts';
export type {HasWritableKeys} from './source/has-writable-keys.d.ts';
export type {Spread} from './source/spread.d.ts';
export type {SplitOnRestElement} from './source/split-on-rest-element.d.ts';
export type {ExtractRestElement} from './source/extract-rest-element.d.ts';
export type {ExcludeRestElement} from './source/exclude-rest-element.d.ts';
export type {IsInteger} from './source/is-integer.d.ts';
export type {IsFloat} from './source/is-float.d.ts';
export type {TupleToObject} from './source/tuple-to-object.d.ts';
export type {TupleToUnion} from './source/tuple-to-union.d.ts';
export type {UnionToTuple} from './source/union-to-tuple.d.ts';
export type {IntRange} from './source/int-range.d.ts';
export type {IntClosedRange} from './source/int-closed-range.d.ts';
export type {IsEqual} from './source/is-equal.d.ts';
export type {
	IsLiteral,
	IsStringLiteral,
	IsNumericLiteral,
	IsBooleanLiteral,
	IsSymbolLiteral,
} from './source/is-literal.d.ts';
export type {IsAny} from './source/is-any.d.ts';
export type {IfAny} from './source/if-any.d.ts';
export type {IsNever} from './source/is-never.d.ts';
export type {IfNever} from './source/if-never.d.ts';
export type {IsUnknown} from './source/is-unknown.d.ts';
export type {IfUnknown} from './source/if-unknown.d.ts';
export type {IsTuple, IsTupleOptions} from './source/is-tuple.d.ts';
export type {ArrayIndices} from './source/array-indices.d.ts';
export type {ArrayValues} from './source/array-values.d.ts';
export type {ArraySlice} from './source/array-slice.d.ts';
export type {ArraySplice} from './source/array-splice.d.ts';
export type {ArrayTail} from './source/array-tail.d.ts';
export type {ArrayElement} from './source/array-element.d.ts';
export type {ArrayLength} from './source/array-length.d.ts';
export type {SetFieldType, SetFieldTypeOptions} from './source/set-field-type.d.ts';
export type {Paths, PathsOptions} from './source/paths.d.ts';
export type {AllUnionFields} from './source/all-union-fields.d.ts';
export type {SharedUnionFields} from './source/shared-union-fields.d.ts';
export type {SharedUnionFieldsDeep, SharedUnionFieldsDeepOptions} from './source/shared-union-fields-deep.d.ts';
export type {IsNull} from './source/is-null.d.ts';
export type {IfNull} from './source/if-null.d.ts';
export type {IsUndefined} from './source/is-undefined.d.ts';
export type {And} from './source/and.d.ts';
export type {AndAll} from './source/and-all.d.ts';
export type {Or} from './source/or.d.ts';
export type {OrAll} from './source/or-all.d.ts';
export type {Xor} from './source/xor.d.ts';
export type {AllExtend, AllExtendOptions} from './source/all-extend.d.ts';
export type {SomeExtend, SomeExtendOptions} from './source/some-extend.d.ts';
export type {NonEmptyTuple} from './source/non-empty-tuple.d.ts';
export type {FindGlobalInstanceType, FindGlobalType} from './source/find-global-type.d.ts';
export type {If} from './source/if.d.ts';
export type {IsUnion} from './source/is-union.d.ts';
export type {IsLowercase} from './source/is-lowercase.d.ts';
export type {IsUppercase} from './source/is-uppercase.d.ts';
export type {IsOptional} from './source/is-optional.d.ts';
export type {IsNullable} from './source/is-nullable.d.ts';
export type {TupleOf} from './source/tuple-of.d.ts';
export type {ExclusifyUnion} from './source/exclusify-union.d.ts';
export type {ArrayReverse} from './source/array-reverse.d.ts';
export type {UnionMember} from './source/union-member.d.ts';

// Template literal types
export type {CamelCase, CamelCaseOptions} from './source/camel-case.d.ts';
export type {CamelCasedProperties} from './source/camel-cased-properties.d.ts';
export type {CamelCasedPropertiesDeep} from './source/camel-cased-properties-deep.d.ts';
export type {KebabCase} from './source/kebab-case.d.ts';
export type {KebabCasedProperties} from './source/kebab-cased-properties.d.ts';
export type {KebabCasedPropertiesDeep} from './source/kebab-cased-properties-deep.d.ts';
export type {PascalCase} from './source/pascal-case.d.ts';
export type {PascalCasedProperties} from './source/pascal-cased-properties.d.ts';
export type {PascalCasedPropertiesDeep} from './source/pascal-cased-properties-deep.d.ts';
export type {SnakeCase} from './source/snake-case.d.ts';
export type {SnakeCasedProperties} from './source/snake-cased-properties.d.ts';
export type {SnakeCasedPropertiesDeep} from './source/snake-cased-properties-deep.d.ts';
export type {ScreamingSnakeCase} from './source/screaming-snake-case.d.ts';
export type {DelimiterCase} from './source/delimiter-case.d.ts';
export type {DelimiterCasedProperties} from './source/delimiter-cased-properties.d.ts';
export type {DelimiterCasedPropertiesDeep} from './source/delimiter-cased-properties-deep.d.ts';
export type {Join} from './source/join.d.ts';
export type {Split, SplitOptions} from './source/split.d.ts';
export type {Words, WordsOptions} from './source/words.d.ts';
export type {Trim} from './source/trim.d.ts';
export type {Replace, ReplaceOptions} from './source/replace.d.ts';
export type {StringRepeat} from './source/string-repeat.d.ts';
export type {Includes} from './source/includes.d.ts';
export type {Get, GetOptions} from './source/get.d.ts';
export type {LastArrayElement} from './source/last-array-element.d.ts';
export type {ConditionalSimplify} from './source/conditional-simplify.d.ts';
export type {ConditionalSimplifyDeep} from './source/conditional-simplify-deep.d.ts';
export type {RemovePrefix, RemovePrefixOptions} from './source/remove-prefix.d.ts';

// Miscellaneous
export type {GlobalThis} from './source/global-this.d.ts';
export type {PackageJson} from './source/package-json.d.ts';
export type {TsConfigJson} from './source/tsconfig-json.d.ts';

// Improved built-in
export type {ExtendsStrict} from './source/extends-strict.d.ts';
export type {ExtractStrict} from './source/extract-strict.d.ts';
export type {ExcludeStrict} from './source/exclude-strict.d.ts';
export type {ExcludeExactly} from './source/exclude-exactly.d.ts';

export {};


================================================
FILE: license-cc0
================================================
Creative Commons Legal Code

CC0 1.0 Universal

    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
    HEREUNDER.

Statement of Purpose

The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").

Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.

For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.

1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:

  i. the right to reproduce, adapt, distribute, perform, display,
     communicate, and translate a Work;
 ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
     likeness depicted in a Work;
 iv. rights protecting against unfair competition in regards to a Work,
     subject to the limitations in paragraph 4(a), below;
  v. rights protecting the extraction, dissemination, use and reuse of data
     in a Work;
 vi. database rights (such as those arising under Directive 96/9/EC of the
     European Parliament and of the Council of 11 March 1996 on the legal
     protection of databases, and under any national implementation
     thereof, including any amended or successor version of such
     directive); and
vii. other similar, equivalent or corresponding rights throughout the
     world based on applicable law or treaty, and any national
     implementations thereof.

2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.

3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.

4. Limitations and Disclaimers.

 a. No trademark or patent rights held by Affirmer are waived, abandoned,
    surrendered, licensed or otherwise affected by this document.
 b. Affirmer offers the Work as-is and makes no representations or
    warranties of any kind concerning the Work, express, implied,
    statutory or otherwise, including without limitation warranties of
    title, merchantability, fitness for a particular purpose, non
    infringement, or the absence of latent or other defects, accuracy, or
    the present or absence of errors, whether or not discoverable, all to
    the greatest extent permissible under applicable law.
 c. Affirmer disclaims responsibility for clearing rights of other persons
    that may apply to the Work or any use thereof, including without
    limitation any person's Copyright and Related Rights in the Work.
    Further, Affirmer disclaims responsibility for obtaining any necessary
    consents, permissions or other rights required for any use of the
    Work.
 d. Affirmer understands and acknowledges that Creative Commons is not a
    party to this document and has no duty or obligation with respect to
    this CC0 or use of the Work.


================================================
FILE: license-mit
================================================
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: lint-processors/fixtures/eslint.config.js
================================================
import tseslint from 'typescript-eslint';
import {defineConfig} from 'eslint/config';
import {jsdocCodeblocksProcessor} from '../jsdoc-codeblocks.js';

const errorEndingAtFirstColumnRule = {
	create(context) {
		return {
			'TSTypeAliasDeclaration Literal'(node) {
				if (node.value !== 'error_ending_at_first_column') {
					return;
				}

				context.report({
					loc: {
						start: {
							line: node.loc.start.line,
							column: 0,
						},
						end: {
							line: node.loc.start.line + 1,
							column: 0,
						},
					},
					message: 'Error ending at first column',
				});
			},
		};
	},
};

const config = defineConfig(
	tseslint.configs.recommended,
	tseslint.configs.stylistic,
	{
		rules: {
			'@typescript-eslint/no-unused-vars': 'off',
			'@typescript-eslint/consistent-type-definitions': [
				'error',
				'type',
			],
			'test/error-ending-at-first-column': 'error',
		},
	},
	{
		plugins: {
			test: {
				processors: {
					'jsdoc-codeblocks': jsdocCodeblocksProcessor,
				},
				rules: {
					'error-ending-at-first-column': errorEndingAtFirstColumnRule,
				},
			},
		},
	},
	{
		files: ['**/*.d.ts'],
		processor: 'test/jsdoc-codeblocks',
	},
);

export default config;


================================================
FILE: lint-processors/jsdoc-codeblocks.js
================================================
// @ts-check
import tsParser from '@typescript-eslint/parser';

/**
@import {Linter} from 'eslint';
*/

const CODEBLOCK_REGEX = /(?<openingFence>(?<indent>^[ \t]*)```(?:ts|typescript)?\n)(?<code>[\s\S]*?)\n\s*```/gm;
/**
@typedef {{lineOffset: number, characterOffset: number, indent: string, unindentedText: string}} CodeblockData
@type {Map<string, CodeblockData[]>}
*/
const codeblockDataPerFile = new Map();

/**
@param {string} text
@param {number} index
@param {string} indent
@returns {number}
*/
function indentsUptoIndex(text, index, indent) {
	let i = 0;
	let indents = 0;

	for (const line of text.split('\n')) {
		if (i > index) {
			break;
		}

		if (line === '') {
			i += 1; // +1 for the newline
			continue;
		}

		i += line.length + 1; // +1 for the newline
		i -= indent.length; // Because `text` is unindented but `index` corresponds to dedented text
		indents += indent.length;
	}

	return indents;
}

export const jsdocCodeblocksProcessor = {
	supportsAutofix: true,

	/**
	@param {string} text
	@param {string} filename
	@returns {(string | Linter.ProcessorFile)[]}
	*/
	preprocess(text, filename) {
		const ast = tsParser.parse(text);

		const jsdocComments = ast.comments.filter(
			comment => comment.type === 'Block' && comment.value.startsWith('*'),
		);

		/** @type {(string | Linter.ProcessorFile)[]} */
		const files = [text]; // First entry is for the entire file
		/** @type {CodeblockData[]} */
		const allCodeblocksData = [];

		// Loop over all JSDoc comments in the file
		for (const comment of jsdocComments) {
			// Loop over all codeblocks in the JSDoc comment
			for (const match of comment.value.matchAll(CODEBLOCK_REGEX)) {
				const {code, openingFence, indent} = match.groups ?? {};

				// Skip empty code blocks
				if (!code || !openingFence || indent === undefined) {
					continue;
				}

				const codeLines = code.split('\n');
				const indentSize = indent.length;

				// Skip comments that are not consistently indented
				if (!codeLines.every(line => line === '' || line.startsWith(indent))) {
					continue;
				}

				const dedentedCode = codeLines
					.map(line => line.slice(indentSize))
					.join('\n');

				files.push({
					text: dedentedCode,
					filename: `${files.length}.ts`, // Final filename example: `/path/to/type-fest/source/and.d.ts/1_1.ts`
				});

				const linesBeforeMatch = comment.value.slice(0, match.index).split('\n').length - 1;
				allCodeblocksData.push({
					lineOffset: comment.loc.start.line + linesBeforeMatch,
					characterOffset: comment.range[0] + match.index + openingFence.length + 2, // +2 because `comment.value` doesn't include the starting `/*`
					indent,
					unindentedText: code,
				});
			}
		}

		codeblockDataPerFile.set(filename, allCodeblocksData);

		return files;
	},

	/**
	@param {import('eslint').Linter.LintMessage[][]} messages
	@param {string} filename
	@returns {import('eslint').Linter.LintMessage[]}
	*/
	postprocess(messages, filename) {
		const codeblocks = codeblockDataPerFile.get(filename) || [];
		codeblockDataPerFile.delete(filename);

		const normalizedMessages = [...(messages[0] ?? [])]; // First entry contains errors for the entire file, and it doesn't need any adjustments

		for (const [index, codeblockMessages] of messages.slice(1).entries()) {
			const codeblockData = codeblocks[index];

			if (!codeblockData) {
				// This should ideally never happen
				continue;
			}

			const {lineOffset, characterOffset, indent, unindentedText} = codeblockData;

			for (const message of codeblockMessages) {
				message.line += lineOffset;
				message.column += indent.length;

				if (typeof message.endColumn === 'number' && message.endColumn > 1) {
					// An `endColumn` of `1` indicates the error actually ended on the previous line since it's exclusive.
					// So, adding `indent.length` in this case would incorrectly move the error marker into the indentation.
					// Therefore, the indentation length is only added when `endColumn` is greater than `1`.
					message.endColumn += indent.length;
				}

				if (typeof message.endLine === 'number') {
					message.endLine += lineOffset;
				}

				if (message.fix) {
					message.fix.text = message.fix.text.split('\n').join(`\n${indent}`);

					const indentsBeforeFixStart = indentsUptoIndex(unindentedText, message.fix.range[0], indent);
					const indentsBeforeFixEnd = indentsUptoIndex(unindentedText, message.fix.range[1] - 1, indent); // -1 because range end is exclusive

					message.fix.range = [
						message.fix.range[0] + characterOffset + indentsBeforeFixStart,
						message.fix.range[1] + characterOffset + indentsBeforeFixEnd,
					];
				}

				for (const {fix} of (message.suggestions ?? [])) {
					fix.text = fix.text.split('\n').join(`\n${indent}`);

					const indentsBeforeFixStart = indentsUptoIndex(unindentedText, fix.range[0], indent);
					const indentsBeforeFixEnd = indentsUptoIndex(unindentedText, fix.range[1] - 1, indent); // -1 because range end is exclusive

					fix.range = [
						fix.range[0] + characterOffset + indentsBeforeFixStart,
						fix.range[1] + characterOffset + indentsBeforeFixEnd,
					];
				}

				normalizedMessages.push(message);
			}
		}

		return normalizedMessages;
	},
};


================================================
FILE: lint-processors/jsdoc-codeblocks.test.js
================================================
import {describe, test} from 'node:test';
import fs from 'node:fs/promises';
import path from 'node:path';
import {ESLint} from 'eslint';
import {code1, code2, dedenter, errorAt, exportType, exportTypeAndOption, fence, jsdoc} from '../lint-rules/test-utils.js';

const root = path.join(import.meta.dirname, 'fixtures');

try {
	await fs.access(path.join(root, 'eslint.config.js'));
} catch {
	throw new Error('\'eslint.config.js\' is missing in \'lint-processors/fixtures\' directory.');
}

const valid = [
	{
		name: 'No JSDoc',
		code: exportTypeAndOption(''),
	},
	{
		name: 'JSDoc without code block',
		code: exportType(jsdoc('No codeblock here')),
	},
	{
		name: 'Valid code block',
		code: exportTypeAndOption(jsdoc(fence(code1))),
	},
	{
		name: 'With text before and after',
		code: exportTypeAndOption(jsdoc('Some description.', fence(code1), '@category Test')),
	},
	{
		name: 'With line breaks before and after',
		code: exportTypeAndOption(
			jsdoc('Some description.\n', 'Note: Some note.\n', fence(code1, 'ts'), '\n@category Test'),
		),
	},
	{
		name: 'With @example tag',
		code: exportTypeAndOption(jsdoc('@example', fence(code1))),
	},
	{
		name: 'With ts language specifier',
		code: exportTypeAndOption(jsdoc(fence(code1, 'ts'))),
	},
	{
		name: 'With typescript language specifier',
		code: exportTypeAndOption(jsdoc(fence(code1, 'typescript'))),
	},
	{
		name: 'Multiple code blocks',
		code: exportTypeAndOption(
			jsdoc('@example', fence(code1, 'ts'), '\nSome text in between.\n', '@example', fence(code2)),
		),
	},
	{
		name: 'Multiple exports and multiple properties',
		code: exportTypeAndOption(jsdoc(fence(code1)), jsdoc(fence(code2))),
	},
	{
		name: 'Indented code blocks',
		code: exportTypeAndOption(jsdoc(
			'Note:',
			dedenter`
				1. First point
					\`\`\`ts
					import type {Subtract} from 'type-fest';
					type A = Subtract<1, 2>;
					\`\`\`
				2. Second point
					\`\`\`ts
					import type {Sum} from 'type-fest';
					type A = Sum<1, 2>;
					\`\`\`
			`,
		)),
	},
	{
		name: 'Ignore codeblocks with inconsistent indentation',
		code: exportTypeAndOption(jsdoc(
			'Some description.',
			dedenter`
			Note:
				@example
				\`\`\`ts
				const foo: string = '1';

			const bar: number = 1;
				\`\`\`
			`,
		)),
	},
];

const invalid = [
	{
		name: 'With text before and after',
		code: dedenter`
			/**
			Some description.
			\`\`\`ts
			const foo: Array<string> = [];
			\`\`\`
			@category Test
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.
				\`\`\`ts
				const foo: Array<string> = [];
				\`\`\`
				@category Test
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			Some description.
			\`\`\`ts
			const foo: string[] = [];
			\`\`\`
			@category Test
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.
				\`\`\`ts
				const foo: string[] = [];
				\`\`\`
				@category Test
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 4,
				textBeforeStart: 'const foo: ',
				target: 'Array<string>',
			}),
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 14,
				textBeforeStart: '\tconst foo: ',
				target: 'Array<string>',
			}),
		],
	},

	{
		name: 'With line breaks before and after',
		code: dedenter`
			/**
			Some description.

			Note: Some note.

			\`\`\`ts
			const foo: number = 1;
			\`\`\`

			@category Test
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.

				Note: Some note.

				\`\`\`ts
				const foo: number = 1;
				\`\`\`

				@category Test
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			Some description.

			Note: Some note.

			\`\`\`ts
			const foo = 1;
			\`\`\`

			@category Test
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.

				Note: Some note.

				\`\`\`ts
				const foo = 1;
				\`\`\`

				@category Test
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/no-inferrable-types',
				line: 7,
				textBeforeStart: 'const ',
				target: 'foo: number = 1',
			}),
			errorAt({
				ruleId: '@typescript-eslint/no-inferrable-types',
				line: 21,
				textBeforeStart: '\tconst ',
				target: 'foo: number = 1',
			}),
		],
	},

	{
		name: 'With @example tag',
		code: dedenter`
			/**
			@example
			\`\`\`ts
			interface Foo {
				a: string;
				b: number;
			}
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				@example
				\`\`\`ts
				interface Foo {
					a: string;
					b: number;
				}
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			@example
			\`\`\`ts
			type Foo = {
				a: string;
				b: number;
			}
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				@example
				\`\`\`ts
				type Foo = {
					a: string;
					b: number;
				}
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/consistent-type-definitions',
				line: 4,
				textBeforeStart: 'interface ',
				target: 'Foo',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-type-definitions',
				line: 16,
				textBeforeStart: '\tinterface ',
				target: 'Foo',
			}),
		],
	},

	{
		name: 'With language specifiers',
		code: dedenter`
			/**
			\`\`\`ts
			const foo: Array<string> = [];
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`ts
				const foo: Array<string> = [];
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			\`\`\`ts
			const foo: string[] = [];
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`ts
				const foo: string[] = [];
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 3,
				textBeforeStart: 'const foo: ',
				target: 'Array<string>',
			}),
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 11,
				textBeforeStart: '\tconst foo: ',
				target: 'Array<string>',
			}),
		],
	},

	{
		name: 'With typescript language specifiers',
		code: dedenter`
			/**
			\`\`\`typescript
			const foo: Array<string> = [];
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`typescript
				const foo: Array<string> = [];
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			\`\`\`typescript
			const foo: string[] = [];
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`typescript
				const foo: string[] = [];
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 3,
				textBeforeStart: 'const foo: ',
				target: 'Array<string>',
			}),
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 11,
				textBeforeStart: '\tconst foo: ',
				target: 'Array<string>',
			}),
		],
	},

	{
		name: 'Multiple code blocks',
		code: dedenter`
			/**
			@example
			\`\`\`ts
			const foo: Array<string> = [];
			\`\`\`

			Some text in between.

			@example
			\`\`\`ts
			const bar: number = 1;
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				@example
				\`\`\`ts
				const foo: Array<string> = [];
				\`\`\`

				Some text in between.

				@example
				\`\`\`ts
				const bar: number = 1;
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			@example
			\`\`\`ts
			const foo: string[] = [];
			\`\`\`

			Some text in between.

			@example
			\`\`\`ts
			const bar = 1;
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				@example
				\`\`\`ts
				const foo: string[] = [];
				\`\`\`

				Some text in between.

				@example
				\`\`\`ts
				const bar = 1;
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 4,
				textBeforeStart: 'const foo: ',
				target: 'Array<string>',
			}),
			errorAt({
				ruleId: '@typescript-eslint/no-inferrable-types',
				line: 11,
				textBeforeStart: 'const ',
				target: 'bar: number = 1',
			}),
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 20,
				textBeforeStart: '\tconst foo: ',
				target: 'Array<string>',
			}),
			errorAt({
				ruleId: '@typescript-eslint/no-inferrable-types',
				line: 27,
				textBeforeStart: '\tconst ',
				target: 'bar: number = 1',
			}),
		],
	},

	{
		name: 'Multiple exports and multiple properties',
		code: dedenter`
			/**
			\`\`\`ts
			function foo(example: {(): number}): number {
				return example();
			}
			\`\`\`
			*/
			export type T0 = string;

			/**
			\`\`\`ts
			type Foo = {
				[key: string]: unknown;
			};
			\`\`\`
			*/
			export type T1 = string;

			export type T0Options = {
				/**
				\`\`\`ts
				function foo(example: {(): number}): number {
					return example();
				}
				\`\`\`
				*/
				p0: string;

				/**
				\`\`\`ts
				type Foo = {
					[key: string]: unknown;
				};
				\`\`\`
				*/
				p1: string;
			};

			export type T1Options = {
				/**
				\`\`\`ts
				const foo: Map<string, number> = new Map();
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			\`\`\`ts
			function foo(example: () => number): number {
				return example();
			}
			\`\`\`
			*/
			export type T0 = string;

			/**
			\`\`\`ts
			type Foo = Record<string, unknown>;
			\`\`\`
			*/
			export type T1 = string;

			export type T0Options = {
				/**
				\`\`\`ts
				function foo(example: () => number): number {
					return example();
				}
				\`\`\`
				*/
				p0: string;

				/**
				\`\`\`ts
				type Foo = Record<string, unknown>;
				\`\`\`
				*/
				p1: string;
			};

			export type T1Options = {
				/**
				\`\`\`ts
				const foo = new Map<string, number>();
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/prefer-function-type',
				line: 3,
				textBeforeStart: 'function foo(example: {',
				target: '(): number',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-indexed-object-style',
				line: 12,
				textBeforeStart: 'type Foo = ',
				endLine: 14,
				textBeforeEnd: '}',
			}),
			errorAt({
				ruleId: '@typescript-eslint/prefer-function-type',
				line: 22,
				textBeforeStart: '\tfunction foo(example: {',
				target: '(): number',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-indexed-object-style',
				line: 31,
				textBeforeStart: '\ttype Foo = ',
				endLine: 33,
				textBeforeEnd: '\t}',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-generic-constructors',
				line: 42,
				textBeforeStart: '\tconst ',
				target: 'foo: Map<string, number> = new Map()',
			}),
		],
	},

	{
		name: 'Indented code blocks',
		code: dedenter`
			/**
			Note:
			1. First point
				\`\`\`ts
				type Foo = {
					[x: string]: unknown;
				};
				\`\`\`
			2. Second point
				\`\`\`ts
				type Bar = {
					(arg: string): number;
				};
				\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Note:
				1. First point
					\`\`\`ts
					type Foo = {
						[x: string]: unknown;
					};
					\`\`\`
				2. Second point
					\`\`\`ts
					type Bar = {
						(arg: string): number;
					};
					\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			Note:
			1. First point
				\`\`\`ts
				type Foo = Record<string, unknown>;
				\`\`\`
			2. Second point
				\`\`\`ts
				type Bar = (arg: string) => number;
				\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Note:
				1. First point
					\`\`\`ts
					type Foo = Record<string, unknown>;
					\`\`\`
				2. Second point
					\`\`\`ts
					type Bar = (arg: string) => number;
					\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/consistent-indexed-object-style',
				line: 5,
				textBeforeStart: '\ttype Foo = ',
				endLine: 7,
				textBeforeEnd: '\t}',
			}),
			errorAt({
				ruleId: '@typescript-eslint/prefer-function-type',
				line: 12,
				textBeforeStart: '\t\t',
				target: '(arg: string): number;',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-indexed-object-style',
				line: 23,
				textBeforeStart: '\t\ttype Foo = ',
				endLine: 25,
				textBeforeEnd: '\t\t}',
			}),
			errorAt({
				ruleId: '@typescript-eslint/prefer-function-type',
				line: 30,
				textBeforeStart: '\t\t\t',
				target: '(arg: string): number;',
			}),
		],
	},

	{
		name: 'Error and fix starting at the first character of the codeblock',
		code: dedenter`
			/**
			Some description.
			\`\`\`ts
			var foo = 1;
			foo = 2;
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.
				\`\`\`ts
				var foo = 1;
				foo = 2;
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			Some description.
			\`\`\`ts
			let foo = 1;
			foo = 2;
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.
				\`\`\`ts
				let foo = 1;
				foo = 2;
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: 'no-var',
				line: 4,
				textBeforeStart: '',
				target: 'var foo = 1;',
			}),
			errorAt({
				ruleId: 'no-var',
				line: 14,
				textBeforeStart: '\t',
				target: 'var foo = 1;',
			}),
		],
	},

	{
		name: 'Error and fix in the middle of the codeblock',
		code: dedenter`
			/**
			\`\`\`ts
			const foo: string[] = [];

			const bar: Array<number> = [];

			const baz: boolean[] = [];
			\`\`\`
			Some text after.
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`ts
				const foo: string[] = [];

				const bar: Array<number> = [];

				const baz: boolean[] = [];
				\`\`\`
				Some text after.
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			\`\`\`ts
			const foo: string[] = [];

			const bar: number[] = [];

			const baz: boolean[] = [];
			\`\`\`
			Some text after.
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`ts
				const foo: string[] = [];

				const bar: number[] = [];

				const baz: boolean[] = [];
				\`\`\`
				Some text after.
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 5,
				textBeforeStart: 'const bar: ',
				target: 'Array<number>',
			}),
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 18,
				textBeforeStart: '\tconst bar: ',
				target: 'Array<number>',
			}),
		],
	},

	{
		name: 'Error and fix ending at the last character of the codeblock',
		code: dedenter`
			/**
			Some description.

			@example
			\`\`\`ts
			type Foo = {a: string}
			type Bar = {[K: string]: Foo}
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.

				@example
				\`\`\`ts
				type Foo = {a: string}
				type Bar = {[K: string]: Foo}
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			Some description.

			@example
			\`\`\`ts
			type Foo = {a: string}
			type Bar = Record<string, Foo>
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.

				@example
				\`\`\`ts
				type Foo = {a: string}
				type Bar = Record<string, Foo>
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/consistent-indexed-object-style',
				line: 7,
				textBeforeStart: 'type Bar = ',
				target: '{[K: string]: Foo}',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-indexed-object-style',
				line: 19,
				textBeforeStart: '\ttype Bar = ',
				target: '{[K: string]: Foo}',
			}),
		],
	},

	{
		name: 'Error spanning multiple lines',
		code: dedenter`
			/**
			\`\`\`ts
			import type {PickIndexSignature} from 'type-fest';

			type Foo = {
				[key: string]: unknown;
			};

			type Test = PickIndexSignature<Foo>;
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`ts
				import type {PickIndexSignature} from 'type-fest';

				type Foo = {
					[key: string]: unknown;
				};

				type Test = PickIndexSignature<Foo>;
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			\`\`\`ts
			import type {PickIndexSignature} from 'type-fest';

			type Foo = Record<string, unknown>;

			type Test = PickIndexSignature<Foo>;
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`ts
				import type {PickIndexSignature} from 'type-fest';

				type Foo = Record<string, unknown>;

				type Test = PickIndexSignature<Foo>;
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/consistent-indexed-object-style',
				line: 5,
				textBeforeStart: 'type Foo = ',
				endLine: 7,
				textBeforeEnd: '}',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-indexed-object-style',
				line: 19,
				textBeforeStart: '\ttype Foo = ',
				endLine: 21,
				textBeforeEnd: '\t}',
			}),
		],
	},

	{
		name: 'Multiline fix',
		code: dedenter`
			/**
			Some description.
			Some more description.

			@example
			\`\`\`ts
			type Test = {(
				foo: string,
				bar: number
			): void};
			\`\`\`
			@category Test
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.
				Some more description.

				@example
				\`\`\`ts
				type Test = {(
					foo: string,
					bar: number
				): void};
				\`\`\`
				@category Test
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			Some description.
			Some more description.

			@example
			\`\`\`ts
			type Test = (
				foo: string,
				bar: number
			) => void;
			\`\`\`
			@category Test
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.
				Some more description.

				@example
				\`\`\`ts
				type Test = (
					foo: string,
					bar: number
				) => void;
				\`\`\`
				@category Test
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/prefer-function-type',
				line: 7,
				textBeforeStart: 'type Test = {',
				endLine: 10,
				textBeforeEnd: '): void',
			}),
			errorAt({
				ruleId: '@typescript-eslint/prefer-function-type',
				line: 23,
				textBeforeStart: '\ttype Test = {',
				endLine: 26,
				textBeforeEnd: '\t): void',
			}),
		],
	},

	{
		name: 'Multiple errors',
		code: dedenter`
			/**
			@example
			\`\`\`typescript
			const foo: number = 1

			const bar: Map<string, number> = new Map()

			interface Baz {
				(x: string): unknown
			}
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				@example
				\`\`\`typescript
				const foo: number = 1

				const bar: Map<string, number> = new Map()

				interface Baz {
					(x: string): unknown
				}
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			@example
			\`\`\`typescript
			const foo = 1

			const bar = new Map<string, number>()

			type Baz = (x: string) => unknown
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				@example
				\`\`\`typescript
				const foo = 1

				const bar = new Map<string, number>()

				type Baz = (x: string) => unknown
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/no-inferrable-types',
				line: 4,
				textBeforeStart: 'const ',
				target: 'foo: number = 1',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-generic-constructors',
				line: 6,
				textBeforeStart: 'const ',
				target: 'bar: Map<string, number> = new Map()',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-type-definitions',
				line: 8,
				textBeforeStart: 'interface ',
				target: 'Baz',
			}),
			errorAt({
				ruleId: '@typescript-eslint/prefer-function-type',
				line: 9,
				textBeforeStart: '\t',
				target: '(x: string): unknown',
			}),
			errorAt({
				ruleId: '@typescript-eslint/no-inferrable-types',
				line: 19,
				textBeforeStart: '\tconst ',
				target: 'foo: number = 1',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-generic-constructors',
				line: 21,
				textBeforeStart: '\tconst ',
				target: 'bar: Map<string, number> = new Map()',
			}),
			errorAt({
				ruleId: '@typescript-eslint/consistent-type-definitions',
				line: 23,
				textBeforeStart: '\tinterface ',
				target: 'Baz',
			}),
			errorAt({
				ruleId: '@typescript-eslint/prefer-function-type',
				line: 24,
				textBeforeStart: '\t\t',
				target: '(x: string): unknown',
			}),
		],
	},

	{
		name: 'Overlapping errors',
		code: dedenter`
			/**
			\`\`\`ts
			const foo: Array<Array<string>> = [];
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`ts
				const foo: Array<Array<string>> = [];
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			\`\`\`ts
			const foo: string[][] = [];
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`ts
				const foo: string[][] = [];
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 3,
				textBeforeStart: 'const foo: ',
				target: 'Array<Array<string>>',
			}),
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 3,
				textBeforeStart: 'const foo: Array<',
				target: 'Array<string>',
			}),
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 11,
				textBeforeStart: '\tconst foo: ',
				target: 'Array<Array<string>>',
			}),
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 11,
				textBeforeStart: '\tconst foo: Array<',
				target: 'Array<string>',
			}),
		],
	},

	{
		name: 'Error reporting location different from fix location',
		code: dedenter`
			/**
			\`\`\`ts
			type Foo = {
				(): void;
			};
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`ts
				type Foo = {
					(): void;
				};
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: dedenter`
			/**
			\`\`\`ts
			type Foo = () => void;
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				\`\`\`ts
				type Foo = () => void;
				\`\`\`
				*/
				p0: string;
			};
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/prefer-function-type',
				line: 4,
				textBeforeStart: '\t',
				target: '(): void;',
			}),
			errorAt({
				ruleId: '@typescript-eslint/prefer-function-type',
				line: 14,
				textBeforeStart: '\t\t',
				target: '(): void;',
			}),
		],
	},

	{
		name: 'Non fixable error',
		code: dedenter`
			/**
			Some description.
			@example
			\`\`\`
			type Foo = {};
			\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.
				@example
				\`\`\`
				type Foo = {};
				\`\`\`
				*/
				p0: string;
			};
		`,
		output: undefined,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/no-empty-object-type',
				line: 5,
				textBeforeStart: 'type Foo = ',
				target: '{}',
			}),
			errorAt({
				ruleId: '@typescript-eslint/no-empty-object-type',
				line: 15,
				textBeforeStart: '\ttype Foo = ',
				target: '{}',
			}),
		],
	},

	{
		name: 'Error outside JSDoc',
		code: dedenter`
			/**
			Some description.
			\`\`\`
			type Foo = string;
			\`\`\`
			*/
			export type T0 = Array<string>;

			type Foo = String;
		`,
		output: dedenter`
			/**
			Some description.
			\`\`\`
			type Foo = string;
			\`\`\`
			*/
			export type T0 = string[];

			type Foo = string;
		`,
		errors: [
			errorAt({
				ruleId: '@typescript-eslint/array-type',
				line: 7,
				textBeforeStart: 'export type T0 = ',
				target: 'Array<string>',
			}),
			errorAt({
				ruleId: '@typescript-eslint/no-wrapper-object-types',
				line: 9,
				textBeforeStart: 'type Foo = ',
				target: 'String',
			}),
		],
	},
	{
		name: 'Error ending at first column',
		code: dedenter`
			/**
			Some description.

			Note:
			    @example
				\`\`\`ts
				type Foo = 'error_ending_at_first_column'
				type Bar = number
				\`\`\`
			*/
			export type T0 = string;

			export type TOptions = {
				/**
				Some description.

				Note:
					@example
					\`\`\`ts
					type Foo = 'error_ending_at_first_column'
					type Bar = number
					\`\`\`
				*/
				p0: string;
			};
		`,
		output: undefined,
		errors: [
			errorAt({
				line: 7,
				textBeforeStart: '\t',
				endLine: 8,
				textBeforeEnd: '',
			}),
			errorAt({
				line: 20,
				textBeforeStart: '\t\t',
				endLine: 21,
				textBeforeEnd: '',
			}),
		],
	},
];

describe('jsdoc-codeblocks processor', {concurrency: true}, () => {
	const eslint = new ESLint({cwd: root});
	const eslintFixed = new ESLint({cwd: root, fix: true});

	const testCases = [
		...valid.map(testCase => ({...testCase, type: 'valid'})),
		...invalid.map(testCase => ({...testCase, type: 'invalid'})),
	];

	for (const {type, name, code, output, errors = []} of testCases) {
		test(`${type} - ${name}`, async t => {
			const fileName = `test-${type}-${name.replaceAll(/\s+/g, '-')}.d.ts`;
			const filePath = path.join(root, fileName);
			await fs.writeFile(filePath, code);
			t.after(async () => {
				await fs.unlink(filePath);
			});

			const results = await eslint.lintFiles([fileName]);
			t.assert.strictEqual(results[0].messages.length, errors.length);

			if (type === 'invalid') {
				// Manual loop because `assert.partialDeepStrictEqual` isn't available in Node 20
				for (const [index, expected] of errors.entries()) {
					const actual = results[0].messages[index];
					const actualSubset = Object.fromEntries(Object.keys(expected).map(key => [key, actual[key]]));

					t.assert.deepStrictEqual(actualSubset, expected);
				}

				const resultsFixed = await eslintFixed.lintFiles([fileName]);
				t.assert.strictEqual(resultsFixed[0].output, output);
			}
		});
	}
});


================================================
FILE: lint-rules/import-path.js
================================================
import path from 'node:path';

export const importPathRule = /** @type {const} */ ({
	meta: {
		type: 'problem',
		docs: {
			description: 'Enforces import paths to end with a \'.d.ts\' extension.',
		},
		fixable: 'code',
		messages: {
			incorrectImportPath:
                'Import path \'{{importPath}}\' must end with a \'.d.ts\' extension. Use \'{{fixedImportPath}}\' instead.',
		},
		schema: [],
	},
	defaultOptions: [],
	create(context) {
		return {
			'ImportDeclaration, ExportNamedDeclaration, ExportAllDeclaration'(node) {
				// Exit if not a re-export
				if (!node.source) {
					return;
				}

				const importPath = node.source.value;

				// Skip if not relative path
				if (!(importPath.startsWith('./') || importPath.startsWith('../'))) {
					return;
				}

				const filename = path.basename(importPath);
				const firstDotIndex = filename.indexOf('.');
				const extension = firstDotIndex === -1 ? '' : filename.slice(firstDotIndex);

				// Skip if the import path already ends with `.d.ts`
				if (extension === '.d.ts') {
					return;
				}

				const importPathWithoutExtension = extension.length > 0
					? importPath.slice(0, -extension.length)
					: importPath;
				const fixedImportPath = `${importPathWithoutExtension}.d.ts`;

				context.report({
					node: node.source,
					messageId: 'incorrectImportPath',
					fix(fixer) {
						return fixer.replaceText(node.source, `'${fixedImportPath}'`);
					},
					data: {importPath, fixedImportPath},
				});
			},
		};
	},
});


================================================
FILE: lint-rules/import-path.test.js
================================================
import {createRuleTester} from './test-utils.js';
import {importPathRule} from './import-path.js';

const ruleTester = createRuleTester();

const invalidImport = (code, output) => ({
	code,
	errors: [{messageId: 'incorrectImportPath'}],
	output,
});

ruleTester.run('import-path', importPathRule, {
	valid: [
		// Already has .d.ts extension
		{
			code: 'import type {Foo} from "./foo.d.ts";',
		},
		{
			code: 'import type {Bar} from "../bar.d.ts";',
		},
		{
			code: 'import {Baz} from "./types/baz.d.ts";',
		},
		// Non-relative imports are ignored
		{
			code: 'import {something} from "external-package";',
		},
		{
			code: 'import type {Type} from "@types/node";',
		},
		// Export named declarations with .d.ts extension
		{
			code: 'export type {Foo} from "./foo.d.ts";',
		},
		{
			code: 'export {Bar} from "../bar.d.ts";',
		},
		{
			code: 'export type {Baz as Qux} from "./types/baz.d.ts";',
		},
		// Export all declarations with .d.ts extension
		{
			code: 'export * from "./foo.d.ts";',
		},
		{
			code: 'export * from "../bar.d.ts";',
		},
		{
			code: 'export * as Types from "./types.d.ts";',
		},
		// Non re-exports are ignored
		{
			code: 'export {localVar};',
		},
		{
			code: 'export type {LocalType};',
		},
		{
			code: 'export type Foo = string;',
		},
		// Non-relative exports are ignored
		{
			code: 'export {something} from "external-package";',
		},
		{
			code: 'export * from "@types/node";',
		},
	],
	invalid: [
		// Missing extension
		invalidImport(
			'import type {Foo} from "./foo";',
			'import type {Foo} from \'./foo.d.ts\';',
		),
		// Wrong extension .ts
		invalidImport(
			'import type {Bar} from "../bar.ts";',
			'import type {Bar} from \'../bar.d.ts\';',
		),
		// Wrong extension .js
		invalidImport(
			'import type {Baz} from "./types.js";',
			'import type {Baz} from \'./types.d.ts\';',
		),
		// Deep path
		invalidImport(
			'import type {Deep} from "../../deep/path.tsx";',
			'import type {Deep} from \'../../deep/path.d.ts\';',
		),
		// Export named declarations - missing extension
		invalidImport(
			'export type {Foo} from "./foo";',
			'export type {Foo} from \'./foo.d.ts\';',
		),
		invalidImport(
			'export {Bar} from "../bar";',
			'export {Bar} from \'../bar.d.ts\';',
		),
		// Export named declarations - wrong extension
		invalidImport(
			'export type {Baz} from "./types.ts";',
			'export type {Baz} from \'./types.d.ts\';',
		),
		invalidImport(
			'export {Qux} from "./qux.js";',
			'export {Qux} from \'./qux.d.ts\';',
		),
		// Export all declarations - missing extension
		invalidImport(
			'export * from "./foo";',
			'export * from \'./foo.d.ts\';',
		),
		invalidImport(
			'export * from "../bar";',
			'export * from \'../bar.d.ts\';',
		),
		// Export all declarations - wrong extension
		invalidImport(
			'export * from "./types.ts";',
			'export * from \'./types.d.ts\';',
		),
		invalidImport(
			'export * as AllTypes from "../../all.js";',
			'export * as AllTypes from \'../../all.d.ts\';',
		),
		// Wrong extension .d.d.ts
		invalidImport(
			'import type {Foo} from "./foo.d.d.ts";',
			'import type {Foo} from \'./foo.d.ts\';',
		),
	],
});


================================================
FILE: lint-rules/require-export.js
================================================
export const requireExportRule = /** @type {const} */ ({
	meta: {
		type: 'problem',
		docs: {
			description: 'Ensure .d.ts files always have `export {}` to avoid being treated as global',
			category: 'Best Practices',
			recommended: true,
		},
		messages: {
			noEmptyExport: 'File must have `export {}` to ensure it is treated as a module.',
		},
		fixable: 'code',
	},
	defaultOptions: [],
	create(context) {
		const filename = context.filename.replaceAll('\\', '/');

		// Only check source .d.ts files
		if (!filename.includes('/source/') || !filename.endsWith('.d.ts')) {
			return {};
		}

		let hasEmptyExport = false;

		return {
			ExportNamedDeclaration(node) {
				// Check if this is specifically `export {}`
				if (!node.declaration && node.specifiers.length === 0 && !node.source) {
					hasEmptyExport = true;
				}
			},
			'Program:exit'(node) {
				if (!hasEmptyExport) {
					context.report({
						node,
						messageId: 'noEmptyExport',
						fix(fixer) {
							// Add export {} at the end of the file
							return fixer.insertTextAfter(node, '\nexport {};\n');
						},
					});
				}
			},
		};
	},
});


================================================
FILE: lint-rules/require-export.test.js
================================================
import {createRuleTester} from './test-utils.js';
import {requireExportRule} from './require-export.js';

const ruleTester = createRuleTester();

const missingEmptyExport = (code, filename, output) => ({
	code,
	filename,
	errors: [{messageId: 'noEmptyExport'}],
	output,
});

ruleTester.run('require-export', requireExportRule, {
	valid: [
		// Has export {}
		{
			code: 'export {};',
			filename: '/source/foo.d.ts',
		},
		// Has export {} with other exports
		{
			code: 'export type Foo = string;\nexport {};',
			filename: '/source/bar.d.ts',
		},
		// Non-.d.ts files don't need export {}
		{
			code: 'const x = 1;',
			filename: '/source/foo.ts',
		},
		{
			code: 'export const y = 2;',
			filename: '/source/bar.js',
		},
		// Files outside source directory are ignored
		{
			code: 'type Test = string;',
			filename: '/test/foo.d.ts',
		},
		{
			code: 'interface ITest {}',
			filename: '/lib/bar.d.ts',
		},
	],
	invalid: [
		// Missing export {} in empty file
		missingEmptyExport('', '/source/foo.d.ts', '\nexport {};\n'),
		// Missing export {} with type declarations
		missingEmptyExport(
			'export type Foo = string;',
			'/source/bar.d.ts',
			'export type Foo = string;\nexport {};\n',
		),
		// Missing export {} with interface
		missingEmptyExport(
			'export interface IFoo {\n\tx: string;\n}',
			'/source/baz.d.ts',
			'export interface IFoo {\n\tx: string;\n}\nexport {};\n',
		),
		// Missing export {} with multiple exports
		missingEmptyExport(
			'export type A = string;\nexport type B = number;',
			'/source/multi.d.ts',
			'export type A = string;\nexport type B = number;\nexport {};\n',
		),
	],
});


================================================
FILE: lint-rules/require-exported-types.js
================================================
import path from 'node:path';
import fs from 'node:fs';

export const requireExportedTypesRule = /** @type {const} */ ({
	meta: {
		type: 'suggestion',
		docs: {
			description: 'Enforce that exported types are also exported from index.d.ts',
			category: 'Best Practices',
			recommended: true,
		},
		messages: {
			missingExport: 'Type `{{typeName}}` is exported from this file but not from index.d.ts. '
				+ 'Add it to index.d.ts or use `// eslint-disable-next-line type-fest/require-exported-types` to ignore.',
			noTypeInfo: 'Rule requires TypeScript type information. Configure `parserServices` in your ESLint config.',
		},
		schema: [
			{
				type: 'object',
				properties: {
					indexFile: {
						type: 'string',
						description: 'Path to the index file (default: "index.d.ts")',
					},
				},
				additionalProperties: false,
			},
		],
	},
	defaultOptions: [],
	create(context) {
		// Only run on TypeScript declaration files in source directory
		// Convert to forward slashes for consistent path checking across platforms
		const filename = context.filename.replaceAll('\\', '/');
		if (!filename.includes('/source/') || !filename.endsWith('.d.ts')) {
			return {};
		}

		// Skip internal files
		if (filename.includes('/internal/')) {
			return {};
		}

		const options = context.options?.[0] ?? {};
		const indexFileName = options.indexFile ?? 'index.d.ts';

		// Get TypeScript type-aware services
		const {parserServices} = context.sourceCode;

		// Type information is required for this rule
		if (!parserServices?.program || !parserServices?.esTreeNodeToTSNodeMap) {
			// Report once per file that type information is required
			return {
				'Program'(node) {
					context.report({
						node,
						messageId: 'noTypeInfo',
					});
				},
			};
		}

		const {program} = parserServices;
		const checker = program.getTypeChecker();

		// Find project root
		let projectRoot = path.dirname(filename);
		while (projectRoot !== path.dirname(projectRoot)) {
			if (fs.existsSync(path.join(projectRoot, 'package.json'))) {
				break;
			}

			projectRoot = path.dirname(projectRoot);
		}

		const indexPath = path.join(projectRoot, indexFileName);

		// Get index exports (no caching to detect changes immediately)
		const indexExports = new Set();

		// Get the source file for index.d.ts
		const indexSourceFile = program.getSourceFile(indexPath);
		if (indexSourceFile) {
			const indexSymbol = checker.getSymbolAtLocation(indexSourceFile);
			if (indexSymbol) {
				const exports = checker.getExportsOfModule(indexSymbol);
				for (const exportSymbol of exports) {
					indexExports.add(exportSymbol.name);
				}
			}
		}

		// State to track processed nodes
		const processed = new Set();

		// Helper function to check exported type/interface
		const checkExportedType = node => {
			const typeName = node.id.name;

			// Skip types starting with underscore (internal/private convention)
			if (typeName.startsWith('_')) {
				return;
			}

			// Skip if inside declare namespace
			const ancestors = context.sourceCode.getAncestors(node);
			const isInsideDeclareNamespace = ancestors.some(ancestor =>
				ancestor.type === 'TSModuleDeclaration' && ancestor.declare,
			);

			if (isInsideDeclareNamespace) {
				return;
			}

			// Skip if already processed
			if (processed.has(typeName)) {
				return;
			}

			processed.add(typeName);

			// Report if not exported from index
			if (!indexExports.has(typeName)) {
				context.report({
					node,
					messageId: 'missingExport',
					data: {typeName},
				});
			}
		};

		return {
			// Handle: export type Foo = ...
			'ExportNamedDeclaration > TSTypeAliasDeclaration': checkExportedType,

			// Handle: export interface Foo { ... }
			'ExportNamedDeclaration > TSInterfaceDeclaration': checkExportedType,

			// Clean up cache periodically
		};
	},
});


================================================
FILE: lint-rules/require-exported-types.test.js
================================================
import {createTypeAwareRuleTester} from './test-utils.js';
import {requireExportedTypesRule} from './require-exported-types.js';

const packageContent = JSON.stringify({
	name: 'require-exported-types-fixture',
}, null, '\t');

const indexContent = 'export {type ExportedType} from \'./source/exported-type\';\n';
const exportedTypeContent = 'export type ExportedType = {\n\tvalue: string;\n};\n';
const internalTypeContent = 'export type InternalType = {\n\tvalue: boolean;\n};\n';
const nestedInternalTypeContent = 'export interface NestedInternalType {\n\tvalue: string;\n}\n';
const privateTypeContent = 'export type _HiddenType = string;\n';
const missingTypeContent = 'export type MissingType = {\n\tvalue: number;\n};\n';
const unexportedMultipleContent = 'export type FirstUnexportedType = string;\nexport interface SecondUnexportedInterface {\n\tvalue: boolean;\n}\n';
const implementationContent = 'export const value = 1;\n';
const testDeclarationContent = 'export type Test = number;\n';
const libDeclarationContent = 'export interface LibTest {\n\tvalue: string;\n}\n';

const {ruleTester, fixturePath} = createTypeAwareRuleTester({
	'package.json': `${packageContent}\n`,
	'index.d.ts': indexContent,
	'source/exported-type.d.ts': undefined,
	'source/internal/internal-type.d.ts': undefined,
	'source/internal/nested/deep.d.ts': undefined,
	'source/private-type.d.ts': undefined,
	'source/missing-type.d.ts': undefined,
	'source/unexported-multiple.d.ts': undefined,
	'source/implementation.ts': undefined,
	'test/test.d.ts': undefined,
	'lib/test.d.ts': undefined,
});

// Type-aware rule tests rely on the generated fixture project above.
const missingExportError = typeName => ({
	messageId: 'missingExport',
	data: {typeName},
});

ruleTester.run('require-exported-types', requireExportedTypesRule, {
	valid: [
		{
			code: exportedTypeContent,
			filename: fixturePath('source/exported-type.d.ts'),
		},
		{
			code: privateTypeContent,
			filename: fixturePath('source/private-type.d.ts'),
		},
		{
			code: internalTypeContent,
			filename: fixturePath('source/internal/internal-type.d.ts'),
		},
		{
			code: nestedInternalTypeContent,
			filename: fixturePath('source/internal/nested/deep.d.ts'),
		},
		{
			code: implementationContent,
			filename: fixturePath('source/implementation.ts'),
		},
		{
			code: testDeclarationContent,
			filename: fixturePath('test/test.d.ts'),
		},
		{
			code: libDeclarationContent,
			filename: fixturePath('lib/test.d.ts'),
		},
	],
	invalid: [
		{
			code: missingTypeContent,
			filename: fixturePath('source/missing-type.d.ts'),
			errors: [missingExportError('MissingType')],
		},
		{
			code: unexportedMultipleContent,
			filename: fixturePath('source/unexported-multiple.d.ts'),
			errors: [
				missingExportError('FirstUnexportedType'),
				missingExportError('SecondUnexportedInterface'),
			],
		},
	],
});


================================================
FILE: lint-rules/source-files-extension.js
================================================
import path from 'node:path';

export const sourceFilesExtensionRule = /** @type {const} */ ({
	meta: {
		type: 'problem',
		docs: {
			description: 'Enforces source files to end with a \'.d.ts\' extension.',
		},
		fixable: 'code',
		messages: {
			incorrectFilename:
				'Filename \'{{filename}}\' must end with a \'.d.ts\' extension. Use \'{{fixedFilename}}\' instead.',
		},
		schema: [],
	},
	defaultOptions: [],
	create(context) {
		const filename = path.basename(context.filename);
		const firstDotIndex = filename.indexOf('.');
		const extension = firstDotIndex === -1 ? '' : filename.slice(firstDotIndex);

		if (extension === '.d.ts') {
			return {};
		}

		return {
			Program(node) {
				const filenameWithoutExtension = extension.length > 0
					? filename.slice(0, -extension.length)
					: filename;
				const fixedFilename = `${filenameWithoutExtension}.d.ts`;

				context.report({
					loc: {column: 0, line: 1}, // Report error on start of the file
					node,
					messageId: 'incorrectFilename',
					data: {filename, fixedFilename},
				});
			},
		};
	},
});


================================================
FILE: lint-rules/source-files-extension.test.js
================================================
import {createRuleTester} from './test-utils.js';
import {sourceFilesExtensionRule} from './source-files-extension.js';

const ruleTester = createRuleTester();

const invalidSourceFile = (filename, code = '') => ({
	code,
	filename,
	errors: [{messageId: 'incorrectFilename'}],
});

ruleTester.run('source-files-extension', sourceFilesExtensionRule, {
	valid: [
		// Correct .d.ts extension
		{
			code: '',
			filename: '/source/foo.d.ts',
		},
		{
			code: '',
			filename: '/source/types/bar.d.ts',
		},
		{
			code: '',
			filename: '/source/deeply/nested/file.d.ts',
		},
	],
	invalid: [
		// Wrong .ts extension
		invalidSourceFile('/source/foo.ts'),
		// Wrong .js extension
		invalidSourceFile('/source/foo.js'),
		// No extension
		invalidSourceFile('/source/bar'),
		// Wrong .tsx extension
		invalidSourceFile('/source/component.tsx'),
		// Wrong .mjs extension
		invalidSourceFile('/source/module.mjs'),
	],
});


================================================
FILE: lint-rules/test-utils.js
================================================
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import {RuleTester} from 'eslint';
import tsParser from '@typescript-eslint/parser';
import dedent from 'dedent';

export const createRuleTester = (overrides = {}) => {
	const {
		languageOptions: overrideLanguageOptions = {},
		...restOverrides
	} = overrides;

	const {
		parserOptions: overrideParserOptions = {},
		...otherLanguageOptions
	} = overrideLanguageOptions;

	return new RuleTester({
		...restOverrides,
		languageOptions: {
			ecmaVersion: 'latest',
			sourceType: 'module',
			parser: tsParser,
			...otherLanguageOptions,
			parserOptions: {
				...overrideParserOptions,
			},
		},
	});
};

const defaultTypeAwareTsconfig = {
	compilerOptions: {
		declaration: true,
		emitDeclarationOnly: true,
		module: 'ESNext',
		moduleResolution: 'Bundler',
		skipLibCheck: true,
		strict: true,
		target: 'ES2022',
	},
	include: [
		'*.d.ts',
		'source/**/*.*',
		'lib/**/*.d.ts',
		'test/**/*.d.ts',
	],
};

export const createTypeAwareRuleTester = (fixtureFiles, options = {}) => {
	const fixtureRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'type-fest-type-aware-'));

	const writeFixture = (relativePath, content) => {
		const absolutePath = path.join(fixtureRoot, relativePath);
		fs.mkdirSync(path.dirname(absolutePath), {recursive: true});
		fs.writeFileSync(absolutePath, content ?? '');
	};

	for (const [relativePath, content] of Object.entries(fixtureFiles)) {
		writeFixture(relativePath, content);
	}

	const hasRuleTesterOption = Object.hasOwn(options, 'ruleTester');
	const hasTsconfigOption = Object.hasOwn(options, 'tsconfig');
	const ruleTesterOverrides = hasRuleTesterOption || hasTsconfigOption ? options.ruleTester ?? {} : options;
	const tsconfig = hasRuleTesterOption || hasTsconfigOption
		? options.tsconfig ?? defaultTypeAwareTsconfig
		: defaultTypeAwareTsconfig;

	if (!('tsconfig.json' in fixtureFiles)) {
		writeFixture('tsconfig.json', `${JSON.stringify(tsconfig, null, '\t')}\n`);
	}

	const overrideLanguageOptions = ruleTesterOverrides.languageOptions ?? {};
	const overrideParserOptions = overrideLanguageOptions.parserOptions ?? {};
	const overrideProjectService = overrideParserOptions.projectService ?? {};
	const ruleTester = createRuleTester({
		...ruleTesterOverrides,
		languageOptions: {
			...overrideLanguageOptions,
			parserOptions: {
				...overrideParserOptions,
				projectService: {
					allowDefaultProject: ['*.ts*'],
					...overrideProjectService,
				},
				tsconfigRootDir: fixtureRoot,
			},
		},
	});

	const fixturePath = relativePath => path.join(fixtureRoot, relativePath);

	return {
		ruleTester,
		fixtureRoot,
		fixturePath,
		writeFixture,
	};
};

export const dedenter = dedent.withOptions({alignValues: true});

/**
Returns the specified code in a fenced code block, with an optional language tag.

@example
```
fence('type A = string;');
// Returns:
// ```
// type A = string;
// ```

fence(`import {RemovePrefix} from 'type-fest';

type A = RemovePrefix<'onChange', 'on'>;
//=> 'Change'`, 'ts');
// Returns:
// ```ts
// import {RemovePrefix} from 'type-fest';

// type A = RemovePrefix<'onChange', 'on'>;
// //=> 'Change'
// ```
```
*/
export const fence = (code, lang = '') =>
	dedenter`
		\`\`\`${lang}
		${code}
		\`\`\`
	`;

/**
Returns the specified lines as a JSDoc comment, placing each specified line on a new line.

@example
```
jsdoc('Some description.', 'Note: Some note.');
// Returns:
// /**
// Some description.
// Note: Some note.
// *​/

jsdoc('@example', '```\ntype A = string;\n```', '@category Test');
// Returns;
// /**
// @example
// ```
// type A = string;
// ```
// @category Test
// *​/
```
*/
export const jsdoc = (...lines) =>
	dedenter`
		/**
		${lines.join('\n')}
		*/
	`;

/**
Returns an exported type for each provided prefix, with each prefix placed directly above its corresponding type declaration.

@example
```
exportType(
	'// Some comment',
	'type Test = string;',
	'/**\nSome description.\nNote: Some note.\n*​/'
);
// Returns:
// // Some comment
// export type T0 = string;
//
// type Test = string;
// export type T1 = string;
//
// /**
// Some description.
// Note: Some note.
// *​/
// export type T2 = string;
*/
export const exportType = (...prefixes) =>
	prefixes
		.map((doc, i) => dedenter`
			${doc}
			export type T${i} = string;
		`)
		.join('\n\n');

/**
Returns an exported "Options" object type containing a property for each specified prefix, with each prefix placed directly above its corresponding property declaration.

@example
```
exportOption(
	'// Some comment',
	'type Test = string;',
	'/**\nSome description.\nNote: Some note.\n*​/'
);
// Returns:
// export type TOptions = {
// 	// Some comment
// 	p0: string;

// 	test: string;
// 	p1: string;

// 	/**
// 	Some description.
// 	Note: Some note.
// 	*​/
// 	p2: string;
// };
```
*/
export const exportOption = (...prefixes) =>
	dedenter`
		export type TOptions = {
			${prefixes
				.map((doc, i) => dedenter`
					${doc}
					p${i}: string;
				`)
				.join('\n\n')}
		};
	`;

/**
Returns an exported type for each provided prefix, and an exported "Options" object type containing a property for each specified prefix, with each prefix placed directly above its corresponding declaration.

@example
```
exportTypeAndOption('// Some comment', '/**\nSome JSDoc\n*​/');
// Returns:
// // Some comment
// type T0 = string;

// /**
// Some JSDoc
// *​/
// type T1 = string;

// type TOptions = {
// 	// Some comment
// 	p0: string;

// 	/**
// 	Some JSDoc
// 	*​/
// 	p1: string;
// };
```
*/
export const exportTypeAndOption = (...prefixes) =>
	dedenter`
		${exportType(...prefixes)}

		${exportOption(...prefixes)}
	`;

/**
@typedef {{
	line: number;
	textBeforeStart: string;
	ruleId?: string;
	messageId?: string;
} & ({ target: string } | { endLine: number; textBeforeEnd: string })} ErrorAtProps

@param {ErrorAtProps} props
@returns {{line: number, column: number, endLine: number, endColumn: number, ruleId?: string, messageId?: string}}
*/
export const errorAt = props => {
	const {line, textBeforeStart, ruleId, messageId} = props;

	const column = textBeforeStart.length + 1;
	const endColumn = 'textBeforeEnd' in props ? props.textBeforeEnd.length + 1 : column + props.target.length;

	const endLine = 'endLine' in props ? props.endLine : line;

	return {
		...(ruleId && {ruleId}),
		...(messageId && {messageId}),
		line, // 1-based, inclusive
		column, // 1-based, inclusive
		endLine, // 1-based, inclusive
		endColumn, // 1-based, exclusive
	};
};

/// Code samples
export const code1 = dedenter`
import type {Sum} from 'type-fest';

type A = Sum<1, 2>;
//=> 3
`;

export const code2 = dedenter`
import type {LiteralToPrimitiveDeep} from 'type-fest';

const config = {appName: 'MyApp', version: '1.0.0'} as const;

declare function updateConfig(newConfig: LiteralToPrimitiveDeep<typeof config>): void;

updateConfig({appName: 'MyUpdatedApp', version: '2.0.0'});
`;


================================================
FILE: lint-rules/validate-jsdoc-codeblocks.js
================================================
import path from 'node:path';
import ts from 'typescript';
import {createFSBackedSystem, createVirtualTypeScriptEnvironment} from '@typescript/vfs';

const CODEBLOCK_REGEX = /(?<openingFence>```(?:ts|typescript)?\n)(?<code>[\s\S]*?)```/g;
const FILENAME = 'example-codeblock.ts';
const TWOSLASH_COMMENT = '//=>';

const compilerOptions = {
	lib: ['lib.es2023.d.ts', 'lib.dom.d.ts', 'lib.dom.iterable.d.ts'],
	target: ts.ScriptTarget.ESNext,
	module: ts.ModuleKind.Node20,
	moduleResolution: ts.ModuleResolutionKind.Node16,
	strict: true,
	noImplicitReturns: true,
	noImplicitOverride: true,
	noUnusedLocals: false, // This is intentionally disabled
	noUnusedParameters: true,
	noFallthroughCasesInSwitch: true,
	noUncheckedIndexedAccess: true,
	noPropertyAccessFromIndexSignature: true,
	noUncheckedSideEffectImports: true,
	useDefineForClassFields: true,
	exactOptionalPropertyTypes: true,
};

const virtualFsMap = new Map();
virtualFsMap.set(FILENAME, '// Can\'t be empty');

const rootDir = path.join(import.meta.dirname, '..');
const system = createFSBackedSystem(virtualFsMap, rootDir, ts);
const defaultEnv = createVirtualTypeScriptEnvironment(system, [FILENAME], ts, compilerOptions);

function parseCompilerOptions(code) {
	const options = {};
	const lines = code.split('\n');

	for (const line of lines) {
		if (!line.trim()) {
			// Skip empty lines
			continue;
		}

		const match = line.match(/^\s*\/\/ @(\w+): (.*)$/);
		if (!match) {
			// Stop parsing at the first non-matching line
			return options;
		}

		const [, key, value] = match;
		const trimmedValue = value.trim();

		try {
			options[key] = JSON.parse(trimmedValue);
		} catch {
			options[key] = trimmedValue;
		}
	}

	return options;
}

function getJSDocNode(sourceCode, node) {
	let previousToken = sourceCode.getTokenBefore(node, {includeComments: true});

	// Skip over any line comments immediately before the node
	while (previousToken && previousToken.type === 'Line') {
		previousToken = sourceCode.getTokenBefore(previousToken, {includeComments: true});
	}

	if (previousToken && previousToken.type === 'Block' && previousToken.value.startsWith('*')) {
		return previousToken;
	}

	return undefined;
}

export const validateJSDocCodeblocksRule = /** @type {const} */ ({
	meta: {
		type: 'suggestion',
		docs: {
			description: 'Ensures JSDoc example codeblocks don\'t have errors',
		},
		fixable: 'code',
		messages: {
			invalidCodeblock: '{{errorMessage}}',
			incorrectTwoslashType: 'Expected twoslash comment to be: {{expectedComment}}, but found: {{actualComment}}',
			incorrectTwoslashFormat: 'Expected twoslash comment to be: {{expectedComment}}, but found: {{actualComment}}',
		},
		schema: [{
			type: 'object',
			properties: {
				verbosityLevels: {
					type: 'array',
					uniqueItems: true,
					items: {
						minimum: 0,
						type: 'number',
					},
				},
			},
		}],
		/** @type {unknown[]} */
		defaultOptions: [{
			verbosityLevels: [],
		}],
	},
	create(context) {
		const filename = context.filename.replaceAll('\\', '/');

		// Skip internal files
		if (filename.includes('/internal/')) {
			return {};
		}

		try {
			defaultEnv.updateFile(context.filename, context.sourceCode.getText());
		} catch {
			// Ignore
		}

		return {
			TSTypeAliasDeclaration(node) {
				const {parent} = node;

				// Skip if type is not exported or starts with an underscore (private/internal)
				if (parent.type !== 'ExportNamedDeclaration' || node.id.name.startsWith('_')) {
					return;
				}

				const previousNodes = [];
				const jsdocForExport = getJSDocNode(context.sourceCode, parent);
				if (jsdocForExport) {
					previousNodes.push(jsdocForExport);
				}

				// Handle JSDoc blocks for options
				if (node.id.name.endsWith('Options') && node.typeAnnotation.type === 'TSTypeLiteral') {
					for (const member of node.typeAnnotation.members) {
						const jsdocForMember = getJSDocNode(context.sourceCode, member);
						if (jsdocForMember) {
							previousNodes.push(jsdocForMember);
						}
					}
				}

				for (const previousNode of previousNodes) {
					const comment = previousNode.value;

					for (const match of comment.matchAll(CODEBLOCK_REGEX)) {
						const {code, openingFence} = match.groups ?? {};

						// Skip empty code blocks
						if (!code || !openingFence) {
							continue;
						}

						const matchOffset = match.index + openingFence.length + 2; // Add `2` because `comment` doesn't include the starting `/*`
						const codeStartIndex = previousNode.range[0] + matchOffset;

						const overrides = parseCompilerOptions(code);
						let env = defaultEnv;

						if (Object.keys(overrides).length > 0) {
							const {options, errors} = ts.convertCompilerOptionsFromJson(overrides, rootDir);

							if (errors.length === 0) {
								// Create a new environment with overridden options
								env = createVirtualTypeScriptEnvironment(system, [FILENAME], ts, {...compilerOptions, ...options});
							}
						}

						env.updateFile(FILENAME, code);
						const syntacticDiagnostics = env.languageService.getSyntacticDiagnostics(FILENAME);
						const semanticDiagnostics = env.languageService.getSemanticDiagnostics(FILENAME);
						const diagnostics = syntacticDiagnostics.length > 0 ? syntacticDiagnostics : semanticDiagnostics; // Show semantic errors only if there are no syntactic errors

						for (const diagnostic of diagnostics) {
							// If diagnostic location is not available, report on the entire code block
							const diagnosticStart = codeStartIndex + (diagnostic.start ?? 0);
							const diagnosticEnd = diagnosticStart + (diagnostic.length ?? code.length);

							context.report({
								loc: {
									start: context.sourceCode.getLocFromIndex(diagnosticStart),
									end: context.sourceCode.getLocFromIndex(diagnosticEnd),
								},
								messageId: 'invalidCodeblock',
								data: {
									errorMessage: ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'),
								},
							});
						}

						if (diagnostics.length === 0) {
							validateTwoslashTypes(context, env, code, codeStartIndex);
						}
					}
				}
			},
		};
	},
});

function getLeftmostQuickInfo(env, line, lineOffset, verbosityLevel) {
	for (let i = 0; i < line.length; i++) {
		const quickInfo = env.languageService.getQuickInfoAtPosition(FILENAME, lineOffset + i, undefined, verbosityLevel);
		if (quickInfo?.displayParts) {
			return quickInfo;
		}
	}
}

function extractTypeFromQuickInfo(quickInfo) {
	const {displayParts} = quickInfo;

	// For interfaces and enums, return everything after the keyword
	const keywordIndex = displayParts.findIndex(
		part => part.kind === 'keyword' && ['interface', 'enum'].includes(part.text),
	);

	if (keywordIndex !== -1) {
		return displayParts.slice(keywordIndex + 1).map(part => part.text).join('').trim();
	}

	let depth = 0;
	const separatorIndex = displayParts.findIndex(part => {
		if (part.kind === 'punctuation') {
			if (['(', '{', '<'].includes(part.text)) {
				depth++;
			} else if ([')', '}', '>'].includes(part.text)) {
				depth--;
			} else if (part.text === ':' && depth === 0) {
				return true;
			}
		} else if (part.kind === 'operator' && part.text === '=' && depth === 0) {
			return true;
		}

		return false;
	});

	// If `separatorIndex` is `-1` (not found), return the entire thing
	return displayParts.slice(separatorIndex + 1).map(part => part.text).join('').trim();
}

function normalizeType(type, onlySortNumbers = false) {
	const sourceFile = ts.createSourceFile(
		'twoslash-type.ts',
		`declare const test: ${type};`,
		ts.ScriptTarget.Latest,
	);

	const typeNode = sourceFile.statements[0].declarationList.declarations[0].type;

	const print = node => ts.createPrinter().printNode(ts.EmitHint.Unspecified, node, sourceFile);

	const isNumeric = v => v.trim() !== '' && Number.isFinite(Number(v));

	const visit = node => {
		node = ts.visitEachChild(node, visit, undefined);

		if (ts.isUnionTypeNode(node)) {
			let types = node.types.map(t => [print(t), t]);

			if (onlySortNumbers) {
				// Sort only numeric members while keeping non-numeric members at their original positions
				const sortedNumericTypes = types.filter(([a]) => isNumeric(a)).sort(([a], [b]) => Number(a) - Number(b));
				let numericIndex = 0;
				types = types.map(t => isNumeric(t[0]) ? sortedNumericTypes[numericIndex++][1] : t[1]);
			} else {
				types = types
					.sort(([a], [b]) => a < b ? -1 : (a > b ? 1 : 0))
					.map(t => t[1]);
			}

			return ts.factory.updateUnionTypeNode(
				node,
				ts.factory.createNodeArray(types),
			);
		}

		// Prefer single-line formatting for tuple types
		if (ts.isTupleTypeNode(node)) {
			const updated = ts.factory.createTupleTypeNode(node.elements);
			ts.setEmitFlags(updated, ts.EmitFlags.SingleLine);
			return updated;
		}

		// Replace double-quoted string literals with single-quoted ones
		if (ts.isStringLiteral(node)) {
			const updated = ts.factory.createStringLiteral(node.text, true);
			// Preserve non-ASCII characters like emojis.
			ts.setEmitFlags(updated, ts.EmitFlags.NoAsciiEscaping);
			return updated;
		}

		return node;
	};

	return print(visit(typeNode)).replaceAll(/^( +)/gm, indentation => {
		// Replace spaces used for indentation with tabs
		const spacesPerTab = 4;
		const tabCount = Math.floor(indentation.length / spacesPerTab);
		const remainingSpaces = indentation.length % spacesPerTab;
		return '\t'.repeat(tabCount) + ' '.repeat(remainingSpaces);
	});
}

function getCommentForType(type) {
	let comment = type;

	if (type.length < 80) {
		comment = type
			.replaceAll(/\r?\n\s*/g, ' ') // Collapse into single line
			.replaceAll(/{\s+/g, '{') // Remove spaces after `{`
			.replaceAll(/\s+}/g, '}') // Remove spaces before `}`
			.replaceAll(/;(?=})/g, ''); // Remove semicolons before `}`
	}

	return `${TWOSLASH_COMMENT} ${comment.replaceAll('\n', '\n// ')}`;
}

function reportTypeMismatch({context, messageId, start, end, data, fix}) {
	context.report({
		loc: {
			start: context.sourceCode.getLocFromIndex(start),
			end: context.sourceCode.getLocFromIndex(end),
		},
		messageId,
		data,
		fix(fixer) {
			return fixer.replaceTextRange([start, end], fix);
		},
	});
}

function validateTwoslashTypes(context, env, code, codeStartIndex) {
	const sourceFile = env.languageService.getProgram().getSourceFile(FILENAME);
	const lines = code.split('\n');

	const specifiedVerbosityLevels = context.options[0].verbosityLevels;
	const verbosityLevels = [0, ...specifiedVerbosityLevels, Infinity]; // Keep `Infinity` last since suggestion logic relies on the order

	for (const [index, line] of lines.entries()) {
		const dedentedLine = line.trimStart();
		if (!dedentedLine.startsWith(TWOSLASH_COMMENT)) {
			continue;
		}

		const previousLineIndex = index - 1;
		if (previousLineIndex < 0) {
			continue;
		}

		let rawActualType = dedentedLine.slice(TWOSLASH_COMMENT.length);
		let actualComment = dedentedLine;
		let actualCommentEndLine = index;

		for (let i = index + 1; i < lines.length; i++) {
			const dedentedNextLine = lines[i].trimStart();
			if (!dedentedNextLine.startsWith('//') || dedentedNextLine.startsWith(TWOSLASH_COMMENT)) {
				break;
			}

			actualComment += '\n' + dedentedNextLine;
			rawActualType += '\n' + dedentedNextLine.slice(2); // Remove the `//` from start
			actualCommentEndLine = i;
		}

		const previousLine = lines[previousLineIndex];
		const previousLineOffset = sourceFile.getPositionOfLineAndCharacter(previousLineIndex, 0);

		const actualCommentIndex = line.indexOf(TWOSLASH_COMMENT);

		const actualCommentStartOffset = sourceFile.getPositionOfLineAndCharacter(index, actualCommentIndex);
		const actualCommentEndOffset = sourceFile.getPositionOfLineAndCharacter(actualCommentEndLine, lines[actualCommentEndLine].length);

		const start = codeStartIndex + actualCommentStartOffset;
		const end = codeStartIndex + actualCommentEndOffset;

		const indent = line.slice(0, actualCommentIndex);

		const quickInfos = verbosityLevels
			.map(verbosity => getLeftmostQuickInfo(env, previousLine, previousLineOffset, verbosity))
			.filter(qi => qi?.displayParts);

		if (quickInfos.length > 0) {
			const expectedTypes = quickInfos.map(qi => normalizeType(extractTypeFromQuickInfo(qi)));
			const actualType = normalizeType(rawActualType);

			if (expectedTypes.includes(actualType)) {
				// If the types match, check for formatting errors and unordered numbers in unions
				const expectedComment = getCommentForType(normalizeType(rawActualType, true));

				if (actualComment !== expectedComment) {
					reportTypeMismatch({
						messageId: 'incorrectTwoslashFormat',
						context,
						start,
						end,
						data: {expectedComment, actualComment},
						fix: expectedComment.replaceAll('\n', `\n${indent}`),
					});
				}
			} else {
				// For suggestion, use infinite verbosity, and it should be the last one
				const expectedComment = getCommentForType(expectedTypes.at(-1));

				reportTypeMismatch({
					messageId: 'incorrectTwoslashType',
					context,
					start,
					end,
					data: {expectedComment, actualComment},
					fix: expectedComment.replaceAll('\n', `\n${indent}`),
				});
			}
		}
	}
}


================================================
FILE: lint-rules/validate-jsdoc-codeblocks.test.js
================================================
/* eslint-disable max-lines */
import {code1, code2, createRuleTester, dedenter, errorAt as errorAt_, exportType, exportTypeAndOption, fence, jsdoc} from './test-utils.js';
import {validateJSDocCodeblocksRule} from './validate-jsdoc-codeblocks.js';

const ruleTester = createRuleTester();

const codeWithErrors = dedenter`
import type {RemovePrefix} from 'type-fest';

type A = RemovePrefix<'on-change', string, {strict: "yes"}>;
`;

const invalidCodeblockErrorAt = props => errorAt_({...props, messageId: 'invalidCodeblock'});
const incorrectTwoslashTypeErrorAt = props => errorAt_({...props, messageId: 'incorrectTwoslashType'});
const incorrectTwoslashFormatErrorAt = props => errorAt_({...props, messageId: 'incorrectTwoslashFormat'});

ruleTester.run('validate-jsdoc-codeblocks', validateJSDocCodeblocksRule, {
	valid: [
		// Not exported
		dedenter`
			${jsdoc(fence(codeWithErrors))}
			type NotExported = string;
		`,
		dedenter`
			type NotExportedOptions = {
				${jsdoc(fence(codeWithErrors))}
				p1: string;
			}
		`,

		// Internal (leading underscore)
		dedenter`
			${jsdoc(fence(codeWithErrors))}
			export type _Internal = string;
		`,
		dedenter`
			export type _InternalOptions = {
				${jsdoc(fence(codeWithErrors))}
				p1: string;
			}
		`,

		// Without `Options` suffix
		dedenter`
			export type NoSuffix = {
				${jsdoc(fence(codeWithErrors))}
				p1: string;
			}
		`,

		// No JSDoc
		exportTypeAndOption(''),
		exportType('type Some = number;'),
		exportTypeAndOption('// Not block comment'),
		exportTypeAndOption('/* Block comment, but not JSDoc */'),

		// No codeblock in JSDoc
		exportType(jsdoc('No codeblock here')),

		// With text before and after
		exportTypeAndOption(jsdoc('Some description.', fence(code1), '@category Test')),

		// With line breaks before and after
		exportTypeAndOption(
			jsdoc('Some description.\n', 'Note: Some note.\n', fence(code1, 'ts'), '\n@category Test'),
		),

		// With `@example` tag
		exportTypeAndOption(jsdoc('@example', fence(code1))),

		// With language specifiers
		exportTypeAndOption(jsdoc(fence(code1, 'ts'))),
		exportTypeAndOption(jsdoc(fence(code1, 'typescript'))),

		// Multiple code blocks
		exportTypeAndOption(
			jsdoc('@example', fence(code1, 'ts'), '\nSome text in between.\n', '@example', fence(code2)),
		),

		// Multiple exports and multiple properties
		exportTypeAndOption(jsdoc(fence(code1)), jsdoc(fence(code2))),

		// With @ts-expect-error
		exportTypeAndOption(jsdoc(fence(dedenter`
			import type {ExtractStrict} from 'type-fest';

			// @ts-expect-error
			type A = ExtractStrict<'foo' | 'bar', 'baz'>;
		`))),

		// Indented code blocks
		exportTypeAndOption(jsdoc(
			'Note:',
			dedenter`
				1. First point
					\`\`\`ts
					import type {Subtract} from 'type-fest';
					type A = Subtract<1, 2>;
					\`\`\`
				2. Second point
					\`\`\`ts
					import type {Sum} from 'type-fest';
					type A = Sum<1, 2>;
					\`\`\`
			`,
		)),

		// Compiler options overrides
		exportTypeAndOption(jsdoc(fence(dedenter`
			// @exactOptionalPropertyTypes: false
			const foo: {a?: number} = {a: undefined};
		`))),

		// Incorrect compiler options are ignored
		exportTypeAndOption(jsdoc(fence(dedenter`
			// @noUnusedLocals: 'invalid-value'
			const foo = {a: 1};
		`))),

		// Line comment between JSDoc and type/option
		exportTypeAndOption(dedenter`
			${jsdoc(fence(code1))}
			// Some line comment between JSDoc and export
		`),
	],
	invalid: [
		// With text before and after
		{
			code: dedenter`
				/**
				Some description.
				\`\`\`ts
				type A = Subtract<1, 2>;
				\`\`\`
				@category Test
				*/
				export type T0 = string;

				export type TOptions = {
					/**
					Some description.
					\`\`\`ts
					type A = Subtract<1, 2>;
					\`\`\`
					@category Test
					*/
					p0: string;
				};
			`,
			errors: [
				invalidCodeblockErrorAt({line: 4, textBeforeStart: 'type A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 14, textBeforeStart: '\ttype A = ', target: 'Subtract'}),
			],
		},

		// With line breaks before and after
		{
			code: dedenter`
				/**
				Some description.

				Note: Some note.

				\`\`\`ts
				type A = Subtract<1, 2>;
				\`\`\`

				@category Test
				*/
				export type T0 = string;

				export type TOptions = {
					/**
					Some description.

					Note: Some note.

					\`\`\`ts
					type A = Subtract<1, 2>;
					\`\`\`

					@category Test
					*/
					p0: string;
				};
			`,
			errors: [
				invalidCodeblockErrorAt({line: 7, textBeforeStart: 'type A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 21, textBeforeStart: '\ttype A = ', target: 'Subtract'}),
			],
		},

		// With `@example` tag
		{
			code: dedenter`
				/**
				@example
				\`\`\`ts
				type A = Subtract<1, 2>;
				\`\`\`
				*/
				export type T0 = string;

				export type TOptions = {
					/**
					@example
					\`\`\`ts
					type A = Subtract<1, 2>;
					\`\`\`
					*/
					p0: string;
				};
			`,
			errors: [
				invalidCodeblockErrorAt({line: 4, textBeforeStart: 'type A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 13, textBeforeStart: '\ttype A = ', target: 'Subtract'}),
			],
		},

		// With language specifiers
		{
			code: dedenter`
				/**
				\`\`\`ts
				type A = Subtract<1, 2>;
				\`\`\`
				*/
				export type T0 = string;

				export type TOptions = {
					/**
					\`\`\`ts
					type A = Subtract<1, 2>;
					\`\`\`
					*/
					p0: string;
				};
			`,
			errors: [
				invalidCodeblockErrorAt({line: 3, textBeforeStart: 'type A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 11, textBeforeStart: '\ttype A = ', target: 'Subtract'}),
			],
		},
		{
			code: dedenter`
				/**
				\`\`\`typescript
				type A = Subtract<1, 2>;
				\`\`\`
				*/
				export type T0 = string;

				export type TOptions = {
					/**
					\`\`\`typescript
					type A = Subtract<1, 2>;
					\`\`\`
					*/
					p0: string;
				};
			`,
			errors: [
				invalidCodeblockErrorAt({line: 3, textBeforeStart: 'type A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 11, textBeforeStart: '\ttype A = ', target: 'Subtract'}),
			],
		},

		// Multiple code blocks
		{
			code: dedenter`
				/**
				@example
				\`\`\`ts
				type A = Subtract<1, 2>;
				\`\`\`

				Some text in between.

				@example
				\`\`\`ts
				import type {ExcludeStrict} from 'type-fest';

				type A = ExcludeStrict<string, number>;
				\`\`\`
				*/
				export type T0 = string;

				export type TOptions = {
					/**
					@example
					\`\`\`ts
					type A = Subtract<1, 2>;
					\`\`\`

					Some text in between.

					@example
					\`\`\`ts
					import type {ExcludeStrict} from 'type-fest';

					type A = ExcludeStrict<string, number>;
					\`\`\`
					*/
					p0: string;
				};
			`,
			errors: [
				invalidCodeblockErrorAt({line: 4, textBeforeStart: 'type A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 13, textBeforeStart: 'type A = ExcludeStrict<string, ', target: 'number'}),
				invalidCodeblockErrorAt({line: 22, textBeforeStart: '\ttype A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 31, textBeforeStart: '\ttype A = ExcludeStrict<string, ', target: 'number'}),
			],
		},

		// Multiple exports and multiple properties
		{
			code: dedenter`
				/**
				\`\`\`ts
				type A = Subtract<1, 2>;
				\`\`\`
				*/
				export type T0 = string;

				/**
				\`\`\`ts
				import type {ExcludeStrict} from 'type-fest';

				type A = ExcludeStrict<string, number>;
				\`\`\`
				*/
				export type T1 = string;

				export type T0Options = {
					/**
					\`\`\`ts
					type A = Subtract<1, 2>;
					\`\`\`
					*/
					p0: string;

					/**
					\`\`\`ts
					import type {ExcludeStrict} from 'type-fest';

					type A = ExcludeStrict<string, number>;
					\`\`\`
					*/
					p1: string;
				};

				export type T1Options = {
					/**
					\`\`\`ts
					import type {Sum} from 'type-fest';

					Sum<1, 2>; //=> 3
					\`\`\`
					*/
					p0: string;
				};
			`,
			errors: [
				invalidCodeblockErrorAt({line: 3, textBeforeStart: 'type A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 12, textBeforeStart: 'type A = ExcludeStrict<string, ', target: 'number'}),
				invalidCodeblockErrorAt({line: 20, textBeforeStart: '\ttype A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 29, textBeforeStart: '\ttype A = ExcludeStrict<string, ', target: 'number'}),
				invalidCodeblockErrorAt({line: 40, textBeforeStart: '\t', target: 'Sum'}),
			],
		},

		// Indented code blocks
		{
			code: dedenter`
				/**
				Note:
				1. First point
					\`\`\`ts
					type A = Subtract<1, 2>;
					\`\`\`
				2. Second point
					\`\`\`ts
					type A = Sum<1, 2>;
					\`\`\`
				*/
				export type T0 = string;

				export type TOptions = {
					/**
					Note:
					1. First point
						\`\`\`ts
						type A = Subtract<1, 2>;
						\`\`\`
					2. Second point
						\`\`\`ts
						type A = Sum<1, 2>;
						\`\`\`
					*/
					p0: string;
				};
			`,
			errors: [
				invalidCodeblockErrorAt({line: 5, textBeforeStart: '\ttype A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 9, textBeforeStart: '\ttype A = ', target: 'Sum'}),
				invalidCodeblockErrorAt({line: 19, textBeforeStart: '\t\ttype A = ', target: 'Subtract'}),
				invalidCodeblockErrorAt({line: 23, textBeforeStart: '\t\ttype A = ', target: 'Sum'}),
			],
		},

		// Missing import
		{
			code: dedenter`
				/**
				Description
				\`\`\`
				type A = Sum<1, 2>;
				//=> 3

				type B = Sum<-1, 2>;
				//=> 1
				\`\`\`
				*/
				export type Sum = string;
			`,
			errors: [
				invalidCodeblockErrorAt({line: 4, textBeforeStart: 'type A = ', target: 'Sum'}),
				invalidCodeblockErrorAt({line: 7, textBeforeStart: 'type B = ', target: 'Sum'}),
			],
		},

		// Floating examples
		{
			code: dedenter`
			/**
			\`\`\`ts
			import type {IsUppercase} from 'type-fest';

			IsUppercase<'ABC'>;
			//=> true

			IsUppercase<'Abc'>;
			//=> false
			\`\`\`
			@category Utilities
			*/
			export type IsUppercase = boolean;
			`,
			errors: [
				invalidCodeblockErrorAt({line: 5, textBeforeStart: '', target: 'IsUppercase'}),
				invalidCodeblockErrorAt({line: 8, textBeforeStart: '', target: 'IsUppercase'}),
			],
		},

		// Hypthetical references
		{
			code: dedenter`
				/**
				Some description
				Some note
				\`\`\`
				import type {Except} from 'type-fest';

				type PostPayload = Except<UserData, 'email'>;
				\`\`\`
				*/
				export type Except = string;
			`,
			errors: [
				invalidCodeblockErrorAt({line: 7, textBeforeStart: 'type PostPayload = Except<', target: 'UserData'}),
			],
		},

		// Duplicate identifiers
		{
			code: dedenter`
				export type IsTupleOptions = {
					/**
					@example
					\`\`\`
					import type {IsTuple} from 'type-fest';

					type Example = IsTuple<[number, ...number[]], {fixedLengthOnly: true}>;
					//=> false

					type Example = IsTuple<[number, ...number[]], {fixedLengthOnly: false}>;
					//=> true
					\`\`\`
					@default true
					*/
					fixedLengthOnly: boolean;
				};
			`,
			errors: [
				invalidCodeblockErrorAt({line: 7, textBeforeStart: '\ttype ', target: 'Example'}),
				invalidCodeblockErrorAt({line: 10, textBeforeStart: '\ttype ', target: 'Example'}),
			],
		},

		// Multi line error
		{
			code: dedenter`
				/**
				@example
				\`\`\`
				declare function updateConfig(newConfig: {name?: string; version?: number}): void;

				updateConfig({
					name: undefined,
					version: undefined,
				});
				\`\`\`
				@category Utilities
				*/
				export type MultiLine = string;
			`,
			errors: [
				invalidCodeblockErrorAt({line: 6, textBeforeStart: 'updateConfig(', endLine: 9, textBeforeEnd: '}'}),
			],
		},

		// Precise one character error
		{
			code: dedenter`
			/**
			\`\`\`
			import type {ExcludeStrict} from 'type-fest';

			type A = ExcludeStrict<'a' | 'b', 'A'>;
			\`\`\`
			*/
			export type ExcludeStrict = string;
			`,
			errors: [
				invalidCodeblockErrorAt({
					line: 5,
					textBeforeStart: 'type A = ExcludeStrict<\'a\' | \'b\', ',
					target: '\'A\'',
				}),
			],
		},

		// `exactOptionalPropertyTypes` is enabled
		{
			code: dedenter`
			/**
			\`\`\`
			const test: {foo?: string} = {foo: undefined};
			\`\`\`
			*/
			export type Test = string;
			`,
			errors: [
				invalidCodeblockErrorAt({line: 3, textBeforeStart: 'const ', target: 'test'}),
			],
		},

		// Overlapping errors
		{
			code: dedenter`
			/**
			\`\`\`typescript
			import type {ExcludeStrict, Sum} from 'type-fest';

			type A = Sum<1, '2'>;
			\`\`\`
			*/
			export type Test = string;
			`,
			errors: [
				invalidCodeblockErrorAt({line: 5, textBeforeStart: 'type A = ', target: 'Sum<1, \'2\'>'}),
				invalidCodeblockErrorAt({line: 5, textBeforeStart: 'type A = Sum<1, ', target: '\'2\''}),
			],
		},

		// Compiler options overrides
		{
			code: dedenter`
			/**
			\`\`\`ts
			// @noUnusedLocals: true
			const foo = {a: 1};
			\`\`\`
			*/
			export type T0 = string;
			`,
			errors: [
				invalidCodeblockErrorAt({line: 4, textBeforeStart: 'const ', target: 'foo'}),
			],
		},
	],
});

// Type mismatch tests
ruleTester.run('validate-jsdoc-codeblocks', validateJSDocCodeblocksRule, {
	valid: [
		exportTypeAndOption(jsdoc(fence(dedenter`
			type Foo = string;
			//=> string
		`))),

		// No twoslash comment at all
		exportTypeAndOption(jsdoc(fence(dedenter`
			const foo = 'bar';
		`))),

		// Twoslash comment at very first line
		exportTypeAndOption(jsdoc(fence(dedenter`
			//=> 'bar'
			const foo = 'bar';
		`))),

		// Object type collapsed into single line
		exportTypeAndOption(jsdoc(fence(dedenter`
			const foo = {a: 1, b: {c: 'c'}};
			//=> {a: number; b: {c: string}}
		`))),

		// Multiline type
		exportTypeAndOption(jsdoc(fence(dedenter`
			import type {Simplify} from 'type-fest';

			type Foo = {readonly a: number; readonly b?: number};
			type Bar = {c?: string; d: {readonly e: boolean}; e: string};
			type Baz = Simplify<Foo & Bar>;
			//=> {
			// 	readonly a: number;
			// 	readonly b?: number;
			// 	c?: string;
			// 	d: {
			// 		readonly e: boolean;
			// 	};
			// 	e: string;
			// }
		`))),

		// Quick info at 0th index
		exportTypeAndOption(jsdoc(fence(dedenter`
			let foo = 1;
			foo++;
			//=> number
		`))),

		// Quick info at some middle index
		exportTypeAndOption(jsdoc(fence(dedenter`
			const foo = 1 as string | number;
			//=> string | number
		`))),

		// Quick info at last index
		exportTypeAndOption(jsdoc(fence(dedenter`
			const foo = {n: 1}
			const bar = foo
				.n
			//=> number
		`))),

		// Double-quotes properly replaced
		exportTypeAndOption(jsdoc(fence(dedenter`
			import type {Simplify} from 'type-fest';

			type Foo = {a: 'abc'; b: 123; c: 'def'};
			type Bar = {x: {y: 'y'; z: 'z'}};
			type Baz = Simplify<Foo & Bar>;
			//=> {a: 'abc'; b: 123; c: 'def'; x: {y: 'y'; z: 'z'}}
		`))),
		exportTypeAndOption(jsdoc(fence(dedenter`
			type Foo = 'a"b"c';
			//=> 'a"b"c'

			type Bar = "d'e'f";
			//=> 'd\'e\'f'
		`))),

		// Space indentation properly replaced
		exportTypeAndOption(jsdoc(fence(dedenter`
			import type {Simplify} from 'type-fest';

			type Foo = {
				a: {
					ab: boolean;
					ac: {
						acd: string | number;
					};
				};
				e: [
					{
						fgh: false;
						ijk: {
							lmno: 'yes' | 'no';
						};
					},
					string,
					[
						'foo',
						'bar',
					],
				];
			};

			type Bar = Simplify<Foo>;
			//=> {
			// 	a: {
			// 		ab: boolean;
			// 		ac: {
			// 			acd: string | number;
			// 		};
			// 	};
			// 	e: [{
			// 		fgh: false;
			// 		ijk: {
			// 			lmno: 'yes' | 'no';
			// 		};
			// 	}, string, ['foo', 'bar']];
			// }
		`))),

		// Compiler options overrides
		exportTypeAndOption(jsdoc(fence(dedenter`
			// @exactOptionalPropertyTypes: false
			import type {AllExtend} from 'type-fest';

			type A = AllExtend<[1?, 2?, 3?], number>;
			//=> boolean
		`))),

		// Multiple `//=>`
		exportTypeAndOption(jsdoc(fence(dedenter`
			const foo = {a: true, b: false, c: {d: true}} as const;
			//=> {
			// 	readonly a: true;
			// 	readonly b: false;
			// 	readonly c: {
			// 		readonly d: true;
			// 	};
			// }
			const bar = ['a', 'b', 'c'] as const;
			//=> readonly ['a', 'b', 'c']
			const baz = new Set(bar);
			//=> Set<'a' | 'b' | 'c'>
		`))),

		// Indented code blocks
		exportTypeAndOption(jsdoc(
			'Note:',
			dedenter`
				1. First point
					\`\`\`ts
					import type {Subtract} from 'type-fest';
					type A = Subtract<1, 2>;
					//=> -1
					\`\`\`
				2. Second point
					\`\`\`ts
					import type {Sum} from 'type-fest';
					type A = Sum<1, 2>;
					//=> 3
					\`\`\`
			`,
		)),

		// Order of non-numbers in unions doesn't matter
		exportTypeAndOption(jsdoc(fence(dedenter`
			type Test = 'a' | 'b' | {x: ['c' | 'd' | 'e']; y: {z: 'f' | 'g' | 'h'}};

			type Valid = Test
			//=> 'b' | 'a' | {x: ['d' | 'c' | 'e']; y: {z: 'g' | 'h' | 'f'}}
			
			type Valid2 = Test
			//=> 'a' | {x: ['e' | 'd' | 'c']; y: {z: 'h' | 'g' | 'f'}} | 'b'
			
			type Valid3 = Test
			//=> {x: ['e' | 'c' | 'd']; y: {z: 'h' | 'f' | 'g'}} | 'b' | 'a'
		`))),

		// Numbers are sorted in unions
		exportTypeAndOption(jsdoc(fence(dedenter`
			import type {IntClosedRange} from 'type-fest';

			type ZeroToNine = IntClosedRange<0, 9>;
			//=> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
		`))),

		// Numbers in nested unions are sorted
		exportTypeAndOption(jsdoc(fence(dedenter`
			type Test = {w: 0 | 10 | 5; x: [2 | 16 | 4]; y: {z: 3 | 27 | 9}};
			//=> {w: 0 | 5 | 10; x: [2 | 4 | 16]; y: {z: 3 | 9 | 27}}
		`))),

		// Numbers in unions inside unions are sorted, non-numbers can be in any order
		exportTypeAndOption(jsdoc(fence(dedenter`
			type Test = {a: 'foo' | 27 | 1 | {b: 2 | 1 | 8 | 4} | 'baz' | 9 | 3 | 'bar'};

			type Valid = Test;
			//=> {a: 1 | 3 | 9 | 27 | {b: 1 | 2 | 4 | 8} | 'bar' | 'foo' | 'baz'}
			
			type Valid2 = Test;
			//=> {a: {b: 1 | 2 | 4 | 8} | 1 | 'foo' | 3 | 'baz' | 'bar' | 9 | 27}
			
			type Valid3 = Test;
			//=> {a: 'baz' | 'foo' | 1 | 3 | 9 | 'bar' | 27 | {b: 1 | 2 | 4 | 8}}
		`))),

		// Only numbers are sorted in unions, non-numbers can be in any order
		exportTypeAndOption(jsdoc(fence(dedenter`
			import type {ArrayElement} from 'type-fest';

			type Tuple1 = ArrayElement<[null, string, boolean, 1, 3, 0, -2, 4, 2, -1]>;
			//=> string | -2 | -1 | boolean | 0 | null | 1 | 2 | 3 | 4

			type Tuple2 = ArrayElement<[null, 1, 3, string, 0, -2, 4, 2, boolean, -1]>;
			//=> -2 | boolean | -1 | 0 | 1 | 2 | 3 | 4 | null | string
		`))),

		// Tuples are in single line
		exportTypeAndOption(jsdoc(fence(dedenter`
			import type {TupleOf} from 'type-fest';

			type RGB = TupleOf<3, number>;
			//=> [number, number, number]

			type TicTacToeBoard = TupleOf<3, TupleOf<3, 'X' | 'O' | null>>;
			//=> [['X' | 'O' | null, 'X' | 'O' | null, 'X' | 'O' | null], ['X' | 'O' | null, 'X' | 'O' | null, 'X' | 'O' | null], ['X' | 'O' | null, 'X' | 'O' | null, 'X' | 'O' | null]]
		`))),

		// Emojis are preserved
		exportTypeAndOption(jsdoc(fence(dedenter`
			type Pets = '🦄' | '🐶' | '🐇';
			//=> '🦄' | '🐶' | '🐇'
		`))),

		// `0` and `Infinity` verbosity levels
		exportTypeAndOption(jsdoc(fence(dedenter`
			type Test = {a: Pick<{b: Pick<{c: Pick<{d: 1}, 'd'>}, 'c'>}, 'b'>};

			type LevelZero = Test;
			//=> {a: {b: {c: {d: 1}}}}

			type LevelThree = Test;
			//=> {
			// 	a: Pick<{
			// 		b: Pick<{
			// 			c: Pick<{
			// 				d: 1;
			// 			}, 'd'>;
			// 		}, 'c'>;
			// 	}, 'b'>;
			// }
		`))),

		// Custom verbosity level
		// `0` and `Infinity` verbosity levels are still allowed
		{
			code: exportTypeAndOption(jsdoc(fence(dedenter`
				type Test = {a: Pick<{b: Pick<{c: Pick<{d: 1}, 'd'>}, 'c'>}, 'b'>};

				type LevelZero = Test;
				//=> {a: {b: {c: {d: 1}}}}

				type LevelOne = Test;
				//=> {a: {b: Pick<{c: Pick<{d: 1}, 'd'>}, 'c'>}}

				type LevelTwo = Test;
				//=> {a: {b: {c: Pick<{d: 1}, 'd'>}}}

				type LevelThree = Test;
				//=> {
				// 	a: Pick<{
				// 		b: Pick<{
				// 			c: Pick<{
				// 				d: 1;
				// 			}, 'd'>;
				// 		}, 'c'>;
				// 	}, 'b'>;
				// }
			`))),
			options: [{verbosityLevels: [1, 2]}],
		},

		// === Different types of quick info ===
		// Function
		exportTypeAndOption(jsdoc(fence(dedenter`
			declare function foo(a: string): {b: string; c: number};
			foo('a');
			//=> {b: string; c: number}
		`))),

		// Variable
		exportTypeAndOption(jsdoc(fence(dedenter`
			const foo = 'foo';
			//=> 'foo'

			let bar = {a: 1};
			//=> {a: number}

			var baz = true;
			//=> boolean
		`))),

		// Type Alias
		exportTypeAndOption(jsdoc(fence(dedenter`
			type Foo = {a: number};
			//=> {a: number}
		`))),

		// Interface
		exportTypeAndOption(jsdoc(fence(dedenter`
			interface Foo { foo: string; }
			//=> Foo
		`))),

		// Generic interface
		exportTypeAndOption(jsdoc(fence(dedenter`
			interface Foo<T> { foo: T; }
			//=> Foo<T>
		`))),

		// Parameter
		exportTypeAndOption(jsdoc(fence(dedenter`
			function foo(n: number) {
				n++;
				//=> number
			}
		`))),

		// Property
		exportTypeAndOption(jsdoc(fence(dedenter`
			const foo = {n: 1};
			foo
				.n++;
			//=> number
		`))),

		// Method
		exportTypeAndOption(jsdoc(fence(dedenter`
			class Foo {
				m() {
					return 'foo';
				}
			}

			const f = new Foo()
				.m();
			//=> string
		`))),

		// Constructor
		exportTypeAndOption(jsdoc(fence(dedenter`
			class Foo {
				constructor() {
					//=> Foo
					console.log('Foo');
				}
			}
		`))),

		// Enum
		exportTypeAndOption(jsdoc(fence(dedenter`
			enum Foo {}
			//=> Foo
		`))),

		// Const enum
		exportTypeAndOption(jsdoc(fence(dedenter`
			const enum Foo { A = 1 }
			//=> Foo
		`))),

		// Enum Member
		exportTypeAndOption(jsdoc(fence(dedenter`
			enum Foo { A }
			void Foo
			.A;
			//=> 0
		`))),
	],
	invalid: [
		// === Twoslash format errors ===

		// No space after `//=>`
		{
			code: dedenter`
				/**
				\`\`\`ts
				type Foo = string;
				//=>string
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 4,	textBeforeStart: '',	target: '//=>string'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				type Foo = string;
				//=> string
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// More than one space after `//=>`
		{
			code: dedenter`
				/**
				\`\`\`ts
				type Foo = string;
				//=>     string
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 4, textBeforeStart: '', target: '//=>     string'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				type Foo = string;
				//=> string
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Incorrect spacing
		{
			code: dedenter`
				/**
				\`\`\`ts
				type Foo = 'a' | 'b' | { c: 'd' } | 'e';
				//=> 'a'|'b'   |    { c :  'd' }|    'e'  
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 4, textBeforeStart: '', target: '//=> \'a\'|\'b\'   |    { c :  \'d\' }|    \'e\'  '}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				type Foo = 'a' | 'b' | { c: 'd' } | 'e';
				//=> 'a' | 'b' | {c: 'd'} | 'e'
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// No space in subsequent lines
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = {a: true, b: true, c: false, d: false, e: true} as const;
				//=> {
				//	readonly a: true;
				//	readonly b: true;
				//	readonly c: false;
				//	readonly d: false;
				//	readonly e: true;
				//}
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 4, textBeforeStart: '', endLine: 10, textBeforeEnd: '//}'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = {a: true, b: true, c: false, d: false, e: true} as const;
				//=> {
				// 	readonly a: true;
				// 	readonly b: true;
				// 	readonly c: false;
				// 	readonly d: false;
				// 	readonly e: true;
				// }
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Incorrect double quotes
		{
			code: dedenter`
				/**
				\`\`\`ts
				type Foo = ["a", {b: "c", d: {e: "f"}}, "g" | "h"];
				//=> ["a", {b: "c"; d: {e: "f"}}, "g" | "h"]
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 4, textBeforeStart: '', target: '//=> ["a", {b: "c"; d: {e: "f"}}, "g" | "h"]'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				type Foo = ["a", {b: "c", d: {e: "f"}}, "g" | "h"];
				//=> ['a', {b: 'c'; d: {e: 'f'}}, 'g' | 'h']
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Incorrect multiline tuples
		{
			code: dedenter`
				/**
				\`\`\`ts
				import type {TupleOf} from 'type-fest';

				type RGB = TupleOf<3, number>;
				//=> [
				// 	number,
				// 	number,
				// 	number,
				// ]
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 6, textBeforeStart: '', endLine: 10, textBeforeEnd: '// ]'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				import type {TupleOf} from 'type-fest';

				type RGB = TupleOf<3, number>;
				//=> [number, number, number]
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Multi line to single line
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = [{a: 1}] as const;
				//=> readonly [{
				// 	readonly a: 1;
				// }]
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 4, textBeforeStart: '', endLine: 6, textBeforeEnd: '// }]'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = [{a: 1}] as const;
				//=> readonly [{readonly a: 1}]
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Single line to multi line
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = {a: true, b: true, c: false, d: false, e: true} as const;
				//=> {readonly a: true; readonly b: true; readonly c: false; readonly d: false; readonly e: true}
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 4, textBeforeStart: '', target: '//=> {readonly a: true; readonly b: true; readonly c: false; readonly d: false; readonly e: true}'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = {a: true, b: true, c: false, d: false, e: true} as const;
				//=> {
				// 	readonly a: true;
				// 	readonly b: true;
				// 	readonly c: false;
				// 	readonly d: false;
				// 	readonly e: true;
				// }
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Incorrect order of numbers in unions
		{
			code: dedenter`
				/**
				\`\`\`ts
				type T1 = 5 | 4 | 3 | 2 | 1;
				//=> 5 | 4 | 1 | 2 | 3

				type T2 = 1 | 2 | 3 | 'a';
				//=> 2 | 'a' | 3 | 1
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 4, textBeforeStart: '', target: '//=> 5 | 4 | 1 | 2 | 3'}),
				incorrectTwoslashFormatErrorAt({line: 7, textBeforeStart: '', target: '//=> 2 | \'a\' | 3 | 1'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				type T1 = 5 | 4 | 3 | 2 | 1;
				//=> 1 | 2 | 3 | 4 | 5

				type T2 = 1 | 2 | 3 | 'a';
				//=> 1 | 'a' | 2 | 3
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Indented code blocks
		{
			code: dedenter`
				/**
				Note:
				1. First point
					\`\`\`ts
					const foo = {a: true, b: false, c: {d: true}};
					//=> {a: boolean; b: boolean;
					// c: {d: boolean};
					// }
					\`\`\`
				2. Second point
					\`\`\`ts
					const bar = ['a', 'b', 'c'] as const;
					//=> readonly [ 'a', 'b', 'c' ]
					const baz = new Set(bar);
					//=>Set< 'a'|'b'|'c' >
					\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 6, textBeforeStart: '\t', endLine: 8, textBeforeEnd: '\t// }'}),
				incorrectTwoslashFormatErrorAt({line: 13, textBeforeStart: '\t', target: '//=> readonly [ \'a\', \'b\', \'c\' ]'}),
				incorrectTwoslashFormatErrorAt({line: 15, textBeforeStart: '\t', target: '//=>Set< \'a\'|\'b\'|\'c\' >'}),
			],
			output: dedenter`
				/**
				Note:
				1. First point
					\`\`\`ts
					const foo = {a: true, b: false, c: {d: true}};
					//=> {a: boolean; b: boolean; c: {d: boolean}}
					\`\`\`
				2. Second point
					\`\`\`ts
					const bar = ['a', 'b', 'c'] as const;
					//=> readonly ['a', 'b', 'c']
					const baz = new Set(bar);
					//=> Set<'a' | 'b' | 'c'>
					\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Multiple `//=>`
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = {a: 'a', b: 'b'} as const;
				//=> {
				// 	readonly a: 'a';
				// 	readonly b: 'b';
				// }
				const bar = ['a', 'b', 'c'] as const;
				//=> readonly [
				// 	'a', 
				// 	'b', 
				// 	'c'
				// ]
				const baz = new Set(bar);
				//=> Set<
				// 	| 'a'
				// 	| 'b'
				// 	| 'c'
				// >
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 4, textBeforeStart: '', endLine: 7, textBeforeEnd: '// }'}),
				incorrectTwoslashFormatErrorAt({line: 9, textBeforeStart: '', endLine: 13, textBeforeEnd: '// ]'}),
				incorrectTwoslashFormatErrorAt({line: 15, textBeforeStart: '', endLine: 19, textBeforeEnd: '// >'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = {a: 'a', b: 'b'} as const;
				//=> {readonly a: 'a'; readonly b: 'b'}
				const bar = ['a', 'b', 'c'] as const;
				//=> readonly ['a', 'b', 'c']
				const baz = new Set(bar);
				//=> Set<'a' | 'b' | 'c'>
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Preserves the specified verbosity level during formatting fixes
		{
			code: dedenter`
				/**
				\`\`\`ts
				type Test = {a: Pick<{b: Pick<{c: Pick<{d: 'abracadabra'}, 'd'>}, 'c'>}, 'b'>};

				type LevelOne = Test;
				//=> {a: {b: Pick<{c: Pick<{d: 'abracadabra'}, 'd'>}, 'c'>}}

				type LevelTwo = Test;
				//=> {a: {b: {c: Pick<{d: "abracadabra"}, "d">}}}
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashFormatErrorAt({line: 6, textBeforeStart: '', target: '//=> {a: {b: Pick<{c: Pick<{d: \'abracadabra\'}, \'d\'>}, \'c\'>}}'}),
				incorrectTwoslashFormatErrorAt({line: 9, textBeforeStart: '', target: '//=> {a: {b: {c: Pick<{d: "abracadabra"}, "d">}}}'}),
			],
			options: [{verbosityLevels: [1, 2]}],
			output: dedenter`
				/**
				\`\`\`ts
				type Test = {a: Pick<{b: Pick<{c: Pick<{d: 'abracadabra'}, 'd'>}, 'c'>}, 'b'>};

				type LevelOne = Test;
				//=> {
				// 	a: {
				// 		b: Pick<{
				// 			c: Pick<{
				// 				d: 'abracadabra';
				// 			}, 'd'>;
				// 		}, 'c'>;
				// 	};
				// }

				type LevelTwo = Test;
				//=> {a: {b: {c: Pick<{d: 'abracadabra'}, 'd'>}}}
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// === Twoslash type errors ===

		// Incorrect type
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = 'bar';
				//=> 'baz'
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 4, textBeforeStart: '', target: '//=> \'baz\''}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = 'bar';
				//=> 'bar'
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Empty `//=>`
		{
			code: dedenter`
				/**
				\`\`\`ts
				type Foo = string;
				//=>
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 4, textBeforeStart: '', target: '//=>'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				type Foo = string;
				//=> string
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Broken type
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = {a: 1, b: 2};
				//=> {a
				
				const bar = {a: 1, b: 2};
				//=> {a: number
				// 	b:
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 4, textBeforeStart: '', target: '//=> {a'}),
				incorrectTwoslashTypeErrorAt({line: 7, textBeforeStart: '', endLine: 8, textBeforeEnd: '// 	b:'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = {a: 1, b: 2};
				//=> {a: number; b: number}

				const bar = {a: 1, b: 2};
				//=> {a: number; b: number}
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Multiline replace
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = {foo: true, bar: {baz: true, qux: [true, false]}} as const;
				//=> {
				// 	foo: true;
				// 	readonly bar: {
				// 		readonly baz: false;
				// 		readonly qux: [true, false];
				// 	};
				// }
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 4, textBeforeStart: '', endLine: 10, textBeforeEnd: '// }'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = {foo: true, bar: {baz: true, qux: [true, false]}} as const;
				//=> {
				// 	readonly foo: true;
				// 	readonly bar: {
				// 		readonly baz: true;
				// 		readonly qux: readonly [true, false];
				// 	};
				// }
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Multiline add missing lines
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = {foo: true, bar: {baz: true, qux: [true, false]}} as const;
				//=> {
				// 	readonly bar: {
				// 		readonly qux: readonly [true, false];
				// 	};
				// }
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 4, textBeforeStart: '', endLine: 8, textBeforeEnd: '// }'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = {foo: true, bar: {baz: true, qux: [true, false]}} as const;
				//=> {
				// 	readonly foo: true;
				// 	readonly bar: {
				// 		readonly baz: true;
				// 		readonly qux: readonly [true, false];
				// 	};
				// }
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Multiline remove extra lines
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = {bar: {qux: [true, false]}, quux: [null, undefined]} as const;
				//=> {
				// 	readonly foo: true;
				// 	readonly bar: {
				// 		readonly baz: true;
				// 		readonly qux: readonly [true, false];
				// 	};
				// 	readonly quux: readonly [null, undefined];
				// }
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 4, textBeforeStart: '', endLine: 11, textBeforeEnd: '// }'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = {bar: {qux: [true, false]}, quux: [null, undefined]} as const;
				//=> {
				// 	readonly bar: {
				// 		readonly qux: readonly [true, false];
				// 	};
				// 	readonly quux: readonly [null, undefined];
				// }
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Compiler options overrides
		{
			code: dedenter`
				/**
				\`\`\`ts
				// @exactOptionalPropertyTypes: false
				type Prettify<T> = {
					[P in keyof T]: T[P];
				};

				type T1 = Prettify<{a?: string; b?: number}>;
				//=> {
				// 	a?: string;
				// 	b?: number;
				// }
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 9, textBeforeStart: '', endLine: 12, textBeforeEnd: '// }'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				// @exactOptionalPropertyTypes: false
				type Prettify<T> = {
					[P in keyof T]: T[P];
				};

				type T1 = Prettify<{a?: string; b?: number}>;
				//=> {a?: string | undefined; b?: number | undefined}
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Incorrect type and improper formatting
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = {a: 'a', b: 'b'} as const;
				//=> {
				// 	a: 'a';
				// 	b: 'b';
				// }

				const bar = 'bar';
				//=>"baz"
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 4, textBeforeStart: '', endLine: 7, textBeforeEnd: '// }'}),
				incorrectTwoslashTypeErrorAt({line: 10, textBeforeStart: '', target: '//=>"baz"'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = {a: 'a', b: 'b'} as const;
				//=> {readonly a: 'a'; readonly b: 'b'}

				const bar = 'bar';
				//=> 'bar'
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Indented code blocks
		{
			code: dedenter`
				/**
				Note:
				1. First point
					\`\`\`ts
					const foo = {a: true, b: false, c: {d: true}} as const;
					//=> {
					// 	a?: false;
					// 	c?: {
					// 		d?: false;
					// 	};
					// }
					\`\`\`
				2. Second point
					\`\`\`ts
					const bar = ['a', 'b', 'c'] as const;
					//=> ['a', 'c']
					const baz = new Set(bar);
					//=> Set<string>
					\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 6, textBeforeStart: '\t', endLine: 11, textBeforeEnd: '\t// }'}),
				incorrectTwoslashTypeErrorAt({line: 16, textBeforeStart: '\t', target: '//=> [\'a\', \'c\']'}),
				incorrectTwoslashTypeErrorAt({line: 18, textBeforeStart: '\t', target: '//=> Set<string>'}),
			],
			output: dedenter`
				/**
				Note:
				1. First point
					\`\`\`ts
					const foo = {a: true, b: false, c: {d: true}} as const;
					//=> {
					// 	readonly a: true;
					// 	readonly b: false;
					// 	readonly c: {
					// 		readonly d: true;
					// 	};
					// }
					\`\`\`
				2. Second point
					\`\`\`ts
					const bar = ['a', 'b', 'c'] as const;
					//=> readonly ['a', 'b', 'c']
					const baz = new Set(bar);
					//=> Set<'a' | 'b' | 'c'>
					\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Multiple `//=>`
		{
			code: dedenter`
				/**
				\`\`\`ts
				const foo = {a: true, b: false, c: {d: true}} as const;
				//=>
				const bar = ['a', 'b', 'c'] as const;
				//=>
				const baz = new Set(bar);
				//=>
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 4, textBeforeStart: '', target: '//=>'}),
				incorrectTwoslashTypeErrorAt({line: 6, textBeforeStart: '', target: '//=>'}),
				incorrectTwoslashTypeErrorAt({line: 8, textBeforeStart: '', target: '//=>'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				const foo = {a: true, b: false, c: {d: true}} as const;
				//=> {
				// 	readonly a: true;
				// 	readonly b: false;
				// 	readonly c: {
				// 		readonly d: true;
				// 	};
				// }
				const bar = ['a', 'b', 'c'] as const;
				//=> readonly ['a', 'b', 'c']
				const baz = new Set(bar);
				//=> Set<'a' | 'b' | 'c'>
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Fixer suggests types at `Infinity` verbosity level
		{
			code: dedenter`
				/**
				\`\`\`ts
				type Test = {foo: Pick<{bar: Pick<{baz: string}, 'baz'>}, 'bar'>};
				//=>
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 4, textBeforeStart: '', target: '//=>'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				type Test = {foo: Pick<{bar: Pick<{baz: string}, 'baz'>}, 'bar'>};
				//=> {foo: {bar: {baz: string}}}
				\`\`\`
				*/
				export type T0 = string;
			`,
		},

		// Only `0` and `Infinity` verbosity levels are allowed by default
		{
			code: dedenter`
				/**
				\`\`\`ts
				type Test = {foo: Pick<{bar: Pick<{baz: string}, 'baz'>}, 'bar'>};
				//=> {foo: {bar: Pick<{baz: string}, 'baz'>}}
				\`\`\`
				*/
				export type T0 = string;
			`,
			errors: [
				incorrectTwoslashTypeErrorAt({line: 4, textBeforeStart: '', target: '//=> {foo: {bar: Pick<{baz: string}, \'baz\'>}}'}),
			],
			output: dedenter`
				/**
				\`\`\`ts
				type Test = {foo: Pick<{bar: Pick<{baz: string}, 'baz'>}, 'bar'>};
				//=> {foo: {bar: {baz: string}}}
				\`\`\`
				*/
				export type T0 = string;
			`,
		},
	],
});


================================================
FILE: media/readme.md
================================================
# Media

## Attribution

### Fireworks vector graphic

[Free Vectors via Vecteezy!](https://www.vecteezy.com)


================================================
FILE: package.json
================================================
{
	"name": "type-fest",
	"version": "5.5.0",
	"description": "A collection of essential TypeScript types",
	"license": "(MIT OR CC0-1.0)",
	"repository": "sindresorhus/type-fest",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"type": "module",
	"exports": {
		".": {
			"types": "./index.d.ts"
		},
		"./globals": {
			"types": "./source/globals/index.d.ts"
		}
	},
	"types": "./index.d.ts",
	"sideEffects": false,
	"engines": {
		"node": ">=20"
	},
	"scripts": {
		"test:tsc": "node --max-old-space-size=6144 ./node_modules/.bin/tsc",
		"test:tsd": "node --max-old-space-size=6144 ./node_modules/.bin/tsd",
		"test:xo": "node --max-old-space-size=6144 ./node_modules/.bin/xo --ignores=lint-processors/fixtures/**/*.d.ts",
		"test:linter": "node --test",
		"test": "run-p test:*"
	},
	"files": [
		"index.d.ts",
		"source",
		"license-mit",
		"license-cc0"
	],
	"keywords": [
		"typescript",
		"ts",
		"types",
		"utility",
		"util",
		"utilities",
		"omit",
		"merge",
		"json",
		"generics"
	],
	"dependencies": {
		"tagged-tag": "^1.0.0"
	},
	"devDependencies": {
		"@sindresorhus/tsconfig": "^8.0.1",
		"@typescript-eslint/parser": "^8.44.0",
		"eslint": "^9.35.0",
		"@typescript/vfs": "^1.6.1",
		"dedent": "^1.7.0",
		"expect-type": "^1.2.2",
		"npm-run-all2": "^8.0.4",
		"tsd": "^0.33.0",
		"typescript": "^5.9.2",
		"typescript-eslint": "^8.47.0",
		"xo": "^1.2.2"
	},
	"tsd": {
		"compilerOptions": {
			"noUnusedLocals": false
		}
	}
}


================================================
FILE: readme.md
================================================
<div align="center">
	<br>
	<br>
	<img src="media/logo.svg" alt="type-fest" height="300">
	<br>
	<br>
	<b>A collection of essential TypeScript types</b>
	<br>
	<br>
	<br>
	<br>
	<hr>
	<div align="center">
		<p>
			<p>
				<sup>
					<a href="https://github.com/sponsors/sindresorhus">Sindre Sorhus' open source work is supported by the community</a>
				</sup>
			</p>
			<sup>Special thanks to:</sup>
			<br>
			<br>
			<a href="https://nitric.io/?utm_campaign=github_repo&utm_medium=referral&utm_content=sindresorhus&utm_source=github">
				<div>
					<img width="230" src="https://sindresorhus.com/assets/thanks/nitric-logo.svg" alt="nitric logo">
				</div>
				<b>Effortless backends with infrastructure from code</b>
				<div>
					<sup>An open-source framework that supports any programming language, cloud provider, or deployment automation tool.</sup>
				</div>
			</a>
		</p>
	</div>
	<br>
	<hr>
</div>
<br>
<br>

[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://giphy.com/gifs/illustration-rainbow-unicorn-26AHG5KGFxSkUWw1i)
[![npm dependents](https://badgen.net/npm/dependents/type-fest)](https://www.npmjs.com/package/type-fest?activeTab=dependents)
[![npm downloads](https://badgen.net/npm/dt/type-fest)](https://www.npmjs.com/package/type-fest)

Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/main/CONTRIBUTING.md).

Either add this package as a dependency or copy-paste the needed types. No credit required. 👌

PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first.

**Help wanted with reviewing [proposals](https://github.com/sindresorhus/type-fest/issues) and [pull requests](https://github.com/sindresorhus/type-fest/pulls).**

## Install

```sh
npm install type-fest
```

*Requires TypeScript >=5.9, [ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c), and [`{strict: true}`](https://www.typescriptlang.org/tsconfig#strict) in your tsconfig.*

> [!NOTE]
> This readme shows the current development version. For docs about the latest version, see the [npm page](https://www.npmjs.com/package/type-fest).

*You may also like my [`ts-extras`](https://github.com/sindresorhus/ts-extras) package which provides runtime functions for some of these types.*

## Usage

```ts
import type {Except} from 'type-fest';

type Foo = {
	unicorn: string;
	rainbow: boolean;
};

type FooWithoutRainbow = Except<Foo, 'rainbow'>;
//=> {unicorn: string}
```

## API

Click the type names for complete docs.

### Basic

- [`Primitive`](source/primitive.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
- [`Class`](source/basic.d.ts) - Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
- [`Constructor`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
- [`AbstractClass`](source/basic.d.ts) - Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/2/classes.html#abstract-classes-and-members).
- [`AbstractConstructor`](source/basic.d.ts) - Matches an [`abstract class`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-2.html#abstract-construct-signatures) constructor.
- [`TypedArray`](source/typed-array.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
- [`ObservableLike`](source/globals/observable-like.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).
- [`LowercaseLetter`](source/characters.d.ts) - Matches any lowercase letter in the basic Latin alphabet (a-z).
- [`UppercaseLetter`](source/characters.d.ts) - Matches any uppercase letter in the basic Latin alphabet (A-Z).
- [`DigitCharacter`](source/characters.d.ts) - Matches any digit as a string ('0'-'9').
- [`Alphanumeric`](source/characters.d.ts) - Matches any lowercase letter (a-z), uppercase letter (A-Z), or digit ('0'-'9') in the basic Latin alphabet.

### Utilities

- [`EmptyObject`](source/empty-object.d.ts) - Represents a strictly empty plain object, the `{}` value.
- [`NonEmptyObject`](source/non-empty-object.d.ts) - Represents an object with at least 1 non-optional key.
- [`UnknownRecord`](source/unknown-record.d.ts) - Represents an object with `unknown` value. You probably want this instead of `{}`.
- [`UnknownArray`](source/unknown-array.d.ts) - Represents an array with `unknown` value.
- [`UnknownMap`](source/unknown-map.d.ts) - Represents a map with `unknown` key and value.
- [`UnknownSet`](source/unknown-set.d.ts) - Represents a set with `unknown` value.
- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys).
- [`Writable`](source/writable.d.ts) - Create a type that strips `readonly` from the given type. Inverse of `Readonly<T>`.
- [`WritableDeep`](source/writable-deep.d.ts) - Create a deeply mutable version of an `object`/`ReadonlyMap`/`ReadonlySet`/`ReadonlyArray` type. The inverse of `ReadonlyDeep<T>`. Use `Writable<T>` if you only need one level deep.
- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type.
- [`ObjectMerge`](source/object-merge.d.ts) - Merge two object types into a new object type, where keys from the second override keys from the first.
- [`MergeDeep`](source/merge-deep.d.ts) - Merge two objects or two arrays/tuples recursively into a new type.
- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys.
- [`OverrideProperties`](source/override-properties.d.ts) - Override only existing properties of the given type. Similar to `Merge`, but enforces that the original type has the properties you want to override.
- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys.
- [`RequireExactlyOne`](source/require-exactly-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more.
- [`RequireAllOrNone`](source/require-all-or-none.d.ts) - Create a type that requires all of the given keys or none of the given keys.
- [`RequireOneOrNone`](source/require-one-or-none.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more, or none of the given keys.
- [`SingleKeyObject`](source/single-key-object.d.ts) - Create a type that only accepts an object with a single key.
- [`RequiredDeep`](source/required-deep.d.ts) - Create a deeply required version of another type. Use [`Required<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#requiredtype) if you only need one level deep.
- [`PickDeep`](source/pick-deep.d.ts) - Pick properties from a deeply-nested object. Use [`Pick<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys) if you only need one level deep.
- [`OmitDeep`](source/omit-deep.d.ts) - Omit properties from a deeply-nested object. Use [`Omit<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys) if you only need one level deep.
- [`OmitIndexSignature`](source/omit-index-signature.d.ts) - Omit any index signatures from the given object type, leaving only explicitly defined properties.
- [`PickIndexSignature`](source/pick-index-signature.d.ts) - Pick only index signatures from the given object type, leaving out all explicitly defined properties.
- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype) if you only need one level deep.
- [`PartialOnUndefinedDeep`](source/partial-on-undefined-deep.d.ts) - Create a deep version of another type where all keys accepting `undefined` type are set to optional.
- [`UndefinedOnPartialDeep`](source/undefined-on-partial-deep.d.ts) - Create a deep version of another type where all optional keys are set to also accept `undefined`.
- [`UnwrapPartial`](source/unwrap-partial.d.ts) - Revert the `Partial` modifier on an object type.
- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype) if you only need one level deep.
- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729).
- [`Tagged`](source/tagged.d.ts) - Create a [tagged type](https://medium.com/@KevinBGreene/surviving-the-typescript-ecosystem-branding-and-type-tagging-6cf6e516523d) that can support [multiple tags](https://github.com/sindresorhus/type-fest/issues/665) and [per-tag metadata](https://medium.com/@ethanresnick/advanced-typescript-tagged-types-improved-with-type-level-metadata-5072fc125fcf). (This replaces the previous [`Opaque`](source/tagged.d.ts) type, which is now deprecated.)
- [`UnwrapTagged`](source/tagged.d.ts) - Get the untagged portion of a tagged type created with `Tagged`. (This replaces the previous [`UnwrapOpaque`](source/tagged.d.ts) type, which is now deprecated.)
- [`InvariantOf`](source/invariant-of.d.ts) - Create an [invariant type](https://basarat.gitbook.io/typescript/type-system/type-compatibility#footnote-invariance), which is a type that does not accept supertypes and subtypes.
- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional.
- [`SetReadonly`](source/set-readonly.d.ts) - Create a type that makes the given keys readonly.
- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required.
- [`SetRequiredDeep`](source/set-required-deep.d.ts) - Like `SetRequired` except it selects the keys deeply.
- [`SetNonNullable`](source/set-non-nullable.d.ts) - Create a type that makes the given keys non-nullable.
- [`SetNonNullableDeep`](source/set-non-nullable-deep.d.ts) - Create a type that makes the specified keys non-nullable (removes `null` and `undefined`), supports deeply nested key paths, and leaves all other keys unchanged.
- [`ValueOf`](source/value-of.d.ts) - Create a union of the given object's values, and optionally specify which keys to get the values from.
- [`ConditionalKeys`](source/conditional-keys.d.ts) - Extract keys from a shape where values extend the given `Condition` type.
- [`ConditionalPick`](source/conditional-pick.d.ts) - Like `Pick` except it selects properties from a shape where the values extend the given `Condition` type.
- [`ConditionalPickDeep`](source/conditional-pick-deep.d.ts) - Like `ConditionalPick` except that it selects the properties deeply.
- [`ConditionalExcept`](source/conditional-except.d.ts) - Like `Omit` except it removes properties from a shape where the values extend the given `Condition` type.
- [`UnionToIntersection`](source/union-to-intersection.d.ts) - Convert a union type to an intersection type.
- [`LiteralToPrimitive`](source/literal-to-primitive.d.ts) - Convert a [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types) to the [primitive type](source/primitive.d.ts) it belongs to.
- [`LiteralToPrimitiveDeep`](source/literal-to-primitive-deep.d.ts) - Like `LiteralToPrimitive` except it converts literal types inside an object or array deeply.
- [`Stringified`](source/stringified.d.ts) - Create a type with the keys of the given type changed to `string` type.
- [`IterableElement`](source/iterable-element.d.ts) - Get the element type of an `Iterable`/`AsyncIterable`. For example, `Array`, `Set`, `Map`, generator, stream, etc.
- [`Entry`](source/entry.d.ts) - Create a type that represents the type of an entry of a collection.
- [`Entries`](source/entries.d.ts) - Create a type that represents the type of the entries of a collection.
- [`SetReturnType`](source/set-return-type.d.ts) - Create a function type with a return type of your choice and the same parameters as the given function type.
- [`SetParameterType`](source/set-parameter-type.d.ts) - Create a function that replaces some parameters with the given parameters.
- [`Simplify`](source/simplify.d.ts) - Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
- [`SimplifyDeep`](source/simplify-deep.d.ts) - Deeply simplifies an object type.
- [`Get`](source/get.d.ts) - Get a deeply-nested property from an object using a key path, like [Lodash's `.get()`](https://lodash.com/docs/latest#get) function.
- [`KeyAsString`](source/key-as-string.d.ts) - Get keys of the given type as strings.
- [`Schema`](source/schema.d.ts) - Create a deep version of another object type where property values are recursively replaced into a given value type.
- [`Exact`](source/exact.d.ts) - Create a type that does not allow extra properties.
- [`KeysOfUnion`](source/keys-of-union.d.ts) - Create a union of all keys from a given type, even those exclusive to specific union members.
- [`OptionalKeysOf`](source/optional-keys-of.d.ts) - Extract all optional keys from the given type.
- [`HasOptionalKeys`](source/has-optional-keys.d.ts) - Create a `true`/`false` type depending on whether the given type has any optional fields.
- [`RequiredKeysOf`](source/required-keys-of.d.ts) - Extract all required keys from the given type.
- [`HasRequiredKeys`](source/has-required-keys.d.ts) - Create a `true`/`false` type depending on whether the given type has any required fields.
- [`ReadonlyKeysOf`](source/readonly-keys-of.d.ts) - Extract all readonly keys from the given type.
- [`HasReadonlyKeys`](source/has-readonly-keys.d.ts) - Create a `true`/`false` type depending on whether the given type has any readonly fields.
- [`WritableKeysOf`](source/writable-keys-of.d.ts) - Extract all writable (non-readonly) keys from the given type.
- [`HasWritableKeys`](source/has-writable-keys.d.ts) - Create a `true`/`false` type depending on whether the given type has any writable fields.
- [`Spread`](source/spread.d.ts) - Mimic the type inferred by TypeScript when merging two objects or two arrays/tuples using the spread syntax.
- [`IsEqual`](source/is-equal.d.ts) - Returns a boolean for whether the two given types are equal.
- [`TaggedUnion`](source/tagged-union.d.ts) - Create a union of types that share a common discriminant property.
- [`IntRange`](source/int-range.d.ts) - Generate a union of numbers (includes the start and excludes the end).
- [`IntClosedRange`](source/int-closed-range.d.ts) - Generate a union of numbers (includes the start and the end).
- [`ArrayIndices`](source/array-indices.d.ts) - Provides valid indices for a constant array or tuple.
- [`ArrayValues`](source/array-values.d.ts) - Provides all values for a constant array or tuple.
- [`ArraySplice`](source/array-splice.d.ts) - Create a new array type by adding or removing elements at a specified index range in the original array.
- [`ArrayTail`](source/array-tail.d.ts) - Extract the type of an array or tuple minus the first element.
- [`SetFieldType`](source/set-field-type.d.ts) - Create a type that changes the type of the given keys.
- [`Paths`](source/paths.d.ts) - Generate a union of all possible paths to properties in the given object.
- [`SharedUnionFields`](source/shared-union-fields.d.ts) - Create a type with shared fields from a union of object types.
- [`SharedUnionFieldsDeep`](source/shared-union-fields-deep.d.ts) - Create a type with shared fields from a union of object types, deeply traversing nested structures.
- [`AllUnionFields`](source/all-union-fields.d.ts) - Create a type with all fields from a union of object types.
- [`DistributedOmit`](source/distributed-omit.d.ts) - Omits keys from a type, distributing the operation over a union.
- [`DistributedPick`](source/distributed-pick.d.ts) - Picks keys from a type, distributing the operation over a union.
- [`And`](source/and.d.ts) - Returns a boolean for whether two given types are both `true`.
- [`Or`](source/or.d.ts) - Returns a boolean for whether either of two given types is `true`.
- [`Xor`](source/xor.d.ts) - Returns a boolean for whether only one of two given types is `true`.
- [`AndAll`](source/and-all.d.ts) - Returns a boolean for whether all of the given elements are `true`.
- [`OrAll`](source/or-all.d.ts) - Returns a boolean for whether any of the given elements is `true`.
- [`AllExtend`](source/all-extend.d.ts) - Returns a boolean for whether every element in an array type extends another type.
- [`SomeExtend`](source/some-extend.d.ts) - Returns a boolean for whether some element in an array type extends another type.
- [`NonEmptyTuple`](source/non-empty-tuple.d.ts) - Matches any non-empty tuple.
- [`NonEmptyString`](source/non-empty-string.d.ts) - Matches any non-empty string.
- [`FindGlobalType`](source/find-global-type.d.ts) - Tries to find the type of a global with the given name.
- [`FindGlobalInstanceType`](source/find-global-type.d.ts) - Tries to find one or more types from their globally-defined constructors.
- [`ConditionalSimplify`](source/conditional-simplify.d.ts) - Simplifies a type while including and/or excluding certain types from being simplified.
- [`ConditionalSimplifyDeep`](source/conditional-simplify-deep.d.ts) - Recursively simplifies a type while including and/or excluding certain types from being simplified.
- [`ExclusifyUnion`](source/exclusify-union.d.ts) - Ensure mutual exclusivity in object unions by adding other members’ keys as `?: never`.
- [`Optional`](source/optional.d.ts) - Create a type that represents either the value or `undefined`, while stripping `null` from the type.
- [`UnionMember`](source/union-member.d.ts) - Returns an arbitrary member of a union type.

### Type Guard

- [`If`](source/if.d.ts) - An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
- [`IsLiteral`](source/is-literal.d.ts) - Returns a boolean for whether the given type is a [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
- [`IsStringLiteral`](source/is-literal.d.ts) - Returns a boolean for whether the given type is a `string` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
- [`IsNumericLiteral`](source/is-literal.d.ts) - Returns a boolean for whether the given type is a `number` or `bigint` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
- [`IsBooleanLiteral`](source/is-literal.d.ts) - Returns a boolean for whether the given type is a `true` or `false` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
- [`IsSymbolLiteral`](source/is-literal.d.ts) - Returns a boolean for whether the given type is a `symbol` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
- [`IsAny`](source/is-any.d.ts) - Returns a boolean for whether the given type is `any`.
- [`IsNever`](source/is-never.d.ts) - Returns a boolean for whether the given type is `never`.
- [`IsUnknown`](source/is-unknown.d.ts) - Returns a boolean for whether the given type is `unknown`.
- [`IsEmptyObject`](source/empty-object.d.ts) - Returns a boolean for whether the type is strictly equal to an empty plain object, the `{}` value.
- [`IsNull`](source/is-null.d.ts) - Returns a boolean for whether the given type is `null`.
- [`IsUndefined`](source/is-undefined.d.ts) - Returns a boolean for whether the given type is `undefined`.
- [`IsTuple`](source/is-tuple.d.ts) - Returns a boolean for whether the given array is a tuple.
- [`IsUnion`](source/is-union.d.ts) - Returns a boolean for whether the given type is a union.
- [`IsLowercase`](source/is-lowercase.d.ts) - Returns a boolean for whether the given string literal is lowercase.
- [`IsUppercase`](source/is-uppercase.d.ts) - Returns a boolean for whether the given string literal is uppercase.
- [`IsOptional`](source/is-optional.d.ts) - Returns a boolean for whether the given type includes `undefined`.
- [`IsNullable`](source/is-nullable.d.ts) - Returns a boolean for whether the given type includes `null`.
- [`IsOptionalKeyOf`](source/is-optional-key-of.d.ts) - Returns a boolean for whether the given key is an optional key of type.
- [`IsRequiredKeyOf`](source/is-required-key-of.d.ts) - Returns a boolean for whether the given key is a required key of type.
- [`IsReadonlyKeyOf`](source/is-readonly-key-of.d.ts) - Returns a boolean for whether the given key is a readonly key of type.
- [`IsWritableKeyOf`](source/is-writable-key-of.d.ts) - Returns a boolean for whether the given key is a writable key of type.

### JSON

- [`Jsonify`](source/jsonify.d.ts) - Transform a type to one that is assignable to the `JsonValue` type.
- [`Jsonifiable`](source/jsonifiable.d.ts) - Matches a value that can be losslessly converted to JSON.
- [`JsonPrimitive`](source/json-value.d.ts) - Matches a JSON primitive.
- [`JsonObject`](source/json-value.d.ts) - Matches a JSON object.
- [`JsonArray`](source/json-value.d.ts) - Matches a JSON array.
- [`JsonValue`](source/json-value.d.ts) - Matches any valid JSON value.

### Structured clone

- [`StructuredCloneable`](source/structured-cloneable.d.ts) - Matches a value that can be losslessly cloned using `structuredClone`.

### Async

- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`.
- [`AsyncReturnType`](source/async-return-type.d.ts) - Unwrap the return type of a function that returns a `Promise`.
- [`Asyncify`](source/asyncify.d.ts) - Create an async version of the given function type.

### String

- [`Trim`](source/trim.d.ts) - Remove leading and trailing spaces from a string.
- [`Split`](source/split.d.ts) - Represents an array of strings split using a given character or character set.
- [`Words`](source/words.d.ts) - Represents an array of strings split using a heuristic for detecting words.
- [`Replace`](source/replace.d.ts) - Represents a string with some or all matches replaced by a replacement.
- [`StringSlice`](source/string-slice.d.ts) - Returns a string slice of a given range, just like `String#slice()`.
- [`StringRepeat`](source/string-repeat.d.ts) - Returns a new string which contains the specified number of copies of a given string, just like `String#repeat()`.
- [`RemovePrefix`](source/remove-prefix.d.ts) - Remove the specified prefix from the start of a string.

### Array

- [`Arrayable`](source/arrayable.d.ts) - Create a type that represents either the value or an array of the value.
- [`Includes`](source/includes.d.ts) - Returns a boolean for whether the given array includes the given item.
- [`Join`](source/join.d.ts) - Join an array of strings and/or numbers using the given string as a delimiter.
- [`ArraySlice`](source/array-slice.d.ts) - Returns an array slice of a given range, just like `Array#slice()`.
- [`ArrayElement`](source/array-element.d.ts) - Extracts the element type of an array or tuple.
- [`LastArrayElement`](source/last-array-element.d.ts) - Extract the type of the last element of an array.
- [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length. The `Array` prototype methods that manipulate its length are excluded from the resulting type.
- [`MultidimensionalArray`](source/multidimensional-array.d.ts) - Create a type that represents a multidimensional array of the given type and dimensions.
- [`MultidimensionalReadonlyArray`](source/multidimensional-readonly-array.d.ts) - Create a type that represents a multidimensional readonly array of the given type and dimensions.
- [`ReadonlyTuple`](source/readonly-tuple.d.ts) - Create a type that represents a read-only tuple of the given type and length.
- [`TupleToUnion`](source/tuple-to-union.d.ts) - Convert a tuple/array into a union type of its elements.
- [`UnionToTuple`](source/union-to-tuple.d.ts) - Convert a union type into an unordered tuple type of its elements.
- [`TupleToObject`](source/tuple-to-object.d.ts) - Transforms a tuple into an object, mapping each tuple index to its corresponding type as a key-value pair.
- [`TupleOf`](source/tuple-of.d.ts) - Create a tuple type of the specified length with elements of the specified type.
- [`SplitOnRestElement`](source/split-on-rest-element.d.ts) - Splits an array into three parts, where the first contains all elements before the rest element, the second is the [`rest`](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) element itself, and the third contains all elements after the rest element.
- [`ExtractRestElement`](source/extract-rest-element.d.ts) - Extract the [`rest`](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) element type from an array.
- [`ExcludeRestElement`](source/exclude-rest-element.d.ts) - Create a tuple with the [`rest`](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) element removed.
- [`ArrayReverse`](source/array-reverse.d.ts) - Reverse the order of elements in a tuple type.
- [`ArrayLength`](source/array-length.d.ts) - Return the length of an array. Equivalent to `T['length']` where `T` extends any array.

### Numeric

- [`PositiveInfinity`](source/numeric.d.ts) - Matches the hidden `Infinity` type.
- [`NegativeInfinity`](source/numeric.d.ts) - Matches the hidden `-Infinity` type.
- [`Finite`](source/numeric.d.ts) - A finite `number`.
- [`Integer`](source/numeric.d.ts) - A `number` that is an integer.
- [`Float`](source/numeric.d.ts) - A `number` that is not an integer.
- [`NegativeFloat`](source/numeric.d.ts) - A negative (`-∞ < x < 0`) `number` that is not an integer.
- [`Negative`](source/numeric.d.ts) - A negative `number`/`bigint` (`-∞ < x < 0`)
- [`NonNegative`](source/numeric.d.ts) - A non-negative `number`/`bigint` (`0 <= x < ∞`).
- [`NegativeInteger`](source/numeric.d.ts) - A negative (`-∞ < x < 0`) `number` that is an integer.
- [`NonNegativeInteger`](source/numeric.d.ts) - A non-negative (`0 <= x < ∞`) `number` that is an integer.
- [`IsNegative`](source/numeric.d.ts) - Returns a boolean for whether the given number is a negative number.
- [`IsFloat`](source/is-float.d.ts) - Returns a boolean for whether the given number is a float, like `1.5` or `-1.5`.
- [`IsInteger`](source/is-integer.d.ts) - Returns a boolean for whether the given number is an integer, like `-5`, `1.0` or `100`.
- [`GreaterThan`](source/greater-than.d.ts) - Returns a boolean for whether a given number is greater than another number.
- [`GreaterThanOrEqual`](source/greater-than-or-equal.d.ts) - Returns a boolean for whether a given number is greater than or equal to another number.
- [`LessThan`](source/less-than.d.ts) - Returns a boolean for whether a given number is less than another number.
- [`LessThanOrEqual`](source/less-than-or-equal.d.ts) - Returns a boolean for whether a given number is less than or equal to another number.
- [`Sum`](source/sum.d.ts) - Returns the sum of two numbers.
- [`Subtract`](source/subtract.d.ts) - Returns the difference between two numbers.

### Change case

- [`CamelCase`](source/camel-case.d.ts) - Convert a string literal to camel-case (`fooBar`).
- [`CamelCasedProperties`](source/camel-cased-properties.d.ts) - Convert object properties to camel-case (`fooBar`).
- [`CamelCasedPropertiesDeep`](source/camel-cased-properties-deep.d.ts) - Convert object properties to camel-case recursively (`fooBar`).
- [`KebabCase`](source/kebab-case.d.ts) - Convert a string literal to kebab-case (`foo-bar`).
- [`KebabCasedProperties`](source/kebab-cased-properties.d.ts) - Convert object properties to kebab-case (`foo-bar`).
- [`KebabCasedPropertiesDeep`](source/kebab-cased-properties-deep.d.ts) - Convert object properties to kebab-case recursively (`foo-bar`).
- [`PascalCase`](source/pascal-case.d.ts) - Convert a string literal to pascal-case (`FooBar`).
- [`PascalCasedProperties`](source/pascal-cased-properties.d.ts) - Convert object properties to pascal-case (`FooBar`).
- [`PascalCasedPropertiesDeep`](source/pascal-cased-properties-deep.d.ts) - Convert object properties to pascal-case recursively (`FooBar`).
- [`SnakeCase`](source/snake-case.d.ts) - Convert a string literal to snake-case (`foo_bar`).
- [`SnakeCasedProperties`](source/snake-cased-properties.d.ts) - Convert object properties to snake-case (`foo_bar`).
- [`SnakeCasedPropertiesDeep`](source/snake-cased-properties-deep.d.ts) - Convert object properties to snake-case recursively (`foo_bar`).
- [`ScreamingSnakeCase`](source/screaming-snake-case.d.ts) - Convert a string literal to screaming-snake-case (`FOO_BAR`).
- [`DelimiterCase`](source/delimiter-case.d.ts) - Convert a string literal to a custom string delimiter casing.
- [`DelimiterCasedProperties`](source/delimiter-cased-properties.d.ts) - Convert object properties to a custom string delimiter casing.
- [`DelimiterCasedPropertiesDeep`](source/delimiter-cased-properties-deep.d.ts) - Convert object properties to a custom string delimiter casing recursively.

### Miscellaneous

- [`GlobalThis`](source/global-this.d.ts) - Declare locally scoped properties on `globalThis`.
- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). It also includes support for [TypeScript Declaration Files](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html).
- [`TsConfigJson`](source/tsconfig-json.d.ts) - Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).

### Improved built-in

- [`ExtendsStrict`](source/extends-strict.d.ts) - A stricter, non-distributive version of `extends` for checking whether one type is assignable to another.
- [`ExtractStrict`](source/extract-strict.d.ts) - A stricter version of `Extract<T, U>` that ensures every member of `U` can successfully extract something from `T`.
- [`ExcludeStrict`](source/exclude-strict.d.ts) - A stricter version of `Exclude<T, U>` that ensures every member of `U` can successfully exclude something from `T`.
- [`ExcludeExactly`](source/exclude-exactly.d.ts) - A stricter version of `Exclude<T, U>` that excludes types only when they are exactly identical.

## Declined types

*If we decline a type addition, we will make sure to document the better solution here.*

- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The pull request author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider.
- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary<number>` vs `Record<string, number>`) from [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now.
- [`ExtractProperties` and `ExtractMethods`](https://github.com/sindresorhus/type-fest/pull/4) - The types violate the single responsibility principle. Instead, refine your types into more granular type hierarchies.
- [`Url2Json`](https://github.com/sindresorhus/type-fest/pull/262) - Inferring search parameters from a URL string is a cute idea, but not very useful in practice, since search parameters are usually dynamic and defined separately.
- [`Nullish`](https://github.com/sindresorhus/type-fest/pull/318) - The type only saves a couple of characters, not everyone knows what "nullish" means, and I'm also trying to [get away from `null`](https://github.com/sindresorhus/meta/discussions/7).
- [`TitleCase`](https://github.com/sindresorhus/type-fest/pull/303) - It's not solving a common need and is a better fit for a separate package.
- [`ExtendOr` and `ExtendAnd`](https://github.com/sindresorhus/type-fest/pull/247) - The benefits don't outweigh having to learn what they mean.
- [`PackageJsonExtras`](https://github.com/sindresorhus/type-fest/issues/371) - There are too many possible configurations that can be put into `package.json`. If you would like to extend `PackageJson` to support an additional configuration in your project, please see the *Extending existing types* section below.

## Alternative type names

*If you know one of our types by a different name, add it here for discovery.*

- `Prettify`- See [`Simplify`](source/simplify.d.ts)
- `Expand`- See [`Simplify`](source/simplify.d.ts)
- `PartialBy` - See [`SetOptional`](source/set-optional.d.ts)
- `RecordDeep`- See [`Schema`](source/schema.d.ts)
- `Mutable`- See [`Writable`](source/writable.d.ts)
- `RequireOnlyOne`, `OneOf` - See [`RequireExactlyOne`](source/require-exactly-one.d.ts)
- `AtMostOne` - See [`RequireOneOrNone`](source/require-one-or-none.d.ts)
- `AllKeys` - See [`KeysOfUnion`](source/keys-of-union.d.ts)
- `Branded` - See [`Tagged`](source/tagged.d.ts)
- `Opaque` - See [`Tagged`](source/tagged.d.ts)
- `SetElement` - See [`IterableElement`](source/iterable-element.d.ts)
- `SetEntry` - See [`IterableElement`](source/iterable-element.d.ts)
- `SetValues` - See [`IterableElement`](source/iterable-element.d.ts)
- `PickByTypes` - See [`ConditionalPick`](source/conditional-pick.d.ts)
- `HomomorphicOmit` - See [`Except`](source/except.d.ts)
- `IfAny`, `IfNever`, `If*` - See [`If`](source/if.d.ts)
- `Maybe`, `Option` - See [`Optional`](source/optional.d.ts)
- `MaybePromise` - See [`Promisable`](source/promisable.d.ts)
- `ReadonlyTuple` - See [`TupleOf`](source/tuple-of.d.ts)
- `LastOfUnion` - See [`UnionMember`](source/union-member.d.ts)
- `FirstOfUnion` - See [`UnionMember`](source/union-member.d.ts)

## Tips

### Extending existing types

- [`PackageJson`](source/package-json.d.ts) - There are a lot of tools that place extra configurations inside the `package.json` file. You can extend `PackageJson` to support these additional configurations.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBDAnmApnA3gBQIYGMDW2A5igFIDOEAdnNuXAEJ0o4HFmVUC+cAZlBBBwA5ElQBaXinIxhAbgCwAKFCRYCZGnQAZYFRgooPfoJHSANntmKlysWlaESFanAC8jZo-YuaAMgwLKwBhal5gIgB+AC44XX1DADpQqnCiLhsgA)

	```ts
	import type {PackageJson as BasePackageJson} from 'type-fest';
	import type {Linter} from 'eslint';

	type PackageJson = BasePackageJson & {eslintConfig?: Linter.Config};
	```
	</details>

### Related

- [typed-query-selector](https://github.com/g-plane/typed-query-selector) - Enhances `document.querySelector` and `document.querySelectorAll` with a template literal type that matches element types returned from an HTML element query selector.
- [`Linter.Config`](https://github.com/eslint/eslint/blob/main/lib/types/index.d.ts) - Definitions for the [ESLint configuration schema](https://eslint.org/docs/user-guide/configuring/language-options).

### Built-in types

There are many advanced types most users don't know about.


- [`Awaited<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#awaitedtype) - Extract the type of a value that a `Promise` resolves to.
  <details>
  <summary>
  	Example
  </summary>

  [Playground](https://www.typescriptlang.org/play/?#code/JYOwLgpgTgZghgYwgAgKoGdrIN4FgBQyyAkMACYBcyIArgLYBG0A3AUcSHHRFemFKADmrQiTiCe1ekygiiAXwJtkCADZx06NJigBBAA7AAytABuwJDmXENATxAJkMCGAQALDNAAUNHQElKKUZoAEoqAAUoAHs6YEwAHk8oAD4rUWJiAHpM5AAxF3dkMDcUXywyODA4J2i6IpLkCqqGDQgAOmssnIAVBsQwGjhVZGA6fVUIbnBK4CiQZFjBNzBkVSiogGtV4A2UYriKTuyVOb5kKAh0fVOUAF5kOAB3OGAV51c3LwAiTLhDTLKUEyABJsICAvIQnISF0TiAzk1qvcLlcbm0AFboOZeKFHHIXAZQeaI6EZAk0Ik4EaBACMABpqFxJF8AFJRNzzAAiUQgXwZ4kkAGYAAzIeSkxSiSXKMC2fQofIfCBkJLIe66Z6vZXxABKLgpIG6cogiR0BmMZgsEAA2l93u4kl8ALrJZIiZR2BxOGgOMCzeZuOAgMgTJKcypwLx-C1QcxIKhJc0mWNWhngwK0YJQEJpdj8Wy5mEIU4rQFURXuZWq+5PF4raPJuPte0eHQ+fxkXHpWG6GCQKBOApuITIQGNCMM2xRGgqIPIeWwKJQOqmOACadafr+rToGiFDSj-RNEfFUo6EbgaDwJB0vGz9wnhqImpRb2Es8QBlLhZwDYjuBkGQrz+kMyC6OEfjnBAACONCXGAm5aCAEDKsqHTpPIs4fMgXjQNE2aFhkxx4d+gbBqoQjWJKChKKIxbwqWZqGI2VpqtQECPNo0BJpaSA4tCZEhhAYYRu23HMbxn7IDSUJAA)

  ```ts
  interface User {
  	id: number;
  	name: string;
  	age: number;
  }

  class UserApiService {
  	async fetchUser(userId: number): Promise<User> {
  		// Fetch the user data from the database.
  		// The actual implementation might look like this:
  		// const response = await fetch('/api/user/${userId}');
  		// const data = response.json();
  		// return data;
  		return {
  			id: 1,
  			name: 'John Doe',
  			age: 30
  		};
  	}
  }

  type FetchedUser = Awaited<ReturnType<UserApiService['fetchUser']>>;

  async function handleUserData(apiService: UserApiService, userId: number) {
  	try {
  		const user: FetchedUser = await apiService.fetchUser(userId);
  		// After fetching user data, you can perform various actions such as updating the user interface,
  		// caching the data for future use, or making additional API requests as needed.
  	} catch (error) {
  		// Error handling
  	}
  }

  const userApiService = new UserApiService();
  handleUserData(userApiService, 1);
  ```

- [`Partial<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype) - Make all properties in `T` optional.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgHIHsAmEDC6QzADmyA3gLABQyycADnanALYQBcyAzmFKEQNxUaddFDAcQAV2YAjaIMoBfKlQQAbOJ05osEAIIMAQpOBrsUMkOR1eANziRkCfISKSoD4Pg4ZseAsTIALyW1DS0DEysHADkvvoMMQA0VsKi4sgAzAAMuVaKClY2wPaOknSYDrguADwA0sgQAB6QIJjaANYQAJ7oMDp+LsQAfAAUXd0cdUnI9mo+uv6uANp1ALoAlKHhyGAAFsCcAHTOAW4eYF4gyxNrwbNwago0ypRWp66jH8QcAApwYmAjxq8SWIy2FDCNDA3ToKFBQyIdR69wmfQG1TOhShyBgomQX3w3GQE2Q6IA8jIAFYQBBgI4TTiEs5bTQYsFInrLTbbHZOIlgZDlSqQABqj0kKBC3yINx6a2xfOQwH6o2FVXFaklwSCIUkbQghBAEEwENSfNOlykEGefNe5uhB2O6sgS3GPRmLogmslG1tLxUOKgEDA7hAuydtteryAA)

	```ts
	interface NodeConfig {
			appName: string;
			port: number;
	}

	class NodeAppBuilder {
			private configuration: NodeConfig = {
					appName: 'NodeApp',
					port: 3000
			};

			private updateConfig<Key extends keyof NodeConfig>(key: Key, value: NodeConfig[Key]) {
					this.configuration[key] = value;
			}

			config(config: Partial<NodeConfig>) {
					type NodeConfigKey = keyof NodeConfig;

					for (const key of Object.keys(config) as NodeConfigKey[]) {
							const updateValue = config[key];

							if (updateValue === undefined) {
									continue;
							}

							this.updateConfig(key, updateValue);
					}

					return this;
			}
	}

	// `Partial<NodeConfig>`` allows us to provide only a part of the
	// NodeConfig interface.
	new NodeAppBuilder().config({appName: 'ToDoApp'});
	```

	`Partial<T>` can be reverted with [`UnwrapPartial`](source/unwrap-partial.d.ts).
	</details>

- [`Required<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#requiredtype) - Make all properties in `T` required.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA)

	```ts
	interface ContactForm {
			email?: string;
			message?: string;
	}

	function submitContactForm(formData: Required<ContactForm>) {
			// Send the form data to the server.
	}

	submitContactForm({
			email: 'ex@mple.com',
			message: 'Hi! Could you tell me more about…',
	});

	// TypeScript error: missing property 'message'
	submitContactForm({
			email: 'ex@mple.com',
	});
	```
	</details>

- [`Readonly<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype) - Make all properties in `T` readonly.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA)

	```ts
	enum LogLevel {
			Off,
			Debug,
			Error,
			Fatal
	};

	interface LoggerConfig {
			name: string;
			level: LogLevel;
	}

	class Logger {
			config: Readonly<LoggerConfig>;

			constructor({name, level}: LoggerConfig) {
					this.config = {name, level};
					Object.freeze(this.config);
			}
	}

	const config: LoggerConfig = {
		name: 'MyApp',
		level: LogLevel.Debug
	};

	const logger = new Logger(config);

	// TypeScript Error: cannot assign to read-only property.
	logger.config.level = LogLevel.Error;

	// We are able to edit config variable as we please.
	config.level = LogLevel.Error;
	```
	</details>

- [`Pick<T, K>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys) - From `T`, pick a set of properties whose keys are in the union `K`.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA)

	```ts
	interface Article {
			title: string;
			thumbnail: string;
			content: string;
	}

	// Creates new type out of the `Article` interface composed
	// from the Articles' two properties: `title` and `thumbnail`.
	// `ArticlePreview = {title: string; thumbnail: string}`
	type ArticlePreview = Pick<Article, 'title' | 'thumbnail'>;

	// Render a list of articles using only title and description.
	function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement {
			const articles = document.createElement('div');

			for (const preview of previews) {
					// Append preview to the articles.
			}

			return articles;
	}

	const articles = renderArticlePreviews([
			{
				title: 'TypeScript tutorial!',
				thumbnail: '/assets/ts.jpg'
			}
	]);
	```
	</details>

- [`Record<K, T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type) - Construct a type with a set of properties `K` of type `T`.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA)

	```ts
	// Positions of employees in our company.
	type MemberPosition = 'intern' | 'developer' | 'tech-lead';

	// Interface describing properties of a single employee.
	interface Employee {
			firstName: string;
			lastName: string;
			yearsOfExperience: number;
	}

	// Create an object that has all possible `MemberPosition` values set as keys.
	// Those keys will store a collection of Employees of the same position.
	const team: Record<MemberPosition, Employee[]> = {
			intern: [],
			developer: [],
			'tech-lead': [],
	};

	// Our team has decided to help John with his dream of becoming Software Developer.
	team.intern.push({
		firstName: 'John',
		lastName: 'Doe',
		yearsOfExperience: 0
	});

	// `Record` forces you to initialize all of the property keys.
	// TypeScript Error: "tech-lead" property is missing
	const teamEmpty: Record<MemberPosition, null> = {
			intern: null,
			developer: null,
	};
	```
	</details>

- [`Exclude<T, U>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#excludetype-excludedunion) - Exclude from `T` those types that are assignable to `U`.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA)

	```ts
	interface ServerConfig {
		port: null | string | number;
	}

	type RequestHandler = (request: Request, response: Response) => void;

	// Exclude `null` type from `null | string | number`.
	// In case the port is equal to `null`, we will use default value.
	function getPortValue(port: Exclude<ServerConfig['port'], null>): number {
		if (typeof port === 'string') {
			return parseInt(port, 10);
		}

		return port;
	}

	function startServer(handler: RequestHandler, config: ServerConfig): void {
		const server = require('http').createServer(handler);

		const port = config.port === null ? 3000 : getPortValue(config.port);
		server.listen(port);
	}
	```
	</details>

- [`Extract<T, U>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#extracttype-union) - Extract from `T` those types that are assignable to `U`.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA)

	```ts
	declare function uniqueId(): number;

	const ID = Symbol('ID');

	interface Person {
		[ID]: number;
		name: string;
		age: number;
	}

	// Allows changing the person data as long as the property key is of string type.
	function changePersonData<
		Obj extends Person,
		Key extends Extract<keyof Person, string>,
		Value extends Obj[Key]
	> (obj: Obj, key: Key, value: Value): void {
		obj[key] = value;
	}

	// Tiny Andrew was born.
	const andrew = {
		[ID]: uniqueId(),
		name: 'Andrew',
		age: 0,
	};

	// Cool, we're fine with that.
	changePersonData(andrew, 'name', 'Pony');

	// Government didn't like the fact that you wanted to change your identity.
	changePersonData(andrew, ID, uniqueId());
	```
	</details>

- [`NonNullable<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#nonnullabletype) - Exclude `null` and `undefined` from `T`.
	<details>
	<summary>
			Example
	</summary>
	Works with <a href="https://www.typescriptlang.org/tsconfig#strictNullChecks"><code>strictNullChecks</code></a> set to <code>true</code>.

	[Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA)

	```ts
	type PortNumber = string | number | null;

	/** Part of a class definition that is used to build a server */
	class ServerBuilder {
			portNumber!: NonNullable<PortNumber>;

			port(this: ServerBuilder, port: PortNumber): ServerBuilder {
					if (port == null) {
							this.portNumber = 8000;
					} else {
							this.portNumber = port;
					}

					return this;
			}
	}

	const serverBuilder = new ServerBuilder();

	serverBuilder
			.port('8000')   // portNumber = '8000'
			.port(null)     // portNumber =  8000
			.port(3000);    // portNumber =  3000

	// TypeScript error
	serverBuilder.portNumber = null;
	```
	</details>

- [`Parameters<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#parameterstype) - Obtain the parameters of a function type in a tuple.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeyg
Download .txt
gitextract__kzp05im/

├── .editorconfig
├── .gitattributes
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── 1 new type.yml
│   │   ├── 2 bug report.yml
│   │   └── 3 enhancement.md
│   ├── contributing.md
│   ├── dependabot.yml
│   ├── funding.yml
│   ├── pull_request_template.md
│   ├── security.md
│   └── workflows/
│       ├── claude-code-review.yml
│       ├── claude.yml
│       ├── main.yml
│       └── ts-canary.yml
├── .gitignore
├── .npmrc
├── CLAUDE.md
├── index.d.ts
├── license-cc0
├── license-mit
├── lint-processors/
│   ├── fixtures/
│   │   └── eslint.config.js
│   ├── jsdoc-codeblocks.js
│   └── jsdoc-codeblocks.test.js
├── lint-rules/
│   ├── import-path.js
│   ├── import-path.test.js
│   ├── require-export.js
│   ├── require-export.test.js
│   ├── require-exported-types.js
│   ├── require-exported-types.test.js
│   ├── source-files-extension.js
│   ├── source-files-extension.test.js
│   ├── test-utils.js
│   ├── validate-jsdoc-codeblocks.js
│   └── validate-jsdoc-codeblocks.test.js
├── media/
│   ├── logo.sketch
│   └── readme.md
├── package.json
├── readme.md
├── source/
│   ├── all-extend.d.ts
│   ├── all-union-fields.d.ts
│   ├── and-all.d.ts
│   ├── and.d.ts
│   ├── array-element.d.ts
│   ├── array-indices.d.ts
│   ├── array-length.d.ts
│   ├── array-reverse.d.ts
│   ├── array-slice.d.ts
│   ├── array-splice.d.ts
│   ├── array-tail.d.ts
│   ├── array-values.d.ts
│   ├── arrayable.d.ts
│   ├── async-return-type.d.ts
│   ├── asyncify.d.ts
│   ├── basic.d.ts
│   ├── camel-case.d.ts
│   ├── camel-cased-properties-deep.d.ts
│   ├── camel-cased-properties.d.ts
│   ├── characters.d.ts
│   ├── conditional-except.d.ts
│   ├── conditional-keys.d.ts
│   ├── conditional-pick-deep.d.ts
│   ├── conditional-pick.d.ts
│   ├── conditional-simplify-deep.d.ts
│   ├── conditional-simplify.d.ts
│   ├── delimiter-case.d.ts
│   ├── delimiter-cased-properties-deep.d.ts
│   ├── delimiter-cased-properties.d.ts
│   ├── distributed-omit.d.ts
│   ├── distributed-pick.d.ts
│   ├── empty-object.d.ts
│   ├── entries.d.ts
│   ├── entry.d.ts
│   ├── exact.d.ts
│   ├── except.d.ts
│   ├── exclude-exactly.d.ts
│   ├── exclude-rest-element.d.ts
│   ├── exclude-strict.d.ts
│   ├── exclusify-union.d.ts
│   ├── extends-strict.d.ts
│   ├── extract-rest-element.d.ts
│   ├── extract-strict.d.ts
│   ├── find-global-type.d.ts
│   ├── fixed-length-array.d.ts
│   ├── get.d.ts
│   ├── global-this.d.ts
│   ├── globals/
│   │   ├── index.d.ts
│   │   └── observable-like.d.ts
│   ├── greater-than-or-equal.d.ts
│   ├── greater-than.d.ts
│   ├── has-optional-keys.d.ts
│   ├── has-readonly-keys.d.ts
│   ├── has-required-keys.d.ts
│   ├── has-writable-keys.d.ts
│   ├── if-any.d.ts
│   ├── if-empty-object.d.ts
│   ├── if-never.d.ts
│   ├── if-null.d.ts
│   ├── if-unknown.d.ts
│   ├── if.d.ts
│   ├── includes.d.ts
│   ├── int-closed-range.d.ts
│   ├── int-range.d.ts
│   ├── internal/
│   │   ├── array.d.ts
│   │   ├── characters.d.ts
│   │   ├── enforce-optional.d.ts
│   │   ├── index.d.ts
│   │   ├── keys.d.ts
│   │   ├── numeric.d.ts
│   │   ├── object.d.ts
│   │   ├── string.d.ts
│   │   ├── tuple.d.ts
│   │   └── type.d.ts
│   ├── invariant-of.d.ts
│   ├── is-any.d.ts
│   ├── is-equal.d.ts
│   ├── is-float.d.ts
│   ├── is-integer.d.ts
│   ├── is-literal.d.ts
│   ├── is-lowercase.d.ts
│   ├── is-never.d.ts
│   ├── is-null.d.ts
│   ├── is-nullable.d.ts
│   ├── is-optional-key-of.d.ts
│   ├── is-optional.d.ts
│   ├── is-readonly-key-of.d.ts
│   ├── is-required-key-of.d.ts
│   ├── is-tuple.d.ts
│   ├── is-undefined.d.ts
│   ├── is-union.d.ts
│   ├── is-unknown.d.ts
│   ├── is-uppercase.d.ts
│   ├── is-writable-key-of.d.ts
│   ├── iterable-element.d.ts
│   ├── join.d.ts
│   ├── json-value.d.ts
│   ├── jsonifiable.d.ts
│   ├── jsonify.d.ts
│   ├── kebab-case.d.ts
│   ├── kebab-cased-properties-deep.d.ts
│   ├── kebab-cased-properties.d.ts
│   ├── key-as-string.d.ts
│   ├── keys-of-union.d.ts
│   ├── last-array-element.d.ts
│   ├── less-than-or-equal.d.ts
│   ├── less-than.d.ts
│   ├── literal-to-primitive-deep.d.ts
│   ├── literal-to-primitive.d.ts
│   ├── literal-union.d.ts
│   ├── merge-deep.d.ts
│   ├── merge-exclusive.d.ts
│   ├── merge.d.ts
│   ├── multidimensional-array.d.ts
│   ├── multidimensional-readonly-array.d.ts
│   ├── non-empty-object.d.ts
│   ├── non-empty-string.d.ts
│   ├── non-empty-tuple.d.ts
│   ├── numeric.d.ts
│   ├── object-merge.d.ts
│   ├── omit-deep.d.ts
│   ├── omit-index-signature.d.ts
│   ├── opaque.d.ts
│   ├── optional-keys-of.d.ts
│   ├── optional.d.ts
│   ├── or-all.d.ts
│   ├── or.d.ts
│   ├── override-properties.d.ts
│   ├── package-json.d.ts
│   ├── partial-deep.d.ts
│   ├── partial-on-undefined-deep.d.ts
│   ├── pascal-case.d.ts
│   ├── pascal-cased-properties-deep.d.ts
│   ├── pascal-cased-properties.d.ts
│   ├── paths.d.ts
│   ├── pick-deep.d.ts
│   ├── pick-index-signature.d.ts
│   ├── primitive.d.ts
│   ├── promisable.d.ts
│   ├── readonly-deep.d.ts
│   ├── readonly-keys-of.d.ts
│   ├── readonly-tuple.d.ts
│   ├── remove-prefix.d.ts
│   ├── replace.d.ts
│   ├── require-all-or-none.d.ts
│   ├── require-at-least-one.d.ts
│   ├── require-exactly-one.d.ts
│   ├── require-one-or-none.d.ts
│   ├── required-deep.d.ts
│   ├── required-keys-of.d.ts
│   ├── schema.d.ts
│   ├── screaming-snake-case.d.ts
│   ├── set-field-type.d.ts
│   ├── set-non-nullable-deep.d.ts
│   ├── set-non-nullable.d.ts
│   ├── set-optional.d.ts
│   ├── set-parameter-type.d.ts
│   ├── set-readonly.d.ts
│   ├── set-required-deep.d.ts
│   ├── set-required.d.ts
│   ├── set-return-type.d.ts
│   ├── shared-union-fields-deep.d.ts
│   ├── shared-union-fields.d.ts
│   ├── simplify-deep.d.ts
│   ├── simplify.d.ts
│   ├── single-key-object.d.ts
│   ├── snake-case.d.ts
│   ├── snake-cased-properties-deep.d.ts
│   ├── snake-cased-properties.d.ts
│   ├── some-extend.d.ts
│   ├── split-on-rest-element.d.ts
│   ├── split.d.ts
│   ├── spread.d.ts
│   ├── string-repeat.d.ts
│   ├── string-slice.d.ts
│   ├── stringified.d.ts
│   ├── structured-cloneable.d.ts
│   ├── subtract.d.ts
│   ├── sum.d.ts
│   ├── tagged-union.d.ts
│   ├── tagged.d.ts
│   ├── trim.d.ts
│   ├── tsconfig-json.d.ts
│   ├── tuple-of.d.ts
│   ├── tuple-to-object.d.ts
│   ├── tuple-to-union.d.ts
│   ├── typed-array.d.ts
│   ├── undefined-on-partial-deep.d.ts
│   ├── union-member.d.ts
│   ├── union-to-intersection.d.ts
│   ├── union-to-tuple.d.ts
│   ├── unknown-array.d.ts
│   ├── unknown-map.d.ts
│   ├── unknown-record.d.ts
│   ├── unknown-set.d.ts
│   ├── unwrap-partial.d.ts
│   ├── value-of.d.ts
│   ├── words.d.ts
│   ├── writable-deep.d.ts
│   ├── writable-keys-of.d.ts
│   ├── writable.d.ts
│   └── xor.d.ts
├── test-d/
│   ├── abstract-class.ts
│   ├── all-extend.ts
│   ├── all-union-fields.ts
│   ├── and-all.ts
│   ├── and.ts
│   ├── array-element.ts
│   ├── array-indices.ts
│   ├── array-length.ts
│   ├── array-reverse.ts
│   ├── array-slice.ts
│   ├── array-splice.ts
│   ├── array-tail.ts
│   ├── array-values.ts
│   ├── arrayable.ts
│   ├── async-return-type.ts
│   ├── asyncify.ts
│   ├── camel-case.ts
│   ├── camel-cased-properties-deep.ts
│   ├── camel-cased-properties.ts
│   ├── class.ts
│   ├── conditional-except.ts
│   ├── conditional-keys.ts
│   ├── conditional-pick-deep.ts
│   ├── conditional-pick.ts
│   ├── conditional-simplify-deep.ts
│   ├── conditional-simplify.ts
│   ├── delimiter-case.ts
│   ├── delimiter-cased-properties-deep.ts
│   ├── delimiter-cased-properties.ts
│   ├── distributed-omit.ts
│   ├── distributed-pick.ts
│   ├── empty-object.ts
│   ├── entries.ts
│   ├── exact.ts
│   ├── except.ts
│   ├── exclude-exactly.ts
│   ├── exclude-rest-element.ts
│   ├── exclude-strict.ts
│   ├── exclusify-union.ts
│   ├── extends-strict.ts
│   ├── extract-rest-element.ts
│   ├── extract-strict.ts
│   ├── find-global-type.ts
│   ├── fixed-length-array.ts
│   ├── get.ts
│   ├── global-this.ts
│   ├── greater-than-or-equal.ts
│   ├── greater-than.ts
│   ├── has-optional-keys.ts
│   ├── has-readonly-keys.ts
│   ├── has-required-keys.ts
│   ├── has-writable-keys.ts
│   ├── if-any.ts
│   ├── if-never.ts
│   ├── if-unknown.ts
│   ├── if.ts
│   ├── includes.ts
│   ├── int-closed-range.ts
│   ├── int-range.ts
│   ├── internal/
│   │   ├── apply-default-options.ts
│   │   ├── collapse-literals-in-union.ts
│   │   ├── collapse-rest-element.ts
│   │   ├── enforce-optional.ts
│   │   ├── has-multiple-call-signatures.ts
│   │   ├── homomorphic-pick.ts
│   │   ├── if-not-any-or-never.ts
│   │   ├── is-array-readonly.ts
│   │   ├── is-not-false.ts
│   │   ├── is-number-like.ts
│   │   ├── is-numeric.ts
│   │   ├── is-whitespace.ts
│   │   ├── normalized-keys.ts
│   │   ├── not.ts
│   │   ├── number-absolute.ts
│   │   ├── object-value.ts
│   │   ├── readonly-keys-of-union.ts
│   │   ├── require-none.ts
│   │   ├── tuple-max.ts
│   │   ├── tuple-min.ts
│   │   ├── union-max.ts
│   │   ├── union-min.ts
│   │   └── value-of-union.ts
│   ├── invariant-of.ts
│   ├── is-any.ts
│   ├── is-equal.ts
│   ├── is-float.ts
│   ├── is-integer.ts
│   ├── is-literal.ts
│   ├── is-lowercase.ts
│   ├── is-never.ts
│   ├── is-null.ts
│   ├── is-nullable.ts
│   ├── is-optional-key-of.ts
│   ├── is-optional.ts
│   ├── is-readonly-key-of.ts
│   ├── is-required-key-of.ts
│   ├── is-tuple.ts
│   ├── is-undefined.ts
│   ├── is-union.ts
│   ├── is-unknown.ts
│   ├── is-uppercase.ts
│   ├── is-writable-key-of.ts
│   ├── iterable-element.ts
│   ├── join.ts
│   ├── jsonifiable.ts
│   ├── jsonify.ts
│   ├── kebab-case.ts
│   ├── kebab-cased-properties-deep.ts
│   ├── kebab-cased-properties.ts
│   ├── key-as-string.ts
│   ├── keys-of-union.ts
│   ├── last-array-element.ts
│   ├── less-than-or-equal.ts
│   ├── less-than.ts
│   ├── literal-to-primitive-deep.ts
│   ├── literal-to-primitive.ts
│   ├── merge-deep.ts
│   ├── merge-exclusive.ts
│   ├── merge.ts
│   ├── multidimensional-array.ts
│   ├── multidimensional-readonly-array.ts
│   ├── non-empty-object.ts
│   ├── non-empty-string.ts
│   ├── non-empty-tuple.ts
│   ├── numeric.ts
│   ├── object-merge.ts
│   ├── observable-like.ts
│   ├── omit-deep.ts
│   ├── omit-index-signature.ts
│   ├── opaque.ts
│   ├── optional-keys-of.ts
│   ├── optional.ts
│   ├── or-all.ts
│   ├── or.ts
│   ├── override-properties.ts
│   ├── package-json.ts
│   ├── partial-deep.ts
│   ├── partial-on-undefined-deep.ts
│   ├── pascal-case.ts
│   ├── pascal-cased-properties-deep.ts
│   ├── pascal-cased-properties.ts
│   ├── paths.ts
│   ├── pick-deep.ts
│   ├── pick-index-signature.ts
│   ├── promisable.ts
│   ├── readonly-deep.ts
│   ├── readonly-keys-of.ts
│   ├── readonly-tuple.ts
│   ├── remove-prefix.ts
│   ├── replace.ts
│   ├── require-all-or-none.ts
│   ├── require-at-least-one.ts
│   ├── require-exactly-one.ts
│   ├── require-one-or-none.ts
│   ├── required-deep.ts
│   ├── required-keys-of.ts
│   ├── schema.ts
│   ├── screaming-snake-case.ts
│   ├── set-field-type.ts
│   ├── set-non-nullable-deep.ts
│   ├── set-non-nullable.ts
│   ├── set-optional.ts
│   ├── set-parameter-type.ts
│   ├── set-readonly.ts
│   ├── set-required-deep.ts
│   ├── set-required.ts
│   ├── set-return-type.ts
│   ├── shared-union-fields-deep.ts
│   ├── shared-union-fields.ts
│   ├── simplify-deep.ts
│   ├── simplify.ts
│   ├── single-key-object.ts
│   ├── snake-case.ts
│   ├── snake-cased-properties-deep.ts
│   ├── snake-cased-properties.ts
│   ├── some-extend.ts
│   ├── split-on-rest-element.ts
│   ├── split.ts
│   ├── spread.ts
│   ├── string-repeat.ts
│   ├── string-slice.ts
│   ├── stringified.ts
│   ├── structured-cloneable.ts
│   ├── subtract.ts
│   ├── sum.ts
│   ├── tagged-union.ts
│   ├── trim.ts
│   ├── ts41.ts
│   ├── tsconfig-json.ts
│   ├── tuple-of.ts
│   ├── tuple-to-object.ts
│   ├── tuple-to-union.ts
│   ├── undefined-on-partial-deep.ts
│   ├── union-member.ts
│   ├── union-to-intersection.ts
│   ├── union-to-tuple.ts
│   ├── unknown-array.ts
│   ├── unknown-map.ts
│   ├── unknown-record.ts
│   ├── unknown-set.ts
│   ├── unwrap-partial.ts
│   ├── value-of.ts
│   ├── words.ts
│   ├── writable-deep.ts
│   ├── writable-keys-of.ts
│   ├── writable.ts
│   └── xor.ts
├── tsconfig.json
└── xo.config.js
Download .txt
SYMBOL INDEX (1372 symbols across 342 files)

FILE: lint-processors/fixtures/eslint.config.js
  method create (line 6) | create(context) {

FILE: lint-processors/jsdoc-codeblocks.js
  constant CODEBLOCK_REGEX (line 8) | const CODEBLOCK_REGEX = /(?<openingFence>(?<indent>^[ \t]*)```(?:ts|type...
  function indentsUptoIndex (line 21) | function indentsUptoIndex(text, index, indent) {
  method preprocess (line 51) | preprocess(text, filename) {
  method postprocess (line 111) | postprocess(messages, filename) {

FILE: lint-rules/import-path.js
  method create (line 17) | create(context) {

FILE: lint-rules/require-export.js
  method create (line 15) | create(context) {

FILE: lint-rules/require-exported-types.js
  method create (line 31) | create(context) {

FILE: lint-rules/source-files-extension.js
  method create (line 17) | create(context) {

FILE: lint-rules/validate-jsdoc-codeblocks.js
  constant CODEBLOCK_REGEX (line 5) | const CODEBLOCK_REGEX = /(?<openingFence>```(?:ts|typescript)?\n)(?<code...
  constant FILENAME (line 6) | const FILENAME = 'example-codeblock.ts';
  constant TWOSLASH_COMMENT (line 7) | const TWOSLASH_COMMENT = '//=>';
  function parseCompilerOptions (line 34) | function parseCompilerOptions(code) {
  function getJSDocNode (line 63) | function getJSDocNode(sourceCode, node) {
  method create (line 108) | create(context) {
  function getLeftmostQuickInfo (line 205) | function getLeftmostQuickInfo(env, line, lineOffset, verbosityLevel) {
  function extractTypeFromQuickInfo (line 214) | function extractTypeFromQuickInfo(quickInfo) {
  function normalizeType (line 247) | function normalizeType(type, onlySortNumbers = false) {
  function getCommentForType (line 310) | function getCommentForType(type) {
  function reportTypeMismatch (line 324) | function reportTypeMismatch({context, messageId, start, end, data, fix}) {
  function validateTwoslashTypes (line 338) | function validateTwoslashTypes(context, env, code, codeStartIndex) {

FILE: source/all-extend.d.ts
  type AllExtendOptions (line 12) | type AllExtendOptions = {
  type DefaultAllExtendOptions (line 53) | type DefaultAllExtendOptions = {
  type AllExtend (line 103) | type AllExtend<TArray extends UnknownArray, Type, Options extends AllExt...
  type _AllExtend (line 106) | type _AllExtend<TArray extends UnknownArray, Type, Options extends Requi...

FILE: source/all-union-fields.d.ts
  type AllUnionFields (line 71) | type AllUnionFields<Union> =

FILE: source/and-all.d.ts
  type AndAll (line 74) | type AndAll<T extends readonly boolean[]> = AllExtend<T, true>;

FILE: source/and.d.ts
  type And (line 80) | type And<A extends boolean, B extends boolean> = AndAll<[A, B]>;

FILE: source/array-element.d.ts
  type ArrayElement (line 41) | type ArrayElement<T> =

FILE: source/array-indices.d.ts
  type ArrayIndices (line 22) | type ArrayIndices<Element extends readonly unknown[]> =

FILE: source/array-length.d.ts
  type ArrayLength (line 34) | type ArrayLength<T extends readonly unknown[]> = T['length'];

FILE: source/array-reverse.d.ts
  type ArrayReverse (line 54) | type ArrayReverse<TArray extends UnknownArray> = IfNotAnyOrNever<TArray,
  type _ArrayReverse (line 61) | type _ArrayReverse<

FILE: source/array-slice.d.ts
  type ArraySlice (line 59) | type ArraySlice<
  type _ArraySlice (line 81) | type _ArraySlice<
  type VariableLengthArraySliceHelper (line 91) | type VariableLengthArraySliceHelper<
  type ArraySliceHelper (line 104) | type ArraySliceHelper<
  type ArraySliceByPositiveIndex (line 123) | type ArraySliceByPositiveIndex<

FILE: source/array-splice.d.ts
  type SplitFixedArrayByIndex (line 10) | type SplitFixedArrayByIndex<T extends UnknownArray, SplitIndex extends n...
  type SplitVariableArrayByIndex (line 22) | type SplitVariableArrayByIndex<T extends UnknownArray,
  type SplitArrayByIndex (line 59) | type SplitArrayByIndex<T extends UnknownArray, SplitIndex extends number> =
  type ArraySplice (line 92) | type ArraySplice<

FILE: source/array-tail.d.ts
  type ArrayTail (line 54) | type ArrayTail<TArray extends UnknownArray> = IfNotAnyOrNever<TArray,
  type _ArrayTail (line 62) | type _ArrayTail<TArray extends UnknownArray> = TArray extends readonly [...

FILE: source/array-values.d.ts
  type ArrayValues (line 22) | type ArrayValues<T extends readonly unknown[]> = T[number];

FILE: source/arrayable.d.ts
  type Arrayable (line 26) | type Arrayable<T> =

FILE: source/async-return-type.d.ts
  type AsyncFunction (line 1) | type AsyncFunction = (...arguments_: any[]) => PromiseLike<unknown>;
  type AsyncReturnType (line 26) | type AsyncReturnType<Target extends AsyncFunction> = Awaited<ReturnType<...

FILE: source/asyncify.d.ts
  type Asyncify (line 23) | type Asyncify<Function_ extends (...arguments_: any[]) => any> = SetRetu...

FILE: source/basic.d.ts
  type Class (line 6) | type Class<T, Arguments extends unknown[] = any[]> = {
  type Constructor (line 16) | type Constructor<T, Arguments extends unknown[] = any[]> = new(...argume...
  type AbstractClass (line 27) | interface AbstractClass<T, Arguments extends unknown[] = any[]> extends ...
  type AbstractConstructor (line 36) | type AbstractConstructor<T, Arguments extends unknown[] = any[]> = abstr...

FILE: source/camel-case.d.ts
  type CamelCaseOptions (line 9) | type CamelCaseOptions = WordsOptions & {
  type _DefaultCamelCaseOptions (line 18) | type _DefaultCamelCaseOptions = {
  type CamelCaseFromArray (line 26) | type CamelCaseFromArray<
  type CamelCase (line 83) | type CamelCase<Type, Options extends CamelCaseOptions = {}> = Type exten...

FILE: source/camel-cased-properties-deep.d.ts
  type CamelCasedPropertiesDeep (line 57) | type CamelCasedPropertiesDeep<
  type _CamelCasedPropertiesDeep (line 62) | type _CamelCasedPropertiesDeep<
  type CamelCasedPropertiesArrayDeep (line 79) | type CamelCasedPropertiesArrayDeep<

FILE: source/camel-cased-properties.d.ts
  type CamelCasedProperties (line 35) | type CamelCasedProperties<Value, Options extends CamelCaseOptions = {}> ...

FILE: source/characters.d.ts
  type UppercaseLetter (line 17) | type UppercaseLetter = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | '...
  type LowercaseLetter (line 33) | type LowercaseLetter = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | '...
  type DigitCharacter (line 49) | type DigitCharacter = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8...
  type Alphanumeric (line 65) | type Alphanumeric = LowercaseLetter | UppercaseLetter | DigitCharacter;

FILE: source/conditional-except.d.ts
  type ConditionalExcept (line 42) | type ConditionalExcept<Base, Condition> = Except<

FILE: source/conditional-keys.d.ts
  type ConditionalKeys (line 52) | type ConditionalKeys<Base, Condition> = (Base extends UnknownArray ? Tup...
  type _ConditionalKeys (line 56) | type _ConditionalKeys<Base, Condition> = keyof {

FILE: source/conditional-pick-deep.d.ts
  type AssertCondition (line 16) | type AssertCondition<Type, Condition, Options extends ConditionalPickDee...
  type ConditionalPickDeepOptions (line 27) | type ConditionalPickDeepOptions = {
  type DefaultConditionalPickDeepOptions (line 36) | type DefaultConditionalPickDeepOptions = {
  type ConditionalPickDeep (line 98) | type ConditionalPickDeep<
  type _NeverIfEmpty (line 108) | type _NeverIfEmpty<Type> = Type extends EmptyObject ? never : Type;
  type _ConditionalPickDeep (line 110) | type _ConditionalPickDeep<

FILE: source/conditional-pick.d.ts
  type ConditionalPick (line 42) | type ConditionalPick<Base, Condition> = ConditionalKeys<Base, Condition>...

FILE: source/conditional-simplify-deep.d.ts
  type ConditionalSimplifyDeep (line 67) | type ConditionalSimplifyDeep<Type, ExcludeType = never, IncludeType = un...

FILE: source/conditional-simplify.d.ts
  type ConditionalSimplify (line 44) | type ConditionalSimplify<Type, ExcludeType = never, IncludeType = unknow...

FILE: source/delimiter-case.d.ts
  type _DefaultDelimiterCaseOptions (line 7) | type _DefaultDelimiterCaseOptions = Merge<_DefaultWordsOptions, {splitOn...
  type DelimiterCaseFromArray (line 12) | type DelimiterCaseFromArray<
  type DelimiterCase (line 64) | type DelimiterCase<

FILE: source/delimiter-cased-properties-deep.d.ts
  type DelimiterCasedPropertiesDeep (line 60) | type DelimiterCasedPropertiesDeep<
  type _DelimiterCasedPropertiesDeep (line 66) | type _DelimiterCasedPropertiesDeep<
  type DelimiterCasedPropertiesArrayDeep (line 85) | type DelimiterCasedPropertiesArrayDeep<

FILE: source/delimiter-cased-properties.d.ts
  type DelimiterCasedProperties (line 36) | type DelimiterCasedProperties<

FILE: source/distributed-omit.d.ts
  type DistributedOmit (line 91) | type DistributedOmit<ObjectType, KeyType extends KeysOfUnion<ObjectType>> =

FILE: source/distributed-pick.d.ts
  type DistributedPick (line 87) | type DistributedPick<ObjectType, KeyType extends KeysOfUnion<ObjectType>> =

FILE: source/empty-object.d.ts
  type EmptyObject (line 32) | type EmptyObject = {[emptyObjectSymbol]?: never};
  type IsEmptyObject (line 49) | type IsEmptyObject<T> = T extends EmptyObject ? true : false;

FILE: source/entries.d.ts
  type ArrayEntries (line 3) | type ArrayEntries<BaseType extends readonly unknown[]> = Array<_ArrayEnt...
  type MapEntries (line 4) | type MapEntries<BaseType> = Array<_MapEntry<BaseType>>;
  type ObjectEntries (line 5) | type ObjectEntries<BaseType> = Array<_ObjectEntry<BaseType>>;
  type SetEntries (line 6) | type SetEntries<BaseType extends Set<unknown>> = Array<_SetEntry<BaseTyp...
  type Entries (line 57) | type Entries<BaseType> =

FILE: source/entry.d.ts
  type MapKey (line 1) | type MapKey<BaseType> = BaseType extends Map<infer KeyType, unknown> ? K...
  type MapValue (line 2) | type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType>...
  type _ArrayEntry (line 4) | type _ArrayEntry<BaseType extends readonly unknown[]> = [number, BaseTyp...
  type _MapEntry (line 5) | type _MapEntry<BaseType> = [MapKey<BaseType>, MapValue<BaseType>];
  type _ObjectEntry (line 6) | type _ObjectEntry<BaseType> = [keyof BaseType, BaseType[keyof BaseType]];
  type _SetEntry (line 7) | type _SetEntry<BaseType> = BaseType extends Set<infer ItemType> ? [ItemT...
  type Entry (line 60) | type Entry<BaseType> =

FILE: source/exact.d.ts
  type ExactObject (line 13) | type ExactObject<ParameterType, InputType> = {[Key in keyof ParameterTyp...
  type Exact (line 58) | type Exact<ParameterType, InputType> =

FILE: source/except.d.ts
  type Filter (line 31) | type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extend...
  type ExceptOptions (line 33) | type ExceptOptions = {
  type DefaultExceptOptions (line 44) | type DefaultExceptOptions = {
  type Except (line 103) | type Except<ObjectType, KeysType extends keyof ObjectType, Options exten...
  type _Except (line 106) | type _Except<ObjectType, KeysType extends keyof ObjectType, Options exte...

FILE: source/exclude-exactly.d.ts
  type ExcludeExactly (line 35) | type ExcludeExactly<Union, Delete> =
  type _ExcludeExactly (line 45) | type _ExcludeExactly<Union, Delete> =

FILE: source/exclude-rest-element.d.ts
  type ExcludeRestElement (line 30) | type ExcludeRestElement<Array_ extends UnknownArray> = IfNotAnyOrNever<A...

FILE: source/exclude-strict.d.ts
  type ExcludeStrict (line 41) | type ExcludeStrict<

FILE: source/exclusify-union.d.ts
  type ExclusifyUnion (line 128) | type ExclusifyUnion<Union> = IfNotAnyOrNever<Union,
  type _ExclusifyUnion (line 136) | type _ExclusifyUnion<Union, UnionCopy = Union> = Union extends unknown /...

FILE: source/extends-strict.d.ts
  type ExtendsStrict (line 35) | type ExtendsStrict<Left, Right> =

FILE: source/extract-rest-element.d.ts
  type ExtractRestElement (line 28) | type ExtractRestElement<T extends UnknownArray> = SplitOnRestElement<T>[...

FILE: source/extract-strict.d.ts
  type ExtractStrict (line 41) | type ExtractStrict<

FILE: source/find-global-type.d.ts
  type FindGlobalType (line 22) | type FindGlobalType<Name extends string> = typeof globalThis extends Rec...
  type FindGlobalInstanceType (line 63) | type FindGlobalInstanceType<Name extends string> =

FILE: source/fixed-length-array.d.ts
  type ArrayLengthMutationKeys (line 7) | type ArrayLengthMutationKeys = 'splice' | 'push' | 'pop' | 'shift' | 'un...
  type FixedLengthArray (line 92) | type FixedLengthArray<Element, Length extends number> =

FILE: source/get.d.ts
  type GetOptions (line 8) | type GetOptions = {
  type DefaultGetOptions (line 19) | type DefaultGetOptions = {
  type GetWithPath (line 26) | type GetWithPath<BaseType, Keys, Options extends Required<GetOptions>> =
  type Strictify (line 40) | type Strictify<Type, Options extends Required<GetOptions>> =
  type StrictPropertyOf (line 49) | type StrictPropertyOf<BaseType, Key extends keyof BaseType, Options exte...
  type ToPath (line 68) | type ToPath<S extends string> = Split<FixPathSquareBrackets<S>, '.', {st...
  type FixPathSquareBrackets (line 73) | type FixPathSquareBrackets<Path extends string> =
  type ConsistsOnlyOf (line 93) | type ConsistsOnlyOf<LongString extends string, Substring extends string> =
  type WithStringKeys (line 114) | type WithStringKeys<BaseType> = {
  type UncheckedIndex (line 121) | type UncheckedIndex<T, U extends string | number> = [T] extends [Record<...
  type PropertyOf (line 130) | type PropertyOf<BaseType, Key extends string, Options extends Required<G...
  type Get (line 214) | type Get<

FILE: source/global-this.d.ts
  type GlobalThis (line 22) | type GlobalThis = typeof globalThis;

FILE: source/globals/observable-like.d.ts
  type SymbolConstructor (line 3) | interface SymbolConstructor {
  type Unsubscribable (line 20) | type Unsubscribable = {
  type OnNext (line 27) | type OnNext<ValueType> = (value: ValueType) => void;
  type OnError (line 32) | type OnError = (error: unknown) => void;
  type OnComplete (line 37) | type OnComplete = () => void;
  type Observer (line 43) | type Observer<ValueType> = {
  type ObservableLike (line 73) | type ObservableLike<ValueType = unknown> = {

FILE: source/greater-than-or-equal.d.ts
  type GreaterThanOrEqual (line 53) | type GreaterThanOrEqual<A extends number, B extends number> = number ext...

FILE: source/greater-than.d.ts
  type GreaterThan (line 57) | type GreaterThan<A extends number, B extends number> =

FILE: source/has-optional-keys.d.ts
  type HasOptionalKeys (line 21) | type HasOptionalKeys<BaseType extends object> = OptionalKeysOf<BaseType>...

FILE: source/has-readonly-keys.d.ts
  type HasReadonlyKeys (line 21) | type HasReadonlyKeys<BaseType extends object> = ReadonlyKeysOf<BaseType>...

FILE: source/has-required-keys.d.ts
  type HasRequiredKeys (line 59) | type HasRequiredKeys<BaseType extends object> = RequiredKeysOf<BaseType>...

FILE: source/has-writable-keys.d.ts
  type HasWritableKeys (line 21) | type HasWritableKeys<BaseType extends object> = WritableKeysOf<BaseType>...

FILE: source/if-any.d.ts
  type IfAny (line 24) | type IfAny<T, TypeIfAny = true, TypeIfNotAny = false> = (

FILE: source/if-empty-object.d.ts
  type IfEmptyObject (line 24) | type IfEmptyObject<

FILE: source/if-never.d.ts
  type IfNever (line 24) | type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (

FILE: source/if-null.d.ts
  type IfNull (line 24) | type IfNull<T, TypeIfNull = true, TypeIfNotNull = false> = (

FILE: source/if-unknown.d.ts
  type IfUnknown (line 24) | type IfUnknown<T, TypeIfUnknown = true, TypeIfNotUnknown = false> = (

FILE: source/if.d.ts
  type If (line 95) | type If<Type extends boolean, IfBranch, ElseBranch> =

FILE: source/includes.d.ts
  type Includes (line 17) | type Includes<Value extends readonly any[], Item> =

FILE: source/int-closed-range.d.ts
  type IntClosedRange (line 45) | type IntClosedRange<Start extends number, End extends number, Skip exten...

FILE: source/int-range.d.ts
  type IntRange (line 45) | type IntRange<Start extends number, End extends number, Step extends num...
  type PrivateIntRange (line 50) | type PrivateIntRange<

FILE: source/internal/array.d.ts
  type UnknownArrayOrTuple (line 10) | type UnknownArrayOrTuple = readonly [...unknown[]];
  type FirstArrayElement (line 16) | type FirstArrayElement<TArray extends UnknownArrayOrTuple> = TArray exte...
  type StaticPartOfArray (line 30) | type StaticPartOfArray<T extends UnknownArray, Result extends UnknownArr...
  type VariablePartOfArray (line 49) | type VariablePartOfArray<T extends UnknownArray> =
  type SetArrayAccess (line 71) | type SetArrayAccess<T extends UnknownArray, IsReadonly extends boolean> =
  type IsArrayReadonly (line 81) | type IsArrayReadonly<T extends UnknownArray> = If<IsNever<T>, false, T e...
  type CollapseRestElement (line 114) | type CollapseRestElement<TArray extends UnknownArray> = IfNotAnyOrNever<...
  type _CollapseRestElement (line 116) | type _CollapseRestElement<

FILE: source/internal/characters.d.ts
  type Whitespace (line 1) | type Whitespace =
  type WordSeparators (line 29) | type WordSeparators = '-' | '_' | Whitespace;
  type AsciiPunctuation (line 31) | type AsciiPunctuation =

FILE: source/internal/enforce-optional.d.ts
  type RequiredFilter (line 4) | type RequiredFilter<Type, Key extends keyof Type> = undefined extends Ty...
  type OptionalFilter (line 11) | type OptionalFilter<Type, Key extends keyof Type> = undefined extends Ty...
  type EnforceOptional (line 43) | type EnforceOptional<ObjectType> = Simplify<{

FILE: source/internal/keys.d.ts
  type BaseKeyFilter (line 7) | type BaseKeyFilter<Type, Key extends keyof Type> = Key extends symbol
  type FilterDefinedKeys (line 25) | type FilterDefinedKeys<T extends object> = Exclude<
  type FilterOptionalKeys (line 41) | type FilterOptionalKeys<T extends object> = Exclude<
  type RequireNone (line 57) | type RequireNone<KeysType extends PropertyKey> = Partial<Record<KeysType...
  type LiteralKeyOf (line 62) | type LiteralKeyOf<T> = keyof {[K in keyof T as IsLiteral<K> extends true...
  type ExactKey (line 89) | type ExactKey<T extends object, Key extends PropertyKey> =

FILE: source/internal/numeric.d.ts
  type NumberAbsolute (line 22) | type NumberAbsolute<N extends number> = `${N}` extends `-${infer StringP...
  type IsNumberLike (line 46) | type IsNumberLike<N> =
  type UnionMin (line 73) | type UnionMin<N extends number> =
  type InternalUnionMin (line 83) | type InternalUnionMin<N extends number, T extends UnknownArray = []> =
  type UnionMax (line 108) | type UnionMax<N extends number> =
  type InternalUnionMax (line 118) | type InternalUnionMax<N extends number, T extends UnknownArray = []> =
  type ReverseSign (line 143) | type ReverseSign<N extends number> =

FILE: source/internal/object.d.ts
  type BuildObject (line 29) | type BuildObject<Key extends PropertyKey, Value, CopiedFrom extends obje...
  type IsPlainObject (line 41) | type IsPlainObject<T> =
  type ObjectValue (line 55) | type ObjectValue<T, K> =
  type UndefinedToOptional (line 83) | type UndefinedToOptional<T extends object> = Simplify<
  type HomomorphicPick (line 130) | type HomomorphicPick<T, Keys extends KeysOfUnion<T>> = {
  type ValueOfUnion (line 143) | type ValueOfUnion<Union, Key extends KeysOfUnion<Union>> =
  type ReadonlyKeysOfUnion (line 166) | type ReadonlyKeysOfUnion<Union> = Union extends unknown ? keyof {
  type ApplyDefaultOptions (line 222) | type ApplyDefaultOptions<
  type CollapseLiterals (line 262) | type CollapseLiterals<T> = {} extends T
  type NormalizedKeys (line 286) | type NormalizedKeys<Keys extends PropertyKey> =

FILE: source/internal/string.d.ts
  type ToString (line 11) | type ToString<T> = T extends string | number ? `${T}` : never;
  type StringToNumber (line 41) | type StringToNumber<S extends string> = S extends `${infer N extends num...
  type StartsWith (line 70) | type StartsWith<S extends string, SearchString extends string> = string ...
  type StringToArray (line 90) | type StringToArray<S extends string, Result extends string[] = []> = str...
  type StringLength (line 111) | type StringLength<S extends string> = string extends S
  type IsWhitespace (line 118) | type IsWhitespace<T extends string> = T extends Whitespace
  type IsNumeric (line 129) | type IsNumeric<T extends string> = T extends `${number}`
  type SameLengthPositiveNumericStringGt (line 147) | type SameLengthPositiveNumericStringGt<A extends string, B extends strin...
  type NumericString (line 155) | type NumericString = '0123456789';
  type PositiveNumericStringGt (line 172) | type PositiveNumericStringGt<A extends string, B extends string> = A ext...
  type PositiveNumericCharacterGt (line 194) | type PositiveNumericCharacterGt<A extends string, B extends string> = Nu...

FILE: source/internal/tuple.d.ts
  type TupleLength (line 24) | type TupleLength<T extends UnknownArray> =
  type TupleMax (line 48) | type TupleMax<A extends number[], Result extends number = NegativeInfini...
  type TupleMin (line 71) | type TupleMin<A extends number[], Result extends number = PositiveInfini...

FILE: source/internal/type.d.ts
  type BuiltIns (line 11) | type BuiltIns = Primitive | void | Date | RegExp;
  type NonRecursiveType (line 16) | type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]...
  type MapsSetsOrArrays (line 21) | type MapsSetsOrArrays = ReadonlyMap<unknown, unknown> | WeakMap<WeakKey,...
  type IsBothExtends (line 26) | type IsBothExtends<BaseType, FirstType, SecondType> = FirstType extends ...
  type HasMultipleCallSignatures (line 40) | type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unkno...
  type IsNotFalse (line 52) | type IsNotFalse<T extends boolean> = [T] extends [false] ? false : true;
  type IsPrimitive (line 69) | type IsPrimitive<T> = [T] extends [Primitive] ? true : false;
  type Not (line 83) | type Not<A extends boolean> = A extends true
  type IfNotAnyOrNever (line 133) | type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> =
  type IsAnyOrNever (line 156) | type IsAnyOrNever<T> = IsNotFalse<IsAny<T> | IsNever<T>>;
  type IsExactOptionalPropertyTypesEnabled (line 161) | type IsExactOptionalPropertyTypesEnabled = [(string | undefined)?] exten...

FILE: source/invariant-of.d.ts
  type InvariantOf (line 83) | type InvariantOf<Type> = Type & {[invariantBrand]: (_: Type) => Type};

FILE: source/is-any.d.ts
  type IsAny (line 29) | type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;

FILE: source/is-equal.d.ts
  type IsEqual (line 27) | type IsEqual<A, B> =
  type _IsEqual (line 35) | type _IsEqual<A, B> =

FILE: source/is-float.d.ts
  type IsFloat (line 33) | type IsFloat<T> = T extends number

FILE: source/is-integer.d.ts
  type IsInteger (line 49) | type IsInteger<T> =

FILE: source/is-literal.d.ts
  type LiteralCheck (line 24) | type LiteralCheck<T, LiteralType extends Primitive> = (
  type LiteralChecks (line 51) | type LiteralChecks<T, LiteralUnionType> = (
  type IsStringLiteral (line 117) | type IsStringLiteral<S> = IfNotAnyOrNever<S,
  type _IsStringLiteral (line 121) | type _IsStringLiteral<S> =
  type IsNumericLiteral (line 176) | type IsNumericLiteral<T> = LiteralChecks<T, _Numeric>;
  type IsBooleanLiteral (line 216) | type IsBooleanLiteral<T> = LiteralCheck<T, boolean>;
  type IsSymbolLiteral (line 252) | type IsSymbolLiteral<T> = LiteralCheck<T, symbol>;
  type IsLiteralUnion (line 255) | type IsLiteralUnion<T> =
  type IsLiteral (line 310) | type IsLiteral<T> =

FILE: source/is-lowercase.d.ts
  type IsLowercase (line 20) | type IsLowercase<S extends string> = AllExtend<_IsLowercase<S>, true>;
  type _IsLowercase (line 25) | type _IsLowercase<S extends string, Accumulator extends boolean[] = []> ...
  type IsLowercaseHelper (line 32) | type IsLowercaseHelper<S extends string> = S extends Lowercase<string>

FILE: source/is-never.d.ts
  type IsNever (line 54) | type IsNever<T> = [T] extends [never] ? true : false;

FILE: source/is-null.d.ts
  type IsNull (line 20) | type IsNull<T> = [T] extends [null] ? true : false;

FILE: source/is-nullable.d.ts
  type IsNullable (line 28) | type IsNullable<T> = IsAny<T> extends true ? true : Extract<T, null> ext...

FILE: source/is-optional-key-of.d.ts
  type IsOptionalKeyOf (line 43) | type IsOptionalKeyOf<Type extends object, Key extends keyof Type> =

FILE: source/is-optional.d.ts
  type IsOptional (line 26) | type IsOptional<T> = IsAny<T> extends true ? true : Extract<T, undefined...

FILE: source/is-readonly-key-of.d.ts
  type IsReadonlyKeyOf (line 44) | type IsReadonlyKeyOf<Type extends object, Key extends keyof Type> =

FILE: source/is-required-key-of.d.ts
  type IsRequiredKeyOf (line 45) | type IsRequiredKeyOf<Type extends object, Key extends keyof Type> =

FILE: source/is-tuple.d.ts
  type IsTupleOptions (line 10) | type IsTupleOptions = {
  type DefaultIsTupleOptions (line 33) | type DefaultIsTupleOptions = {
  type IsTuple (line 70) | type IsTuple<
  type _IsTuple (line 76) | type _IsTuple<

FILE: source/is-undefined.d.ts
  type IsUndefined (line 20) | type IsUndefined<T> = [T] extends [undefined] ? true : false;

FILE: source/is-union.d.ts
  type IsUnion (line 18) | type IsUnion<T> = InternalIsUnion<T>;
  type InternalIsUnion (line 23) | type InternalIsUnion<T, U = T> =

FILE: source/is-unknown.d.ts
  type IsUnknown (line 35) | type IsUnknown<T> = (

FILE: source/is-uppercase.d.ts
  type IsUppercase (line 20) | type IsUppercase<S extends string> = AllExtend<_IsUppercase<S>, true>;
  type _IsUppercase (line 25) | type _IsUppercase<S extends string, Accumulator extends boolean[] = []> ...
  type IsUppercaseHelper (line 32) | type IsUppercaseHelper<S extends string> = S extends Uppercase<string>

FILE: source/is-writable-key-of.d.ts
  type IsWritableKeyOf (line 45) | type IsWritableKeyOf<Type extends object, Key extends keyof Type> =

FILE: source/iterable-element.d.ts
  type IterableElement (line 59) | type IterableElement<TargetIterable> =

FILE: source/join.d.ts
  type JoinableItem (line 2) | type JoinableItem = string | number | bigint | boolean | undefined | null;
  type NullishCoalesce (line 6) | type NullishCoalesce<
  type Join (line 60) | type Join<

FILE: source/json-value.d.ts
  type JsonObject (line 8) | type JsonObject = {[Key in string]: JsonValue};
  type JsonArray (line 15) | type JsonArray = JsonValue[] | readonly JsonValue[];
  type JsonPrimitive (line 22) | type JsonPrimitive = string | number | boolean | null;
  type JsonValue (line 31) | type JsonValue = JsonPrimitive | JsonObject | JsonArray;

FILE: source/jsonifiable.d.ts
  type JsonifiableObject (line 3) | type JsonifiableObject = {[Key in string]?: Jsonifiable} | {toJSON: () =...
  type JsonifiableArray (line 4) | type JsonifiableArray = readonly Jsonifiable[];
  type Jsonifiable (line 35) | type Jsonifiable = JsonPrimitive | JsonifiableObject | JsonifiableArray;

FILE: source/jsonify.d.ts
  type NotJsonable (line 12) | type NotJsonable = ((...arguments_: any[]) => any) | undefined | symbol;
  type NeverToNull (line 14) | type NeverToNull<T> = IsNever<T> extends true ? null : T;
  type UndefinedToNull (line 15) | type UndefinedToNull<T> = T extends undefined ? null : T;
  type JsonifyList (line 18) | type JsonifyList<T extends UnknownArray> = T extends readonly []
  type FilterJsonableKeys (line 28) | type FilterJsonableKeys<T extends object> = {
  type JsonifyObject (line 35) | type JsonifyObject<T extends object> = {
  type Jsonify (line 95) | type Jsonify<T> = IsAny<T> extends true

FILE: source/kebab-case.d.ts
  type KebabCase (line 41) | type KebabCase<

FILE: source/kebab-cased-properties-deep.d.ts
  type KebabCasedPropertiesDeep (line 60) | type KebabCasedPropertiesDeep<

FILE: source/kebab-cased-properties.d.ts
  type KebabCasedProperties (line 37) | type KebabCasedProperties<

FILE: source/key-as-string.d.ts
  type KeyAsString (line 25) | type KeyAsString<BaseType> = `${Extract<keyof BaseType, string | number>}`;

FILE: source/keys-of-union.d.ts
  type KeysOfUnion (line 40) | type KeysOfUnion<ObjectType> =

FILE: source/last-array-element.d.ts
  type LastArrayElement (line 22) | type LastArrayElement<Elements extends readonly unknown[], ElementBefore...

FILE: source/less-than-or-equal.d.ts
  type LessThanOrEqual (line 53) | type LessThanOrEqual<A extends number, B extends number> =

FILE: source/less-than.d.ts
  type LessThan (line 53) | type LessThan<A extends number, B extends number> =

FILE: source/literal-to-primitive-deep.d.ts
  type LiteralToPrimitiveDeep (line 63) | type LiteralToPrimitiveDeep<T> = T extends object

FILE: source/literal-to-primitive.d.ts
  type LiteralToPrimitive (line 22) | type LiteralToPrimitive<T> = T extends number

FILE: source/literal-union.d.ts
  type _LiteralStringUnion (line 3) | type _LiteralStringUnion<T> = LiteralUnion<T, string>;
  type LiteralUnion (line 34) | type LiteralUnion<

FILE: source/merge-deep.d.ts
  type Writable (line 17) | type Writable<TArray extends UnknownArray> = {-readonly [Key in keyof TA...
  type ArrayTail (line 20) | type ArrayTail<TArray extends UnknownArray> = TArray extends unknown // ...
  type SimplifyDeepExcludeArray (line 26) | type SimplifyDeepExcludeArray<T> = SimplifyDeep<T, UnknownArray>;
  type MergeDeepRecordProperty (line 31) | type MergeDeepRecordProperty<
  type DoMergeDeepRecord (line 46) | type DoMergeDeepRecord<
  type MergeDeepRecord (line 67) | type MergeDeepRecord<
  type PickRestTypeHelper (line 75) | type PickRestTypeHelper<Tail extends UnknownArrayOrTuple, Type> = Tail e...
  type PickRestType (line 89) | type PickRestType<Type extends UnknownArrayOrTuple> = number extends Typ...
  type OmitRestTypeHelper (line 94) | type OmitRestTypeHelper<
  type OmitRestType (line 115) | type OmitRestType<Type extends UnknownArrayOrTuple, Result extends Unkno...
  type TypeNumberOrType (line 120) | type TypeNumberOrType<Type extends UnknownArrayOrTuple> = Type[number] e...
  type PickRestTypeFlat (line 123) | type PickRestTypeFlat<Type extends UnknownArrayOrTuple> = TypeNumberOrTy...
  type MergeDeepArrayOrTupleElements (line 128) | type MergeDeepArrayOrTupleElements<
  type DoMergeDeepTupleAndTupleRecursive (line 141) | type DoMergeDeepTupleAndTupleRecursive<
  type MergeDeepTupleAndTupleRecursive (line 161) | type MergeDeepTupleAndTupleRecursive<
  type MergeTupleAndArrayType (line 173) | type MergeTupleAndArrayType<
  type MergeDeepTupleAndArrayRecursive (line 187) | type MergeDeepTupleAndArrayRecursive<
  type MergeArrayTypeAndTuple (line 199) | type MergeArrayTypeAndTuple<
  type MergeDeepArrayAndTupleRecursive (line 213) | type MergeDeepArrayAndTupleRecursive<
  type ArrayMergeMode (line 225) | type ArrayMergeMode = 'spread' | 'replace';
  type ShouldSpread (line 230) | type ShouldSpread<Options extends MergeDeepInternalOptions> = Options['s...
  type DoMergeArrayOrTuple (line 237) | type DoMergeArrayOrTuple<
  type MergeDeepArrayRecursive (line 252) | type MergeDeepArrayRecursive<
  type MergeDeepArrayOrTupleRecursive (line 274) | type MergeDeepArrayOrTupleRecursive<
  type MergeDeepArrayOrTuple (line 289) | type MergeDeepArrayOrTuple<
  type MergeDeepOrReturn (line 300) | type MergeDeepOrReturn<
  type MergeDeepOptions (line 322) | type MergeDeepOptions = {
  type MergeDeepInternalOptions (line 354) | type MergeDeepInternalOptions = Merge<MergeDeepOptions, {spreadTopLevelA...
  type DefaultMergeDeepOptions (line 359) | type DefaultMergeDeepOptions<Options extends MergeDeepOptions> = Merge<{
  type MergeDeepWithDefaultOptions (line 368) | type MergeDeepWithDefaultOptions<Destination, Source, Options extends Me...
  type MergeDeep (line 489) | type MergeDeep<Destination, Source, Options extends MergeDeepOptions = {...

FILE: source/merge-exclusive.d.ts
  type Without (line 2) | type Without<FirstType, SecondType> = {[KeyType in Exclude<keyof FirstTy...
  type MergeExclusive (line 40) | type MergeExclusive<FirstType, SecondType> =

FILE: source/merge.d.ts
  type SimpleMerge (line 8) | type SimpleMerge<Destination, Source> = Simplify<{
  type Merge (line 74) | type Merge<Destination, Source> =
  type _Merge (line 81) | type _Merge<Destination, Source> =

FILE: source/multidimensional-array.d.ts
  type Recursive (line 4) | type Recursive<T> = Array<Recursive<T>>;
  type MultidimensionalArray (line 32) | type MultidimensionalArray<Element, Dimensions extends number> = number ...

FILE: source/multidimensional-readonly-array.d.ts
  type Recursive (line 4) | type Recursive<T> = ReadonlyArray<Recursive<T>>;
  type MultidimensionalReadonlyArray (line 32) | type MultidimensionalReadonlyArray<Element, Dimensions extends number> =...

FILE: source/non-empty-object.d.ts
  type NonEmptyObject (line 36) | type NonEmptyObject<T extends object> = HasRequiredKeys<T> extends true ...

FILE: source/non-empty-string.d.ts
  type NonEmptyString (line 30) | type NonEmptyString<T extends string> = '' extends T ? never : T;

FILE: source/non-empty-tuple.d.ts
  type NonEmptyTuple (line 22) | type NonEmptyTuple<T = unknown> = readonly [T, ...T[]];

FILE: source/numeric.d.ts
  type _Numeric (line 4) | type _Numeric = number | bigint;
  type Zero (line 6) | type Zero = 0 | 0n;
  type PositiveInfinity (line 19) | type PositiveInfinity = 1e999;
  type NegativeInfinity (line 32) | type NegativeInfinity = -1e999;
  type Finite (line 51) | type Finite<T extends number> = T extends PositiveInfinity | NegativeInf...
  type Integer (line 100) | type Integer<T> =
  type Float (line 123) | type Float<T> =
  type NegativeFloat (line 139) | type NegativeFloat<T extends number> = Negative<Float<T>>;
  type Negative (line 151) | type Negative<T extends _Numeric> = T extends Zero ? never : `${T}` exte...
  type NegativeInteger (line 166) | type NegativeInteger<T extends number> = Negative<Integer<T>>;
  type NonNegative (line 185) | type NonNegative<T extends _Numeric> = T extends Zero ? T : Negative<T> ...
  type NonNegativeInteger (line 207) | type NonNegativeInteger<T extends number> = NonNegative<Integer<T>>;
  type IsNegative (line 224) | type IsNegative<T extends _Numeric> = T extends Negative<T> ? true : false;

FILE: source/object-merge.d.ts
  type ObjectMerge (line 92) | type ObjectMerge<First extends object, Second extends object> =
  type _ObjectMerge (line 110) | type _ObjectMerge<
  type NormalizedLiteralKeys (line 190) | type NormalizedLiteralKeys<Type> = Type extends unknown // For distribut...

FILE: source/omit-deep.d.ts
  type OmitDeep (line 77) | type OmitDeep<T, PathUnion extends LiteralUnion<Paths<T>, string>> =
  type OmitDeepHelper (line 87) | type OmitDeepHelper<T, PathTuple extends UnknownArray> =
  type OmitDeepWithOnePath (line 95) | type OmitDeepWithOnePath<T, Path extends string | number> =
  type OmitDeepObjectWithOnePath (line 105) | type OmitDeepObjectWithOnePath<ObjectT extends object, P extends string ...
  type OmitDeepArrayWithOnePath (line 136) | type OmitDeepArrayWithOnePath<ArrayType extends UnknownArray, P extends ...

FILE: source/omit-index-signature.d.ts
  type OmitIndexSignature (line 92) | type OmitIndexSignature<ObjectType> = {

FILE: source/optional-keys-of.d.ts
  type OptionalKeysOf (line 36) | type OptionalKeysOf<Type extends object> =

FILE: source/optional.d.ts
  type Optional (line 29) | type Optional<Value> = Exclude<Value, null> | undefined;

FILE: source/or-all.d.ts
  type OrAll (line 71) | type OrAll<T extends readonly boolean[]> = SomeExtend<T, true>;

FILE: source/or.d.ts
  type Or (line 80) | type Or<A extends boolean, B extends boolean> = OrAll<[A, B]>;

FILE: source/override-properties.d.ts
  type OverrideProperties (line 31) | type OverrideProperties<

FILE: source/package-json.d.ts
  type Person (line 8) | type Person =
  type BugsLocation (line 16) | type BugsLocation =
  type DirectoryLocations (line 30) | type DirectoryLocations = {
  type Scripts (line 64) | type Scripts = {
  type Dependency (line 209) | type Dependency = Partial<Record<string, string>>;
  type DependencyOverrides (line 214) | type DependencyOverrides = {
  type DevEngineDependency (line 221) | type DevEngineDependency = {
  type ExportConditions (line 230) | type ExportConditions = {
  type Exports (line 237) | type Exports =
  type Imports (line 246) | type Imports = {
  type NonStandardEntryPoints (line 251) | interface NonStandardEntryPoints {
  type TypeScriptConfiguration (line 283) | type TypeScriptConfiguration = {
  type WorkspaceConfig (line 303) | type WorkspaceConfig = {
  type WorkspacePattern (line 327) | type WorkspacePattern = string;
  type YarnConfiguration (line 329) | type YarnConfiguration = {
  type JSPMConfiguration (line 343) | type JSPMConfiguration = {
  type PackageJsonStandard (line 354) | interface PackageJsonStandard {
  type NodeJsStandard (line 653) | type NodeJsStandard = {
  type PublishConfig (line 669) | type PublishConfig = {
  type PackageJson (line 701) | type PackageJson =

FILE: source/partial-deep.d.ts
  type PartialDeepOptions (line 7) | type PartialDeepOptions = {
  type DefaultPartialDeepOptions (line 41) | type DefaultPartialDeepOptions = {
  type PartialDeep (line 97) | type PartialDeep<T, Options extends PartialDeepOptions = {}> =
  type _PartialDeep (line 100) | type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T e...
  type PartialMapDeep (line 131) | type PartialMapDeep<KeyType, ValueType, Options extends Required<Partial...
  type PartialSetDeep (line 136) | type PartialSetDeep<T, Options extends Required<PartialDeepOptions>> = {...
  type PartialReadonlyMapDeep (line 141) | type PartialReadonlyMapDeep<KeyType, ValueType, Options extends Required...
  type PartialReadonlySetDeep (line 146) | type PartialReadonlySetDeep<T, Options extends Required<PartialDeepOptio...
  type PartialObjectDeep (line 151) | type PartialObjectDeep<ObjectType extends object, Options extends Requir...

FILE: source/partial-on-undefined-deep.d.ts
  type PartialOnUndefinedDeepOptions (line 9) | type PartialOnUndefinedDeepOptions = {
  type DefaultPartialOnUndefinedDeepOptions (line 18) | type DefaultPartialOnUndefinedDeepOptions = {
  type PartialOnUndefinedDeep (line 55) | type PartialOnUndefinedDeep<T, Options extends PartialOnUndefinedDeepOpt...
  type _PartialOnUndefinedDeep (line 58) | type _PartialOnUndefinedDeep<T, Options extends Required<PartialOnUndefi...
  type PartialOnUndefinedDeepValue (line 67) | type PartialOnUndefinedDeepValue<T, Options extends Required<PartialOnUn...

FILE: source/pascal-case.d.ts
  type PascalCase (line 44) | type PascalCase<Value, Options extends CamelCaseOptions = {}> =
  type _PascalCase (line 47) | type _PascalCase<Value, Options extends Required<CamelCaseOptions>> = Ca...

FILE: source/pascal-cased-properties-deep.d.ts
  type PascalCasedPropertiesDeep (line 57) | type PascalCasedPropertiesDeep<Value, Options extends CamelCaseOptions =...
  type _PascalCasedPropertiesDeep (line 60) | type _PascalCasedPropertiesDeep<Value, Options extends Required<CamelCas...

FILE: source/pascal-cased-properties.d.ts
  type PascalCasedProperties (line 36) | type PascalCasedProperties<Value, Options extends CamelCaseOptions = {}>...

FILE: source/paths.d.ts
  type PathsOptions (line 14) | type PathsOptions = {
  type DefaultPathsOptions (line 142) | type DefaultPathsOptions = {
  type Paths (line 192) | type Paths<T, Options extends PathsOptions = {}> = _Paths<T, ApplyDefaul...
  type _Paths (line 194) | type _Paths<T, Options extends Required<PathsOptions>, CurrentDepth exte...
  type InternalPaths (line 203) | type InternalPaths<T, Options extends Required<PathsOptions>, CurrentDep...

FILE: source/pick-deep.d.ts
  type PickDeep (line 65) | type PickDeep<T, PathUnion extends Paths<T>> =
  type InternalPickDeep (line 82) | type InternalPickDeep<T, Path extends string | number> =
  type PickDeepObject (line 92) | type PickDeepObject<RecordType extends object, P extends string | number> =
  type PickDeepArray (line 108) | type PickDeepArray<ArrayType extends UnknownArray, P extends string | nu...

FILE: source/pick-index-signature.d.ts
  type PickIndexSignature (line 46) | type PickIndexSignature<ObjectType> = {

FILE: source/primitive.d.ts
  type Primitive (line 6) | type Primitive =

FILE: source/promisable.d.ts
  type Promisable (line 25) | type Promisable<T> = T | PromiseLike<T>;

FILE: source/readonly-deep.d.ts
  type ReadonlyDeep (line 72) | type ReadonlyDeep<T> = T extends BuiltIns
  type ReadonlyMapDeep (line 102) | type ReadonlyMapDeep<KeyType, ValueType> = {} & Readonly<ReadonlyMap<Rea...
  type ReadonlySetDeep (line 107) | type ReadonlySetDeep<ItemType> = {} & Readonly<ReadonlySet<ReadonlyDeep<...
  type _ReadonlyObjectDeep (line 112) | type _ReadonlyObjectDeep<ObjectType extends object> = {

FILE: source/readonly-keys-of.d.ts
  type ReadonlyKeysOf (line 28) | type ReadonlyKeysOf<Type extends object> =

FILE: source/readonly-tuple.d.ts
  type ReadonlyTuple (line 32) | type ReadonlyTuple<Element, Length extends number> = Readonly<TupleOf<Le...

FILE: source/remove-prefix.d.ts
  type RemovePrefixOptions (line 9) | type RemovePrefixOptions = {
  type DefaultRemovePrefixOptions (line 83) | type DefaultRemovePrefixOptions = {
  type RemovePrefix (line 112) | type RemovePrefix<S extends string, Prefix extends string, Options exten...
  type _RemovePrefix (line 123) | type _RemovePrefix<S extends string, Prefix extends string, Options exte...

FILE: source/replace.d.ts
  type ReplaceOptions (line 3) | type ReplaceOptions = {
  type DefaultReplaceOptions (line 7) | type DefaultReplaceOptions = {
  type Replace (line 64) | type Replace<
  type _Replace (line 71) | type _Replace<

FILE: source/require-all-or-none.d.ts
  type RequireAll (line 9) | type RequireAll<ObjectType, KeysType extends keyof ObjectType> = Require...
  type RequireAllOrNone (line 42) | type RequireAllOrNone<ObjectType, KeysType extends keyof ObjectType = ke...
  type _RequireAllOrNone (line 49) | type _RequireAllOrNone<ObjectType, KeysType extends keyof ObjectType> = (

FILE: source/require-at-least-one.d.ts
  type RequireAtLeastOne (line 28) | type RequireAtLeastOne<
  type _RequireAtLeastOne (line 38) | type _RequireAtLeastOne<

FILE: source/require-exactly-one.d.ts
  type RequireExactlyOne (line 35) | type RequireExactlyOne<ObjectType, KeysType extends keyof ObjectType = k...
  type _RequireExactlyOne (line 42) | type _RequireExactlyOne<ObjectType, KeysType extends keyof ObjectType> =

FILE: source/require-one-or-none.d.ts
  type RequireOneOrNone (line 37) | type RequireOneOrNone<ObjectType, KeysType extends keyof ObjectType = ke...
  type _RequireOneOrNone (line 44) | type _RequireOneOrNone<ObjectType, KeysType extends keyof ObjectType> = (

FILE: source/required-deep.d.ts
  type RequiredDeep (line 46) | type RequiredDeep<T> = T extends BuiltIns
  type RequiredObjectDeep (line 72) | type RequiredObjectDeep<ObjectType extends object> = {

FILE: source/required-keys-of.d.ts
  type RequiredKeysOf (line 33) | type RequiredKeysOf<Type extends object> =

FILE: source/schema.d.ts
  type SchemaOptions (line 10) | type SchemaOptions = {
  type DefaultSchemaOptions (line 46) | type DefaultSchemaOptions = {
  type Schema (line 93) | type Schema<Type, Value, Options extends SchemaOptions = {}> =
  type _Schema (line 98) | type _Schema<Type, Value, Options extends Required<SchemaOptions>> =
  type SchemaHelper (line 112) | type SchemaHelper<Type, Value, Options extends Required<SchemaOptions>> ...

FILE: source/screaming-snake-case.d.ts
  type ScreamingSnakeCase (line 23) | type ScreamingSnakeCase<

FILE: source/set-field-type.d.ts
  type SetFieldTypeOptions (line 4) | type SetFieldTypeOptions = {
  type DefaultSetFieldTypeOptions (line 15) | type DefaultSetFieldTypeOptions = {
  type SetFieldType (line 56) | type SetFieldType<BaseType, Keys extends keyof BaseType, NewType, Option...
  type _SetFieldType (line 59) | type _SetFieldType<BaseType, Keys extends keyof BaseType, NewType, Optio...

FILE: source/set-non-nullable-deep.d.ts
  type SetNonNullableDeep (line 58) | type SetNonNullableDeep<BaseType, KeyPaths extends Paths<BaseType>> =
  type SetNonNullableDeepHelper (line 66) | type SetNonNullableDeepHelper<BaseType, KeyPathsTuple extends UnknownArr...
  type SetNonNullableDeepSinglePath (line 74) | type SetNonNullableDeepSinglePath<BaseType, KeyPath> =

FILE: source/set-non-nullable.d.ts
  type SetNonNullable (line 28) | type SetNonNullable<BaseType, Keys extends keyof BaseType = keyof BaseTy...

FILE: source/set-optional.d.ts
  type SetOptional (line 26) | type SetOptional<BaseType, Keys extends keyof BaseType> =
  type _SetOptional (line 32) | type _SetOptional<BaseType, Keys extends keyof BaseType> =

FILE: source/set-parameter-type.d.ts
  type MergeObjectToArray (line 28) | type MergeObjectToArray<TArray extends UnknownArray, TObject, TArrayCopy...
  type SetParameterType (line 113) | type SetParameterType<Function_ extends (...arguments_: any[]) => unknow...

FILE: source/set-readonly.d.ts
  type SetReadonly (line 26) | type SetReadonly<BaseType, Keys extends keyof BaseType> =
  type _SetReadonly (line 32) | type _SetReadonly<BaseType, Keys extends keyof BaseType> =

FILE: source/set-required-deep.d.ts
  type SetRequiredDeep (line 37) | type SetRequiredDeep<BaseType, KeyPaths extends Paths<BaseType>> = IsAny...
  type SetRequiredDeepHelper (line 46) | type SetRequiredDeepHelper<BaseType, KeyPathsTuple extends UnknownArray> =
  type SetRequiredDeepSinglePath (line 54) | type SetRequiredDeepSinglePath<BaseType, KeyPath> = BaseType extends Non...

FILE: source/set-required.d.ts
  type SetRequired (line 33) | type SetRequired<BaseType, Keys extends keyof BaseType> =
  type _SetRequired (line 39) | type _SetRequired<BaseType, Keys extends keyof BaseType> =
  type SetArrayRequired (line 54) | type SetArrayRequired<

FILE: source/set-return-type.d.ts
  type SetReturnType (line 20) | type SetReturnType<Function_ extends (...arguments_: any[]) => any, Type...

FILE: source/shared-union-fields-deep.d.ts
  type SharedUnionFieldsDeepOptions (line 10) | type SharedUnionFieldsDeepOptions = {
  type DefaultSharedUnionFieldsDeepOptions (line 19) | type DefaultSharedUnionFieldsDeepOptions = {
  type SharedUnionFieldsDeep (line 89) | type SharedUnionFieldsDeep<Union, Options extends SharedUnionFieldsDeepO...
  type SharedObjectUnionFieldsDeep (line 108) | type SharedObjectUnionFieldsDeep<Union, Options extends Required<SharedU...
  type SharedArrayUnionFieldsDeep (line 128) | type SharedArrayUnionFieldsDeep<Union extends UnknownArray, Options exte...
  type InternalSharedArrayUnionFieldsDeep (line 138) | type InternalSharedArrayUnionFieldsDeep<

FILE: source/shared-union-fields.d.ts
  type SharedUnionFields (line 68) | type SharedUnionFields<Union> =

FILE: source/simplify-deep.d.ts
  type SimplifyDeep (line 110) | type SimplifyDeep<Type, ExcludeType = never> =

FILE: source/simplify.d.ts
  type Simplify (line 59) | type Simplify<T> = {[KeyType in keyof T]: T[KeyType]} & {};

FILE: source/single-key-object.d.ts
  type SingleKeyObject (line 23) | type SingleKeyObject<ObjectType> =

FILE: source/snake-case.d.ts
  type SnakeCase (line 42) | type SnakeCase<

FILE: source/snake-cased-properties-deep.d.ts
  type SnakeCasedPropertiesDeep (line 60) | type SnakeCasedPropertiesDeep<

FILE: source/snake-cased-properties.d.ts
  type SnakeCasedProperties (line 37) | type SnakeCasedProperties<

FILE: source/some-extend.d.ts
  type SomeExtendOptions (line 12) | type SomeExtendOptions = {
  type DefaultSomeExtendOptions (line 47) | type DefaultSomeExtendOptions = {
  type SomeExtend (line 97) | type SomeExtend<TArray extends UnknownArray, Type, Options extends SomeE...
  type _SomeExtend (line 100) | type _SomeExtend<TArray extends UnknownArray, Type, Options extends Requ...

FILE: source/split-on-rest-element.d.ts
  type SplitOnRestElementOptions (line 11) | type SplitOnRestElementOptions = {
  type DefaultSplitOnRestElementOptions (line 27) | type DefaultSplitOnRestElementOptions = {
  type SplitOnRestElement (line 63) | type SplitOnRestElement<
  type _SplitOnRestElement (line 79) | type _SplitOnRestElement<

FILE: source/split.d.ts
  type SplitOptions (line 11) | type SplitOptions = {
  type DefaultSplitOptions (line 37) | type DefaultSplitOptions = {
  type Split (line 62) | type Split<
  type SplitHelper (line 69) | type SplitHelper<

FILE: source/spread.d.ts
  type SpreadObject (line 4) | type SpreadObject<FirstType extends object, SecondType extends object> = {
  type TupleOrArray (line 13) | type TupleOrArray = readonly [...unknown[]];
  type SpreadTupleOrArray (line 15) | type SpreadTupleOrArray<
  type Spreadable (line 20) | type Spreadable = object | TupleOrArray;
  type Spread (line 69) | type Spread<

FILE: source/string-repeat.d.ts
  type StringRepeat (line 28) | type StringRepeat<
  type StringRepeatHelper (line 33) | type StringRepeatHelper<

FILE: source/string-slice.d.ts
  type StringSlice (line 29) | type StringSlice<

FILE: source/stringified.d.ts
  type Stringified (line 23) | type Stringified<ObjectType> = {[KeyType in keyof ObjectType]: string};

FILE: source/structured-cloneable.d.ts
  type StructuredCloneablePrimitive (line 4) | type StructuredCloneablePrimitive =
  type StructuredCloneableData (line 15) | type StructuredCloneableData =
  type StructuredCloneableCollection (line 50) | type StructuredCloneableCollection =
  type StructuredCloneable (line 87) | type StructuredCloneable = StructuredCloneablePrimitive | StructuredClon...

FILE: source/subtract.d.ts
  type Subtract (line 38) | type Subtract<A extends number, B extends number> =
  type SubtractPostChecks (line 57) | type SubtractPostChecks<A extends number, B extends number, AreNegative ...
  type SubtractPositives (line 71) | type SubtractPositives<A extends number, B extends number> =
  type SubtractIfAGreaterThanB (line 80) | type SubtractIfAGreaterThanB<A extends number, B extends number> =

FILE: source/sum.d.ts
  type Sum (line 35) | type Sum<A extends number, B extends number> =
  type SumPostChecks (line 54) | type SumPostChecks<A extends number, B extends number, AreNegative = [Is...
  type SumPositives (line 76) | type SumPositives<A extends number, B extends number> =

FILE: source/tagged-union.d.ts
  type TaggedUnion (line 46) | type TaggedUnion<

FILE: source/tagged.d.ts
  type TagContainer (line 4) | type TagContainer<Token> = {
  type Tag (line 8) | type Tag<Token extends PropertyKey, TagMetadata> = TagContainer<{[K in T...
  type Tagged (line 71) | type Tagged<Type, TagName extends PropertyKey, TagMetadata = never> = Ty...
  type GetTagMetadata (line 100) | type GetTagMetadata<Type extends Tag<TagName, unknown>, TagName extends ...
  type UnwrapTagged (line 131) | type UnwrapTagged<TaggedType extends Tag<PropertyKey, any>> =
  type RemoveAllTags (line 134) | type RemoveAllTags<T> = T extends Tag<PropertyKey, any>
  type Opaque (line 216) | type Opaque<Type, Token = unknown> = Type & TagContainer<Token>;
  type UnwrapOpaque (line 254) | type UnwrapOpaque<OpaqueType extends TagContainer<unknown>> =

FILE: source/trim.d.ts
  type TrimLeft (line 6) | type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? ...
  type TrimRight (line 11) | type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ?...
  type Trim (line 27) | type Trim<V extends string> = TrimLeft<TrimRight<V>>;

FILE: source/tsconfig-json.d.ts
  type JSX (line 3) | type JSX =
  type Module (line 10) | type Module =
  type NewLine (line 43) | type NewLine =
  type Target (line 50) | type Target =
  type Lib (line 81) | type Lib =
  type Plugin (line 274) | type Plugin = {
  type ImportsNotUsedAsValues (line 281) | type ImportsNotUsedAsValues =
  type FallbackPolling (line 286) | type FallbackPolling =
  type WatchDirectory (line 295) | type WatchDirectory =
  type WatchFile (line 301) | type WatchFile =
  type ModuleResolution (line 309) | type ModuleResolution =
  type ModuleDetection (line 324) | type ModuleDetection =
  type IgnoreDeprecations (line 329) | type IgnoreDeprecations = '5.0';
  type CompilerOptions (line 332) | type CompilerOptions = {
  type WatchFileKind (line 1159) | type WatchFileKind =
  type WatchDirectoryKind (line 1167) | type WatchDirectoryKind =
  type PollingWatchKind (line 1173) | type PollingWatchKind =
  type WatchOptions (line 1180) | type WatchOptions = {
  type TypeAcquisition (line 1220) | type TypeAcquisition = {
  type References (line 1242) | type References = {
  type TsConfigJson (line 1273) | type TsConfigJson = {

FILE: source/tuple-of.d.ts
  type TupleOf (line 70) | type TupleOf<Length extends number, Fill = unknown> = IfNotAnyOrNever<Le...
  type _TupleOf (line 74) | type _TupleOf<L extends number, Fill, Accumulator extends UnknownArray> ...

FILE: source/tuple-to-object.d.ts
  type TupleToObject (line 41) | type TupleToObject<TArray extends UnknownArray> = If<IsAny<TArray>, any, {

FILE: source/tuple-to-union.d.ts
  type TupleToUnion (line 52) | type TupleToUnion<ArrayType> = ArrayType extends readonly unknown[] ? Ar...

FILE: source/typed-array.d.ts
  type TypedArray (line 6) | type TypedArray =

FILE: source/undefined-on-partial-deep.d.ts
  type UndefinedOnPartialDeep (line 44) | type UndefinedOnPartialDeep<T> =
  type UndefinedOnPartialList (line 71) | type UndefinedOnPartialList<T extends readonly unknown[]> = T extends []

FILE: source/union-member.d.ts
  type UnionMember (line 58) | type UnionMember<T> =

FILE: source/union-to-intersection.d.ts
  type UnionToIntersection (line 18) | type UnionToIntersection<Union> = (

FILE: source/union-to-tuple.d.ts
  type UnionToTuple (line 40) | type UnionToTuple<T, L = UnionMember<T>> =

FILE: source/unknown-array.d.ts
  type UnknownArray (line 25) | type UnknownArray = readonly unknown[];

FILE: source/unknown-map.d.ts
  type UnknownMap (line 24) | type UnknownMap = ReadonlyMap<unknown, unknown>;

FILE: source/unknown-record.d.ts
  type UnknownRecord (line 31) | type UnknownRecord = Record<PropertyKey, unknown>;

FILE: source/unknown-set.d.ts
  type UnknownSet (line 24) | type UnknownSet = ReadonlySet<unknown>;

FILE: source/unwrap-partial.d.ts
  type UnwrapPartial (line 24) | type UnwrapPartial<PartialObjectType> =

FILE: source/value-of.d.ts
  type ValueOf (line 22) | type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof Obje...

FILE: source/words.d.ts
  type SkipEmptyWord (line 9) | type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
  type RemoveLastCharacter (line 11) | type RemoveLastCharacter<
  type WordsOptions (line 23) | type WordsOptions = {
  type _DefaultWordsOptions (line 43) | type _DefaultWordsOptions = {
  type Words (line 80) | type Words<Sentence extends string, Options extends WordsOptions = {}> =
  type WordsImplementation (line 83) | type WordsImplementation<

FILE: source/writable-deep.d.ts
  type WritableDeep (line 32) | type WritableDeep<T> = T extends BuiltIns
  type WritableMapDeep (line 53) | type WritableMapDeep<MapType extends ReadonlyMap<unknown, unknown>> =
  type WritableSetDeep (line 61) | type WritableSetDeep<SetType extends ReadonlySet<unknown>> =
  type _WritableObjectDeep (line 69) | type _WritableObjectDeep<ObjectType extends object> = {
  type WritableArrayDeep (line 76) | type WritableArrayDeep<ArrayType extends readonly unknown[]> =

FILE: source/writable-keys-of.d.ts
  type WritableKeysOf (line 29) | type WritableKeysOf<Type extends object> =

FILE: source/writable.d.ts
  type WritableArray (line 7) | type WritableArray<ArrayType extends readonly unknown[]> =
  type Writable (line 52) | type Writable<BaseType, Keys extends keyof BaseType = keyof BaseType> =

FILE: source/xor.d.ts
  type Xor (line 81) | type Xor<A extends boolean, B extends boolean> = And<Or<A, B>, Not<And<A...

FILE: test-d/abstract-class.ts
  method constructor (line 5) | constructor(x: number) {
  function functionReceivingAbsClass (line 16) | function functionReceivingAbsClass<T>(cls: AbstractClass<T>) {
  function withBar (line 20) | function withBar<T extends AbstractConstructor<object>>(Ctor: T) {
  class WrongConcreteExtendedBar (line 30) | class WrongConcreteExtendedBar extends withBar(Bar) {}
  class CorrectConcreteExtendedBar (line 33) | class CorrectConcreteExtendedBar extends withBar(Bar) {
    method constructor (line 34) | constructor(x: number, y: number) {
    method barMethod (line 41) | barMethod() {}
  function assertWithBar (line 44) | function assertWithBar() {
  method constructor (line 68) | constructor(buildingOwners: T) {
  type Census (line 73) | type Census = {
  class CityBlock (line 79) | class CityBlock<BuildingType extends AbstractBuilding<Census>> {
    method constructor (line 82) | constructor(HousingType: AbstractClass<BuildingType, [Census]>) {

FILE: test-d/all-extend.ts
  type NonStrictNeverAllExtend (line 109) | type NonStrictNeverAllExtend<TArray extends UnknownArray, Type> = AllExt...

FILE: test-d/all-union-fields.ts
  type TestingType (line 5) | type TestingType = {

FILE: test-d/and-all.ts
  type Error1 (line 61) | type Error1 = AndAll<[1, 0]>;
  type Error2 (line 63) | type Error2 = AndAll<[true, false?]>;

FILE: test-d/array-indices.ts
  type ValueKeys (line 5) | type ValueKeys = ArrayIndices<typeof values>;
  type TupleKeys (line 17) | type TupleKeys = ArrayIndices<['a', 2]>;

FILE: test-d/array-length.ts
  type DisallowedPrimitive (line 43) | type DisallowedPrimitive = ArrayLength<string>;
  type DisallowedPrimitives (line 45) | type DisallowedPrimitives = ArrayLength<Primitive>;
  type DisallowedObject (line 47) | type DisallowedObject = ArrayLength<{}>;
  type DisallowedMap (line 49) | type DisallowedMap = ArrayLength<Map<string, number>>;
  type DisallowedSet (line 51) | type DisallowedSet = ArrayLength<Set<number>>;
  type DisallowedRecord (line 53) | type DisallowedRecord = ArrayLength<Record<string, unknown>>;
  type DisallowedObjectWithLength (line 55) | type DisallowedObjectWithLength = ArrayLength<{length: number}>;

FILE: test-d/array-reverse.ts
  type FirstFiftyIntegers (line 69) | type FirstFiftyIntegers = [
  type FirstFiftyIntegersReversed (line 77) | type FirstFiftyIntegersReversed = [
  type FirstNineHundredNinetyNineIntegers (line 89) | type FirstNineHundredNinetyNineIntegers = [
  type FirstNineHundredNinetyNineIntegersReversed (line 192) | type FirstNineHundredNinetyNineIntegersReversed = [

FILE: test-d/array-splice.ts
  type TestTuple (line 5) | type TestTuple = ['a', 'b', 'c', 'd'];
  type TestArray (line 23) | type TestArray = ['a', 'b', 'c', 'd', ...number[]];

FILE: test-d/array-values.ts
  type Values (line 5) | type Values = ArrayValues<typeof values>;
  type TupleValues (line 17) | type TupleValues = ArrayValues<['1', 2, {c: true}]>;
  type AnyStringValues (line 30) | type AnyStringValues = ArrayValues<string[]>;

FILE: test-d/arrayable.ts
  type Item (line 12) | type Item = number;
  function castArray1 (line 13) | function castArray1(value: Arrayable<Item>): Item[] {
  function castArray2 (line 19) | function castArray2<T>(value: Arrayable<T>): T[] {

FILE: test-d/async-return-type.ts
  function asyncFunction (line 4) | async function asyncFunction(): Promise<number> {
  type Value (line 8) | type Value = AsyncReturnType<typeof asyncFunction>;
  function asyncPromiseLike (line 15) | function asyncPromiseLike(): PromiseLike<number> {
  type ValuePromiseLike (line 19) | type ValuePromiseLike = AsyncReturnType<typeof asyncPromiseLike>;

FILE: test-d/camel-case.ts
  type CamelCasedProperties (line 48) | type CamelCasedProperties<T> = {
  type RawOptions (line 52) | type RawOptions = {

FILE: test-d/camel-cased-properties-deep.ts
  type bazBizDeep (line 14) | type bazBizDeep = {fooBAR: number; baz: {fooBAR: Array<{BARFoo: string}>}};
  type UserRole (line 26) | type UserRole = Tagged<string, 'Role'>;
  type User (line 28) | type User = {
  type UserWithFriends (line 36) | type UserWithFriends = {

FILE: test-d/camel-cased-properties.ts
  type User (line 20) | type User = {

FILE: test-d/class.ts
  class Foo (line 4) | class Foo {
    method constructor (line 6) | constructor(_x: number, _y: any) {}
    method method (line 9) | method(): void {}
  function function_ (line 12) | function function_(Cls: Constructor<Foo>): Foo {
  function function2 (line 16) | function function2(Cls: Constructor<Foo, [number, number]>): Foo {
  type PositionProperties (line 26) | type PositionProperties = {
  class Position (line 31) | class Position {
    method constructor (line 36) | constructor(parameterTop: number, parameterLeft: number) {
  class Building (line 60) | class Building<T = unknown> {
    method constructor (line 62) | constructor(buildingOwners: T) {
  type Census (line 67) | type Census = {
  class House (line 71) | class House<OwnerCount extends Census = Census> extends Building<OwnerCo...
  class CityBlock (line 73) | class CityBlock<BuildingType extends Building> {
    method constructor (line 76) | constructor(HousingType: Class<BuildingType, [Census]>) {

FILE: test-d/conditional-except.ts
  class Awesome (line 4) | class Awesome {
    method run (line 9) | run(): void {
  type Example (line 14) | type Example = {

FILE: test-d/conditional-keys.ts
  type Example (line 4) | type Example = {

FILE: test-d/conditional-pick-deep.ts
  class ClassA (line 4) | class ClassA {
  type InterfaceA (line 9) | interface InterfaceA {
  type Example (line 13) | type Example = {

FILE: test-d/conditional-pick.ts
  class Awesome (line 4) | class Awesome {
    method run (line 9) | run(): void {
  type Example (line 14) | type Example = {

FILE: test-d/conditional-simplify-deep.ts
  type Position (line 4) | type Position = {top: number; left: number};
  type Size (line 5) | type Size = {width: number; height: number};
  type PositionAndSizeIntersection (line 8) | type PositionAndSizeIntersection = Position & Size;
  type SomeNode (line 15) | type SomeNode = {
  type SomeNodeSimplified (line 21) | type SomeNodeSimplified = ConditionalSimplifyDeep<SomeNode>;
  type MovablePosition (line 29) | interface MovablePosition extends Position {
  type MovableCollection (line 33) | type MovableCollection = {
  type MovableNodeSimplifiedFail (line 39) | type MovableNodeSimplifiedFail = ConditionalSimplifyDeep<MovableCollecti...
  type MovableNodeSimplifiedPass (line 40) | type MovableNodeSimplifiedPass = ConditionalSimplifyDeep<MovableCollecti...
  method move (line 51) | move(position: Position) {
  type ExcludeFunctionAndSize1 (line 65) | type ExcludeFunctionAndSize1 = ConditionalSimplifyDeep<MovableCollection...
  type ExcludeFunctionAndSize2 (line 69) | type ExcludeFunctionAndSize2 = ConditionalSimplifyDeep<MovableCollection...

FILE: test-d/conditional-simplify.ts
  type Position (line 4) | type Position = {top: number; left: number};
  type Size (line 5) | type Size = {width: number; height: number};
  type PositionAndSizeIntersection (line 8) | type PositionAndSizeIntersection = Position & Size;
  type PositionAndSizeSimplified (line 9) | type PositionAndSizeSimplified = ConditionalSimplify<PositionAndSizeInte...
  type SomeFunction (line 17) | type SomeFunction = (type: string) => string;
  type SimplifiedFunctionFail (line 18) | type SimplifiedFunctionFail = ConditionalSimplify<SomeFunction>;
  type SimplifiedFunctionPass (line 19) | type SimplifiedFunctionPass = ConditionalSimplify<SomeFunction, Function>;

FILE: test-d/delimiter-case.ts
  type OddCasedProperties (line 134) | type OddCasedProperties<T> = {
  type CliOptions (line 138) | type CliOptions = {

FILE: test-d/delimiter-cased-properties-deep.ts
  type User (line 17) | type User = {
  type UserWithFriends (line 24) | type UserWithFriends = {
  type UserType (line 79) | enum UserType {

FILE: test-d/delimiter-cased-properties.ts
  type User (line 17) | type User = {

FILE: test-d/distributed-omit.ts
  type Example1 (line 8) | type Example1 = {
  type Actual1 (line 13) | type Actual1 = DistributedOmit<Example1, 'a'>;
  type Actual2 (line 14) | type Actual2 = DistributedOmit<Example1, 'b'>;
  type Actual3 (line 15) | type Actual3 = DistributedOmit<Example1, 'a' | 'b'>;
  type Expected1 (line 17) | type Expected1 = Except<Example1, 'a'>;
  type Expected2 (line 18) | type Expected2 = Except<Example1, 'b'>;
  type Expected3 (line 19) | type Expected3 = Except<Example1, 'a' | 'b'>;
  type Example2 (line 34) | type Example2 = {
  type Actual4 (line 40) | type Actual4 = DistributedOmit<Example2, 'c'>;
  type A (line 47) | type A = {
  type B (line 53) | type B = {
  type C (line 60) | type C = {
  type Union (line 66) | type Union = A | B | C;
  type OmittedUnion (line 68) | type OmittedUnion = DistributedOmit<Union, 'foo' | 'bar'>;

FILE: test-d/distributed-pick.ts
  type Example1 (line 8) | type Example1 = {
  type Actual1 (line 13) | type Actual1 = DistributedPick<Example1, 'a'>;
  type Actual2 (line 14) | type Actual2 = DistributedPick<Example1, 'b'>;
  type Actual3 (line 15) | type Actual3 = DistributedPick<Example1, 'a' | 'b'>;
  type Expected1 (line 17) | type Expected1 = Pick<Example1, 'a'>;
  type Expected2 (line 18) | type Expected2 = Pick<Example1, 'b'>;
  type Expected3 (line 19) | type Expected3 = Pick<Example1, 'a' | 'b'>;
  type Example2 (line 34) | type Example2 = {
  type Actual4 (line 40) | type Actual4 = DistributedPick<Example2, 'c'>;
  type A (line 47) | type A = {
  type B (line 53) | type B = {
  type C (line 60) | type C = {
  type Union (line 66) | type Union = A | B | C;
  type PickedUnion (line 68) | type PickedUnion = DistributedPick<Union, 'discriminant' | 'a' | 'b' | '...

FILE: test-d/empty-object.ts
  type Union (line 29) | type Union = EmptyObject | {id: number};

FILE: test-d/exact.ts
  type Type (line 4) | type Type = string;
  type Type (line 26) | type Type = bigint;
  type Type (line 48) | type Type = Array<{code: string; name?: string}>;
  type Type (line 81) | type Type = ReadonlyArray<{code: string; name?: string}>;
  type Type (line 113) | type Type = {code: string; name?: string};
  type Type (line 140) | type Type = {
  type Type (line 158) | type Type = {code: string} | {name: string};
  type Type (line 179) | type Type = {code: string} | string;
  type Type (line 200) | type Type = {
  type Type (line 226) | type Type = {
  type Type (line 244) | type Type = Array<{x: string}> & Array<{z: number}>;
  type Type (line 292) | type Type = ReadonlyArray<{x: string}> & Array<{z: number}>;
  type Type (line 340) | type Type = Array<{x: string}> & Array<{z: number; d: {e: string; f: boo...
  type SpecialName (line 399) | type SpecialName = Opaque<string, 'special name'>;
  type OnlyAcceptName (line 401) | type OnlyAcceptName = {
  type SpecialName (line 418) | type SpecialName = Opaque<number, 'special name'>;
  type OnlyAcceptName (line 420) | type OnlyAcceptName = {
  type TaggedNumber (line 435) | type TaggedNumber = Opaque<number, 'tag'>;
  type ParameterType (line 447) | type ParameterType = {
  type Input (line 458) | type Input = {
  type A (line 497) | type A = {
  type UserType (line 514) | type UserType = {
  type A (line 544) | type A = {
  type B (line 547) | type B = {
  type Expected (line 550) | type Expected = A | B;

FILE: test-d/except.ts
  type Example (line 22) | type Example = {

FILE: test-d/exclude-rest-element.ts
  type FiftyZeroes (line 56) | type FiftyZeroes = TupleOf<50, '0'>;
  type NineHundredNinetyNineZeroes (line 59) | type NineHundredNinetyNineZeroes = TupleOf<999, '0'>;
  type Assignability (line 63) | type Assignability<_T extends UnknownArray> = unknown;
  type TestAssignability (line 64) | type TestAssignability<T extends UnknownArray> = Assignability<ExcludeRe...

FILE: test-d/exclude-strict.ts
  type ShirtSize (line 6) | type ShirtSize = 'xxxl' | 'xxl' | 'xl' | 'l' | 'm' | 's' | 'xs' | 'xxs';
  type LargeShirtSize (line 7) | type LargeShirtSize = 'xxxl' | 'xxl' | 'xl' | 'l';
  type SmallShirtSize (line 8) | type SmallShirtSize = 's' | 'xs' | 'xxs';
  type Foo (line 24) | type Foo = {
  type Bar (line 30) | type Bar = {
  type Foobar (line 37) | type Foobar = Foo | Bar;
  type invalid1 (line 60) | type invalid1 = ExcludeStrict<string | number | boolean, number | bigint>;
  type invalid2 (line 62) | type invalid2 = ExcludeStrict<string, Uppercase<string>>;
  type invalid3 (line 70) | type invalid3 = ExcludeStrict<{a?: string; b: number}, {a: string}>;
  type invalid4 (line 72) | type invalid4 = ExcludeStrict<readonly string[], string[]>;
  type invalid5 (line 80) | type invalid5 = ExcludeStrict<{a: string; b: number} | {c: true; d: fals...

FILE: test-d/exclusify-union.ts
  type FileConfig (line 59) | type FileConfig = {filePath: string};
  type InlineConfig (line 60) | type InlineConfig = {content: string};
  type Config (line 62) | type Config = ExclusifyUnion<FileConfig | InlineConfig>;
  type CardPayment (line 72) | type CardPayment = {amount: number; cardNumber: string};
  type PaypalPayment (line 73) | type PaypalPayment = {amount: number; paypalId: string};
  function processPayment (line 75) | function processPayment(payment: ExclusifyUnion<CardPayment | PaypalPaym...

FILE: test-d/extends-strict.ts
  type UserId (line 66) | type UserId = Tagged<string, 'UserId'>;

FILE: test-d/extract-rest-element.ts
  type FiftyZeroes (line 54) | type FiftyZeroes = TupleOf<50, '0'>;
  type NineHundredNinetyNineZeroes (line 57) | type NineHundredNinetyNineZeroes = TupleOf<999, '0'>;

FILE: test-d/extract-strict.ts
  type ShirtSize (line 6) | type ShirtSize = 'xxxl' | 'xxl' | 'xl' | 'l' | 'm' | 's' | 'xs' | 'xxs';
  type LargeShirtSize (line 7) | type LargeShirtSize = 'xxxl' | 'xxl' | 'xl' | 'l';
  type SmallShirtSize (line 8) | type SmallShirtSize = 's' | 'xs' | 'xxs';
  type Foo (line 24) | type Foo = {
  type Bar (line 30) | type Bar = {
  type Foobar (line 37) | type Foobar = Foo | Bar;
  type invalid1 (line 69) | type invalid1 = ExtractStrict<string | number | boolean, number | bigint>;
  type invalid2 (line 71) | type invalid2 = ExtractStrict<string, Uppercase<string>>;
  type invalid3 (line 78) | type invalid3 = ExtractStrict<{a?: string; b: number}, {a: string}>;
  type invalid4 (line 80) | type invalid4 = ExtractStrict<readonly string[], string[]>;
  type invalid5 (line 88) | type invalid5 = ExtractStrict<{a: string; b: number} | {c: true; d: fals...

FILE: test-d/find-global-type.ts
  class NonGlobalES6Class (line 5) | class NonGlobalES6Class {}
  class GlobalES6Class (line 11) | class GlobalES6Class {}
  type GlobalClass (line 16) | type GlobalClass = {foo: string};
  type GlobalTypeAlias (line 21) | type GlobalTypeAlias = {value: string};

FILE: test-d/fixed-length-array.ts
  type FixedToThreeStrings (line 4) | type FixedToThreeStrings = FixedLengthArray<string, 3>;
  type OutOfBounds (line 18) | type OutOfBounds = FixedToThreeStrings[3];
  type NoSplice (line 32) | type NoSplice = FixedToThreeStrings['splice'];
  type NoPush (line 34) | type NoPush = FixedToThreeStrings['push'];
  type NoPop (line 36) | type NoPop = FixedToThreeStrings['pop'];
  type NoShift (line 38) | type NoShift = FixedToThreeStrings['shift'];
  type NoUnshift (line 40) | type NoUnshift = FixedToThreeStrings['unshift'];
  type FixedLength (line 47) | type FixedLength = FixedLengthArray<string, number>;
  type NoSplice (line 66) | type NoSplice = FixedLength['splice'];
  type NoPush (line 68) | type NoPush = FixedLength['push'];
  type NoPop (line 70) | type NoPop = FixedLength['pop'];
  type NoShift (line 72) | type NoShift = FixedLength['shift'];
  type NoUnshift (line 74) | type NoUnshift = FixedLength['unshift'];

FILE: test-d/get.ts
  type NonStrict (line 4) | type NonStrict = {strict: false};
  type ApiResponse (line 8) | type ApiResponse = {
  type WithDictionary (line 33) | type WithDictionary = {
  type WithTuples (line 52) | type WithTuples = {
  type EmptyTuple (line 72) | type EmptyTuple = Parameters<() => {}>;
  type WithNumberKeys (line 79) | type WithNumberKeys = {
  type WithModifiers (line 95) | type WithModifiers = {
  type Foo (line 145) | type Foo = {
  type FooPaths (line 149) | type FooPaths = `array.${number}`;
  type FooPaths2 (line 152) | type FooPaths2 = 'array.1';

FILE: test-d/global-this.ts
  type ExtraProperties (line 4) | type ExtraProperties = GlobalThis & {

FILE: test-d/has-optional-keys.ts
  type TestType1 (line 4) | type TestType1 = {
  type TestType2 (line 9) | type TestType2 = {
  type TestType3 (line 14) | type TestType3 = {
  type HasOptionalKeys1 (line 19) | type HasOptionalKeys1 = HasOptionalKeys<TestType1>;
  type HasOptionalKeys2 (line 20) | type HasOptionalKeys2 = HasOptionalKeys<TestType2>;
  type HasOptionalKeys3 (line 21) | type HasOptionalKeys3 = HasOptionalKeys<TestType3>;

FILE: test-d/has-readonly-keys.ts
  type TestType1 (line 4) | type TestType1 = {
  type TestType2 (line 9) | type TestType2 = {
  type TestType3 (line 14) | type TestType3 = {
  type HasReadonlyKeys1 (line 19) | type HasReadonlyKeys1 = HasReadonlyKeys<TestType1>;
  type HasReadonlyKeys2 (line 20) | type HasReadonlyKeys2 = HasReadonlyKeys<TestType2>;
  type HasReadonlyKeys3 (line 21) | type HasReadonlyKeys3 = HasReadonlyKeys<TestType3>;

FILE: test-d/has-required-keys.ts
  type TestType1 (line 4) | type TestType1 = {
  type TestType2 (line 9) | type TestType2 = {
  type TestType3 (line 14) | type TestType3 = {
  type HasRequiredKeys1 (line 19) | type HasRequiredKeys1 = HasRequiredKeys<TestType1>;
  type HasRequiredKeys2 (line 20) | type HasRequiredKeys2 = HasRequiredKeys<TestType2>;
  type HasRequiredKeys3 (line 21) | type HasRequiredKeys3 = HasRequiredKeys<TestType3>;

FILE: test-d/has-writable-keys.ts
  type TestType1 (line 4) | type TestType1 = {
  type TestType2 (line 9) | type TestType2 = {
  type TestType3 (line 14) | type TestType3 = {
  type HasWritableKeys1 (line 19) | type HasWritableKeys1 = HasWritableKeys<TestType1>;
  type HasWritableKeys2 (line 20) | type HasWritableKeys2 = HasWritableKeys<TestType2>;
  type HasWritableKeys3 (line 21) | type HasWritableKeys3 = HasWritableKeys<TestType3>;

FILE: test-d/if-any.ts
  type A (line 14) | type A = IfAny;

FILE: test-d/if-never.ts
  type A (line 12) | type A = IfNever;

FILE: test-d/if-unknown.ts
  type A (line 12) | type A = IfUnknown;

FILE: test-d/includes.ts
  type A0 (line 45) | type A0 = Includes;
  type A1 (line 49) | type A1 = Includes<['my', 'array', 'has', 'stuff']>;
  type A2 (line 53) | type A2 = Includes<'why a string?', 5>;
  type A3 (line 57) | type A3 = Includes<{key: 'value'}, 7>;

FILE: test-d/int-closed-range.ts
  type Int0_998 (line 17) | type Int0_998 = IntClosedRange<0, 998>;

FILE: test-d/internal/apply-default-options.ts
  type PathsOptions (line 4) | type PathsOptions = {
  type DefaultPathsOptions (line 11) | type DefaultPathsOptions = {
  type SomeType (line 71) | type SomeType<Options extends PathsOptions = {}> = _SomeType<ApplyDefaul...
  type _SomeType (line 72) | type _SomeType<Options extends Required<PathsOptions>> = Options;

FILE: test-d/internal/enforce-optional.ts
  type Foo (line 4) | type Foo = {
  type EnforcedOptionalFoo (line 11) | type EnforcedOptionalFoo = EnforceOptional<Foo>;

FILE: test-d/internal/has-multiple-call-signatures.ts
  type Overloaded (line 4) | type Overloaded = {
  type Overloaded2 (line 9) | type Overloaded2 = {
  type Namespace (line 15) | type Namespace = {

FILE: test-d/internal/normalized-keys.ts
  type T1 (line 19) | type T1 = NormalizedKeys<boolean>;
  type T2 (line 21) | type T2 = NormalizedKeys<string[]>;
  type T3 (line 23) | type T3 = NormalizedKeys<unknown>;

FILE: test-d/internal/object-value.ts
  type ObjectT (line 4) | type ObjectT = {

FILE: test-d/internal/require-none.ts
  type NoneAllowed (line 4) | type NoneAllowed = RequireNone<'foo' | 'bar'>;
  type SomeAllowed (line 11) | type SomeAllowed = Record<'bar', string> & RequireNone<'foo'>;

FILE: test-d/invariant-of.ts
  type FooBar (line 4) | type FooBar = InvariantOf<{
  type FooBarBaz (line 9) | type FooBarBaz = InvariantOf<{

FILE: test-d/is-any.ts
  type A (line 20) | type A = IsAny;
  type OnlyAny (line 24) | type OnlyAny<T extends IsAny<T> extends true ? any : never> = T;
  type B (line 25) | type B = OnlyAny<any>;
  type C (line 27) | type C = OnlyAny<string>;

FILE: test-d/is-equal.ts
  type LongTupleNumber (line 45) | type LongTupleNumber = TupleOf<50, 0>;
  type ReadonlyLongTupleNumber (line 48) | type ReadonlyLongTupleNumber = Readonly<TupleOf<50, 0>>;
  type A (line 55) | type A = IsEqual;
  type B (line 59) | type B = IsEqual<number>;
  type UnionType (line 62) | type UnionType = IsEqual<{a: 1} | {a: 1}, {a: 1}>;
  type IntersectionType (line 65) | type IntersectionType = IsEqual<{a: 1} & {a: 1}, {a: 1}>;
  type BranchOnWrappedTupleMatches (line 69) | type BranchOnWrappedTupleMatches<Tpl> = (Tpl extends [[0, 2]] ? 'Foo' : ...
  type BranchOnWrappedTupleDoesNotMatch (line 70) | type BranchOnWrappedTupleDoesNotMatch<Tpl> = (Tpl extends [[0, 1]] ? 'Fo...
  type BranchOnTupleMatches (line 71) | type BranchOnTupleMatches<Tpl> = (Tpl extends [0, 2] ? 'Foo' : 'Bar');
  type BranchOnTupleDoesNotMatch (line 72) | type BranchOnTupleDoesNotMatch<Tpl> = (Tpl extends [0, 1] ? 'Foo' : 'Bar');
  type Assignability (line 90) | type Assignability<T, U, _V extends IsEqual<T, U>> = any;
  type TestAssignability (line 91) | type TestAssignability<T> = Assignability<T, T, true>;

FILE: test-d/is-literal.ts
  type A0 (line 109) | type A0 = IsLiteral;
  type A1 (line 111) | type A1 = IsStringLiteral;
  type A2 (line 113) | type A2 = IsNumericLiteral;
  type A3 (line 115) | type A3 = IsBooleanLiteral;
  type A4 (line 117) | type A4 = IsSymbolLiteral;

FILE: test-d/is-never.ts
  type A (line 20) | type A = IsNever;

FILE: test-d/is-optional-key-of.ts
  type A (line 9) | type A = {
  type B (line 23) | type B = {
  type C (line 31) | type C = {
  type D (line 40) | type D = {
  type E1 (line 49) | type E1 = {a?: number};
  type E2 (line 50) | type E2 = {a: number};
  type E (line 51) | type E = E1 | E2;
  type F1 (line 56) | type F1 = {a?: number};
  type F2 (line 57) | type F2 = {a: number};
  type F (line 58) | type F = F1 & F2;
  class G (line 63) | class G {
  type H (line 71) | type H = {
  type I (line 80) | type I = {
  type J (line 89) | type J = Partial<{
  type L (line 98) | type L = {
  type FullKeyUnion (line 113) | type FullKeyUnion = keyof A;
  type K (line 119) | type K = {a?: string};

FILE: test-d/is-readonly-key-of.ts
  type A (line 9) | type A = {
  type B (line 23) | type B = {
  type C (line 30) | type C = {
  type D (line 38) | type D = {
  type E1 (line 47) | type E1 = {a: number};
  type E2 (line 48) | type E2 = {readonly a: number};
  type E (line 49) | type E = E1 | E2;
  type F1 (line 54) | type F1 = {readonly a: string};
  type F2 (line 55) | type F2 = {a: string};
  type F (line 56) | type F = F1 & F2;
  class G (line 61) | class G {
  type H (line 70) | type H = {
  type I (line 79) | type I = Readonly<{
  type J (line 88) | type J = {
  type K (line 97) | type K = Record<'a' | 'b', string>;
  type FullKeyUnion (line 109) | type FullKeyUnion = keyof A;
  type L (line 115) | type L = {readonly a: string};

FILE: test-d/is-required-key-of.ts
  type A (line 9) | type A = {
  type B (line 23) | type B = {
  type C (line 31) | type C = {
  type D (line 40) | type D = {
  type E1 (line 49) | type E1 = {a?: number};
  type E2 (line 50) | type E2 = {a: number};
  type E (line 51) | type E = E1 | E2;
  type F1 (line 56) | type F1 = {a?: number};
  type F2 (line 57) | type F2 = {a: number};
  type F (line 58) | type F = F1 & F2;
  class G (line 63) | class G {
  type H (line 71) | type H = {
  type I (line 80) | type I = {
  type J (line 89) | type J = Partial<{
  type L (line 98) | type L = {
  type FullKeyUnion (line 113) | type FullKeyUnion = keyof A;
  type K (line 119) | type K = {a: string};

FILE: test-d/is-tuple.ts
  type T (line 66) | type T = IsTuple<{}>;

FILE: test-d/is-union.ts
  type TestUnion (line 20) | type TestUnion =

FILE: test-d/is-unknown.ts
  type A (line 20) | type A = IsUnknown;

FILE: test-d/is-writable-key-of.ts
  type A (line 9) | type A = {
  type B (line 23) | type B = {
  type C (line 30) | type C = {
  type D (line 38) | type D = {
  type E1 (line 47) | type E1 = {a: number};
  type E2 (line 48) | type E2 = {readonly a: number};
  type E (line 49) | type E = E1 | E2;
  type F1 (line 54) | type F1 = {readonly a: string};
  type F2 (line 55) | type F2 = {a: string};
  type F (line 56) | type F = F1 & F2;
  class G (line 61) | class G {
  type H (line 70) | type H = {
  type I (line 79) | type I = Readonly<{
  type J (line 88) | type J = {
  type K (line 97) | type K = Record<'a' | 'b', string>;
  type FullKeyUnion (line 109) | type FullKeyUnion = keyof A;
  type L (line 115) | type L = {readonly a: string};

FILE: test-d/iterable-element.ts
  type Fruit (line 22) | type Fruit = IterableElement<typeof fruits>;
  type VegetableSet (line 28) | type VegetableSet = Set<'🥦' | '🥕' | '🌶'>;
  type Vegetable (line 29) | type Vegetable = IterableElement<VegetableSet>;
  type UserRolesSet (line 35) | type UserRolesSet = ReadonlySet<'regular' | 'contributor' | 'maintainer'>;
  type UserRole (line 36) | type UserRole = IterableElement<UserRolesSet>;

FILE: test-d/jsonifiable.ts
  method toJSON (line 16) | toJSON() {

FILE: test-d/jsonify.ts
  type A (line 6) | interface A {
  class B (line 10) | class B {
  type V (line 14) | interface V {
  type X (line 18) | interface X {
  type Y (line 22) | interface Y {
  type Z (line 26) | interface Z {
  type W (line 30) | interface W {
  type Geometry (line 71) | interface Geometry {
  class NonJsonWithToJSON (line 100) | class NonJsonWithToJSON {
    method toJSON (line 103) | public toJSON(): {fixture: Array<[string, number]>} {
  class NonJsonExtendPrimitiveWithToJSON (line 115) | class NonJsonExtendPrimitiveWithToJSON extends Number {
    method toJSON (line 118) | public toJSON(): {fixture: string} {
  class NonJsonWithToJSONWrapper (line 130) | class NonJsonWithToJSONWrapper {
    method toJSON (line 134) | public toJSON() {
  type InnerFixture (line 147) | type InnerFixture = {fixture: Array<[string, number]>};
  class NonJsonWithInvalidToJSON (line 155) | class NonJsonWithInvalidToJSON {
    method toJSON (line 160) | public toJSON(): {fixture: Map<string, number>} {
  type OptionalPrimitive (line 288) | type OptionalPrimitive = {
  type OptionalTypeUnion (line 292) | type OptionalTypeUnion = {
  type NonOptionalTypeUnion (line 296) | type NonOptionalTypeUnion = {
  type AppData (line 310) | type AppData = {
  type ExpectedAppDataJson (line 330) | type ExpectedAppDataJson = {

FILE: test-d/kebab-cased-properties-deep.ts
  type FooBar (line 4) | type FooBar = {helloWorld: {p2p: Array<{addressLine1: string}>}};
  type User (line 13) | type User = {
  type UserWithFriends (line 20) | type UserWithFriends = {

FILE: test-d/kebab-cased-properties.ts
  type Foobar (line 4) | type Foobar = {helloWorld1: {fooBar: string}};
  type User (line 13) | type User = {

FILE: test-d/keys-of-union.ts
  type Example1 (line 6) | type Example1 = {
  type Expected1 (line 14) | type Expected1 = keyof Example1;
  type Example2 (line 22) | type Example2 = {
  type Expected2 (line 33) | type Expected2 = 'common' | 'a' | 'b' | 'c';
  type Assignability1 (line 44) | type Assignability1<T, _K extends keyof T> = unknown;
  type Test1 (line 46) | type Test1<T> = Assignability1<T, KeysOfUnion<T>>;
  type Assignability2 (line 49) | type Assignability2<T, _K extends KeysOfUnion<T>> = unknown;
  type Test2 (line 50) | type Test2<T> = Assignability2<T, keyof T>;
  type Assignability3 (line 53) | type Assignability3<_T, _K extends PropertyKey> = unknown;
  type Test3 (line 54) | type Test3<T> = Assignability3<T, KeysOfUnion<T>>;
  type Assignability4 (line 57) | type Assignability4<T, _K extends KeysOfUnion<T>> = unknown;
  type Test4 (line 59) | type Test4<T> = Assignability4<T, PropertyKey>;
  type Assignability5 (line 62) | type Assignability5<T extends Record<string, unknown>, _K extends KeysOf...
  type Test5 (line 63) | type Test5<T extends Record<string, unknown>> = Assignability5<T, keyof T>;
  type Assignability6 (line 66) | type Assignability6<T extends object, _K extends KeysOfUnion<T>> = unknown;
  type Test6 (line 67) | type Test6<T extends object> = Assignability6<T, keyof T>;
  type Assignability7 (line 70) | type Assignability7<T extends UnknownRecord, _K extends KeysOfUnion<T>> ...
  type Test7 (line 71) | type Test7<T extends UnknownRecord> = Assignability7<T, keyof T>;
  type Assignability8 (line 74) | type Assignability8<T extends Record<string, unknown>, _K extends keyof ...
  type Test8 (line 76) | type Test8<T extends Record<string, unknown>> = Assignability8<T, KeysOf...
  type Assignability9 (line 79) | type Assignability9<T extends object, _K extends keyof T> = unknown;
  type Test9 (line 81) | type Test9<T extends object> = Assignability9<T, KeysOfUnion<T>>;

FILE: test-d/literal-to-primitive-deep.ts
  type LiteralObject (line 4) | type LiteralObject = {
  type PrimitiveObject (line 27) | type PrimitiveObject = {

FILE: test-d/merge-deep.ts
  class ClassA (line 63) | class ClassA {
  class ClassB (line 67) | class ClassB {
  type Foo (line 78) | type Foo = {foo: string; fooBar: unknown; items: string[]};
  type Bar (line 79) | type Bar = {bar: number; fooBar: boolean; items: number[]};
  type FooDeep (line 91) | type FooDeep = {foo: Foo; fooBar: Foo; items: {foo: Foo[]; fooBar: Foo}};
  type BarDeep (line 92) | type BarDeep = {bar: Bar; fooBar: Bar; items: {bar: Bar[]; fooBar: Bar}};
  type FooWithIndexSignature (line 125) | type FooWithIndexSignature = {[x: number]: number; foo: string; items: s...
  type BarWithIndexSignature (line 126) | type BarWithIndexSignature = {[x: symbol]: symbol; bar: number; items: n...
  type FooWithIndexSignatureDeep (line 127) | type FooWithIndexSignatureDeep = {[x: number]: number; foo: string; fooB...
  type BarWithIndexSignatureDeep (line 128) | type BarWithIndexSignatureDeep = {[x: symbol]: symbol; bar: number; fooB...
  type FooWithOptional (line 147) | type FooWithOptional = {foo: string; fooOptional?: string; fooBar: Foo; ...
  type BarWithOptional (line 148) | type BarWithOptional = {bar: number; barOptional?: number; fooBar: Bar; ...
  type FooOptional (line 171) | type FooOptional = {
  type BarOptional (line 176) | type BarOptional = {
  type MergedFooBar (line 179) | type MergedFooBar = {
  type ReadonlyFoo (line 191) | type ReadonlyFoo = {
  type ReadonlyBar (line 196) | type ReadonlyBar = {
  type FooArray (line 208) | type FooArray = Foo[];
  type BarArray (line 209) | type BarArray = Bar[];
  type FooTuple (line 254) | type FooTuple = [Foo, [Foo[], 42], 'foo'];
  type BarTuple (line 255) | type BarTuple = [Bar, [Bar[], 'a', 'b'], 'bar', true];
  type FooBarSpread (line 257) | type FooBarSpread = typeof fooBarSpread;
  type FooBarReplace (line 258) | type FooBarReplace = typeof fooBarReplace;
  type FooNumberTuple (line 267) | type FooNumberTuple = [Foo[], number[]];
  type BarArray2D (line 268) | type BarArray2D = Bar[][];
  type FooArray2D (line 277) | type FooArray2D = Foo[][];
  type BarNumberTuple (line 278) | type BarNumberTuple = [Bar[], number[]];
  type RecordNotPartial (line 313) | type RecordNotPartial = {
  type RecordPartial (line 318) | type RecordPartial = Partial<RecordNotPartial>;
  type NotOptional (line 323) | type NotOptional = {a: string; b: number; c: boolean};
  type OptionalWithUndefined (line 324) | type OptionalWithUndefined = {a: string | undefined; b?: number; c?: boo...

FILE: test-d/merge-exclusive.ts
  type BaseOptions (line 4) | type BaseOptions = {
  type ExclusiveVariation1 (line 8) | type ExclusiveVariation1 = {
  type ExclusiveVariation2 (line 12) | type ExclusiveVariation2 = {
  type Options (line 16) | type Options = MergeExclusive<ExclusiveVariation1, ExclusiveVariation2>;

FILE: test-d/merge.ts
  type Foo (line 4) | type Foo = {
  type Bar (line 9) | type Bar = {
  type FooInterface (line 17) | interface FooInterface {
  type BarType (line 24) | type BarType = {
  type FooBar (line 31) | type FooBar = Merge<FooInterface, BarType>;
  type FooDefaultOptions (line 62) | type FooDefaultOptions = {
  type FooOptions (line 66) | type FooOptions = Merge<FooDefaultOptions, {stripUndefinedValues: true}>;
  type FooWithOptionaKeys (line 71) | type FooWithOptionaKeys = {
  type BarWithOptionaKeys (line 81) | type BarWithOptionaKeys = {
  type FooBarWithOptionalKeys (line 91) | type FooBarWithOptionalKeys = Merge<FooWithOptionaKeys, BarWithOptionaKe...
  type FooWithIndexSignature (line 110) | type FooWithIndexSignature = {
  type BarWithIndexSignatureOverwrite (line 118) | type BarWithIndexSignatureOverwrite = {
  type FooBarWithIndexSignature (line 126) | type FooBarWithIndexSignature = Merge<FooWithIndexSignature, BarWithInde...
  type Baz (line 154) | type Baz = {
  type TestIntersectionObject (line 192) | type TestIntersectionObject = {a: string} & {b: string};

FILE: test-d/multidimensional-array.ts
  function createArray (line 4) | function createArray<T extends number>(dimensions: T): MultidimensionalA...
  type RecursiveArray (line 24) | type RecursiveArray<T> = Array<RecursiveArray<T>>;

FILE: test-d/multidimensional-readonly-array.ts
  function createArray (line 4) | function createArray<T extends number>(dimensions: T): MultidimensionalR...
  type RecursiveArray (line 26) | type RecursiveArray<T> = ReadonlyArray<RecursiveArray<T>>;

FILE: test-d/non-empty-object.ts
  type TestType1 (line 4) | type TestType1 = {
  type TestType2 (line 9) | type TestType2 = {
  type TestType3 (line 14) | type TestType3 = {
  type TestType4 (line 19) | type TestType4 = {};

FILE: test-d/non-empty-string.ts
  type Assignability1 (line 19) | type Assignability1<_S extends string> = unknown;
  type Test1 (line 20) | type Test1<S extends string> = Assignability1<NonEmptyString<S>>;
  type Assignability2 (line 23) | type Assignability2<_S extends string, _SS extends NonEmptyString<_S>> =...
  type Test2 (line 25) | type Test2<S extends string> = Assignability2<S, S>;

FILE: test-d/object-merge.ts
  type T1 (line 267) | type T1 = ObjectMerge<string, {a: string}>;
  type T2 (line 269) | type T2 = ObjectMerge<{a: string}, number>;
  type T3 (line 271) | type T3 = ObjectMerge<{a: string}, unknown>;
  type T4 (line 273) | type T4 = ObjectMerge<unknown, {a: string}>;

FILE: test-d/observable-like.ts
  method next (line 10) | next() {}
  method next (line 15) | next(value) {
  method next (line 23) | next() {}
  method next (line 26) | next(value) {

FILE: test-d/omit-deep.ts
  class ClassA (line 4) | class ClassA {
  type BaseType (line 8) | type BaseType = {
  type Testing (line 30) | type Testing = {
  type DeepType (line 76) | type DeepType = {
  type Optional (line 109) | type Optional = {

FILE: test-d/omit-index-signature.ts
  type ExampleInterface (line 4) | type ExampleInterface = {
  type MappedType (line 20) | type MappedType<ObjectType> = {

FILE: test-d/opaque.ts
  type Value (line 4) | type Value = Opaque<number, 'Value'>;
  type WithoutToken (line 18) | type WithoutToken = Opaque<number>;
  type Person (line 22) | type Person = {
  type UUID (line 34) | type UUID = Opaque<string, 'UUID'>;
  type NormalizedDictionary (line 35) | type NormalizedDictionary<T> = Record<UUID, T>;
  type Foo (line 36) | type Foo = {bar: string};
  type PlainValue (line 50) | type PlainValue = UnwrapOpaque<Value>;
  type TaggedValue (line 65) | type TaggedValue = Tagged<number, 'Value'>;
  type TaggedUUID (line 66) | type TaggedUUID = Tagged<string, 'UUID'>;
  type AbsolutePath (line 85) | type AbsolutePath = Tagged<string, 'AbsolutePath'>;
  type NormalizedPath (line 86) | type NormalizedPath = Tagged<string, 'NormalizedPath'>;
  type NormalizedAbsolutePath (line 87) | type NormalizedAbsolutePath = AbsolutePath & NormalizedPath;
  type UrlString (line 89) | type UrlString = Tagged<string, 'URL'>;
  type SpecialCacheKey (line 90) | type SpecialCacheKey = Tagged<UrlString, 'SpecialCacheKey'>;
  type PlainValueUnwrapOpaque (line 107) | type PlainValueUnwrapOpaque = UnwrapOpaque<TaggedValue>;
  type PlainValueUnwrapTagged (line 108) | type PlainValueUnwrapTagged = UnwrapTagged<TaggedValue>;
  type JsonOf (line 126) | type JsonOf<T> = Tagged<string, 'JSON', T>;
  type IdType (line 146) | type IdType = Opaque<number, 'test'>;
  type TestSnakeObject (line 147) | type TestSnakeObject = SnakeCasedPropertiesDeep<{testId: IdType}>;

FILE: test-d/optional-keys-of.ts
  type TestType1 (line 4) | type TestType1 = {
  type TestType2 (line 9) | type TestType2 = {
  type TestType3 (line 14) | type TestType3 = {
  type OptionalKeysOf1 (line 19) | type OptionalKeysOf1 = OptionalKeysOf<TestType1>;
  type OptionalKeysOf2 (line 20) | type OptionalKeysOf2 = OptionalKeysOf<TestType2>;
  type OptionalKeysOf3 (line 21) | type OptionalKeysOf3 = OptionalKeysOf<TestType3>;
  type Assignability1 (line 44) | type Assignability1<T, _K extends keyof T> = unknown;
  type Test1 (line 45) | type Test1<T extends object> = Assignability1<T, OptionalKeysOf<T>>;
  type Assignability2 (line 48) | type Assignability2<T extends object, _K extends OptionalKeysOf<T>> = un...
  type Test2 (line 50) | type Test2<T extends object> = Assignability2<T, keyof T>;
  type Assignability3 (line 53) | type Assignability3<_T, _K extends PropertyKey> = unknown;
  type Test3 (line 54) | type Test3<T extends object> = Assignability3<T, OptionalKeysOf<T>>;
  type Assignability4 (line 57) | type Assignability4<T extends object, _K extends OptionalKeysOf<T>> = un...
  type Test4 (line 59) | type Test4<T extends object> = Assignability4<T, PropertyKey>;
  type Assignability5 (line 62) | type Assignability5<T extends Record<string, unknown>, _K extends keyof ...
  type Test5 (line 63) | type Test5<T extends Record<string, unknown>> = Assignability5<T, Option...
  type Assignability6 (line 66) | type Assignability6<T extends object, _K extends keyof T> = unknown;
  type Test6 (line 67) | type Test6<T extends object> = Assignability6<T, OptionalKeysOf<T>>;
  type Assignability7 (line 70) | type Assignability7<T extends UnknownRecord, _K extends keyof T> = unknown;
  type Test7 (line 71) | type Test7<T extends UnknownRecord> = Assignability7<T, OptionalKeysOf<T>>;
  type Assignability8 (line 74) | type Assignability8<T extends Record<string, unknown>, _K extends Option...
  type Test8 (line 76) | type Test8<T extends Record<string, unknown>> = Assignability8<T, keyof T>;
  type Assignability9 (line 79) | type Assignability9<T extends object, _K extends OptionalKeysOf<T>> = un...
  type Test9 (line 81) | type Test9<T extends object> = Assignability9<T, keyof T>;
  type Assignability10 (line 84) | type Assignability10<T extends UnknownRecord, _K extends OptionalKeysOf<...
  type Test10 (line 86) | type Test10<T extends UnknownRecord> = Assignability10<T, keyof T>;

FILE: test-d/or-all.ts
  type Error1 (line 60) | type Error1 = OrAll<[1, 0]>;
  type Error2 (line 62) | type Error2 = OrAll<[true, false?]>;

FILE: test-d/override-properties.ts
  type Foo (line 5) | type Foo = {
  type Bar1 (line 14) | type Bar1 = OverrideProperties<Foo, {c: number}>;
  type Bar2 (line 17) | type Bar2 = OverrideProperties<Foo, {b: number; c: number}>;
  type Original (line 21) | type Original = {
  type Modified (line 26) | type Modified = {
  type Final (line 31) | type Final = OverrideProperties<Original, Modified>;

FILE: test-d/package-json.ts
  type UnknownRecord (line 137) | type UnknownRecord = Record<string, unknown>;

FILE: test-d/partial-deep.ts
  class ClassA (line 4) | class ClassA {
  type Recurse (line 67) | type Recurse =
  type RecurseObject (line 74) | type RecurseObject = {value: Recurse};
  type FunctionWithProperties (line 114) | type FunctionWithProperties = {(a1: string, a2: number): boolean; p1: st...
  type FunctionWithProperties2 (line 119) | type FunctionWithProperties2 = {(a1: boolean, ...a2: string[]): number; ...
  type FunctionWithProperties3 (line 124) | type FunctionWithProperties3 = {(): void; p1: {p2?: string; p3: [{p4: nu...
  type FunctionWithProperties4 (line 133) | type FunctionWithProperties4 = {(a1: number): string; (a1: string, a2: n...

FILE: test-d/partial-on-undefined-deep.ts
  type TestingType (line 4) | type TestingType = {

FILE: test-d/pascal-cased-properties-deep.ts
  type User (line 14) | type User = {
  type UserWithFriends (line 21) | type UserWithFriends = {
  type bazBizDeep (line 56) | type bazBizDeep = {fooBAR: number; baz: {fooBAR: Array<{BARFoo: string}>}};

FILE: test-d/pascal-cased-properties.ts
  type User (line 14) | type User = {

FILE: test-d/paths.ts
  type DeepObject (line 8) | type DeepObject = {
  type DeepPath (line 20) | type DeepPath = 'a' | 'a.b' | 'a.b2' | 'a.b3' | 'a.b.c' | 'a.b.c.d' | `a...
  type InterfaceType (line 25) | interface InterfaceType extends DeepObject {}
  type MyEntity (line 133) | type MyEntity = {
  type MyOtherEntity (line 136) | type MyOtherEntity = {
  type MyEntityPaths (line 139) | type MyEntityPaths = Paths<MyEntity>;
  type RecursiveFoo (line 143) | type RecursiveFoo = {foo: RecursiveFoo};
  type Object1 (line 153) | type Object1 = {
  type Object2 (line 158) | type Object2 = {
  type Object3 (line 164) | type Object3 = {
  type Object4 (line 170) | type Object4 = {
  type Object5 (line 177) | type Object5 = {
  type deepArray (line 184) | type deepArray = {
  type RecursionArray (line 189) | type RecursionArray = RecursionArray[];
  type RecursionArrayPaths (line 190) | type RecursionArrayPaths = Paths<RecursionArray, {bracketNotation: true;...
  type PathsConstraint (line 529) | type PathsConstraint<T, _U extends Paths<T>> = never;
  type Generic1 (line 531) | type Generic1<T> = {bar: {baz: T}};
  type Test1 (line 532) | type Test1<T> = PathsConstraint<Generic1<T>, 'bar.baz'>;
  type Generic2 (line 534) | type Generic2<T, U> = {bar: {baz: {qux: T}; fizz: {buzz: U} | U | T}};
  type Test2 (line 535) | type Test2<T, U> = PathsConstraint<
  type LeavesOnlyPathsConstraint (line 540) | type LeavesOnlyPathsConstraint<T, _U extends Paths<T, {leavesOnly: true}...
  type Generic3 (line 542) | type Generic3<T> = {bar: {baz: T; qux: string}};
  type Test3 (line 543) | type Test3<T> = LeavesOnlyPathsConstraint<Generic3<T>, 'bar.qux'>;
  type Test4 (line 545) | type Test4<T> = LeavesOnlyPathsConstraint<Generic3<T>, 'bar'>;
  type Test5 (line 547) | type Test5<T> = LeavesOnlyPathsConstraint<Generic3<T>, 'bar.baz'>;
  type DepthPathsConstraint (line 549) | type DepthPathsConstraint<T, _U extends Paths<T, {depth: 1}>> = never;
  type Generic4 (line 551) | type Generic4<T> = {bar: {baz: T}; qux: [T]};
  type Test6 (line 552) | type Test6<T> = DepthPathsConstraint<Generic4<T>, 'bar.baz' | 'qux.0'>;
  type Test7 (line 554) | type Test7<T> = DepthPathsConstraint<Generic4<T>, 'bar'>;
  type Test8 (line 556) | type Test8<T> = DepthPathsConstraint<Generic4<T>, 'qux'>;
  type BracketNotationPathsConstraint (line 558) | type BracketNotationPathsConstraint<T, _U extends Paths<T, {bracketNotat...
  type Generic5 (line 560) | type Generic5<T> = {1: {2: T}; 3: [T]};
  type Test9 (line 561) | type Test9<T> = BracketNotationPathsConstraint<Generic5<T>, '[1]' | '[1]...
  type MaxRecursionDepthPathsConstraint (line 563) | type MaxRecursionDepthPathsConstraint<T, _U extends Paths<T, {maxRecursi...
  type Generic6 (line 565) | type Generic6<T> = {foo: {bar: T}; baz: T; fizz: {buzz: {qux: {quxx: T}}}};
  type Test10 (line 566) | type Test10<T> = MaxRecursionDepthPathsConstraint<
  type Test11 (line 571) | type Test11<T> = MaxRecursionDepthPathsConstraint<Generic6<T>, 'fizz.buz...
  type LeavesOnlyAndDepthPathsConstraint (line 573) | type LeavesOnlyAndDepthPathsConstraint<T, _U extends Paths<T, {leavesOnl...
  type Generic7 (line 575) | type Generic7<T> = {foo: {bar: T; baz: string; fizz: {buzz: number}}; qu...
  type Test12 (line 576) | type Test12<T> = LeavesOnlyAndDepthPathsConstraint<Generic7<T>, 'foo.baz'>;
  type Test13 (line 578) | type Test13<T> = LeavesOnlyAndDepthPathsConstraint<Generic7<T>, 'qux'>;
  type Test14 (line 580) | type Test14<T> = LeavesOnlyAndDepthPathsConstraint<Generic7<T>, 'foo.fiz...
  type Test15 (line 582) | type Test15<T> = LeavesOnlyAndDepthPathsConstraint<Generic7<T>, 'foo.bar'>;

FILE: test-d/pick-deep.ts
  class ClassA (line 4) | class ClassA {
  type BaseType (line 8) | type BaseType = {
  type Testing (line 26) | type Testing = BaseType & {
  type DeepType (line 38) | type DeepType = {
  type DepthType (line 49) | type DepthType = {nested: {deep: {deeper: {value: string}}}};
  type DeepInterface (line 56) | interface DeepInterface extends DeepType {
  type GenericType (line 67) | type GenericType<T> = {

FILE: test-d/pick-index-signature.ts
  type Foo (line 6) | type Foo = {
  type Bar (line 17) | type Bar = {
  type FooBar (line 24) | type FooBar = Simplify<Foo & Bar>;

FILE: test-d/readonly-deep.ts
  type Overloaded (line 6) | type Overloaded = {
  type Namespace (line 11) | type Namespace = {
  type NamespaceWithOverload (line 16) | type NamespaceWithOverload = Overloaded & {
  type OpaqueObjectData (line 20) | type OpaqueObjectData = {a: number[]} | {b: string};
  type OpaqueObject (line 21) | type OpaqueObject = Opaque<OpaqueObjectData, {token: unknown}>;
  type ReadonlyJsonValue (line 23) | type ReadonlyJsonValue =
  class ClassA (line 31) | class ClassA {
  type VoidType (line 116) | type VoidType = {
  type VoidTypeExpected (line 120) | type VoidTypeExpected = {

FILE: test-d/readonly-keys-of.ts
  type TestType1 (line 4) | type TestType1 = {
  type TestType2 (line 9) | type TestType2 = {
  type TestType3 (line 14) | type TestType3 = {
  type ReadonlyKeysOf1 (line 19) | type ReadonlyKeysOf1 = ReadonlyKeysOf<TestType1>;
  type ReadonlyKeysOf2 (line 20) | type ReadonlyKeysOf2 = ReadonlyKeysOf<TestType2>;
  type ReadonlyKeysOf3 (line 21) | type ReadonlyKeysOf3 = ReadonlyKeysOf<TestType3>;
  type Assignability1 (line 45) | type Assignability1<T, _K extends keyof T> = unknown;
  type Test1 (line 46) | type Test1<T extends object> = Assignability1<T, ReadonlyKeysOf<T>>;
  type Assignability2 (line 49) | type Assignability2<T extends object, _K extends ReadonlyKeysOf<T>> = un...
  type Test2 (line 51) | type Test2<T extends object> = Assignability2<T, keyof T>;
  type Assignability3 (line 54) | type Assignability3<_T, _K extends PropertyKey> = unknown;
  type Test3 (line 55) | type Test3<T extends object> = Assignability3<T, ReadonlyKeysOf<T>>;
  type Assignability4 (line 58) | type Assignability4<T extends object, _K extends ReadonlyKeysOf<T>> = un...
  type Test4 (line 60) | type Test4<T extends object> = Assignability4<T, PropertyKey>;
  type Assignability5 (line 63) | type Assignability5<T extends Record<string, unknown>, _K extends keyof ...
  type Test5 (line 64) | type Test5<T extends Record<string, unknown>> = Assignability5<T, Readon...
  type Assignability6 (line 67) | type Assignability6<T extends object, _K extends keyof T> = unknown;
  type Test6 (line 68) | type Test6<T extends object> = Assignability6<T, ReadonlyKeysOf<T>>;
  type Assignability7 (line 71) | type Assignability7<T extends UnknownRecord, _K extends keyof T> = unknown;
  type Test7 (line 72) | type Test7<T extends UnknownRecord> = Assignability7<T, ReadonlyKeysOf<T>>;
  type Assignability8 (line 75) | type Assignability8<T extends Record<string, unknown>, _K extends Readon...
  type Test8 (line 77) | type Test8<T extends Record<string, unknown>> = Assignability8<T, keyof T>;
  type Assignability9 (line 80) | type Assignability9<T extends object, _K extends ReadonlyKeysOf<T>> = un...
  type Test9 (line 82) | type Test9<T extends object> = Assignability9<T, keyof T>;
  type Assignability10 (line 85) | type Assignability10<T extends UnknownRecord, _K extends ReadonlyKeysOf<...
  type Test10 (line 87) | type Test10<T extends UnknownRecord> = Assignability10<T, keyof T>;
  type AllowsOnlyObjects (line 90) | type AllowsOnlyObjects = ReadonlyKeysOf<string>;

FILE: test-d/readonly-tuple.ts
  type TupleOfThreeStrings (line 4) | type TupleOfThreeStrings = ReadonlyTuple<string, 3>;

FILE: test-d/remove-prefix.ts
  type Assignability (line 92) | type Assignability<S extends string> = S;
  type Test1 (line 94) | type Test1<S extends string, Prefix extends string> = Assignability<Remo...
  type Test2 (line 95) | type Test2<S extends Uppercase<string>, Prefix extends '-' | '/' | '#'> ...

FILE: test-d/replace.ts
  type FiftyZeroes (line 57) | type FiftyZeroes = StringRepeat<'0', 50>;
  type FiftyOnes (line 58) | type FiftyOnes = StringRepeat<'1', 50>;
  type NineHundredNinetyNineZeroes (line 62) | type NineHundredNinetyNineZeroes = StringRepeat<'0', 999>;
  type NineHundredNinetyNineOnes (line 63) | type NineHundredNinetyNineOnes = StringRepeat<'1', 999>;

FILE: test-d/require-all-or-none.ts
  type SystemMessages (line 4) | type SystemMessages = {
  type ValidMessages (line 13) | type ValidMessages = RequireAllOrNone<SystemMessages, 'macos' | 'linux'>;
  function narrowingTest (line 36) | function narrowingTest(foo: Simplify<RequireAllOrNone<{a: string; b: str...
  function narrowingTest2 (line 50) | function narrowingTest2(foo: Simplify<RequireAllOrNone<{a: string; b: st...
  function narrowingTest3 (line 66) | function narrowingTest3(foo: Simplify<RequireAllOrNone<{a: string; b: st...

FILE: test-d/require-at-least-one.ts
  type SystemMessages (line 4) | type SystemMessages = {
  type ValidMessages (line 14) | type ValidMessages = RequireAtLeastOne<SystemMessages, 'macos' | 'linux'...
  type MessageBoard (line 37) | type MessageBoard<M> = (messages: M) => string;

FILE: test-d/require-exactly-one.ts
  type SystemMessages (line 4) | type SystemMessages = {
  type ValidMessages (line 13) | type ValidMessages = RequireExactlyOne<SystemMessages, 'macos' | 'linux'>;
  function narrowingTest (line 34) | function narrowingTest(foo: Simplify<RequireExactlyOne<{a: string; b: st...
  function narrowingTest2 (line 48) | function narrowingTest2(foo: Simplify<RequireExactlyOne<{a: string; b: s...
  function narrowingTest3 (line 72) | function narrowingTest3(foo: Simplify<RequireExactlyOne<{a: string; b: s...

FILE: test-d/require-one-or-none.ts
  type OneAtMost (line 4) | type OneAtMost = RequireOneOrNone<Record<'foo' | 'bar' | 'baz', true>>;
  type OneOrTwo (line 17) | type OneOrTwo = RequireOneOrNone<Record<'foo' | 'bar' | 'baz', true>, 'b...
  function narrowingTest (line 28) | function narrowingTest(foo: Simplify<RequireOneOrNone<{a: string; b: str...
  function narrowingTest2 (line 49) | function narrowingTest2(foo: Simplify<RequireOneOrNone<{a: string; b: st...
  function narrowingTest3 (line 81) | function narrowingTest3(foo: Simplify<RequireOneOrNone<{a: string; b: st...

FILE: test-d/required-deep.ts
  type FunctionWithProperties (line 65) | type FunctionWithProperties = {(a1: string, a2: number): boolean; p1?: s...
  type FunctionWithProperties2 (line 70) | type FunctionWithProperties2 = {(a1: boolean, ...a2: string[]): number; ...
  type FunctionWithProperties3 (line 75) | type FunctionWithProperties3 = {(): void; p1?: {p2?: string; p3: [{p4?: ...
  type FunctionWithProperties4 (line 81) | type FunctionWithProperties4 = {(a1: number): string; (a1: string, a2: n...

FILE: test-d/required-keys-of.ts
  type TestType1 (line 4) | type TestType1 = {
  type TestType2 (line 9) | type TestType2 = {
  type TestType3 (line 14) | type TestType3 = {
  type RequiredKeysOf1 (line 19) | type RequiredKeysOf1 = RequiredKeysOf<TestType1>;
  type RequiredKeysOf2 (line 20) | type RequiredKeysOf2 = RequiredKeysOf<TestType2>;
  type RequiredKeysOf3 (line 21) | type RequiredKeysOf3 = RequiredKeysOf<TestType3>;

FILE: test-d/schema.ts
  type FooOption (line 26) | type FooOption = 'A' | 'B';
  type FooSchema (line 27) | type FooSchema = Schema<typeof foo, FooOption>;
  type ComplexOption (line 74) | type ComplexOption = {
  type ComplexSchema (line 78) | type ComplexSchema = Schema<typeof foo, ComplexOption>;
  method validation (line 82) | validation(value) {
  type FooSchemaWithOptionsNoRecurse (line 131) | type FooSchemaWithOptionsNoRecurse = Schema<typeof foo, FooOption, {recu...
  type FooSchemaWithOptionsRecurse (line 179) | type FooSchemaWithOptionsRecurse = Schema<typeof foo, FooOption, {recurs...

FILE: test-d/set-non-nullable.ts
  type Variation6Config (line 25) | type Variation6Config = {a: boolean | null; b: boolean | null};

FILE: test-d/set-parameter-type.ts
  function function_ (line 4) | function function_(_a: number, _b: string, _c: Object, ..._arguments: bo...
  function functionWithThis (line 9) | function functionWithThis(this: Global, _a: number) {

FILE: test-d/set-return-type.ts
  function function1 (line 17) | function function1(this: Date): void {} // eslint-disable-line @typescri...

FILE: test-d/shared-union-fields-deep.ts
  type TestingType (line 4) | type TestingType = {
  type SharedUnionFieldsDeepRecurseIntoArrays (line 34) | type SharedUnionFieldsDeepRecurseIntoArrays<T> = SharedUnionFieldsDeep<T...
  type TestingType2 (line 128) | type TestingType2 = TestingType & {foo: any};

FILE: test-d/shared-union-fields.ts
  type TestingType (line 5) | type TestingType = {

FILE: test-d/simplify-deep.ts
  type Properties1 (line 4) | type Properties1 = {
  type Properties2 (line 12) | type Properties2 = {
  type BarBaz (line 38) | interface BarBaz {

FILE: test-d/simplify.ts
  type PositionProperties (line 4) | type PositionProperties = {
  type SizeProperties (line 9) | type SizeProperties = {
  type SomeInterface (line 19) | interface SomeInterface {
  type SomeInterfaceAsTypeWrittenByHand (line 25) | type SomeInterfaceAsTypeWrittenByHand = {
  type SomeFunction (line 49) | type SomeFunction = (type: string) => string;
  type SimplifiedFunction (line 50) | type SimplifiedFunction = Simplify<SomeFunction>;

FILE: test-d/snake-cased-properties-deep.ts
  type FooBar (line 4) | type FooBar = {helloWorld: {p2p: Array<{addressLine1: string}>}};
  type User (line 13) | type User = {
  type UserWithFriends (line 20) | type UserWithFriends = {

FILE: test-d/snake-cased-properties.ts
  type Foobar (line 4) | type Foobar = {helloWorld1: {fooBar: string}};
  type User (line 13) | type User = {

FILE: test-d/some-extend.ts
  type NonStrictNeverSomeExtend (line 111) | type NonStrictNeverSomeExtend<TArray extends UnknownArray, Type> = SomeE...

FILE: test-d/split-on-rest-element.ts
  type FiftyZeroes (line 58) | type FiftyZeroes = TupleOf<50, '0'>;
  type FourHundredNinetyNineZeroes (line 61) | type FourHundredNinetyNineZeroes = TupleOf<499, '0'>;
  type Assignability (line 65) | type Assignability<_T extends UnknownArray> = unknown;
  type TestAssignability (line 66) | type TestAssignability<T extends UnknownArray> = Assignability<SplitOnRe...

FILE: test-d/split.ts
  type FiftyZeroes (line 60) | type FiftyZeroes = StringRepeat<'0', 50>;
  type NineHundredNinetyNineZeroes (line 64) | type NineHundredNinetyNineZeroes = StringRepeat<'0', 999>;

FILE: test-d/spread.ts
  type Foo (line 4) | type Foo = {
  type Bar (line 14) | type Bar = {
  type FooBar (line 24) | type FooBar = Spread<Foo, Bar>;
  type ArrayFooBar (line 50) | type ArrayFooBar = Spread<typeof arrayFoo, typeof arrayBar>;
  type MixedArrayFooBar (line 58) | type MixedArrayFooBar = Spread<typeof arrayFoo, typeof stringArray>;
  type TupleFooBar (line 67) | type TupleFooBar = Spread<typeof tupleFoo, typeof tupleBar>;
  type ArrayTupleFooBar (line 73) | type ArrayTupleFooBar = Spread<typeof arrayFoo, typeof tupleBar>;
  type TupleArrayFooBar (line 79) | type TupleArrayFooBar = Spread<typeof tupleFoo, typeof arrayBar>;

FILE: test-d/stringified.ts
  type Car (line 7) | type Car = {

FILE: test-d/structured-cloneable.ts
  class CustomType (line 115) | class CustomType {}
  class CustomTypeWithProperties (line 117) | class CustomTypeWithProperties {

FILE: test-d/tagged-union.ts
  type Union (line 4) | type Union = TaggedUnion<'tag', {str: {a: string}; num: {b: number}}>;

FILE: test-d/tuple-of.ts
  type LengthShouldBeNumber (line 33) | type LengthShouldBeNumber = TupleOf<'ten'>;

FILE: test-d/tuple-to-object.ts
  type T (line 62) | type T = TupleToObject<{}>;

FILE: test-d/tuple-to-union.ts
  type Options (line 5) | type Options = TupleToUnion<typeof options>;

FILE: test-d/undefined-on-partial-deep.ts
  type TestType1 (line 5) | type TestType1 = UndefinedOnPartialDeep<{required: string; optional?: st...
  type TestType2 (line 8) | type TestType2 = UndefinedOnPartialDeep<{optional?: string | undefined}>;
  type TestType3 (line 11) | type TestType3 = UndefinedOnPartialDeep<{requiredWithUndefind: string | ...
  type NullType (line 15) | type NullType = UndefinedOnPartialDeep<{null?: null}>;
  type UndefinedType (line 17) | type UndefinedType = UndefinedOnPartialDeep<{ud?: undefined}>;
  type MixedType (line 21) | type MixedType = UndefinedOnPartialDeep<{
  type ObjectType (line 43) | type ObjectType = UndefinedOnPartialDeep<{obj?: {key: string}}>;
  type ObjectDeepType (line 46) | type ObjectDeepType = UndefinedOnPartialDeep<{obj?: {subObj?: {key?: str...
  type MapType (line 52) | type MapType = UndefinedOnPartialDeep<{map?: Map<string, {key?: string}>}>;
  type SetType (line 57) | type SetType = UndefinedOnPartialDeep<{set?: Set<{key?: string}>}>;
  type TupleType (line 62) | type TupleType = UndefinedOnPartialDeep<{tuple?: [string, number]}>;
  type ArrayType (line 64) | type ArrayType = UndefinedOnPartialDeep<{array?: string[]}>;
  type ArrayDeepType (line 66) | type ArrayDeepType = UndefinedOnPartialDeep<{array?: Array<{subArray?: s...
  type ObjectListType (line 69) | type ObjectListType = UndefinedOnPartialDeep<{array?: Array<{key?: strin...
  type ReadonlyType (line 74) | type ReadonlyType = UndefinedOnPartialDeep<{readonly?: readonly string[]}>;
  type ReadonlyArrayTest (line 77) | type ReadonlyArrayTest = UndefinedOnPartialDeep<{readonly?: ReadonlyArra...

FILE: test-d/union-member.ts
  type WrapMemberInTuple (line 21) | type WrapMemberInTuple<T, L = UnionMember<T>> =
  type UnionType (line 32) | type UnionType = {a: 0} | {readonly a: 0};
  type PickedUnionMember (line 33) | type PickedUnionMember = UnionMember<UnionType>;

FILE: test-d/union-to-intersection.ts
  type Assignability (line 11) | type Assignability<T, U, _K extends T | U> = never;
  type TestAssignability (line 12) | type TestAssignability<T, U> = Assignability<T, U, UnionToIntersection<T...

FILE: test-d/union-to-tuple.ts
  type Options (line 4) | type Options = UnionToTuple<'a' | 'b' | 'c'>;
  type Options1 (line 9) | type Options1 = UnionToTuple<1 | 2 | 3>;
  type Options2 (line 12) | type Options2 = UnionToTuple<boolean | 1>;
  type DifferentModifierUnion (line 19) | type DifferentModifierUnion = {readonly a: 0} | {a: 0};

FILE: test-d/unknown-array.ts
  type IsArray (line 21) | type IsArray<T> = T extends UnknownArray ? true : false;

FILE: test-d/unwrap-partial.ts
  type TestType (line 4) | type TestType = {
  type TestTypeWithOptionalProp (line 14) | type TestTypeWithOptionalProp = TestType & {
  type AnotherTestType (line 18) | type AnotherTestType = {
  type TestTypeWithOptionalProps (line 23) | type TestTypeWithOptionalProps = TestType & Partial<AnotherTestType>;
  type TestTypeWithPartialProp (line 29) | type TestTypeWithPartialProp = TestType & {
  type TestTypeWithReadonlyProps (line 36) | type TestTypeWithReadonlyProps = Readonly<TestType> & {
  type TestTypeWithMethod (line 43) | type TestTypeWithMethod = {
  type PartialUnionType (line 50) | type PartialUnionType = Partial<TestType> | Partial<AnotherTestType>;
  type ArrayLikeTestType (line 56) | type ArrayLikeTestType = {
  type PlainObjectTestType (line 60) | type PlainObjectTestType = {
  type TestTuple (line 71) | type TestTuple = [string, number, boolean];

FILE: test-d/writable-deep.ts
  type Overloaded (line 6) | type Overloaded = {
  type Namespace (line 11) | type Namespace = {
  type NamespaceWithOverload (line 16) | type NamespaceWithOverload = Overloaded & {
  type OpaqueObjectData (line 20) | type OpaqueObjectData = {readonly a: number[]} | {readonly b: string};
  type OpaqueObject (line 21) | type OpaqueObject = Opaque<OpaqueObjectData, {readonly token: unknown}>;
  type ReadonlyJsonValue (line 23) | type ReadonlyJsonValue =

FILE: test-d/writable-keys-of.ts
  type TestType1 (line 4) | type TestType1 = {
  type TestType2 (line 9) | type TestType2 = {
  type TestType3 (line 14) | type TestType3 = {
  type WritableKeysOf1 (line 19) | type WritableKeysOf1 = WritableKeysOf<TestType1>;
  type WritableKeysOf2 (line 20) | type WritableKeysOf2 = WritableKeysOf<TestType2>;
  type WritableKeysOf3 (line 21) | type WritableKeysOf3 = WritableKeysOf<TestType3>;
  type Assignability1 (line 45) | type Assignability1<T, _K extends keyof T> = unknown;
  type Test1 (line 46) | type Test1<T extends object> = Assignability1<T, WritableKeysOf<T>>;
  type Assignability2 (line 49) | type Assignability2<T extends object, _K extends WritableKeysOf<T>> = un...
  type Test2 (line 51) | type Test2<T extends object> = Assignability2<T, keyof T>;
  type Assignability3 (line 54) | type Assignability3<_T, _K extends PropertyKey> = unknown;
  type Test3 (line 55) | type Test3<T extends object> = Assignability3<T, WritableKeysOf<T>>;
  type Assignability4 (line 58) | type Assignability4<T extends object, _K extends WritableKeysOf<T>> = un...
  type Test4 (line 60) | type Test4<T extends object> = Assignability4<T, PropertyKey>;
  type Assignability5 (line 63) | type Assignability5<T extends Record<string, unknown>, _K extends keyof ...
  type Test5 (line 64) | type Test5<T extends Record<string, unknown>> = Assignability5<T, Writab...
  type Assignability6 (line 67) | type Assignability6<T extends object, _K extends keyof T> = unknown;
  type Test6 (line 68) | type Test6<T extends object> = Assignability6<T, WritableKeysOf<T>>;
  type Assignability7 (line 71) | type Assignability7<T extends UnknownRecord, _K extends keyof T> = unknown;
  type Test7 (line 72) | type Test7<T extends UnknownRecord> = Assignability7<T, WritableKeysOf<T>>;
  type Assignability8 (line 75) | type Assignability8<T extends Record<string, unknown>, _K extends Writab...
  type Test8 (line 77) | type Test8<T extends Record<string, unknown>> = Assignability8<T, keyof T>;
  type Assignability9 (line 80) | type Assignability9<T extends object, _K extends WritableKeysOf<T>> = un...
  type Test9 (line 82) | type Test9<T extends object> = Assignability9<T, keyof T>;
  type Assignability10 (line 85) | type Assignability10<T extends UnknownRecord, _K extends WritableKeysOf<...
  type Test10 (line 87) | type Test10<T extends UnknownRecord> = Assignability10<T, keyof T>;
  type AllowsOnlyObjects (line 90) | type AllowsOnlyObjects = WritableKeysOf<string>;

FILE: test-d/writable.ts
  type Foo (line 4) | type Foo = {
Condensed preview — 449 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,321K chars).
[
  {
    "path": ".editorconfig",
    "chars": 175,
    "preview": "root = true\n\n[*]\nindent_style = tab\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newlin"
  },
  {
    "path": ".gitattributes",
    "chars": 19,
    "preview": "* text=auto eol=lf\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/1 new type.yml",
    "chars": 643,
    "preview": "name: 💡 Suggest new type\ndescription: '​‌‍⁠ ' # Magic whitespace to hide this required field\nlabels: 'type addition'\n\nb"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/2 bug report.yml",
    "chars": 704,
    "preview": "name: 🐛 Report bug\ndescription: '​‌‍⁠ ' # Magic whitespace to hide this required field\nlabels: bug\n\nbody:\n  - type: tex"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/3 enhancement.md",
    "chars": 150,
    "preview": "---\nname: ♻️ Propose change or improvement to existing types\nabout: '​‌‍⁠ ' # Magic whitespace to hide this required fi"
  },
  {
    "path": ".github/contributing.md",
    "chars": 2501,
    "preview": "# Contributing guidelines\n\n## Submitting a new type\n\n- One type addition per pull request, unless they are connected.\n- "
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 406,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: 'github-actions'\n    directory: '/'\n    schedule:\n      interval: 'weekly'\n  "
  },
  {
    "path": ".github/funding.yml",
    "chars": 52,
    "preview": "github: [sindresorhus, som-sm, Emiyaaaaa, voxpelli]\n"
  },
  {
    "path": ".github/pull_request_template.md",
    "chars": 203,
    "preview": "<!--\n\nThanks for submitting a pull request 🙌\n\nIf you're submitting a new type, please review the contribution guidelines"
  },
  {
    "path": ".github/security.md",
    "chars": 179,
    "preview": "# Security Policy\n\nTo report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/s"
  },
  {
    "path": ".github/workflows/claude-code-review.yml",
    "chars": 1900,
    "preview": "name: Claude Code Review\non:\n  pull_request:\n    types: [opened, synchronize]\njobs:\n  claude-review:\n    runs-on: ubuntu"
  },
  {
    "path": ".github/workflows/claude.yml",
    "chars": 1238,
    "preview": "name: Claude Code\non:\n  issue_comment:\n    types: [created]\n  pull_request_review_comment:\n    types: [created]\n  issues"
  },
  {
    "path": ".github/workflows/main.yml",
    "chars": 999,
    "preview": "name: CI\non:\n  push:\n    branches:\n      - main\n    tags:\n      - '*'\n  pull_request:\n    branches:\n      - main\njobs:\n "
  },
  {
    "path": ".github/workflows/ts-canary.yml",
    "chars": 700,
    "preview": "name: TypeScript Canary\non:\n  schedule:\n    # Every Thursday at 21.15\n    - cron: '15 21 * * 4'\n  workflow_dispatch:\njob"
  },
  {
    "path": ".gitignore",
    "chars": 23,
    "preview": "node_modules\nyarn.lock\n"
  },
  {
    "path": ".npmrc",
    "chars": 19,
    "preview": "package-lock=false\n"
  },
  {
    "path": "CLAUDE.md",
    "chars": 3340,
    "preview": "# type-fest\n\nTypeScript utility types library. Pure type-level programming—no runtime code.\n\n**Read `.github/contributin"
  },
  {
    "path": "index.d.ts",
    "chars": 12743,
    "preview": "// Basic\nexport type * from './source/primitive.d.ts';\nexport type * from './source/typed-array.d.ts';\nexport type * fro"
  },
  {
    "path": "license-cc0",
    "chars": 7048,
    "preview": "Creative Commons Legal Code\n\nCC0 1.0 Universal\n\n    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE\n"
  },
  {
    "path": "license-mit",
    "chars": 1117,
    "preview": "MIT License\n\nCopyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n\nPermission is hereby grant"
  },
  {
    "path": "lint-processors/fixtures/eslint.config.js",
    "chars": 1205,
    "preview": "import tseslint from 'typescript-eslint';\nimport {defineConfig} from 'eslint/config';\nimport {jsdocCodeblocksProcessor} "
  },
  {
    "path": "lint-processors/jsdoc-codeblocks.js",
    "chars": 5232,
    "preview": "// @ts-check\nimport tsParser from '@typescript-eslint/parser';\n\n/**\n@import {Linter} from 'eslint';\n*/\n\nconst CODEBLOCK_"
  },
  {
    "path": "lint-processors/jsdoc-codeblocks.test.js",
    "chars": 26068,
    "preview": "import {describe, test} from 'node:test';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport {ESLin"
  },
  {
    "path": "lint-rules/import-path.js",
    "chars": 1510,
    "preview": "import path from 'node:path';\n\nexport const importPathRule = /** @type {const} */ ({\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs:"
  },
  {
    "path": "lint-rules/import-path.test.js",
    "chars": 3154,
    "preview": "import {createRuleTester} from './test-utils.js';\nimport {importPathRule} from './import-path.js';\n\nconst ruleTester = c"
  },
  {
    "path": "lint-rules/require-export.js",
    "chars": 1133,
    "preview": "export const requireExportRule = /** @type {const} */ ({\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Ensure ."
  },
  {
    "path": "lint-rules/require-export.test.js",
    "chars": 1640,
    "preview": "import {createRuleTester} from './test-utils.js';\nimport {requireExportRule} from './require-export.js';\n\nconst ruleTest"
  },
  {
    "path": "lint-rules/require-exported-types.js",
    "chars": 3845,
    "preview": "import path from 'node:path';\nimport fs from 'node:fs';\n\nexport const requireExportedTypesRule = /** @type {const} */ ({"
  },
  {
    "path": "lint-rules/require-exported-types.test.js",
    "chars": 2879,
    "preview": "import {createTypeAwareRuleTester} from './test-utils.js';\nimport {requireExportedTypesRule} from './require-exported-ty"
  },
  {
    "path": "lint-rules/source-files-extension.js",
    "chars": 1081,
    "preview": "import path from 'node:path';\n\nexport const sourceFilesExtensionRule = /** @type {const} */ ({\n\tmeta: {\n\t\ttype: 'problem"
  },
  {
    "path": "lint-rules/source-files-extension.test.js",
    "chars": 924,
    "preview": "import {createRuleTester} from './test-utils.js';\nimport {sourceFilesExtensionRule} from './source-files-extension.js';\n"
  },
  {
    "path": "lint-rules/test-utils.js",
    "chars": 6957,
    "preview": "import fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport {RuleTester} from 'eslint';\nimp"
  },
  {
    "path": "lint-rules/validate-jsdoc-codeblocks.js",
    "chars": 13163,
    "preview": "import path from 'node:path';\nimport ts from 'typescript';\nimport {createFSBackedSystem, createVirtualTypeScriptEnvironm"
  },
  {
    "path": "lint-rules/validate-jsdoc-codeblocks.test.js",
    "chars": 39661,
    "preview": "/* eslint-disable max-lines */\nimport {code1, code2, createRuleTester, dedenter, errorAt as errorAt_, exportType, export"
  },
  {
    "path": "media/readme.md",
    "chars": 110,
    "preview": "# Media\n\n## Attribution\n\n### Fireworks vector graphic\n\n[Free Vectors via Vecteezy!](https://www.vecteezy.com)\n"
  },
  {
    "path": "package.json",
    "chars": 1576,
    "preview": "{\n\t\"name\": \"type-fest\",\n\t\"version\": \"5.5.0\",\n\t\"description\": \"A collection of essential TypeScript types\",\n\t\"license\": \""
  },
  {
    "path": "readme.md",
    "chars": 62078,
    "preview": "<div align=\"center\">\n\t<br>\n\t<br>\n\t<img src=\"media/logo.svg\" alt=\"type-fest\" height=\"300\">\n\t<br>\n\t<br>\n\t<b>A collection o"
  },
  {
    "path": "source/all-extend.d.ts",
    "chars": 3343,
    "preview": "import type {CollapseRestElement} from './internal/array.d.ts';\nimport type {ApplyDefaultOptions} from './internal/objec"
  },
  {
    "path": "source/all-union-fields.d.ts",
    "chars": 2388,
    "preview": "import type {NonRecursiveType, ReadonlyKeysOfUnion, ValueOfUnion} from './internal/index.d.ts';\nimport type {KeysOfUnion"
  },
  {
    "path": "source/and-all.d.ts",
    "chars": 2050,
    "preview": "import type {AllExtend} from './all-extend.d.ts';\n\n/**\nReturns a boolean for whether all of the given elements are `true"
  },
  {
    "path": "source/and.d.ts",
    "chars": 1507,
    "preview": "import type {AndAll} from './and-all.d.ts';\n\n/**\nReturns a boolean for whether two given types are both true.\n\nUse-case:"
  },
  {
    "path": "source/array-element.d.ts",
    "chars": 1219,
    "preview": "import type {UnknownArray} from './unknown-array.d.ts';\n\n/**\nExtracts the element type of an array or tuple.\n\nUse-cases:"
  },
  {
    "path": "source/array-indices.d.ts",
    "chars": 737,
    "preview": "/**\nProvides valid indices for a constant array or tuple.\n\nUse-case: This type is useful when working with constant arra"
  },
  {
    "path": "source/array-length.d.ts",
    "chars": 882,
    "preview": "/**\nReturn the length of an array. Equivalent to `T['length']` where `T` extends any array.\n\nTuples resolve to numeric l"
  },
  {
    "path": "source/array-reverse.d.ts",
    "chars": 3170,
    "preview": "import type {If} from './if.d.ts';\nimport type {IsArrayReadonly} from './internal/array.d.ts';\nimport type {IfNotAnyOrNe"
  },
  {
    "path": "source/array-slice.d.ts",
    "chars": 4320,
    "preview": "import type {Sum} from './sum.d.ts';\nimport type {LessThanOrEqual} from './less-than-or-equal.d.ts';\nimport type {Greate"
  },
  {
    "path": "source/array-splice.d.ts",
    "chars": 3147,
    "preview": "import type {StaticPartOfArray, VariablePartOfArray} from './internal/index.d.ts';\nimport type {GreaterThanOrEqual} from"
  },
  {
    "path": "source/array-tail.d.ts",
    "chars": 1873,
    "preview": "import type {If} from './if.d.ts';\nimport type {IfNotAnyOrNever, IsArrayReadonly} from './internal/index.d.ts';\nimport t"
  },
  {
    "path": "source/array-values.d.ts",
    "chars": 660,
    "preview": "/**\nProvides all values for a constant array or tuple.\n\nUse-case: This type is useful when working with constant arrays "
  },
  {
    "path": "source/arrayable.d.ts",
    "chars": 666,
    "preview": "/**\nCreate a type that represents either the value or an array of the value.\n\n@see {@link Promisable}\n\n@example\n```\nimpo"
  },
  {
    "path": "source/async-return-type.d.ts",
    "chars": 762,
    "preview": "type AsyncFunction = (...arguments_: any[]) => PromiseLike<unknown>;\n\n/**\nUnwrap the return type of a function that retu"
  },
  {
    "path": "source/asyncify.d.ts",
    "chars": 859,
    "preview": "import type {SetReturnType} from './set-return-type.d.ts';\n\n/**\nCreate an async version of the given function type, by b"
  },
  {
    "path": "source/basic.d.ts",
    "chars": 1293,
    "preview": "/**\nMatches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).\n\n@category Class\n*/\n"
  },
  {
    "path": "source/camel-case.d.ts",
    "chars": 2317,
    "preview": "import type {ApplyDefaultOptions} from './internal/index.d.ts';\nimport type {Words, WordsOptions} from './words.d.ts';\n\n"
  },
  {
    "path": "source/camel-cased-properties-deep.d.ts",
    "chars": 2747,
    "preview": "import type {CamelCase, CamelCaseOptions, _DefaultCamelCaseOptions} from './camel-case.d.ts';\nimport type {ApplyDefaultO"
  },
  {
    "path": "source/camel-cased-properties.d.ts",
    "chars": 1097,
    "preview": "import type {CamelCase, CamelCaseOptions, _DefaultCamelCaseOptions} from './camel-case.d.ts';\nimport type {ApplyDefaultO"
  },
  {
    "path": "source/characters.d.ts",
    "chars": 1655,
    "preview": "/**\nMatches any uppercase letter in the basic Latin alphabet (A-Z).\n\n@example\n```\nimport type {UppercaseLetter} from 'ty"
  },
  {
    "path": "source/conditional-except.d.ts",
    "chars": 1124,
    "preview": "import type {Except} from './except.d.ts';\nimport type {ConditionalKeys} from './conditional-keys.d.ts';\n\n/**\nExclude ke"
  },
  {
    "path": "source/conditional-keys.d.ts",
    "chars": 1810,
    "preview": "import type {ExtendsStrict} from './extends-strict.d.ts';\nimport type {IfNotAnyOrNever} from './internal/type.d.ts';\nimp"
  },
  {
    "path": "source/conditional-pick-deep.d.ts",
    "chars": 3195,
    "preview": "import type {IsEqual} from './is-equal.d.ts';\nimport type {ConditionalExcept} from './conditional-except.d.ts';\nimport t"
  },
  {
    "path": "source/conditional-pick.d.ts",
    "chars": 1167,
    "preview": "import type {ConditionalKeys} from './conditional-keys.d.ts';\nimport type {IsNever} from './is-never.d.ts';\n\n/**\nPick ke"
  },
  {
    "path": "source/conditional-simplify-deep.d.ts",
    "chars": 1294,
    "preview": "/**\nRecursively simplifies a type while including and/or excluding certain types from being simplified.\n\n@example\n```\nim"
  },
  {
    "path": "source/conditional-simplify.d.ts",
    "chars": 1199,
    "preview": "/**\nSimplifies a type while including and/or excluding certain types from being simplified.\n\nUseful to improve type hint"
  },
  {
    "path": "source/delimiter-case.d.ts",
    "chars": 2115,
    "preview": "import type {ApplyDefaultOptions, AsciiPunctuation, StartsWith} from './internal/index.d.ts';\nimport type {IsStringLiter"
  },
  {
    "path": "source/delimiter-cased-properties-deep.d.ts",
    "chars": 3268,
    "preview": "import type {_DefaultDelimiterCaseOptions, DelimiterCase} from './delimiter-case.d.ts';\nimport type {ApplyDefaultOptions"
  },
  {
    "path": "source/delimiter-cased-properties.d.ts",
    "chars": 1191,
    "preview": "import type {_DefaultDelimiterCaseOptions, DelimiterCase} from './delimiter-case.d.ts';\nimport type {ApplyDefaultOptions"
  },
  {
    "path": "source/distributed-omit.d.ts",
    "chars": 2407,
    "preview": "import type {KeysOfUnion} from './keys-of-union.d.ts';\n\n/**\nOmits keys from a type, distributing the operation over a un"
  },
  {
    "path": "source/distributed-pick.d.ts",
    "chars": 2248,
    "preview": "import type {KeysOfUnion} from './keys-of-union.d.ts';\n\n/**\nPick keys from a type, distributing the operation over a uni"
  },
  {
    "path": "source/empty-object.d.ts",
    "chars": 1589,
    "preview": "declare const emptyObjectSymbol: unique symbol;\n\n/**\nRepresents a strictly empty plain object, the `{}` value.\n\nWhen you"
  },
  {
    "path": "source/entries.d.ts",
    "chars": 2601,
    "preview": "import type {_ArrayEntry, _MapEntry, _ObjectEntry, _SetEntry} from './entry.d.ts';\n\ntype ArrayEntries<BaseType extends r"
  },
  {
    "path": "source/entry.d.ts",
    "chars": 2867,
    "preview": "type MapKey<BaseType> = BaseType extends Map<infer KeyType, unknown> ? KeyType : never;\ntype MapValue<BaseType> = BaseTy"
  },
  {
    "path": "source/exact.d.ts",
    "chars": 3473,
    "preview": "import type {ObjectValue} from './internal/index.d.ts';\nimport type {ArrayElement} from './array-element.d.ts';\nimport t"
  },
  {
    "path": "source/except.d.ts",
    "chars": 3393,
    "preview": "import type {ApplyDefaultOptions} from './internal/index.d.ts';\nimport type {IsEqual} from './is-equal.d.ts';\n\n/**\nFilte"
  },
  {
    "path": "source/exclude-exactly.d.ts",
    "chars": 1808,
    "preview": "import type {IsNever} from './is-never.d.ts';\nimport type {IsAny} from './is-any.d.ts';\nimport type {If} from './if.d.ts"
  },
  {
    "path": "source/exclude-rest-element.d.ts",
    "chars": 1168,
    "preview": "import type {SplitOnRestElement} from './split-on-rest-element.d.ts';\nimport type {IsArrayReadonly} from './internal/arr"
  },
  {
    "path": "source/exclude-strict.d.ts",
    "chars": 1781,
    "preview": "/**\nA stricter version of {@link Exclude<T, U>} that ensures every member of `U` can successfully exclude something from"
  },
  {
    "path": "source/exclusify-union.d.ts",
    "chars": 3602,
    "preview": "import type {If} from './if.d.ts';\nimport type {IfNotAnyOrNever, MapsSetsOrArrays, NonRecursiveType} from './internal/ty"
  },
  {
    "path": "source/extends-strict.d.ts",
    "chars": 1273,
    "preview": "import type {IsNever} from './is-never.d.ts';\nimport type {IsAny} from './is-any.d.ts';\n\n/**\nA stricter, non-distributiv"
  },
  {
    "path": "source/extract-rest-element.d.ts",
    "chars": 785,
    "preview": "import type {SplitOnRestElement} from './split-on-rest-element.d.ts';\nimport type {UnknownArray} from './unknown-array.d"
  },
  {
    "path": "source/extract-strict.d.ts",
    "chars": 1772,
    "preview": "/**\nA stricter version of {@link Extract<T, U>} that ensures every member of `U` can successfully extract something from"
  },
  {
    "path": "source/find-global-type.d.ts",
    "chars": 2073,
    "preview": "/**\nTries to find the type of a global with the given name.\n\nLimitations: Due to peculiarities with the behavior of `glo"
  },
  {
    "path": "source/fixed-length-array.d.ts",
    "chars": 2998,
    "preview": "import type {Except} from './except.d.ts';\nimport type {TupleOf} from './tuple-of.d.ts';\n\n/**\nMethods to exclude.\n*/\ntyp"
  },
  {
    "path": "source/get.d.ts",
    "chars": 7529,
    "preview": "import type {ApplyDefaultOptions, ToString} from './internal/index.d.ts';\nimport type {_LiteralStringUnion} from './lite"
  },
  {
    "path": "source/global-this.d.ts",
    "chars": 732,
    "preview": "/**\nDeclare locally scoped properties on `globalThis`.\n\nWhen defining a global variable in a declaration file is inappro"
  },
  {
    "path": "source/globals/index.d.ts",
    "chars": 57,
    "preview": "export type * from './observable-like.d.ts';\n\nexport {};\n"
  },
  {
    "path": "source/globals/observable-like.d.ts",
    "chars": 2494,
    "preview": "declare global {\n\t// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interfa"
  },
  {
    "path": "source/greater-than-or-equal.d.ts",
    "chars": 1422,
    "preview": "import type {GreaterThan} from './greater-than.d.ts';\n\n/**\nReturns a boolean for whether a given number is greater than "
  },
  {
    "path": "source/greater-than.d.ts",
    "chars": 2453,
    "preview": "import type {NumberAbsolute, PositiveNumericStringGt} from './internal/index.d.ts';\nimport type {IsEqual} from './is-equ"
  },
  {
    "path": "source/has-optional-keys.d.ts",
    "chars": 686,
    "preview": "import type {OptionalKeysOf} from './optional-keys-of.d.ts';\n\n/**\nCreates a type that represents `true` or `false` depen"
  },
  {
    "path": "source/has-readonly-keys.d.ts",
    "chars": 686,
    "preview": "import type {ReadonlyKeysOf} from './readonly-keys-of.d.ts';\n\n/**\nCreates a type that represents `true` or `false` depen"
  },
  {
    "path": "source/has-required-keys.d.ts",
    "chars": 1216,
    "preview": "import type {RequiredKeysOf} from './required-keys-of.d.ts';\n\n/**\nCreates a type that represents `true` or `false` depen"
  },
  {
    "path": "source/has-writable-keys.d.ts",
    "chars": 686,
    "preview": "import type {WritableKeysOf} from './writable-keys-of.d.ts';\n\n/**\nCreates a type that represents `true` or `false` depen"
  },
  {
    "path": "source/if-any.d.ts",
    "chars": 584,
    "preview": "import type {IsAny} from './is-any.d.ts';\n\n/**\nAn if-else-like type that resolves depending on whether the given type is"
  },
  {
    "path": "source/if-empty-object.d.ts",
    "chars": 678,
    "preview": "import type {IsEmptyObject} from './empty-object.d.ts';\n\n/**\nAn if-else-like type that resolves depending on whether the"
  },
  {
    "path": "source/if-never.d.ts",
    "chars": 614,
    "preview": "import type {IsNever} from './is-never.d.ts';\n\n/**\nAn if-else-like type that resolves depending on whether the given typ"
  },
  {
    "path": "source/if-null.d.ts",
    "chars": 599,
    "preview": "import type {IsNull} from './is-null.d.ts';\n\n/**\nAn if-else-like type that resolves depending on whether the given type "
  },
  {
    "path": "source/if-unknown.d.ts",
    "chars": 644,
    "preview": "import type {IsUnknown} from './is-unknown.d.ts';\n\n/**\nAn if-else-like type that resolves depending on whether the given"
  },
  {
    "path": "source/if.d.ts",
    "chars": 2798,
    "preview": "import type {IsNever} from './is-never.d.ts';\n\n/**\nAn if-else-like type that resolves depending on whether the given `bo"
  },
  {
    "path": "source/includes.d.ts",
    "chars": 578,
    "preview": "import type {IsEqual} from './is-equal.d.ts';\n\n/**\nReturns a boolean for whether the given array includes the given item"
  },
  {
    "path": "source/int-closed-range.d.ts",
    "chars": 1460,
    "preview": "import type {IntRange} from './int-range.d.ts';\nimport type {Sum} from './sum.d.ts';\n\n/**\nGenerate a union of numbers.\n\n"
  },
  {
    "path": "source/int-range.d.ts",
    "chars": 2583,
    "preview": "import type {TupleOf} from './tuple-of.d.ts';\nimport type {Subtract} from './subtract.d.ts';\n\n/**\nGenerate a union of nu"
  },
  {
    "path": "source/internal/array.d.ts",
    "chars": 4913,
    "preview": "import type {If} from '../if.d.ts';\nimport type {IsNever} from '../is-never.d.ts';\nimport type {OptionalKeysOf} from '.."
  },
  {
    "path": "source/internal/characters.d.ts",
    "chars": 741,
    "preview": "export type Whitespace =\n\t| '\\u{9}' // '\\t'\n\t| '\\u{A}' // '\\n'\n\t| '\\u{B}' // '\\v'\n\t| '\\u{C}' // '\\f'\n\t| '\\u{D}' // '\\r'\n"
  },
  {
    "path": "source/internal/enforce-optional.d.ts",
    "chars": 1120,
    "preview": "import type {Simplify} from '../simplify.d.ts';\n\n// Returns `never` if the key is optional otherwise return the key type"
  },
  {
    "path": "source/internal/index.d.ts",
    "chars": 345,
    "preview": "export type * from './array.d.ts';\nexport type * from './characters.d.ts';\nexport type * from './keys.d.ts';\nexport type"
  },
  {
    "path": "source/internal/keys.d.ts",
    "chars": 2805,
    "preview": "import type {IsAny} from '../is-any.d.ts';\nimport type {IsLiteral} from '../is-literal.d.ts';\nimport type {IsUnknown} fr"
  },
  {
    "path": "source/internal/numeric.d.ts",
    "chars": 3380,
    "preview": "import type {IsNever} from '../is-never.d.ts';\nimport type {Finite, NegativeInfinity, PositiveInfinity} from '../numeric"
  },
  {
    "path": "source/internal/object.d.ts",
    "chars": 9243,
    "preview": "import type {Simplify} from '../simplify.d.ts';\nimport type {IsEqual} from '../is-equal.d.ts';\nimport type {KeysOfUnion}"
  },
  {
    "path": "source/internal/string.d.ts",
    "chars": 4774,
    "preview": "import type {TupleOf} from '../tuple-of.d.ts';\nimport type {NegativeInfinity, PositiveInfinity} from '../numeric.d.ts';\n"
  },
  {
    "path": "source/internal/tuple.d.ts",
    "chars": 2048,
    "preview": "import type {GreaterThan} from '../greater-than.d.ts';\nimport type {LessThan} from '../less-than.d.ts';\nimport type {Neg"
  },
  {
    "path": "source/internal/type.d.ts",
    "chars": 4681,
    "preview": "import type {If} from '../if.d.ts';\nimport type {IsAny} from '../is-any.d.ts';\nimport type {IsNever} from '../is-never.d"
  },
  {
    "path": "source/invariant-of.d.ts",
    "chars": 2409,
    "preview": "declare const invariantBrand: unique symbol;\n\n/**\nCreate an [invariant type](https://basarat.gitbook.io/typescript/type-"
  },
  {
    "path": "source/is-any.d.ts",
    "chars": 693,
    "preview": "/**\nReturns a boolean for whether the given type is `any`.\n\n@link https://stackoverflow.com/a/49928360/1490091\n\nUseful i"
  },
  {
    "path": "source/is-equal.d.ts",
    "chars": 1223,
    "preview": "/**\nReturns a boolean for whether the two given types are equal.\n\n@link https://github.com/microsoft/TypeScript/issues/2"
  },
  {
    "path": "source/is-float.d.ts",
    "chars": 777,
    "preview": "/**\nReturns a boolean for whether the given number is a float, like `1.5` or `-1.5`.\n\nUse-case:\n- If you want to make a "
  },
  {
    "path": "source/is-integer.d.ts",
    "chars": 1092,
    "preview": "import type {Not} from './internal/index.d.ts';\nimport type {IsFloat} from './is-float.d.ts';\nimport type {PositiveInfin"
  },
  {
    "path": "source/is-literal.d.ts",
    "chars": 8425,
    "preview": "import type {Primitive} from './primitive.d.ts';\nimport type {_Numeric} from './numeric.d.ts';\nimport type {CollapseLite"
  },
  {
    "path": "source/is-lowercase.d.ts",
    "chars": 1026,
    "preview": "import type {AllExtend} from './all-extend.d.ts';\n\n/**\nReturns a boolean for whether the given string literal is lowerca"
  },
  {
    "path": "source/is-never.d.ts",
    "chars": 1217,
    "preview": "/**\nReturns a boolean for whether the given type is `never`.\n\n@link https://github.com/microsoft/TypeScript/issues/31751"
  },
  {
    "path": "source/is-null.d.ts",
    "chars": 431,
    "preview": "/**\nReturns a boolean for whether the given type is `null`.\n\n@example\n```\nimport type {IsNull} from 'type-fest';\n\ntype N"
  },
  {
    "path": "source/is-nullable.d.ts",
    "chars": 647,
    "preview": "import type {IsAny} from './is-any.d.ts';\n\n/**\nReturns a boolean for whether the given type includes `null`.\n\nNote: The "
  },
  {
    "path": "source/is-optional-key-of.d.ts",
    "chars": 1006,
    "preview": "import type {IsAny} from './is-any.d.ts';\n\n/**\nReturns a boolean for whether the given key is an optional key of type.\n\n"
  },
  {
    "path": "source/is-optional.d.ts",
    "chars": 545,
    "preview": "import type {IsAny} from './is-any.d.ts';\n\n/**\nReturns a boolean for whether the given type includes `undefined`.\n\n@exam"
  },
  {
    "path": "source/is-readonly-key-of.d.ts",
    "chars": 1180,
    "preview": "import type {IsEqual} from './is-equal.d.ts';\nimport type {IsAny} from './is-any.d.ts';\n\n/**\nReturns a boolean for wheth"
  },
  {
    "path": "source/is-required-key-of.d.ts",
    "chars": 1088,
    "preview": "import type {IsOptionalKeyOf} from './is-optional-key-of.d.ts';\nimport type {Not} from './internal/type.d.ts';\nimport ty"
  },
  {
    "path": "source/is-tuple.d.ts",
    "chars": 2424,
    "preview": "import type {If} from './if.d.ts';\nimport type {ApplyDefaultOptions} from './internal/index.d.ts';\nimport type {IsAny} f"
  },
  {
    "path": "source/is-undefined.d.ts",
    "chars": 467,
    "preview": "/**\nReturns a boolean for whether the given type is `undefined`.\n\n@example\n```\nimport type {IsUndefined} from 'type-fest"
  },
  {
    "path": "source/is-union.d.ts",
    "chars": 848,
    "preview": "import type {IsNever} from './is-never.d.ts';\nimport type {IsEqual} from './is-equal.d.ts';\n\n/**\nReturns a boolean for w"
  },
  {
    "path": "source/is-unknown.d.ts",
    "chars": 782,
    "preview": "import type {IsNull} from './is-null.d.ts';\n\n/**\nReturns a boolean for whether the given type is `unknown`.\n\n@link https"
  },
  {
    "path": "source/is-uppercase.d.ts",
    "chars": 1028,
    "preview": "import type {AllExtend} from './all-extend.d.ts';\n\n/**\nReturns a boolean for whether the given string literal is upperca"
  },
  {
    "path": "source/is-writable-key-of.d.ts",
    "chars": 1058,
    "preview": "import type {IsReadonlyKeyOf} from './is-readonly-key-of.d.ts';\nimport type {Not} from './internal/type.d.ts';\nimport ty"
  },
  {
    "path": "source/iterable-element.d.ts",
    "chars": 1616,
    "preview": "/**\nGet the element type of an `Iterable`/`AsyncIterable`. For example, `Array`, `Set`, `Map`, generator, stream, etc.\n\n"
  },
  {
    "path": "source/join.d.ts",
    "chars": 2824,
    "preview": "// The builtin `join` method supports all these natively in the same way that typescript handles them so we can safely a"
  },
  {
    "path": "source/json-value.d.ts",
    "chars": 951,
    "preview": "/**\nMatches a JSON object.\n\nThis type can be useful to enforce some input to be JSON-compatible or as a super-type to be"
  },
  {
    "path": "source/jsonifiable.d.ts",
    "chars": 1079,
    "preview": "import type {JsonPrimitive} from './json-value.d.ts';\n\ntype JsonifiableObject = {[Key in string]?: Jsonifiable} | {toJSO"
  },
  {
    "path": "source/jsonify.d.ts",
    "chars": 4508,
    "preview": "import type {JsonPrimitive, JsonValue} from './json-value.d.ts';\nimport type {EmptyObject} from './empty-object.d.ts';\ni"
  },
  {
    "path": "source/kebab-case.d.ts",
    "chars": 1129,
    "preview": "import type {_DefaultDelimiterCaseOptions, DelimiterCase} from './delimiter-case.d.ts';\nimport type {ApplyDefaultOptions"
  },
  {
    "path": "source/kebab-cased-properties-deep.d.ts",
    "chars": 1395,
    "preview": "import type {_DefaultDelimiterCaseOptions} from './delimiter-case.d.ts';\nimport type {DelimiterCasedPropertiesDeep} from"
  },
  {
    "path": "source/kebab-cased-properties.d.ts",
    "chars": 1082,
    "preview": "import type {_DefaultDelimiterCaseOptions} from './delimiter-case.d.ts';\nimport type {DelimiterCasedProperties} from './"
  },
  {
    "path": "source/key-as-string.d.ts",
    "chars": 518,
    "preview": "/**\nGet keys of the given type as strings.\n\nNumber keys are converted to strings.\n\nUse-cases:\n- Get string keys from a t"
  },
  {
    "path": "source/keys-of-union.d.ts",
    "chars": 922,
    "preview": "import type {UnionToIntersection} from './union-to-intersection.d.ts';\n\n/**\nCreate a union of all keys from a given type"
  },
  {
    "path": "source/last-array-element.d.ts",
    "chars": 1362,
    "preview": "/**\nExtract the type of the last element of an array.\n\nUse-case: Defining the return type of functions that extract the "
  },
  {
    "path": "source/less-than-or-equal.d.ts",
    "chars": 1261,
    "preview": "import type {GreaterThan} from './greater-than.d.ts';\n\n/**\n Returns a boolean for whether a given number is less than or"
  },
  {
    "path": "source/less-than.d.ts",
    "chars": 1170,
    "preview": "import type {GreaterThanOrEqual} from './greater-than-or-equal.d.ts';\n\n/**\nReturns a boolean for whether a given number "
  },
  {
    "path": "source/literal-to-primitive-deep.d.ts",
    "chars": 1853,
    "preview": "import type {LiteralToPrimitive} from './literal-to-primitive.d.ts';\nimport type {OmitIndexSignature} from './omit-index"
  },
  {
    "path": "source/literal-to-primitive.d.ts",
    "chars": 911,
    "preview": "/**\nGiven a [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types) return the "
  },
  {
    "path": "source/literal-union.d.ts",
    "chars": 1289,
    "preview": "import type {Primitive} from './primitive.d.ts';\n\nexport type _LiteralStringUnion<T> = LiteralUnion<T, string>;\n\n/**\nAll"
  },
  {
    "path": "source/merge-deep.d.ts",
    "chars": 17260,
    "preview": "import type {ConditionalSimplifyDeep} from './conditional-simplify-deep.d.ts';\nimport type {OmitIndexSignature} from './"
  },
  {
    "path": "source/merge-exclusive.d.ts",
    "chars": 1386,
    "preview": "// Helper type. Not useful on its own.\ntype Without<FirstType, SecondType> = {[KeyType in Exclude<keyof FirstType, keyof"
  },
  {
    "path": "source/merge.d.ts",
    "chars": 2647,
    "preview": "import type {OmitIndexSignature} from './omit-index-signature.d.ts';\nimport type {PickIndexSignature} from './pick-index"
  },
  {
    "path": "source/multidimensional-array.d.ts",
    "chars": 1200,
    "preview": "import type {Subtract} from './subtract.d.ts';\nimport type {IsEqual} from './is-equal.d.ts';\n\ntype Recursive<T> = Array<"
  },
  {
    "path": "source/multidimensional-readonly-array.d.ts",
    "chars": 1329,
    "preview": "import type {Subtract} from './subtract.d.ts';\nimport type {IsEqual} from './is-equal.d.ts';\n\ntype Recursive<T> = Readon"
  },
  {
    "path": "source/non-empty-object.d.ts",
    "chars": 985,
    "preview": "import type {HasRequiredKeys} from './has-required-keys.d.ts';\nimport type {RequireAtLeastOne} from './require-at-least-"
  },
  {
    "path": "source/non-empty-string.d.ts",
    "chars": 844,
    "preview": "/**\nMatches any non-empty string.\n\nThis is useful when you need a string that is not empty, for example, as a function p"
  },
  {
    "path": "source/non-empty-tuple.d.ts",
    "chars": 441,
    "preview": "/**\nMatches any non-empty tuple.\n\n@example\n```\nimport type {NonEmptyTuple} from 'type-fest';\n\nconst sum = (...numbers: N"
  },
  {
    "path": "source/numeric.d.ts",
    "chars": 5256,
    "preview": "import type {IsFloat} from './is-float.d.ts';\nimport type {IsInteger} from './is-integer.d.ts';\n\nexport type _Numeric = "
  },
  {
    "path": "source/object-merge.d.ts",
    "chars": 7767,
    "preview": "import type {If} from './if.d.ts';\nimport type {NormalizedKeys} from './internal/object.d.ts';\nimport type {IfNotAnyOrNe"
  },
  {
    "path": "source/omit-deep.d.ts",
    "chars": 4224,
    "preview": "import type {ArraySplice} from './array-splice.d.ts';\nimport type {ExactKey, IsArrayReadonly, NonRecursiveType, SetArray"
  },
  {
    "path": "source/omit-index-signature.d.ts",
    "chars": 3425,
    "preview": "/**\nOmit any index signatures from the given object type, leaving only explicitly defined properties.\n\nThis is the count"
  },
  {
    "path": "source/opaque.d.ts",
    "chars": 48,
    "preview": "export type * from './tagged.d.ts';\n\nexport {};\n"
  },
  {
    "path": "source/optional-keys-of.d.ts",
    "chars": 1161,
    "preview": "import type {IsOptionalKeyOf} from './is-optional-key-of.d.ts';\n\n/**\nExtract all optional keys from the given type.\n\nThi"
  },
  {
    "path": "source/optional.d.ts",
    "chars": 763,
    "preview": "/**\nCreate a type that represents either the value or `undefined`, while stripping `null` from the type.\n\nUse-cases:\n- E"
  },
  {
    "path": "source/or-all.d.ts",
    "chars": 1836,
    "preview": "import type {SomeExtend} from './some-extend.d.ts';\n\n/**\nReturns a boolean for whether any of the given elements is `tru"
  },
  {
    "path": "source/or.d.ts",
    "chars": 1528,
    "preview": "import type {OrAll} from './or-all.d.ts';\n\n/**\nReturns a boolean for whether either of two given types is true.\n\nUse-cas"
  },
  {
    "path": "source/override-properties.d.ts",
    "chars": 1345,
    "preview": "import type {Merge} from './merge.d.ts';\n\n/**\nOverride existing properties of the given type. Similar to `Merge`, but en"
  },
  {
    "path": "source/package-json.d.ts",
    "chars": 17518,
    "preview": "import type {JsonObject, JsonValue} from './json-value.d.ts';\nimport type {LiteralUnion} from './literal-union.d.ts';\n\ne"
  },
  {
    "path": "source/partial-deep.d.ts",
    "chars": 5646,
    "preview": "import type {ApplyDefaultOptions, BuiltIns, HasMultipleCallSignatures} from './internal/index.d.ts';\nimport type {IsNeve"
  },
  {
    "path": "source/partial-on-undefined-deep.d.ts",
    "chars": 3155,
    "preview": "import type {If} from './if.d.ts';\nimport type {ApplyDefaultOptions, BuiltIns, LiteralKeyOf} from './internal/index.d.ts"
  },
  {
    "path": "source/pascal-case.d.ts",
    "chars": 1251,
    "preview": "import type {CamelCase, CamelCaseOptions, _DefaultCamelCaseOptions} from './camel-case.d.ts';\nimport type {ApplyDefaultO"
  },
  {
    "path": "source/pascal-cased-properties-deep.d.ts",
    "chars": 1769,
    "preview": "import type {CamelCaseOptions, _DefaultCamelCaseOptions} from './camel-case.d.ts';\nimport type {ApplyDefaultOptions} fro"
  },
  {
    "path": "source/pascal-cased-properties.d.ts",
    "chars": 1131,
    "preview": "import type {CamelCaseOptions, _DefaultCamelCaseOptions} from './camel-case.d.ts';\nimport type {ApplyDefaultOptions} fro"
  },
  {
    "path": "source/paths.d.ts",
    "chars": 6362,
    "preview": "import type {NonRecursiveType, ToString, IsNumberLike, ApplyDefaultOptions, MapsSetsOrArrays} from './internal/index.d.t"
  },
  {
    "path": "source/pick-deep.d.ts",
    "chars": 4123,
    "preview": "import type {TupleOf} from './tuple-of.d.ts';\nimport type {BuildObject, NonRecursiveType, ObjectValue} from './internal/"
  },
  {
    "path": "source/pick-index-signature.d.ts",
    "chars": 1245,
    "preview": "/**\nPick only index signatures from the given object type, leaving out all explicitly defined properties.\n\nThis is the c"
  },
  {
    "path": "source/primitive.d.ts",
    "chars": 224,
    "preview": "/**\nMatches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).\n\n@category Type\n*/\nexpor"
  },
  {
    "path": "source/promisable.d.ts",
    "chars": 815,
    "preview": "/**\nCreate a type that represents either the value or the value wrapped in `PromiseLike`.\n\nUse-cases:\n- A function accep"
  },
  {
    "path": "source/readonly-deep.d.ts",
    "chars": 3834,
    "preview": "import type {BuiltIns, HasMultipleCallSignatures} from './internal/index.d.ts';\n\n/**\nConvert `object`s, `Map`s, `Set`s, "
  },
  {
    "path": "source/readonly-keys-of.d.ts",
    "chars": 888,
    "preview": "import type {IsReadonlyKeyOf} from './is-readonly-key-of.d.ts';\n\n/**\nExtract all readonly keys from the given type.\n\nThi"
  },
  {
    "path": "source/readonly-tuple.d.ts",
    "chars": 1255,
    "preview": "import type {TupleOf} from './tuple-of.d.ts';\n\n/**\nCreate a type that represents a read-only tuple of the given type and"
  },
  {
    "path": "source/remove-prefix.d.ts",
    "chars": 4296,
    "preview": "import type {ApplyDefaultOptions} from './internal/object.d.ts';\nimport type {IfNotAnyOrNever, Not} from './internal/typ"
  },
  {
    "path": "source/replace.d.ts",
    "chars": 2090,
    "preview": "import type {ApplyDefaultOptions} from './internal/index.d.ts';\n\nexport type ReplaceOptions = {\n\tall?: boolean;\n};\n\ntype"
  },
  {
    "path": "source/require-all-or-none.d.ts",
    "chars": 1641,
    "preview": "import type {If} from './if.d.ts';\nimport type {IfNotAnyOrNever, RequireNone} from './internal/index.d.ts';\nimport type "
  },
  {
    "path": "source/require-at-least-one.d.ts",
    "chars": 1305,
    "preview": "import type {Except} from './except.d.ts';\nimport type {If} from './if.d.ts';\nimport type {IfNotAnyOrNever} from './inte"
  },
  {
    "path": "source/require-exactly-one.d.ts",
    "chars": 1578,
    "preview": "import type {If} from './if.d.ts';\nimport type {IfNotAnyOrNever} from './internal/index.d.ts';\nimport type {IsAny} from "
  },
  {
    "path": "source/require-one-or-none.d.ts",
    "chars": 1303,
    "preview": "import type {RequireExactlyOne} from './require-exactly-one.d.ts';\nimport type {IfNotAnyOrNever, RequireNone} from './in"
  },
  {
    "path": "source/required-deep.d.ts",
    "chars": 2506,
    "preview": "import type {BuiltIns, HasMultipleCallSignatures} from './internal/index.d.ts';\nimport type {IsNever} from './is-never.d"
  },
  {
    "path": "source/required-keys-of.d.ts",
    "chars": 1212,
    "preview": "import type {OptionalKeysOf} from './optional-keys-of.d.ts';\n\n/**\nExtract all required keys from the given type.\n\nThis i"
  },
  {
    "path": "source/schema.d.ts",
    "chars": 3284,
    "preview": "import type {ApplyDefaultOptions} from './internal/object.d.ts';\nimport type {IfNotAnyOrNever, NonRecursiveType} from '."
  },
  {
    "path": "source/screaming-snake-case.d.ts",
    "chars": 940,
    "preview": "import type {_DefaultDelimiterCaseOptions} from './delimiter-case.d.ts';\nimport type {ApplyDefaultOptions} from './inter"
  },
  {
    "path": "source/set-field-type.d.ts",
    "chars": 1981,
    "preview": "import type {ApplyDefaultOptions} from './internal/index.d.ts';\nimport type {Simplify} from './simplify.d.ts';\n\nexport t"
  },
  {
    "path": "source/set-non-nullable-deep.d.ts",
    "chars": 2822,
    "preview": "import type {NonRecursiveType, StringToNumber} from './internal/index.d.ts';\nimport type {Paths} from './paths.d.ts';\nim"
  },
  {
    "path": "source/set-non-nullable.d.ts",
    "chars": 937,
    "preview": "/**\nCreate a type that makes the given keys non-nullable, where the remaining keys are kept as is.\n\nIf no keys are given"
  },
  {
    "path": "source/set-optional.d.ts",
    "chars": 1259,
    "preview": "import type {Except} from './except.d.ts';\nimport type {HomomorphicPick} from './internal/index.d.ts';\nimport type {Simp"
  },
  {
    "path": "source/set-parameter-type.d.ts",
    "chars": 4887,
    "preview": "import type {IsUnknown} from './is-unknown.d.ts';\nimport type {StaticPartOfArray, VariablePartOfArray} from './internal/"
  },
  {
    "path": "source/set-readonly.d.ts",
    "chars": 1107,
    "preview": "import type {Except} from './except.d.ts';\nimport type {HomomorphicPick} from './internal/index.d.ts';\nimport type {Simp"
  },
  {
    "path": "source/set-required-deep.d.ts",
    "chars": 2187,
    "preview": "import type {IsAny} from './is-any.d.ts';\nimport type {NonRecursiveType, StringToNumber} from './internal/index.d.ts';\ni"
  },
  {
    "path": "source/set-required.d.ts",
    "chars": 2952,
    "preview": "import type {Except} from './except.d.ts';\nimport type {If} from './if.d.ts';\nimport type {HomomorphicPick, IsArrayReado"
  },
  {
    "path": "source/set-return-type.d.ts",
    "chars": 1524,
    "preview": "import type {IsUnknown} from './is-unknown.d.ts';\n\n/**\nCreate a function type with a return type of your choice and the "
  },
  {
    "path": "source/shared-union-fields-deep.d.ts",
    "chars": 6506,
    "preview": "import type {NonRecursiveType, UnionMin, UnionMax, TupleLength, StaticPartOfArray, VariablePartOfArray, IsArrayReadonly,"
  },
  {
    "path": "source/shared-union-fields.d.ts",
    "chars": 2003,
    "preview": "import type {NonRecursiveType} from './internal/index.d.ts';\nimport type {IsNever} from './is-never.d.ts';\nimport type {"
  }
]

// ... and 249 more files (download for full content)

About this extraction

This page contains the full source code of the sindresorhus/type-fest GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 449 files (1.2 MB), approximately 363.6k tokens, and a symbol index with 1372 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!