Merge pull request #10 from xzessmedia/master

broken default param fix
This commit is contained in:
Micah Allen 2019-10-31 18:15:04 -04:00 committed by GitHub
commit 98e0918c8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 882 additions and 863 deletions

14
dist/rage-rpc.d.ts vendored
View File

@ -2,13 +2,13 @@ export as namespace rpc;
export function register(name: string, cb: ProcedureListener): void;
export function unregister(name: string): void;
export function call<T = any>(name: string, args?: any, options: CallOptions = {}): Promise<T>;
export function callServer<T = any>(name: string, args?: any, options: CallOptions = {}): Promise<T>;
export function callClient<T = any>(player: Player, name: string, args?: any, options: CallOptions = {}): Promise<T>;
export function callClient<T = any>(name: string, args?: any, options: CallOptions = {}): Promise<T>;
export function callBrowsers<T = any>(player: Player, name: string, args?: any, options: CallOptions = {}): Promise<T>;
export function callBrowsers<T = any>(name: string, args?: any, options: CallOptions = {}): Promise<T>;
export function callBrowser<T = any>(browser: Browser, name: string, args?: any, options: CallOptions = {}): Promise<T>;
export function call<T = any>(name: string, args?: any, options?: CallOptions): Promise<T>;
export function callServer<T = any>(name: string, args?: any, options?: CallOptions): Promise<T>;
export function callClient<T = any>(player: Player, name: string, args?: any, options?: CallOptions): Promise<T>;
export function callClient<T = any>(name: string, args?: any, options?: CallOptions): Promise<T>;
export function callBrowsers<T = any>(player: Player, name: string, args?: any, options?: CallOptions): Promise<T>;
export function callBrowsers<T = any>(name: string, args?: any, options?: CallOptions): Promise<T>;
export function callBrowser<T = any>(browser: Browser, name: string, args?: any, options?: CallOptions): Promise<T>;
export function on(name: string, cb: ProcedureListener): void;
export function off(name: string, cb: ProcedureListener): void;

File diff suppressed because one or more lines are too long

1725
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -360,7 +360,7 @@ function _callBrowsers(player: Player, name: string, args?: any, extraData: any
* @param options - Any options.
* @returns The result from the procedure.
*/
export function callBrowsers(player: Player | string, name?: string | any, args?: any, options: CallOptions = {}): Promise<any> {
export function callBrowsers(player: Player | string, name?: string | any, args?: any, options?: CallOptions): Promise<any> {
let promise;
let extraData: any = {};
@ -397,7 +397,7 @@ export function callBrowsers(player: Player | string, name?: string | any, args?
* @param options - Any options.
* @returns The result from the procedure.
*/
export function callBrowser(browser: Browser, name: string, args?: any, options: CallOptions = {}): Promise<any> {
export function callBrowser(browser: Browser, name: string, args?: any, options?: CallOptions): Promise<any> {
if(environment !== 'client') return util.promiseReject('callBrowser can only be used in the client environment');
if(arguments.length < 2 || arguments.length > 4) return util.promiseReject('callBrowser expects 2 to 4 arguments: "browser", "name", optional "args", and optional "options"');