More detailed typing for Meteor.methods(), fixed User model.

This commit is contained in:
Deadly0
2019-02-06 20:27:24 +03:00
parent ab0806bfb5
commit 24e05c755b
2 changed files with 20 additions and 4 deletions
+10 -2
View File
@@ -25,7 +25,7 @@ declare module Meteor {
_id?: string;
username?: string;
emails?: UserEmail[];
createdAt?: number;
createdAt?: Date;
profile?: any;
services?: any;
}
@@ -49,7 +49,15 @@ declare module Meteor {
/** Error **/
/** Method **/
function methods(methods: Object): void;
interface MethodThisType {
isSimulation: boolean;
userId: string | null;
connection: Connection | null;
setUserId(userId: string): void;
unblock(): void;
}
function methods(methods: {[key: string]: (this: MethodThisType, ...args: any[]) => any}): void;
function call(name: string, ...args: any[]): any;
+10 -2
View File
@@ -26,7 +26,7 @@ declare module "meteor/meteor" {
_id?: string;
username?: string;
emails?: UserEmail[];
createdAt?: number;
createdAt?: Date;
profile?: any;
services?: any;
}
@@ -50,7 +50,15 @@ declare module "meteor/meteor" {
/** Error **/
/** Method **/
function methods(methods: Object): void;
interface MethodThisType {
isSimulation: boolean;
userId: string | null;
connection: Connection | null;
setUserId(userId: string): void;
unblock(): void;
}
function methods(methods: {[key: string]: (this: MethodThisType, ...args: any[]) => any}): void;
function call(name: string, ...args: any[]): any;