1
- declare interface BrowserMp {
1
+ declare interface Browser {
2
2
url : string ;
3
3
execute : ( code : string ) => void ;
4
4
[ property : string ] : any ;
5
5
}
6
6
7
- declare interface PlayerMp {
7
+ declare interface Player {
8
8
call : ( eventName : string , args ?: any [ ] ) => void ;
9
9
[ property : string ] : any ;
10
10
}
11
11
12
12
export declare type ProcedureListener = ( args : any , info : ProcedureListenerInfo ) => any ;
13
13
14
- export declare interface ProcedureListenerInfo {
14
+ export declare interface ProcedureListenerInfo < T = any , K = any > {
15
15
environment : string ;
16
16
id ?: string ;
17
- player ?: PlayerMp ;
18
- browser ?: BrowserMp ;
17
+ player ?: T ;
18
+ browser ?: K ;
19
19
}
20
20
21
21
/**
@@ -41,7 +41,7 @@ export declare function call<T = any>(name: string, args?: any, options?: CallOp
41
41
* @param options - Any options.
42
42
* @returns The result from the procedure.
43
43
*/
44
- export declare function callBrowser < T = any > ( browser : BrowserMp , name : string , args ?: any , options ?: CallOptions ) : Promise < T > ;
44
+ export declare function callBrowser < T = any > ( browser : Browser , name : string , args ?: any , options ?: CallOptions ) : Promise < T > ;
45
45
46
46
/**
47
47
* Calls a remote procedure registered in any browser context.
@@ -55,7 +55,7 @@ export declare function callBrowser<T = any>(browser: BrowserMp, name: string, a
55
55
* @returns The result from the procedure.
56
56
*/
57
57
export declare function callBrowsers < T = any > ( name : string , args ?: any , options ?: CallOptions ) : Promise < T > | undefined ;
58
- export declare function callBrowsers < T = any > ( player : PlayerMp , name : string , args ?: any , options ?: CallOptions ) : Promise < T > | undefined ;
58
+ export declare function callBrowsers < T = any > ( player : Player , name : string , args ?: any , options ?: CallOptions ) : Promise < T > | undefined ;
59
59
60
60
/**
61
61
* Calls a remote procedure registered on the client.
@@ -69,7 +69,7 @@ export declare function callBrowsers<T = any>(player: PlayerMp, name: string, ar
69
69
* @returns The result from the procedure.
70
70
*/
71
71
export declare function callClient < T = any > ( name : string , args ?: any , options ?: CallOptions ) : Promise < T > ;
72
- export declare function callClient < T = any > ( player : PlayerMp , name : string , args ?: any , options ?: CallOptions ) : Promise < T > ;
72
+ export declare function callClient < T = any > ( player : Player , name : string , args ?: any , options ?: CallOptions ) : Promise < T > ;
73
73
74
74
export declare interface CallOptions {
75
75
timeout ?: number ;
@@ -132,7 +132,7 @@ export declare function trigger(name: string, args?: any): void;
132
132
* @param name - The name of the event.
133
133
* @param args - Any parameters for the event.
134
134
*/
135
- export declare function triggerBrowser ( browser : BrowserMp , name : string , args ?: any ) : void ;
135
+ export declare function triggerBrowser ( browser : Browser , name : string , args ?: any ) : void ;
136
136
137
137
/**
138
138
* Triggers an event registered in any browser context.
@@ -144,7 +144,7 @@ export declare function triggerBrowser(browser: BrowserMp, name: string, args?:
144
144
* @param args - Any parameters for the event.
145
145
*/
146
146
export declare function triggerBrowsers ( name : string , args ?: any ) : void ;
147
- export declare function triggerBrowsers ( player : PlayerMp , name : string , args ?: any ) : void ;
147
+ export declare function triggerBrowsers ( player : Player , name : string , args ?: any ) : void ;
148
148
149
149
/**
150
150
* Triggers an event registered on the client.
@@ -156,7 +156,7 @@ export declare function triggerBrowsers(player: PlayerMp, name: string, args?: a
156
156
* @param args - Any parameters for the event.
157
157
*/
158
158
export declare function triggerClient ( name : string , args ?: any ) : void ;
159
- export declare function triggerClient ( player : PlayerMp , name : string , args ?: any ) : void ;
159
+ export declare function triggerClient ( player : Player , name : string , args ?: any ) : void ;
160
160
161
161
/**
162
162
* Triggers an event registered on the server.
0 commit comments