mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Added missing nconf.required(keys) and Provider.required(keys) methods. * update to 4.7.0, add querycursor.map() and schema.loadClass() * add error callback for schema.post() * Added playsInline property as introduced in React 15.3.2 * Add definitions for redux-localstorage and main enhancers (#12580) * Add definitions for redux-localstorage * Add definitions for redux-localstorage-filter enhancer * Add definitions for redux-localstorage-debounce enhancer * csurf.d.ts relying on CookieOptions from express It seems express no longer exports `CookieOptions`, we need to import `express-serve-static-core` instead. * Added height property to IDialogOptions * versionKey type * kendo-ui: mark toString() params as optional (#13164) These function parameters are optional according to the upstream docs, e.g. http://docs.telerik.com/kendo-ui/api/javascript/geometry/matrix#methods-toString * Ensure that zoneAbbr and zoneName are expected type (string). * Update moment-timezone.d.ts * Fix syntax error in interact.d.ts A parameter name was missing making TypeScript compiler fail. * adding type for move to fs-extra * fixing signature of sinon/alwaysReturned based on the http://sinonjs.org/docs/#sinonspy * increasing version number * returning back the version number to the origin number * reversing changes in fs-extra * Request that PRs have meaningful titles * Improvement to existing nouislider type definition. (#12033) * updated nouislider version and added a lot of tests out of the documentation * corrected intentation * corrected untyped variables, issue raised by Travis * incorporated feedback on pull request * #13037 (#13039) * #13037 * pointToLayer first argument type fixed GeoJSON.Point to GeoJSON.Feature<GeoJSON.Point> * Missing cc in sendgrid packate (#13063) The sendgrid package was missing the `cc` field, and the `bcc` field had a too generic type (`any` instead of `string[]`, as used on the `setCcs` and `setBccs` below. * Fixes #12414 (#13076) * Fixes #12414 * Make applicationServerKey optional * added ariaLabelledBy and ariaDescribedBy to IModalSettings (#13004) * Ceymard leaflet (#13007) * replaced all overrides of LatLng by a single use of LatLngExpression when appropriate * Changed Point, PointTuple overrides to use PointExpression instead * Changet use of LatLngBounds and Bounds in general to use the Expression variant instead of having several overrides * add ElasticSeach 5.x API function for deleteByQuery (#13014) * add ElasticSeach 5.x API function for deleteByQuery * use searchParams for deleteByQuery, as theses resemble the documentation. * add DeleteByQueryParams parameter type. * add deleteByQuery to tests. * Make `less` render options optional (#13078) * Added semver * Updated gravity definition. (#13088) * Full Redis client options (#13108) * Added missing return type to on() methods. (#13082) * Update react-native.0.29.d.ts (#13118) drawerPosition is of type `number` Android DrawerConsts.DrawerPosition.Left is equivalent to DrawerLayoutAndroid.positions.Left Android DrawerConsts.DrawerPosition.Right is equivalent to DrawerLayoutAndroid.positions.Right * Upgrade to match braintree-web 3.6.1 (#13098) * Update to match braintree-web version 3.3.0 * Upgrade to match Braintree-web v3.5.0 * upgrade to match braintree-web 3.6.1 add US bank class * Fix missing parameters from svg append (#13119) * Add parameter declarations to append() * Made insertFirst parameter optional * Correct missing ‘auto’ option of GridList’s cellHeight (#13094) * Add new Angular 1.5.9 methods to $compileProvider (#13096) * Add new Angular 1.5.9 methods to $compileProvider Add new methods available in Angular 1.5.9: onChangesTtl(), commentDirectivesEnabled() and cssClassDirectivesEnabled() * Add JSDoc to Angular 1.59 new methods of $compileProvider JSDoc for onChangesTtl(), commentDirectivesEnabled() and cssClassDirectivesEnabled() methods. * Expand $compileProvider JSDoc Urls added to JSDoc of Angular 1.5.9 new methods . * Changed type of injectedScript property to string (#13120) The injectedScript property should take string value with script code, not the bool flag as in current version * Use unions for openlayers string enums (#13134) * Update google.maps.MapPane interface (#13122) * Removing myself (AlStar01) as definition author from angular-material.d.ts (#13125) * Clarify that notNeededPackages.json is just for packages formerly on DefinitelyTyped (#13156) * Update Parsimmon typings (#13146) * Update AmCharts.d.ts (#13170) * knex: add MySqlConnectionConfig, tests (#13161) * knex: add MySqlConnectionConfig, tests * knex: add types for MySqlConnectionConfig queryFormat params * Add note in readme about tsjs-lib-generator (#13210) * Remove redux-localstorage packages; added by #13115 instead
190 lines
5.1 KiB
TypeScript
190 lines
5.1 KiB
TypeScript
// Type definitions for sendgrid v2.0.0
|
|
// Project: https://github.com/sendgrid/sendgrid-nodejs
|
|
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
import * as SmtpApi from 'smtpapi';
|
|
|
|
declare var ctor: Sendgrid.Constructor;
|
|
export = ctor;
|
|
|
|
declare namespace Sendgrid {
|
|
//#region Options
|
|
|
|
export interface UriParts {
|
|
protocol: string;
|
|
host: string;
|
|
port: string;
|
|
endpoint: string;
|
|
}
|
|
|
|
export interface Options {
|
|
protocol?: string;
|
|
host?: string;
|
|
port?: string;
|
|
endpoint?: string;
|
|
uri?: string;
|
|
proxy?: string;
|
|
web?: {
|
|
pool?: any;
|
|
}
|
|
}
|
|
|
|
export interface OptionsExport {
|
|
uriParts: UriParts;
|
|
uri: string;
|
|
|
|
proxy?: string;
|
|
web?: {
|
|
pool?: any;
|
|
}
|
|
}
|
|
|
|
//#endregion
|
|
|
|
//#region Email
|
|
|
|
export interface EmailOptions {
|
|
to?: any;
|
|
toname?: string;
|
|
from?: string;
|
|
fromname?: string;
|
|
subject?: string;
|
|
text?: string;
|
|
html?: string;
|
|
cc?: string[];
|
|
bcc?: string[];
|
|
replyto?: string;
|
|
date?: Date;
|
|
headers?: { [key: string]: string };
|
|
files?: FileHandlerOptions[];
|
|
smtpapi?: SmtpApi.Instance;
|
|
}
|
|
|
|
export class Email {
|
|
to: any;
|
|
toname: string;
|
|
from: string;
|
|
fromname: string;
|
|
subject: string;
|
|
text: string;
|
|
html: string;
|
|
cc: string[];
|
|
bcc: string[];
|
|
replyto: string;
|
|
date: Date;
|
|
headers: { [key: string]: string };
|
|
files: FileHandler[];
|
|
smtpapi: SmtpApi.Instance;
|
|
|
|
constructor();
|
|
constructor(options: EmailOptions);
|
|
|
|
new(options: EmailOptions): Email;
|
|
|
|
addTo(address: string): Email;
|
|
addHeader(type: string, value: string): Email;
|
|
addSubstitution(type: string, value: string): Email;
|
|
addSubstitution(type: string, value: string[]): Email;
|
|
addSection(section: { [key: string]: string }): Email;
|
|
addUniqueArg(uarg: { [key: string]: string }): Email;
|
|
addCategory(category: string): Email;
|
|
addFilter(filter: string, command: string, value: number): Email;
|
|
addFilter(filter: string, command: string, value: string): Email;
|
|
addFile(file: FileHandlerOptions): Email;
|
|
addSmtpapiTo(to: string): Email;
|
|
addCc(cc: string): Email;
|
|
addBcc(bcc: string): Email;
|
|
addSendEachAt(send_each_at: number): Email;
|
|
|
|
setFrom(address: string): Email;
|
|
setSubject(subject: string): Email;
|
|
setText(text: string): Email;
|
|
setHtml(html: string): Email;
|
|
setHeaders(headers: { [key: string]: string }): Email;
|
|
setSubstitutions(substitutions: { [key: string]: string[] }): Email;
|
|
setSections(sections: { [key: string]: string }): Email;
|
|
setUniqueArgs(uargs: { [key: string]: string }): Email;
|
|
setCategories(categories: string[]): Email;
|
|
setFilters(filters: any): Email;
|
|
setSmtpapiTos(tos: string[]): Email;
|
|
setTos(tos: string[]): Email;
|
|
setFromName(fromname: string): Email;
|
|
setCcs(ccs: string[]): Email;
|
|
setBccs(bcc: string[]): Email;
|
|
setDate(date: string): Email;
|
|
setSendAt(send_at: number): Email;
|
|
setSendEachAt(send_each_at: number[]): Email;
|
|
setASMGroupID(val: number): Email;
|
|
}
|
|
|
|
//#endregion
|
|
|
|
//#region FileHandler
|
|
|
|
export interface FileHandlerOptions {
|
|
filename?: string;
|
|
contentType?: string;
|
|
cid?: string;
|
|
path?: string;
|
|
url?: string;
|
|
content?: any;
|
|
}
|
|
|
|
export class FileHandler {
|
|
filename: string;
|
|
contentType: string;
|
|
cid: string;
|
|
|
|
type: string;
|
|
content: string;
|
|
path: string;
|
|
url: string;
|
|
|
|
constructor(options: FileHandlerOptions);
|
|
|
|
loadContent(callback: HandlerCallback): void;
|
|
|
|
static handlers: {
|
|
content: Handler;
|
|
path: Handler;
|
|
url: Handler;
|
|
none: Handler;
|
|
};
|
|
}
|
|
|
|
export interface Handler {
|
|
(file: FileHandler, callback: HandlerCallback): void;
|
|
}
|
|
|
|
export interface HandlerCallback {
|
|
(hasError: boolean, error: Error): void;
|
|
(hasError: boolean, error: string): void;
|
|
}
|
|
|
|
//#endregion
|
|
|
|
//#region Sendgrid Class
|
|
|
|
interface Constructor {
|
|
(api_user: string, api_key: string, options?: Options): Instance;
|
|
(api_key: string, option?: Options): Instance
|
|
new (api_user: string, api_key: string, options?: Options): Instance;
|
|
new (api_key: string, options?: Options): Instance;
|
|
}
|
|
|
|
export interface Instance {
|
|
version: string;
|
|
api_user: string;
|
|
api_key: string;
|
|
smtpapi: SmtpApi.Instance;
|
|
options: OptionsExport;
|
|
Email: typeof Email;
|
|
|
|
send(email: EmailOptions, callback: (err: Error, json: Object) => any): void;
|
|
send(email: Email, callback: (err: Error, json: Object) => any): void;
|
|
}
|
|
|
|
//#endregion
|
|
}
|