-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Hello,
First, thank you for new update!
I've checked it in all my projects and found only one issue:
declare namespace browser.scripting {
func?: () => void | undefined;
The function type func?: () => void | undefined;
should be probably func?: (...args: any) => any;
.
The first issue is the arguments - the function will be called with arguments based on the "args" property in the interface ScriptInjection
.
Second issue is the return type, function can return a value which is then used in the "InjectionResult" here:
interface InjectionResult {
/** The frame ID associated with the injection. */
frameId: number;
/** The result of the script execution. */
result?: any;
/**
* The error property is set when the script execution failed. The value is typically an (Error) object with a message property, but could be any value (including primitives and undefined) if the script threw or rejected with such a value.
*/
error?: any;
}
In ideal world one would use generics instead of any
, but I guess it's ok to keep it simple for now.