dts-bundle-generator icon indicating copy to clipboard operation
dts-bundle-generator copied to clipboard

Monorepo packages support

Open bluelovers opened this issue 4 years ago • 3 comments

Bug report

Input code

// place your code here

Expected output

// place your code here

ICardOfLibraryBase ICardOfLibrary IOptions DeckLibrary

should import from mtg-decklist-to-library

Actual output

https://github.com/bluelovers/ws-mtg/blob/master/packages/mtg-deck-shuffle/dist/index.d.ts

import { Decklist, ICard } from 'mtg-decklist-parser2';
import { Random } from 'random-extra/src';

export interface ICardOfLibraryBase extends Omit<ICard, "amount"> {
}
export declare type ICardOfLibrary<T = {}> = ICardOfLibraryBase & T;
export interface IOptions<T = ICardOfLibrary> {
	entryHandler?(entry: ICardOfLibraryBase): T;
}
declare class DeckLibrary<T = {}> {
	readonly deck: Decklist;
	cards: T[];
	protected _shuffleStarting: boolean;
	handSize: number;
	constructor(deck: Decklist, options?: IOptions<ICardOfLibrary<T>>);
	get length(): number;
	shuffleStarting(): void;
	shuffle(isStarting?: boolean): void;
	drawStarting(noPickup?: boolean): T[];
	draw(size?: number, noPickup?: boolean): T[];
}
export interface IOptionsDeckLibraryWithShuffle<T = ICardOfLibrary> extends IOptionsDecklistToLibrary<T> {
	maxChunkLength?: number;
	random?: Random;
}
export declare class DeckLibraryWithShuffle<T = {}> extends DeckLibrary<ICardOfLibrary<T>> {
	_options?: IOptionsDeckLibraryWithShuffle<ICardOfLibrary<T>>;
	constructor(deck: Decklist, options?: IOptionsDeckLibraryWithShuffle<ICardOfLibrary<T>>);
	options(options?: IOptionsDeckLibraryWithShuffle): IOptionsDeckLibraryWithShuffle;
	shuffleStarting(): void;
	shuffle(isStarting?: boolean): void;
}
export declare function distributeCards<T extends ICardOfLibraryBase = ICardOfLibraryBase>(cards: T[], options?: IOptionsDeckLibraryWithShuffle): T[];
export declare function splitThenMerge<T = ICardOfLibraryBase>(cards: T[], options?: IOptionsDeckLibraryWithShuffle): T[];
export default DeckLibraryWithShuffle;

export {};

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

bluelovers avatar Nov 22 '21 03:11 bluelovers

It looks like it is related to https://github.com/timocov/dts-bundle-generator/issues/94#issuecomment-955686181 (monorepo support and how to handle them). Please a comment I mentioned, maybe you will have any thoughts how to handle it in a better way.

timocov avatar Nov 22 '21 22:11 timocov

@timocov where is the code of control output as import or not ?

i maybe can try fix it

bluelovers avatar Nov 24 '21 12:11 bluelovers

@bluelovers see https://github.com/timocov/dts-bundle-generator/blob/master/src/module-info.ts#L60-L115

timocov avatar Nov 24 '21 19:11 timocov