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

[api-extractor] rollup .d.ts include not declare module #2090

Open
1 of 2 tasks
Senasiko opened this issue Aug 10, 2020 · 3 comments
Open
1 of 2 tasks

[api-extractor] rollup .d.ts include not declare module #2090

Senasiko opened this issue Aug 10, 2020 · 3 comments

Comments

@Senasiko
Copy link

Senasiko commented Aug 10, 2020

Is this a feature or a bug?

  • Feature
  • Bug

Please describe the actual behavior.
I have an index.d.ts what include declare module

// index.d.ts
export const test: string;

declare module 'my-module' {
  export const name = 'my-module';
}

And run api-extractor run

// api-extractor.json
{
  "mainEntryPointFilePath": "./index.d.ts",

  "apiReport": {
    "enabled": true,
    "reportFolder": "<projectFolder>/temp/"
  },

  "docModel": {
    "enabled": true
  },

  "dtsRollup": {
    "enabled": true,
    "untrimmedFilePath": "./result.d.ts"
  },

  "tsdocMetadata": {
    "enabled": false
  }

}

the result is

export declare const test: string;

export { }

result is include not declare module
What is the expected behavior?

// result.d.ts
export declare const test: string;

declare module 'my-module' {
  export const name = 'my-module';
}

I think it's useful to include declare module for some plugin module what override something. For example.

// my-module
export interface CustomOptions {}
export interface Options extends CustomOptions {
    name: string;
}
// my-module-plugin
declare module 'my-module' {
    export interface CustomOptions {
        otherInfo: string;
    }
}
@posva
Copy link

posva commented Aug 12, 2020

Are you aware of any workaround to include the declare module part? @octogonz
In case I can avoid to append the declare module code by hand 😄

@idranme
Copy link

idranme commented Apr 27, 2024

I'm having this problem too.

@hanfengv
Copy link

package.json
"types": "./dist/index.d.ts",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: AE/AD
Development

No branches or pull requests

4 participants