mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
DEV: Enhance type definitions for Meteor methods
This commit is contained in:
20
packages/meteor/meteor.d.ts
vendored
20
packages/meteor/meteor.d.ts
vendored
@@ -162,14 +162,26 @@ export namespace Meteor {
|
||||
* @param name Name of method to invoke
|
||||
* @param args Optional method arguments
|
||||
*/
|
||||
function call(name: string, ...args: any[]): any;
|
||||
function call<
|
||||
Result extends
|
||||
| EJSONable
|
||||
| EJSONable[]
|
||||
| EJSONableProperty
|
||||
| EJSONableProperty[]
|
||||
>(name: string, ...args: any[]): Result;
|
||||
|
||||
/**
|
||||
* Invokes a method with an async stub, passing any number of arguments.
|
||||
* @param name Name of method to invoke
|
||||
* @param args Optional method arguments
|
||||
*/
|
||||
function callAsync(name: string, ...args: any[]): Promise<any>;
|
||||
function callAsync<
|
||||
Result extends
|
||||
| EJSONable
|
||||
| EJSONable[]
|
||||
| EJSONableProperty
|
||||
| EJSONableProperty[]
|
||||
>(name: string, ...args: any[]): Promise<Result> & { stubPromise: Promise<Result>, serverPromise: Promise<Result> };
|
||||
|
||||
interface MethodApplyOptions<
|
||||
Result extends
|
||||
@@ -226,7 +238,7 @@ export namespace Meteor {
|
||||
error: global_Error | Meteor.Error | undefined,
|
||||
result?: Result
|
||||
) => void
|
||||
): any;
|
||||
): Result;
|
||||
|
||||
/**
|
||||
* Invokes a method with an async stub, passing any number of arguments.
|
||||
@@ -249,7 +261,7 @@ export namespace Meteor {
|
||||
error: global_Error | Meteor.Error | undefined,
|
||||
result?: Result
|
||||
) => void
|
||||
): Promise<Result>;
|
||||
): Promise<Result> & { stubPromise: Promise<Result>, serverPromise: Promise<Result> };
|
||||
/** Method **/
|
||||
|
||||
/** Url **/
|
||||
|
||||
Reference in New Issue
Block a user