Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ulixee
GitHub Repository: ulixee/secret-agent
Path: blob/main/plugins/execute-js/index.ts
1026 views
1
// This import statement is important for all this to work, otherwise we don't extend but replace the secret-agent module definition.
2
// https://github.com/microsoft/TypeScript/issues/10859
3
import type {} from '@secret-agent/client/lib/extendables';
4
import ClientPlugin from './lib/ClientPlugin';
5
import CorePlugin from './lib/CorePlugin';
6
7
type ExecuteJsPluginAdditions = {
8
executeJs<T extends any[]>(fn: string | ((...args: T) => any), ...args: T);
9
};
10
11
declare module '@secret-agent/client/lib/extendables' {
12
interface Agent extends ExecuteJsPluginAdditions {}
13
interface Tab extends ExecuteJsPluginAdditions {}
14
interface FrameEnvironment extends ExecuteJsPluginAdditions {}
15
}
16
17
export { ClientPlugin, CorePlugin };
18
19
export default { ClientPlugin, CorePlugin };
20
21