Skip to content

Incorrect handling of duplicates in augmented types #335

@mnaoumov

Description

@mnaoumov

Bug report

obsidian library has type Plugin

HTML DOM API also has deprecated type Plugin

It seems dts-bundle-generator trying to avoid confusion between those two Plugin types replaces the one we use with Plugin$1, but this makes the augmentation incorrect, because there aliases are not supported

Input code

import { Plugin } from 'obsidian';

export interface Plugin2 extends Plugin {}

declare module 'obsidian' {
    interface Plugin {
        someProperty: string;
    }
}

Expected output

// Generated by dts-bundle-generator v9.5.1

import { Plugin } from 'obsidian';

export interface Plugin2 extends Plugin {
}
declare module "obsidian" {
	interface Plugin {
		someProperty: string;
	}
}

export {};

Actual output

// Generated by dts-bundle-generator v9.5.1

import { Plugin as Plugin$1 } from 'obsidian';

export interface Plugin2 extends Plugin$1 {
}
declare module "obsidian" {
	interface Plugin$1 {
		someProperty: string;
	}
}

export {};

Additional context
Add any other context about the problem here (CLI options, etc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions