mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-30 17:26:24 +02:00
♻️ Switch to turborepo (#532)
This commit is contained in:
parent
41ef81aa75
commit
0a836aeec7
419 changed files with 2300 additions and 2504 deletions
111
apps/web/declarations/smpt-tester.d.ts
vendored
Normal file
111
apps/web/declarations/smpt-tester.d.ts
vendored
Normal file
|
@ -0,0 +1,111 @@
|
|||
declare module "smtp-tester" {
|
||||
/**
|
||||
* Initializes the SMTP tester.
|
||||
*
|
||||
* @param port The port of the SMTP server.
|
||||
*/
|
||||
function init(port: number): SmtpTester;
|
||||
|
||||
/**
|
||||
* A callback that occurs when an email is received.
|
||||
*
|
||||
* @param recipient The bound recipient. Can be `undefined` if the handler is not bound to a specific recipient.
|
||||
* @param id The local incrementing identifier of the email.
|
||||
* @param email The email being received.
|
||||
*/
|
||||
type OnReceiveEmail = (
|
||||
recipient: string,
|
||||
id: number,
|
||||
email: EmailInfo,
|
||||
) => void;
|
||||
|
||||
type CaptureOneResponse = {
|
||||
address: string;
|
||||
id: string;
|
||||
email: EmailInfo;
|
||||
};
|
||||
/**
|
||||
* The SMTP tester.
|
||||
*/
|
||||
interface SmtpTester {
|
||||
/**
|
||||
* Binds a callback to a specific recipient that is fired whenever an email is received for that specific recipient.
|
||||
*
|
||||
* @param recipient The recipient to bind to.
|
||||
* @param callback The callback function.
|
||||
*/
|
||||
bind(recipient: string, callback: OnReceiveEmail): void;
|
||||
|
||||
/**
|
||||
* Binds a callback that is fired whenever an email is received.
|
||||
*
|
||||
* @param callback The callback function.
|
||||
*/
|
||||
bind(callback: OnReceiveEmail): void;
|
||||
|
||||
/**
|
||||
* Captures the next email received by the server.
|
||||
*
|
||||
* @param recipient The recipient to capture for. If not specified, the next email received will be captured.
|
||||
* @param options The options for the capture.
|
||||
*/
|
||||
captureOne(
|
||||
recipient: string,
|
||||
options?: CaptureOptions,
|
||||
): Promise<CaptureOneResponse>;
|
||||
|
||||
/**
|
||||
* Stops the running SMTP server.
|
||||
*/
|
||||
stop(): void;
|
||||
|
||||
/**
|
||||
* Stops the running SMTP server.
|
||||
*
|
||||
* @param callback The callback that is fired when the server has stopped.
|
||||
*/
|
||||
stop(callback: () => void): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains information about a received email.
|
||||
*/
|
||||
interface EmailInfo {
|
||||
/**
|
||||
* The sender of the email.
|
||||
*/
|
||||
readonly sender: string;
|
||||
|
||||
/**
|
||||
* The body of the email.
|
||||
*/
|
||||
readonly body: string;
|
||||
|
||||
/**
|
||||
* The HTML body of the email.
|
||||
*/
|
||||
readonly html: string;
|
||||
|
||||
/**
|
||||
* Headers of the email.
|
||||
*/
|
||||
readonly headers: {
|
||||
/**
|
||||
* Who the email was sent from.
|
||||
*/
|
||||
from: string;
|
||||
|
||||
/**
|
||||
* Who the email was sent to.
|
||||
*/
|
||||
to: string;
|
||||
|
||||
/**
|
||||
* The subject of the email.
|
||||
*/
|
||||
subject: string;
|
||||
|
||||
[string]: string;
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue