Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
feat(nodemailer): add typings
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrossmann committed Dec 5, 2018
1 parent 1e1cc17 commit d18d95d
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions packages/nodemailer/src/index.d.ts
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,
}
}

0 comments on commit d18d95d

Please sign in to comment.