DefinitelyTyped/types/libqp/index.d.ts
Chris. Webster 30b7468458
Add types for libqp (#43437)
ts enable the libqp functions

Signed-off-by: Chris. Webster <chris@webstech.net>
2020-03-31 11:05:50 -07:00

32 lines
1.1 KiB
TypeScript

// Type definitions for libqp 1.1
// Project: https://github.com/nodemailer/libqp
// Definitions by: Chris. Webster <https://github.com/webstech>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { Transform, TransformOptions } from "stream";
/** Encodes a Buffer or String into a Quoted-Printable encoded string */
export function encode(buffer: string | Buffer): string;
/** Decodes a Quoted-Printable encoded string to a Buffer object */
export function decode(input: string): Buffer;
/** Adds soft line breaks to a Quoted-Printable string */
export function wrap(str: string, lineLength?: number): string;
/** Extend options to add lineLength */
export interface EncoderOptions extends TransformOptions {
lineLength?: number;
}
/** Create a transform stream for encoding data to Quoted-Printable encoding */
export class Encoder extends Transform {
constructor(opts?: EncoderOptions);
}
/** Create a transform stream for decoding Quoted-Printable encoded strings */
export class Decoder extends Transform {
constructor(opts?: TransformOptions);
}