The declaration file index.d.ts
of a library I am using contains the following:
declare namespace browser.runtime
{
...
function sendMessage(message: any, options?: _SendMessageOptions): Promise<any>;
function sendMessage(extensionId: string, message: any, options?: _SendMessageOptions): Promise<any>;
...
}
Is it possible to remove these declarations and specifically get rid of the any
type?
I have considered adding an overload, but that solution does not fully meet my requirements:
declare namespace browser.runtime
{
function sendMessage(message: any, options?: _SendMessageOptions): Promise<unknown>;
}