Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSDoc improvements #100

Merged
merged 8 commits into from
Aug 15, 2024
Merged

JSDoc improvements #100

merged 8 commits into from
Aug 15, 2024

Conversation

aryaemami59
Copy link
Collaborator

This PR:

  • Fixes some typos.
  • Renames some type parameters to make their intentions more clear.
  • Adds JSDocs to some of the newly added utilities.

- Rename some type parameters to make their intentions more clear.
- Add JSDocs to some of the newly added utilities.
- Expand the explanations through multiple lines for readability.
@aryaemami59 aryaemami59 requested a review from mmkal August 13, 2024 20:55
@aryaemami59 aryaemami59 self-assigned this Aug 13, 2024
@aryaemami59 aryaemami59 added documentation Improvements or additions to documentation chore Does not impact code behavior labels Aug 13, 2024
Copy link
Owner

@mmkal mmkal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I love the tight hard-wrapping of jsdoc tbh, or the /** x */ to /**\n * x\n */ but I can live with it

@aryaemami59 aryaemami59 merged commit 0bbeffa into mmkal:main Aug 15, 2024
11 checks passed
@aryaemami59 aryaemami59 deleted the fix-jsdocs branch August 15, 2024 04:40
renovate bot added a commit to mmkal/trpc-cli that referenced this pull request Aug 20, 2024
##### [`v0.20.0](https://github.com/mmkal/expect-type/releases/tag/v0.20.0)

#### Breaking changes

-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83

This change updates how overloaded functions are treated. Now, `.parameters` gives you a *union* of the parameter-tuples that a function can take. For example, given the following type:

```ts
type Factorize = {
  (input: number): number[]
  (input: bigint): bigint[]
}
```

Behvaiour before:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[bigint]>()
```

Behaviour now:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
```

There were similar changes for `.returns`, `.parameter(...)`, and `.toBeCallableWith`. Also, overloaded functions are now differentiated properly when using `.branded.toEqualTypeOf` (this was a bug that it seems nobody found).

See [#83](mmkal/expect-type#83) for more details or look at the updated docs (including a new section called "[Overloaded functions](https://github.com/mmkal/expect-type#overloaded-functions)", which has more info on how this behaviour differs for TypeScript versions before 5.3).

#### What's Changed

-   Fix rendering issue in readme by [@mrazauskas](https://github.com/mrazauskas) in mmkal/expect-type#69
-   Fix minor issues in docs by [@aryaemami59](https://github.com/aryaemami59) in mmkal/expect-type#91
-   create utils file by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#93
-   branding.ts and messages.ts by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#95
-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83
-   Extends: explain myself  [`1e37116`](mmkal/expect-type@1e37116)
-   Mark internal APIs with `@internal` JSDoc tag ([#104](mmkal/expect-type#104))  [`4c40b07`](mmkal/expect-type@4c40b07)
-   Re-export everything in `overloads.ts` file ([#107](mmkal/expect-type#107))  [`5ee0181`](mmkal/expect-type@5ee0181)
-   JSDoc improvements ([#100](mmkal/expect-type#100))  [`0bbeffa`](mmkal/expect-type@0bbeffa)

**Full Changelog**: mmkal/expect-type@v0.19.0...v0.20.0
renovate bot added a commit to mmkal/trpc-cli that referenced this pull request Aug 20, 2024
##### [`v0.20.0](https://github.com/mmkal/expect-type/releases/tag/v0.20.0)

#### Breaking changes

-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83

This change updates how overloaded functions are treated. Now, `.parameters` gives you a *union* of the parameter-tuples that a function can take. For example, given the following type:

```ts
type Factorize = {
  (input: number): number[]
  (input: bigint): bigint[]
}
```

Behvaiour before:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[bigint]>()
```

Behaviour now:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
```

There were similar changes for `.returns`, `.parameter(...)`, and `.toBeCallableWith`. Also, overloaded functions are now differentiated properly when using `.branded.toEqualTypeOf` (this was a bug that it seems nobody found).

See [#83](mmkal/expect-type#83) for more details or look at the updated docs (including a new section called "[Overloaded functions](https://github.com/mmkal/expect-type#overloaded-functions)", which has more info on how this behaviour differs for TypeScript versions before 5.3).

#### What's Changed

-   Fix rendering issue in readme by [@mrazauskas](https://github.com/mrazauskas) in mmkal/expect-type#69
-   Fix minor issues in docs by [@aryaemami59](https://github.com/aryaemami59) in mmkal/expect-type#91
-   create utils file by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#93
-   branding.ts and messages.ts by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#95
-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83
-   Extends: explain myself  [`1e37116`](mmkal/expect-type@1e37116)
-   Mark internal APIs with `@internal` JSDoc tag ([#104](mmkal/expect-type#104))  [`4c40b07`](mmkal/expect-type@4c40b07)
-   Re-export everything in `overloads.ts` file ([#107](mmkal/expect-type#107))  [`5ee0181`](mmkal/expect-type@5ee0181)
-   JSDoc improvements ([#100](mmkal/expect-type#100))  [`0bbeffa`](mmkal/expect-type@0bbeffa)

**Full Changelog**: mmkal/expect-type@v0.19.0...v0.20.0
renovate bot added a commit to mmkal/trpc-cli that referenced this pull request Aug 21, 2024
##### [`v0.20.0](https://github.com/mmkal/expect-type/releases/tag/v0.20.0)

#### Breaking changes

-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83

This change updates how overloaded functions are treated. Now, `.parameters` gives you a *union* of the parameter-tuples that a function can take. For example, given the following type:

```ts
type Factorize = {
  (input: number): number[]
  (input: bigint): bigint[]
}
```

Behvaiour before:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[bigint]>()
```

Behaviour now:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
```

There were similar changes for `.returns`, `.parameter(...)`, and `.toBeCallableWith`. Also, overloaded functions are now differentiated properly when using `.branded.toEqualTypeOf` (this was a bug that it seems nobody found).

See [#83](mmkal/expect-type#83) for more details or look at the updated docs (including a new section called "[Overloaded functions](https://github.com/mmkal/expect-type#overloaded-functions)", which has more info on how this behaviour differs for TypeScript versions before 5.3).

#### What's Changed

-   Fix rendering issue in readme by [@mrazauskas](https://github.com/mrazauskas) in mmkal/expect-type#69
-   Fix minor issues in docs by [@aryaemami59](https://github.com/aryaemami59) in mmkal/expect-type#91
-   create utils file by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#93
-   branding.ts and messages.ts by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#95
-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83
-   Extends: explain myself  [`1e37116`](mmkal/expect-type@1e37116)
-   Mark internal APIs with `@internal` JSDoc tag ([#104](mmkal/expect-type#104))  [`4c40b07`](mmkal/expect-type@4c40b07)
-   Re-export everything in `overloads.ts` file ([#107](mmkal/expect-type#107))  [`5ee0181`](mmkal/expect-type@5ee0181)
-   JSDoc improvements ([#100](mmkal/expect-type#100))  [`0bbeffa`](mmkal/expect-type@0bbeffa)

**Full Changelog**: mmkal/expect-type@v0.19.0...v0.20.0
renovate bot added a commit to mmkal/trpc-cli that referenced this pull request Aug 21, 2024
##### [`v0.20.0](https://github.com/mmkal/expect-type/releases/tag/v0.20.0)

#### Breaking changes

-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83

This change updates how overloaded functions are treated. Now, `.parameters` gives you a *union* of the parameter-tuples that a function can take. For example, given the following type:

```ts
type Factorize = {
  (input: number): number[]
  (input: bigint): bigint[]
}
```

Behvaiour before:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[bigint]>()
```

Behaviour now:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
```

There were similar changes for `.returns`, `.parameter(...)`, and `.toBeCallableWith`. Also, overloaded functions are now differentiated properly when using `.branded.toEqualTypeOf` (this was a bug that it seems nobody found).

See [#83](mmkal/expect-type#83) for more details or look at the updated docs (including a new section called "[Overloaded functions](https://github.com/mmkal/expect-type#overloaded-functions)", which has more info on how this behaviour differs for TypeScript versions before 5.3).

#### What's Changed

-   Fix rendering issue in readme by [@mrazauskas](https://github.com/mrazauskas) in mmkal/expect-type#69
-   Fix minor issues in docs by [@aryaemami59](https://github.com/aryaemami59) in mmkal/expect-type#91
-   create utils file by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#93
-   branding.ts and messages.ts by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#95
-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83
-   Extends: explain myself  [`1e37116`](mmkal/expect-type@1e37116)
-   Mark internal APIs with `@internal` JSDoc tag ([#104](mmkal/expect-type#104))  [`4c40b07`](mmkal/expect-type@4c40b07)
-   Re-export everything in `overloads.ts` file ([#107](mmkal/expect-type#107))  [`5ee0181`](mmkal/expect-type@5ee0181)
-   JSDoc improvements ([#100](mmkal/expect-type#100))  [`0bbeffa`](mmkal/expect-type@0bbeffa)

**Full Changelog**: mmkal/expect-type@v0.19.0...v0.20.0
renovate bot added a commit to mmkal/trpc-cli that referenced this pull request Aug 21, 2024
##### [`v0.20.0](https://github.com/mmkal/expect-type/releases/tag/v0.20.0)

#### Breaking changes

-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83

This change updates how overloaded functions are treated. Now, `.parameters` gives you a *union* of the parameter-tuples that a function can take. For example, given the following type:

```ts
type Factorize = {
  (input: number): number[]
  (input: bigint): bigint[]
}
```

Behvaiour before:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[bigint]>()
```

Behaviour now:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
```

There were similar changes for `.returns`, `.parameter(...)`, and `.toBeCallableWith`. Also, overloaded functions are now differentiated properly when using `.branded.toEqualTypeOf` (this was a bug that it seems nobody found).

See [#83](mmkal/expect-type#83) for more details or look at the updated docs (including a new section called "[Overloaded functions](https://github.com/mmkal/expect-type#overloaded-functions)", which has more info on how this behaviour differs for TypeScript versions before 5.3).

#### What's Changed

-   Fix rendering issue in readme by [@mrazauskas](https://github.com/mrazauskas) in mmkal/expect-type#69
-   Fix minor issues in docs by [@aryaemami59](https://github.com/aryaemami59) in mmkal/expect-type#91
-   create utils file by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#93
-   branding.ts and messages.ts by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#95
-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83
-   Extends: explain myself  [`1e37116`](mmkal/expect-type@1e37116)
-   Mark internal APIs with `@internal` JSDoc tag ([#104](mmkal/expect-type#104))  [`4c40b07`](mmkal/expect-type@4c40b07)
-   Re-export everything in `overloads.ts` file ([#107](mmkal/expect-type#107))  [`5ee0181`](mmkal/expect-type@5ee0181)
-   JSDoc improvements ([#100](mmkal/expect-type#100))  [`0bbeffa`](mmkal/expect-type@0bbeffa)

**Full Changelog**: mmkal/expect-type@v0.19.0...v0.20.0
renovate bot added a commit to mmkal/trpc-cli that referenced this pull request Aug 21, 2024
##### [`v0.20.0](https://github.com/mmkal/expect-type/releases/tag/v0.20.0)

#### Breaking changes

-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83

This change updates how overloaded functions are treated. Now, `.parameters` gives you a *union* of the parameter-tuples that a function can take. For example, given the following type:

```ts
type Factorize = {
  (input: number): number[]
  (input: bigint): bigint[]
}
```

Behvaiour before:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[bigint]>()
```

Behaviour now:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
```

There were similar changes for `.returns`, `.parameter(...)`, and `.toBeCallableWith`. Also, overloaded functions are now differentiated properly when using `.branded.toEqualTypeOf` (this was a bug that it seems nobody found).

See [#83](mmkal/expect-type#83) for more details or look at the updated docs (including a new section called "[Overloaded functions](https://github.com/mmkal/expect-type#overloaded-functions)", which has more info on how this behaviour differs for TypeScript versions before 5.3).

#### What's Changed

-   Fix rendering issue in readme by [@mrazauskas](https://github.com/mrazauskas) in mmkal/expect-type#69
-   Fix minor issues in docs by [@aryaemami59](https://github.com/aryaemami59) in mmkal/expect-type#91
-   create utils file by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#93
-   branding.ts and messages.ts by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#95
-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83
-   Extends: explain myself  [`1e37116`](mmkal/expect-type@1e37116)
-   Mark internal APIs with `@internal` JSDoc tag ([#104](mmkal/expect-type#104))  [`4c40b07`](mmkal/expect-type@4c40b07)
-   Re-export everything in `overloads.ts` file ([#107](mmkal/expect-type#107))  [`5ee0181`](mmkal/expect-type@5ee0181)
-   JSDoc improvements ([#100](mmkal/expect-type#100))  [`0bbeffa`](mmkal/expect-type@0bbeffa)

**Full Changelog**: mmkal/expect-type@v0.19.0...v0.20.0
renovate bot added a commit to mmkal/trpc-cli that referenced this pull request Aug 21, 2024
##### [`v0.20.0](https://github.com/mmkal/expect-type/releases/tag/v0.20.0)

#### Breaking changes

-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83

This change updates how overloaded functions are treated. Now, `.parameters` gives you a *union* of the parameter-tuples that a function can take. For example, given the following type:

```ts
type Factorize = {
  (input: number): number[]
  (input: bigint): bigint[]
}
```

Behvaiour before:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[bigint]>()
```

Behaviour now:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
```

There were similar changes for `.returns`, `.parameter(...)`, and `.toBeCallableWith`. Also, overloaded functions are now differentiated properly when using `.branded.toEqualTypeOf` (this was a bug that it seems nobody found).

See [#83](mmkal/expect-type#83) for more details or look at the updated docs (including a new section called "[Overloaded functions](https://github.com/mmkal/expect-type#overloaded-functions)", which has more info on how this behaviour differs for TypeScript versions before 5.3).

#### What's Changed

-   Fix rendering issue in readme by [@mrazauskas](https://github.com/mrazauskas) in mmkal/expect-type#69
-   Fix minor issues in docs by [@aryaemami59](https://github.com/aryaemami59) in mmkal/expect-type#91
-   create utils file by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#93
-   branding.ts and messages.ts by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#95
-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83
-   Extends: explain myself  [`1e37116`](mmkal/expect-type@1e37116)
-   Mark internal APIs with `@internal` JSDoc tag ([#104](mmkal/expect-type#104))  [`4c40b07`](mmkal/expect-type@4c40b07)
-   Re-export everything in `overloads.ts` file ([#107](mmkal/expect-type#107))  [`5ee0181`](mmkal/expect-type@5ee0181)
-   JSDoc improvements ([#100](mmkal/expect-type#100))  [`0bbeffa`](mmkal/expect-type@0bbeffa)

**Full Changelog**: mmkal/expect-type@v0.19.0...v0.20.0
renovate bot added a commit to mmkal/trpc-cli that referenced this pull request Aug 21, 2024
##### [`v0.20.0](https://github.com/mmkal/expect-type/releases/tag/v0.20.0)

#### Breaking changes

-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83

This change updates how overloaded functions are treated. Now, `.parameters` gives you a *union* of the parameter-tuples that a function can take. For example, given the following type:

```ts
type Factorize = {
  (input: number): number[]
  (input: bigint): bigint[]
}
```

Behvaiour before:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[bigint]>()
```

Behaviour now:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
```

There were similar changes for `.returns`, `.parameter(...)`, and `.toBeCallableWith`. Also, overloaded functions are now differentiated properly when using `.branded.toEqualTypeOf` (this was a bug that it seems nobody found).

See [#83](mmkal/expect-type#83) for more details or look at the updated docs (including a new section called "[Overloaded functions](https://github.com/mmkal/expect-type#overloaded-functions)", which has more info on how this behaviour differs for TypeScript versions before 5.3).

#### What's Changed

-   Fix rendering issue in readme by [@mrazauskas](https://github.com/mrazauskas) in mmkal/expect-type#69
-   Fix minor issues in docs by [@aryaemami59](https://github.com/aryaemami59) in mmkal/expect-type#91
-   create utils file by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#93
-   branding.ts and messages.ts by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#95
-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83
-   Extends: explain myself  [`1e37116`](mmkal/expect-type@1e37116)
-   Mark internal APIs with `@internal` JSDoc tag ([#104](mmkal/expect-type#104))  [`4c40b07`](mmkal/expect-type@4c40b07)
-   Re-export everything in `overloads.ts` file ([#107](mmkal/expect-type#107))  [`5ee0181`](mmkal/expect-type@5ee0181)
-   JSDoc improvements ([#100](mmkal/expect-type#100))  [`0bbeffa`](mmkal/expect-type@0bbeffa)

**Full Changelog**: mmkal/expect-type@v0.19.0...v0.20.0
renovate bot added a commit to mmkal/trpc-cli that referenced this pull request Aug 22, 2024
##### [`v0.20.0](https://github.com/mmkal/expect-type/releases/tag/v0.20.0)

#### Breaking changes

-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83

This change updates how overloaded functions are treated. Now, `.parameters` gives you a *union* of the parameter-tuples that a function can take. For example, given the following type:

```ts
type Factorize = {
  (input: number): number[]
  (input: bigint): bigint[]
}
```

Behvaiour before:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[bigint]>()
```

Behaviour now:

```ts
expectTypeOf<Factorize>().parameters.toEqualTypeOf<[number] | [bigint]>()
```

There were similar changes for `.returns`, `.parameter(...)`, and `.toBeCallableWith`. Also, overloaded functions are now differentiated properly when using `.branded.toEqualTypeOf` (this was a bug that it seems nobody found).

See [#83](mmkal/expect-type#83) for more details or look at the updated docs (including a new section called "[Overloaded functions](https://github.com/mmkal/expect-type#overloaded-functions)", which has more info on how this behaviour differs for TypeScript versions before 5.3).

#### What's Changed

-   Fix rendering issue in readme by [@mrazauskas](https://github.com/mrazauskas) in mmkal/expect-type#69
-   Fix minor issues in docs by [@aryaemami59](https://github.com/aryaemami59) in mmkal/expect-type#91
-   create utils file by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#93
-   branding.ts and messages.ts by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#95
-   improve overloads support, attempt 2 by [@mmkal](https://github.com/mmkal) in mmkal/expect-type#83
-   Extends: explain myself  [`1e37116`](mmkal/expect-type@1e37116)
-   Mark internal APIs with `@internal` JSDoc tag ([#104](mmkal/expect-type#104))  [`4c40b07`](mmkal/expect-type@4c40b07)
-   Re-export everything in `overloads.ts` file ([#107](mmkal/expect-type#107))  [`5ee0181`](mmkal/expect-type@5ee0181)
-   JSDoc improvements ([#100](mmkal/expect-type#100))  [`0bbeffa`](mmkal/expect-type@0bbeffa)

**Full Changelog**: mmkal/expect-type@v0.19.0...v0.20.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Does not impact code behavior documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants