angular / ts-api-guardian

MIT License
15 stars 15 forks source link

Overloading a function doesn't generate all of the signatures #22

Open ocombe opened 6 years ago

ocombe commented 6 years ago

When I try to overload a function it doesn't add the overloaded signature to the api file like it does for class methods.

Code of the function:

export function registerLocaleData(data: any, extraData?: any): void;
export function registerLocaleData(data: any, localeId?: string, extraData?: any): void;
export function registerLocaleData(data: any, localeId?: string | any, extraData?: any): void {
  ...
}

Declarations generated by typescript:

export declare function registerLocaleData(data: any, extraData?: any): void;
export declare function registerLocaleData(data: any, localeId?: string, extraData?: any): void;

Api file:

export declare function registerLocaleData(data: any, extraData?: any): void;
IgorMinar commented 6 years ago

Could you send a PR?

ocombe commented 6 years ago

I already have a lot of things on my todo list for now, so if you're not in a hurry then yes, but don't expect anything soon.

IgorMinar commented 6 years ago

Is this issue blocking any work in angular/angular? If not then I'm fine waiting a bit, otherwise I'll need to find someone else to take this on.

On Mon, Nov 27, 2017 at 1:45 PM Olivier Combe notifications@github.com wrote:

I already have a lot of things on my todo list for now, so if you're not in a hurry then yes, but don't expect anything soon.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/ts-api-guardian/issues/22#issuecomment-347338562, or mute the thread https://github.com/notifications/unsubscribe-auth/AANM6IxjhRO3PPpTIK0VeDAdUDTD-6qPks5s6y1pgaJpZM4QsJEq .

ocombe commented 6 years ago

It's not blocking, we'll update the api file with the correct definitions when this bug is fixed

alexeagle commented 6 years ago

note, this project moved to angular/angular