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

@babel/types TypeScript definitions is missing some exported functions #8375

Closed
mgroenhoff opened this issue Jul 24, 2018 · 8 comments · Fixed by #10098
Closed

@babel/types TypeScript definitions is missing some exported functions #8375

mgroenhoff opened this issue Jul 24, 2018 · 8 comments · Fixed by #10098
Labels
area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: types

Comments

@mgroenhoff
Copy link
Contributor

Bug Report

Current Behavior
I am trying to use the TypeScript definitions from @babel/types but I am missing some functions:

export { default as is } from "./validators/is";
export { default as isBinding } from "./validators/isBinding";
export { default as isBlockScoped } from "./validators/isBlockScoped";
export { default as isImmutable } from "./validators/isImmutable";
export { default as isLet } from "./validators/isLet";
export { default as isNode } from "./validators/isNode";
export { default as isNodesEquivalent } from "./validators/isNodesEquivalent";
export { default as isReferenced } from "./validators/isReferenced";
export { default as isScope } from "./validators/isScope";
export { default as isSpecifierDefault } from "./validators/isSpecifierDefault";
export { default as isType } from "./validators/isType";
export {
default as isValidES3Identifier,
} from "./validators/isValidES3Identifier";
export { default as isValidIdentifier } from "./validators/isValidIdentifier";
export { default as isVar } from "./validators/isVar";

Environment

  • Babel version(s): 7.0.0-beta.54
@babel-bot
Copy link
Collaborator

Hey @mgroenhoff! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@xtuc
Copy link
Member

xtuc commented Jul 25, 2018

Would you mind sending a PR?

@mgroenhoff
Copy link
Contributor Author

I am not really sure where to start TBH. I know those types are automatically generated but that's about it. Can you give me some directions on how to approach this?

@brandonkal
Copy link

cloneNode is also missing from the type definitions

@nicolo-ribaudo
Copy link
Member

@brandonkal Added!

@JLHwung
Copy link
Contributor

JLHwung commented Sep 5, 2019

Fixed by #10098

@JLHwung JLHwung closed this as completed Sep 5, 2019
@brandonkal
Copy link

Looking through my babel plugins, I found some more types that are missing:

declare module '@babel/core' {
  namespace types {
    type VisitorKeys = {
      [T in keyof AllNodes]: Extract<
        keyof AllNodes[T],
        {
          [Key in keyof AllNodes[T]]: AllNodes[T][Key] extends (
            | t.Node
            | t.Node[]
            | null)
            ? Key
            : never;
        }[keyof AllNodes[T]]
      >;
    };

    const VISITOR_KEYS: { [T in keyof VisitorKeys]: VisitorKeys[T][] };
    const FLIPPED_ALIAS_KEYS: {
      [T in keyof t.Aliases]: t.Aliases[T]['type'][];
    };

    function shallowEqual(actual: object, expected: object): boolean;
  }
}

I'll post this here as it is related, but I can open new issue if desired.

@mgroenhoff
Copy link
Contributor Author

Thanks all for taking this over!

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 13, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants