This repository has been archived by the owner on Jul 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e1cc17
commit d18d95d
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
declare module '@atlas.js/nodemailer' { | ||
import * as nodemailer from 'nodemailer' | ||
import AtlasService from '@atlas.js/service' | ||
|
||
/** | ||
* Send emails using nodemailer from within Atlas | ||
*/ | ||
class Service extends AtlasService { | ||
/** Service runtime configuration values */ | ||
config: Service.Config | ||
|
||
prepare(): Promise<nodemailer.Transporter> | ||
start(service: nodemailer.Transporter): Promise<nodemailer.Transporter> | ||
stop(service: nodemailer.Transporter): Promise<void> | ||
} | ||
|
||
namespace Service { | ||
/** Configuration schema available to this service */ | ||
interface Config { | ||
/** | ||
* The transport to be used for sending emails | ||
* | ||
* Either provide the transport module itself or specify it as a string and it will be | ||
* `require()`d. | ||
*/ | ||
transport: Function | string | ||
/** | ||
* Transport-specific options | ||
* | ||
* Check the docs for the transporter you are going to use for available options. | ||
*/ | ||
options: object | ||
|
||
plugins?: Array<PluginConfiguration> | ||
} | ||
|
||
interface PluginConfiguration { | ||
/** | ||
* The plugin to be added to the transporter | ||
* | ||
* Either provide the plugin module itself or specify it as a string and it will be | ||
* `require()`d. | ||
*/ | ||
plugin: Function | string | ||
/** Event to which this plugin should be attached */ | ||
event: 'compile' | 'stream' | ||
/** Plugin configuration options */ | ||
options: object | ||
} | ||
} | ||
|
||
export { | ||
Service, | ||
nodemailer, | ||
} | ||
} |