Skip to content

fix(mysql): change Types const enum to regular enum - #75611

Merged
typescript-automation[bot] merged 1 commit into
DefinitelyTyped:masterfrom
skrtheboss:fix-mysql-types-const-enum
Sep 29, 2026
Merged

typescript-automation[bot] merged 1 commit into
DefinitelyTyped:masterfrom
skrtheboss:fix-mysql-types-const-enum

Conversation

@skrtheboss

Copy link
Copy Markdown
Contributor

const enums cannot be imported when a consumer enables TypeScript's verbatimModuleSyntax, since the compiler needs the enum's runtime value to inline it and const enums are erased ambiently (TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled). Switching to a regular enum keeps the same values/behavior while remaining importable under verbatimModuleSyntax.

Please fill in this template.

Select one of these and delete the others:

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
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax (see also TS2748 "Cannot access ambient const enums when 'verbatimModuleSyntax' is enabled")
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the package.json.

If removing a declaration:

  • If a package was never on Definitely Typed, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

const enums cannot be imported when a consumer enables TypeScript's
verbatimModuleSyntax, since the compiler needs the enum's runtime
value to inline it and const enums are erased ambiently
(TS2748: Cannot access ambient const enums when 'verbatimModuleSyntax'
is enabled). Switching to a regular enum keeps the same values/behavior
while remaining importable under verbatimModuleSyntax.
@typescript-automation

typescript-automation Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

@skrtheboss Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Only a DT maintainer can approve changes without tests

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 75611,
  "author": "skrtheboss",
  "headCommitOid": "d4156554068bc3514f6ff1e64899a624097da661",
  "mergeBaseOid": "848f089767f368e5cd3b5afbb41f86f6a730eb0f",
  "lastPushDate": "2026-09-23T07:39:37.000Z",
  "lastActivityDate": "2026-09-29T05:26:17.000Z",
  "mergeOfferDate": "2026-09-28T22:48:13.000Z",
  "mergeRequestDate": "2026-09-29T05:26:17.000Z",
  "mergeRequestUser": "skrtheboss",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "mysql",
      "version": "2.15",
      "kind": "edit",
      "files": [
        {
          "path": "types/mysql/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "wjohnsto",
        "kpping",
        "jdmunro",
        "sedenardi"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "RyanCavanaugh",
      "date": "2026-09-28T22:47:33.000Z",
      "isMaintainer": true
    }
  ],
  "mainBotCommentID": 5790992993,
  "ciResult": "pass"
}

@typescript-automation typescript-automation Bot added Critical package Untested Change This PR does not touch tests labels Sep 23, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

Hey @skrtheboss,

😒 Your PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Please consider adding tests to cover the change you're making. Including tests allows this PR to be merged by yourself and the owners of this module.

This can potentially save days of time for you!

@typescript-automation

Copy link
Copy Markdown
Contributor

🔔 @wjohnsto @kpping @jdmunro @sedenardi — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-automation typescript-automation Bot moved this to Waiting for Code Reviews in Pull Request Status Board Sep 23, 2026
@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board Sep 23, 2026
@typescript-automation typescript-automation Bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Sep 28, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

@skrtheboss: Everything looks good here. I am ready to merge this PR (at d415655) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@wjohnsto, @kpping, @jdmunro, @sedenardi: you can do this too.)

@skrtheboss

Copy link
Copy Markdown
Contributor Author

Ready to merge

@typescript-automation
typescript-automation Bot merged commit b69375c into DefinitelyTyped:master Sep 29, 2026
4 checks passed
@skrtheboss
skrtheboss deleted the fix-mysql-types-const-enum branch September 29, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical package Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner Untested Change This PR does not touch tests

Projects

Status: Recently Merged

Development

Successfully merging this pull request may close these issues.

2 participants