Skip to content

Review ts-internal #830

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

Closed
aciccarello opened this issue Aug 11, 2018 · 2 comments
Closed

Review ts-internal #830

aciccarello opened this issue Aug 11, 2018 · 2 comments
Labels
help wanted Contributions are especially encouraged

Comments

@aciccarello
Copy link
Collaborator

aciccarello commented Aug 11, 2018

TypeDoc uses functions which the TypeScript team considers internal and exposes the types in ts-internal.ts.

We should review these methods to see if:

  1. The methods are still considered private (marked @internal) by the TypeScript team
  2. There is an alternative method (hopefully public) that should be used instead
  3. We could engage the TypeScript team about exposing an api publicly so we are less likely to have breaking changes
@aciccarello aciccarello added enhancement help wanted Contributions are especially encouraged labels Aug 11, 2018
@aciccarello
Copy link
Collaborator Author

There are some relevant comments on @christopherthielen's #310 and #314 PRs

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 27, 2020

0.20 does a pretty good job of cleaning this up. There are only two things left in it, one of them has an issue that I expect will be accepted to be made public. The other... is deeply integrated into how typedoc works, isn't going to be exposed by the TS team, and will just have to be lived with for a while.

import * as ts from "typescript";
/**
* Expose the internal TypeScript APIs that are used by TypeDoc
*/
declare module "typescript" {
interface Node {
// https://github.com/microsoft/TypeScript/blob/v4.1.3/src/compiler/types.ts#L847
symbol?: ts.Symbol;
}
interface TypeChecker {
// https://github.com/microsoft/TypeScript/blob/v4.1.3/src/compiler/types.ts#L4145
// https://github.com/microsoft/TypeScript/issues/42118
getTypePredicateOfSignature(
signature: ts.Signature
): ts.TypePredicate | undefined;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

2 participants