Add type definitions for async methods from Meteor 2.9

This commit is contained in:
Evan Broder
2023-02-09 08:54:04 -08:00
parent 4b04e879ec
commit dd74fa6d70
2 changed files with 21 additions and 0 deletions

View File

@@ -21,6 +21,10 @@ export namespace Accounts {
fields?: Mongo.FieldSpecifier | undefined;
}): Meteor.User | null;
function userAsync(options?: {
fields?: Mongo.FieldSpecifier | undefined;
}): Promise<Meteor.User | null>;
function userId(): string | null;
function createUser(
@@ -33,6 +37,16 @@ export namespace Accounts {
callback?: (error?: Error | Meteor.Error | Meteor.TypedError) => void
): string;
function createUserAsync(
options: {
username?: string | undefined;
email?: string | undefined;
password?: string | undefined;
profile?: Object | undefined;
},
callback?: (error?: Error | Meteor.Error | Meteor.TypedError) => void
): Promise<string>;
function config(options: {
sendVerificationEmail?: boolean | undefined;
forbidClientAccountCreation?: boolean | undefined;
@@ -176,6 +190,12 @@ export namespace Accounts {
options?: { logout?: Object | undefined }
): void;
function setPasswordAsync(
userId: string,
newPassword: string,
options?: { logout?: Object | undefined }
): Promise<void>;
function validateNewUser(func: Function): boolean;
function validateLoginAttempt(

View File

@@ -18,6 +18,7 @@ export namespace Email {
}
function send(options: EmailOptions): void;
function sendAsync(options: EmailOptions): Promise<void>;
function hookSend(fn: (options: EmailOptions) => boolean): void;
function customTransport(fn: (options: CustomEmailOptions) => void): void;
}