I am writing definitions for an existing function module library which exposes the following API:
fn().from(opts: Options)
// and
fn().from.string(path: String)
I found about declaration merging here. Where it says something about declaring many times a function with the same name for overloads. But it says nothing about writing types for a function and a property living in the same place.
Nevertheless I tried writing:
export interface Test {
from(path: string): ToOptionsBuilder;
}
export interface Test {
from: FromOptionsBuilder;
}
But as expected, the compiler complains: Subsequent property declarations must have the same type.
Is there anything I can do about it ?
In case of need, the library is markdown-pdf.