Skip to content

Declaration emit is broken for parameters marked /* @internal */ #33350

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

Open
andrewbranch opened this issue Sep 10, 2019 · 2 comments
Open

Declaration emit is broken for parameters marked /* @internal */ #33350

andrewbranch opened this issue Sep 10, 2019 · 2 comments
Labels
Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files
Milestone

Comments

@andrewbranch
Copy link
Member

.ts:

interface TypeChecker {
    getContextualType(node: Expression, /* @internal */ contextFlags?: ContextFlags): Type | undefined;
}

.d.ts:

interface TypeChecker {
    getContextualType(node: Expression, 
: Type | undefined;
@andrewbranch andrewbranch added Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files labels Sep 10, 2019
@sheetalkamat
Copy link
Member

Seems like multiple issues.. This is d.ts emit through transform. The one you see is because of copying and updating d.ts as per changes in prepends through tsbuild info.

c:\TypeScript\built\local>type a.ts
interface TypeChecker {
    getContextualType(node: string, /* @internal */ contextFlags?: number): string | undefined;
}
c:\TypeScript\built\local>node tsc.js --stripInternal a.ts --d

c:\TypeScript\built\local>type a.d.ts
interface TypeChecker {
    getContextualType(node: string, /* @internal */ contextFlags?: number): string | undefined;
}

@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Sep 25, 2019
@juanrgm
Copy link

juanrgm commented Sep 15, 2022

Same case here with TypeScript 4.8.3.

  • Error
 '*/' expected.
  • index.d.ts
// ...
            lastIndexOf(searchElement: import("@anymodel/docker-compose").Volume, fromIndex?: number | undefined): number;
            every<S extends import("@anymodel/docker-compose").Volume>(predicate: (value: import("@anymodel/docker-compose").Volume, index: number, array: import("@anymodel/docker-compose").Volume[]) => value is S, thisArg?: any): this is S[]; /**"],
          },
// ...
  • A portion of index.ts
// ...
{
  includeIgnored: ["**/.history/**"],
}
// ...

Unfortunately I can't create a POC because the code is very complex and when I delete some parts the problem fixes. But basically the generation stopped after of this is S[]; /**"], and then the rest of the file contains the original source code.

Workaround?

"*" + "*/.history/**" // 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files
Projects
None yet
Development

No branches or pull requests

4 participants