mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-03 06:27:46 +08:00
Adding an X.Y version number to the header.
Improve type for jquery, rewrite, and callback.
This commit is contained in:
19
types/swig-email-templates/index.d.ts
vendored
19
types/swig-email-templates/index.d.ts
vendored
@@ -1,29 +1,30 @@
|
||||
// Type definitions for swig-email-templates
|
||||
// Type definitions for swig-email-templates 5.0
|
||||
// Project: https://github.com/andrewrk/swig-email-templates
|
||||
// Definitions by: Adam Babcock <https://github.com/mrhen>
|
||||
// Satana Charuwichitratana <https://github.com/micksatana>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
/// <reference types="swig" />
|
||||
/// <reference types="jquery" />
|
||||
|
||||
import swig = require('swig');
|
||||
|
||||
interface SwigRender<T> {
|
||||
(file: string, context: T, callback: (err: any, html: string, text: string) => any): any;
|
||||
}
|
||||
type SwigRender<T> = (file: string, context: T, callback: (err: any, html: string, text: string) => any) => any;
|
||||
|
||||
interface SwigEmailTemplatesOptions extends swig.SwigOptions {
|
||||
root?: string;
|
||||
juice?: any;
|
||||
rewriteUrl?: (href: string) => string;
|
||||
rewrite?: ($: JQueryStatic) => void;
|
||||
}
|
||||
|
||||
declare class EmailTemplates {
|
||||
constructor(options?: SwigEmailTemplatesOptions);
|
||||
|
||||
generateText(templatePath: string, context: any, html: string, cb: Function): void;
|
||||
generateSubject(templatePath: string, context: any, cb: Function): void;
|
||||
rewriteUrls($: Function, rewrite: Function): void;
|
||||
render(templatePath: string, context: any, cb: Function): void;
|
||||
generateText(templatePath: string, context: any, html: string, cb: (error: any, text: string | null) => void): void;
|
||||
generateSubject(templatePath: string, context: any, cb: (error: any, text: string | null) => void): void;
|
||||
rewriteUrls($: JQueryStatic, rewrite: (href: string) => void): void;
|
||||
render(templatePath: string, context: any, cb: (error: any, inlinedHTML?: string, text?: string, subject?: string) => void): void;
|
||||
}
|
||||
|
||||
export = EmailTemplates;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import EmailTemplates = require('swig-email-templates');
|
||||
import jQuery = require('jquery');
|
||||
|
||||
let templates = new EmailTemplates(),
|
||||
withOptions = new EmailTemplates({ root: '' });
|
||||
const templates = new EmailTemplates();
|
||||
const withOptions = new EmailTemplates({ root: '' });
|
||||
|
||||
templates.generateText('templatePath', {}, 'html', function () { });
|
||||
templates.generateSubject('templatePath', {}, function () { });
|
||||
templates.rewriteUrls(function () {}, function () {});
|
||||
templates.render('templatePath', {}, function () { });
|
||||
|
||||
withOptions.generateText('templatePath', {}, 'html', function () { });
|
||||
withOptions.generateSubject('templatePath', {}, function () { });
|
||||
withOptions.rewriteUrls(function () {}, function () {});
|
||||
withOptions.render('templatePath', {}, function () { });
|
||||
templates.generateText('templatePath', {}, 'html', () => {});
|
||||
templates.generateSubject('templatePath', {}, () => {});
|
||||
templates.rewriteUrls(jQuery, () => {});
|
||||
templates.render('templatePath', {}, () => {});
|
||||
|
||||
withOptions.generateText('templatePath', {}, 'html', () => {});
|
||||
withOptions.generateSubject('templatePath', {}, () => { });
|
||||
withOptions.rewriteUrls(jQuery, () => {});
|
||||
withOptions.render('templatePath', {}, () => {});
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"swig-email-templates-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,79 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user