Skip to content

feat: Add call‑bind#50541

Merged
weswigham merged 1 commit intoDefinitelyTyped:masterfrom
ExE-Boss:types/call-bind/v1.0
Jan 12, 2021
Merged

feat: Add call‑bind#50541
weswigham merged 1 commit intoDefinitelyTyped:masterfrom
ExE-Boss:types/call-bind/v1.0

Conversation

@ExE-Boss
Copy link
Copy Markdown
Contributor

Please fill in this template.

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an npm package, match the name. If not, do not conflict with the name of an npm package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tslint.json should contain { "extends": "dtslint/dt.json" }, and no additional rules.
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Jan 11, 2021

@ExE-Boss Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

This PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ❌ Only a DT maintainer can approve changes when there are new packages added

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 50541,
  "author": "ExE-Boss",
  "headCommitOid": "5cd88fff8ea291eaa6f6b9f552e454b3001bc53c",
  "lastPushDate": "2021-01-12T13:20:04.000Z",
  "lastActivityDate": "2021-01-12T17:48:35.000Z",
  "maintainerBlessed": false,
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "call-bind",
      "kind": "add",
      "files": [
        {
          "path": "types/call-bind/call-bind-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/call-bind/callBound.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/call-bind/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/call-bind/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/call-bind/test/callBind.test.ts",
          "kind": "test"
        },
        {
          "path": "types/call-bind/test/callBound.test.ts",
          "kind": "test"
        },
        {
          "path": "types/call-bind/ts3.9/call-bind-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/call-bind/ts3.9/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/call-bind/ts3.9/test/callBind.test.ts",
          "kind": "test"
        },
        {
          "path": "types/call-bind/ts3.9/test/callBound.test.ts",
          "kind": "test"
        },
        {
          "path": "types/call-bind/ts3.9/tsconfig.json",
          "kind": "package-meta",
          "suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-tsconfigjson)"
        },
        {
          "path": "types/call-bind/ts3.9/tslint.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/call-bind/tsconfig.json",
          "kind": "package-meta",
          "suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-tsconfigjson)"
        },
        {
          "path": "types/call-bind/tslint.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [],
      "addedOwners": [
        "ljharb",
        "ExE-Boss"
      ],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "ljharb",
      "date": "2021-01-12T17:48:35.000Z",
      "isMaintainer": false
    }
  ],
  "ciResult": "pass"
}

@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @ExE-Boss — you're the only owner, but it would still be good if you find someone to review this PR in the next few days, otherwise a maintainer will look at it. (And if you do find someone, maybe even recruit them to be a second owner to make future changes easier...)

@typescript-bot typescript-bot added New Definition This PR creates a new definition package. Check Config Changes a module config files The CI failed When GH Actions fails labels Jan 11, 2021
@typescript-bot
Copy link
Copy Markdown
Contributor

@ExE-Boss The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Comment on lines -17 to -19
// These are invalid because of `package.json#exports`:
import callBindIllegal1 = require('call-bind/index'); // $ExpectError
import callBindIllegal2 = require('call-bind/index.js'); // $ExpectError
Copy link
Copy Markdown
Contributor Author

@ExE-Boss ExE-Boss Jan 11, 2021

Choose a reason for hiding this comment

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

@orta @sandersn @weswigham

Why do these lines cause @types/call‑bind/index.d.ts to be incorrectly included in the TypeScript 3.9 test?

@typescript-bot typescript-bot added The CI failed When GH Actions fails and removed The CI failed When GH Actions fails labels Jan 11, 2021
@typescript-bot
Copy link
Copy Markdown
Contributor

@ExE-Boss The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

import callBind = require('call-bind');
import { apply as applyBind } from 'call-bind';

declare const any: unknown;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why this instead of just using unknown directly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because unknown only refers to a type.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

gotcha, so it could be named anything then. i was just confused by the name any

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agree, any is a super confusing name for a value of type unknown. Maybe try unknown ?

@typescript-bot typescript-bot added Other Approved This PR was reviewed and signed-off by a community member. The CI failed When GH Actions fails and removed Other Approved This PR was reviewed and signed-off by a community member. The CI failed When GH Actions fails labels Jan 11, 2021
@typescript-bot
Copy link
Copy Markdown
Contributor

@ExE-Boss The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@sandersn
Copy link
Copy Markdown
Contributor

@ExE-Boss it's probably because the dependency tracking code expects people to write require('call-bind') not require('call-bind/index'), and this happens to make a difference in situations typesVersions.

@typescript-bot typescript-bot added The CI failed When GH Actions fails and removed The CI failed When GH Actions fails labels Jan 11, 2021
@typescript-bot
Copy link
Copy Markdown
Contributor

@ExE-Boss The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@ExE-Boss ExE-Boss force-pushed the types/call-bind/v1.0 branch from 9827526 to 5cd88ff Compare January 12, 2021 13:20
@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Jan 12, 2021
@typescript-bot
Copy link
Copy Markdown
Contributor

@ljharb Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@typescript-bot typescript-bot added the Other Approved This PR was reviewed and signed-off by a community member. label Jan 12, 2021
@weswigham weswigham merged commit bacd6ca into DefinitelyTyped:master Jan 12, 2021
@ExE-Boss ExE-Boss deleted the types/call-bind/v1.0 branch January 12, 2021 18:30
@typescript-bot
Copy link
Copy Markdown
Contributor

I just published @types/[email protected] to npm.

kaznovac pushed a commit to kaznovac/DefinitelyTyped that referenced this pull request Mar 2, 2021
@ExE-Boss ExE-Boss mentioned this pull request Mar 14, 2021
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Check Config Changes a module config files New Definition This PR creates a new definition package. Other Approved This PR was reviewed and signed-off by a community member.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants