'
+}, {
+ from: 'sender@example.com',
+});
+
+// use template based sender to send a message
+sendPwdReset({
+ to: 'receiver@example.com'
+}, {
+ username: 'Node Mailer',
+ reset: 'https://www.example.com/reset?token='
+})
+.then(info => info.messageId);
diff --git a/nodemailer/nodemailer-types.d.ts b/nodemailer/nodemailer-types.d.ts
deleted file mode 100644
index 6fde6ebad9..0000000000
--- a/nodemailer/nodemailer-types.d.ts
+++ /dev/null
@@ -1,149 +0,0 @@
-// Type definitions for Nodemailer 1.3.2
-// Project: https://github.com/andris9/Nodemailer
-// Definitions by: Rogier Schouten
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-///
-
-declare namespace nodemailer {
-
- export interface AttachmentObject {
- /**
- * filename to be reported as the name of the attached file, use of unicode is allowed
- */
- filename?: string;
- /**
- * optional content id for using inline images in HTML message source
- */
- cid?: string;
- /**
- * Pathname or URL to use streaming
- */
- path?: string;
- /**
- * String, Buffer or a Stream contents for the attachment
- */
- content: string|Buffer|NodeJS.ReadableStream;
- /**
- * If set and content is string, then encodes the content to a Buffer using the specified encoding. Example values: base64, hex, 'binary' etc. Useful if you want to use binary attachments in a JSON formatted e-mail object.
- */
- encoding?: string;
- /**
- * optional content type for the attachment, if not set will be derived from the filename property
- */
- contentType?: string;
- /**
- * optional content disposition type for the attachment, defaults to 'attachment'
- */
- contentDisposition?: string;
- }
-
- export interface SendMailOptions {
- /**
- * The e-mail address of the sender. All e-mail addresses can be plain 'sender@server.com' or formatted 'Sender Name ', see here for details
- */
- from?: string;
- /**
- * An e-mail address that will appear on the Sender: field
- */
- sender?: string;
- /**
- * Comma separated list or an array of recipients e-mail addresses that will appear on the To: field
- */
- to?: string|string[];
- /**
- * Comma separated list or an array of recipients e-mail addresses that will appear on the Cc: field
- */
- cc?: string|string[];
- /**
- * Comma separated list or an array of recipients e-mail addresses that will appear on the Bcc: field
- */
- bcc?: string|string[];
- /**
- * An e-mail address that will appear on the Reply-To: field
- */
- replyTo?: string;
- /**
- * The message-id this message is replying
- */
- inReplyTo?: string;
- /**
- * Message-id list (an array or space separated string)
- */
- references?: string|string[];
- /**
- * The subject of the e-mail
- */
- subject?: string;
- /**
- * The plaintext version of the message as an Unicode string, Buffer, Stream or an object {path: '...'}
- */
- text?: string|Buffer|NodeJS.ReadableStream|AttachmentObject;
- /**
- * The HTML version of the message as an Unicode string, Buffer, Stream or an object {path: '...'}
- */
- html?: string|Buffer|NodeJS.ReadableStream|AttachmentObject;
- /**
- * An object or array of additional header fields (e.g. {"X-Key-Name": "key value"} or [{key: "X-Key-Name", value: "val1"}, {key: "X-Key-Name", value: "val2"}])
- */
- headers?: any;
- /**
- * An array of attachment objects (see below for details)
- */
- attachments?: AttachmentObject[];
- /**
- * An array of alternative text contents (in addition to text and html parts) (see below for details)
- */
- alternatives?: AttachmentObject[];
- /**
- * optional Message-Id value, random value will be generated if not set
- */
- messageId?: string;
- /**
- * optional Date value, current UTC string will be used if not set
- */
- date?: Date;
- /**
- * optional transfer encoding for the textual parts (defaults to 'quoted-printable')
- */
- encoding?: string;
- }
-
- export interface SentMessageInfo {
- /**
- * most transports should return the final Message-Id value used with this property
- */
- messageId: string;
- /**
- * includes the envelope object for the message
- */
- envelope: any;
- /**
- * is an array returned by SMTP transports (includes recipient addresses that were accepted by the server)
- */
- accepted: string[];
- /**
- * is an array returned by SMTP transports (includes recipient addresses that were rejected by the server)
- */
- rejected: string[];
- /**
- * is an array returned by Direct SMTP transport. Includes recipient addresses that were temporarily rejected together with the server response
- */
- pending?: string[];
- /**
- * is a string returned by SMTP transports and includes the last SMTP response from the server
- */
- response: string;
- }
-
- /**
- * This is what you implement to create a new transporter yourself
- */
- export interface Transport {
- name: string;
- version: string;
- send(mail: SendMailOptions, callback?: (error: Error, info: SentMessageInfo) => void): void;
- close(): void;
- }
-
-}
diff --git a/nodemailer/nodemailer.d.ts b/nodemailer/nodemailer.d.ts
index 647566437f..cd30f2acdc 100644
--- a/nodemailer/nodemailer.d.ts
+++ b/nodemailer/nodemailer.d.ts
@@ -3,8 +3,8 @@
// Definitions by: Rogier Schouten
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+///
///
-///
///
///
@@ -13,6 +13,8 @@ declare module "nodemailer" {
import directTransport = require("nodemailer-direct-transport");
import smtpTransport = require("nodemailer-smtp-transport");
+ import * as Promise from 'bluebird';
+
export type Transport = nodemailer.Transport;
export type SendMailOptions = nodemailer.SendMailOptions;
export type SentMessageInfo = nodemailer.SentMessageInfo;
@@ -39,6 +41,17 @@ declare module "nodemailer" {
*/
sendMail(mail: SendMailOptions): Promise;
+ /**
+ * Send mail using a template.
+ */
+ templateSender(template?: any, defaults?: any): (mailData: any, context: any) => Promise;
+
+ /**
+ * Send mail using a template with a callback.
+ */
+ templateSender(template?: any, defaults?: any, callback?: (error: Error, info: SentMessageInfo) => void): void;
+
+
/**
* Attach a plugin. 'compile' and 'stream' plugins can be attached with use(plugin) method
*
@@ -48,14 +61,14 @@ declare module "nodemailer" {
use(step: string, plugin: Plugin): void;
/**
- * Verifies connection with server
- */
- verify(callback: (error: Error, success?: boolean) => void): void;
-
- /**
- * Verifies connection with server
- */
- verify(): Promise;
+ * Verifies connection with server
+ */
+ verify(callback: (error: Error, success?: boolean) => void): void;
+
+ /**
+ * Verifies connection with server
+ */
+ verify(): Promise;
/**
* Close all connections
@@ -76,3 +89,146 @@ declare module "nodemailer" {
*/
export function createTransport(transport: Transport, defaults?: Object): Transporter;
}
+
+declare namespace nodemailer {
+
+ export interface AttachmentObject {
+ /**
+ * filename to be reported as the name of the attached file, use of unicode is allowed
+ */
+ filename?: string;
+ /**
+ * optional content id for using inline images in HTML message source
+ */
+ cid?: string;
+ /**
+ * Pathname or URL to use streaming
+ */
+ path?: string;
+ /**
+ * String, Buffer or a Stream contents for the attachment
+ */
+ content: string|Buffer|NodeJS.ReadableStream;
+ /**
+ * If set and content is string, then encodes the content to a Buffer using the specified encoding. Example values: base64, hex, 'binary' etc. Useful if you want to use binary attachments in a JSON formatted e-mail object.
+ */
+ encoding?: string;
+ /**
+ * optional content type for the attachment, if not set will be derived from the filename property
+ */
+ contentType?: string;
+ /**
+ * optional content disposition type for the attachment, defaults to 'attachment'
+ */
+ contentDisposition?: string;
+ }
+
+ export interface SendMailOptions {
+ /**
+ * The e-mail address of the sender. All e-mail addresses can be plain 'sender@server.com' or formatted 'Sender Name ', see here for details
+ */
+ from?: string;
+ /**
+ * An e-mail address that will appear on the Sender: field
+ */
+ sender?: string;
+ /**
+ * Comma separated list or an array of recipients e-mail addresses that will appear on the To: field
+ */
+ to?: string|string[];
+ /**
+ * Comma separated list or an array of recipients e-mail addresses that will appear on the Cc: field
+ */
+ cc?: string|string[];
+ /**
+ * Comma separated list or an array of recipients e-mail addresses that will appear on the Bcc: field
+ */
+ bcc?: string|string[];
+ /**
+ * An e-mail address that will appear on the Reply-To: field
+ */
+ replyTo?: string;
+ /**
+ * The message-id this message is replying
+ */
+ inReplyTo?: string;
+ /**
+ * Message-id list (an array or space separated string)
+ */
+ references?: string|string[];
+ /**
+ * The subject of the e-mail
+ */
+ subject?: string;
+ /**
+ * The plaintext version of the message as an Unicode string, Buffer, Stream or an object {path: '...'}
+ */
+ text?: string|Buffer|NodeJS.ReadableStream|AttachmentObject;
+ /**
+ * The HTML version of the message as an Unicode string, Buffer, Stream or an object {path: '...'}
+ */
+ html?: string|Buffer|NodeJS.ReadableStream|AttachmentObject;
+ /**
+ * An object or array of additional header fields (e.g. {"X-Key-Name": "key value"} or [{key: "X-Key-Name", value: "val1"}, {key: "X-Key-Name", value: "val2"}])
+ */
+ headers?: any;
+ /**
+ * An array of attachment objects (see below for details)
+ */
+ attachments?: AttachmentObject[];
+ /**
+ * An array of alternative text contents (in addition to text and html parts) (see below for details)
+ */
+ alternatives?: AttachmentObject[];
+ /**
+ * optional Message-Id value, random value will be generated if not set
+ */
+ messageId?: string;
+ /**
+ * optional Date value, current UTC string will be used if not set
+ */
+ date?: Date;
+ /**
+ * optional transfer encoding for the textual parts (defaults to 'quoted-printable')
+ */
+ encoding?: string;
+ }
+
+ export interface SentMessageInfo {
+ /**
+ * most transports should return the final Message-Id value used with this property
+ */
+ messageId: string;
+ /**
+ * includes the envelope object for the message
+ */
+ envelope: any;
+ /**
+ * is an array returned by SMTP transports (includes recipient addresses that were accepted by the server)
+ */
+ accepted: string[];
+ /**
+ * is an array returned by SMTP transports (includes recipient addresses that were rejected by the server)
+ */
+ rejected: string[];
+ /**
+ * is an array returned by Direct SMTP transport. Includes recipient addresses that were temporarily rejected together with the server response
+ */
+ pending?: string[];
+ /**
+ * is a string returned by SMTP transports and includes the last SMTP response from the server
+ */
+ response: string;
+ }
+
+ /**
+ * This is what you implement to create a new transporter yourself
+ */
+ export interface Transport {
+ name: string;
+ version: string;
+ send(mail: SendMailOptions, callback?: (error: Error, info: SentMessageInfo) => void): void;
+ close(): void;
+ }
+
+}
From 4cb9c9032e8a1cfb45b7f4684aca52c1ce0f2685 Mon Sep 17 00:00:00 2001
From: Kenji-Imamura
Date: Fri, 5 Aug 2016 17:48:34 +0900
Subject: [PATCH 08/35] fix definitions of express req.accepts functions
---
.../express-serve-static-core.d.ts | 22 ++++++++++++++-----
express/express-tests.ts | 20 +++++++++++++++++
2 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/express-serve-static-core/express-serve-static-core.d.ts b/express-serve-static-core/express-serve-static-core.d.ts
index e092d2ecef..de91c521cc 100644
--- a/express-serve-static-core/express-serve-static-core.d.ts
+++ b/express-serve-static-core/express-serve-static-core.d.ts
@@ -192,9 +192,10 @@ declare module "express-serve-static-core" {
* req.accepts('html, json');
* // => "json"
*/
- accepts(type: string): string;
-
- accepts(type: string[]): string;
+ accepts(): string[];
+ accepts(type: string): string | boolean;
+ accepts(type: string[]): string | boolean;
+ accepts(...type: string[]): string | boolean;
/**
* Returns the first accepted charset of the specified character sets,
@@ -204,7 +205,10 @@ declare module "express-serve-static-core" {
* For more information, or if you have issues or concerns, see accepts.
* @param charset
*/
- acceptsCharsets(charset?: string | string[]): string[];
+ acceptsCharsets(): string[];
+ acceptsCharsets(charset: string): string | boolean;
+ acceptsCharsets(charset: string[]): string | boolean;
+ acceptsCharsets(...charset: string[]): string | boolean;
/**
* Returns the first accepted encoding of the specified encodings,
@@ -214,7 +218,10 @@ declare module "express-serve-static-core" {
* For more information, or if you have issues or concerns, see accepts.
* @param encoding
*/
- acceptsEncodings(encoding?: string | string[]): string[];
+ acceptsEncodings(): string[];
+ acceptsEncodings(encoding: string): string | boolean;
+ acceptsEncodings(encoding: string[]): string | boolean;
+ acceptsEncodings(...encoding: string[]): string | boolean;
/**
* Returns the first accepted language of the specified languages,
@@ -225,7 +232,10 @@ declare module "express-serve-static-core" {
*
* @param lang
*/
- acceptsLanguages(lang?: string | string[]): string[];
+ acceptsLanguages(): string[];
+ acceptsLanguages(lang: string): string | boolean;
+ acceptsLanguages(lang: string[]): string | boolean;
+ acceptsLanguages(...lang: string[]): string | boolean;
/**
* Parse Range header field,
diff --git a/express/express-tests.ts b/express/express-tests.ts
index 11f8fd44fd..ed9265b66a 100644
--- a/express/express-tests.ts
+++ b/express/express-tests.ts
@@ -50,6 +50,26 @@ router.delete(pathRE);
router.use((req, res, next) => { next(); })
router.route('/users')
.get((req, res, next) => {
+ let types: string[] = req.accepts();
+ let type: string | boolean = req.accepts('json');
+ type = req.accepts(['json', 'text']);
+ type = req.accepts('json', 'text');
+
+ let charsets: string[] = req.acceptsCharsets();
+ let charset: string | boolean = req.acceptsCharsets('utf-8');
+ charset = req.acceptsCharsets(['utf-8', 'utf-16']);
+ charset = req.acceptsCharsets('utf-8', 'utf-16');
+
+ let encodings: string[] = req.acceptsEncodings();
+ let encoding: string | boolean = req.acceptsEncodings('gzip');
+ encoding = req.acceptsEncodings(['gzip', 'deflate']);
+ encoding = req.acceptsEncodings('gzip', 'deflate');
+
+ let languages: string[] = req.acceptsLanguages();
+ let language: string | boolean = req.acceptsLanguages('en');
+ language = req.acceptsLanguages(['en', 'ja']);
+ language = req.acceptsLanguages('en', 'ja');
+
res.send(req.query['token']);
});
From 19a75797beac86394dc7bc6c65f9acc7c4183947 Mon Sep 17 00:00:00 2001
From: Sayan Pal
Date: Fri, 5 Aug 2016 15:32:33 +0200
Subject: [PATCH 09/35] Added missing function config() to Pikaday class
This function was missing from the type definitions that can be used at
runtime to change/extend configuration options.
Can be very useful to change various configurations, such as i18n
(culture information), format, firstDay etc. on runtime.
---
pikaday/pikaday.d.ts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/pikaday/pikaday.d.ts b/pikaday/pikaday.d.ts
index 3e4f80df9a..913ea69613 100644
--- a/pikaday/pikaday.d.ts
+++ b/pikaday/pikaday.d.ts
@@ -10,6 +10,14 @@ declare class Pikaday {
constructor(options: Pikaday.PikadayOptions);
+ /**
+ * Extends the existing configuration options for Pikaday object with the options provided.
+ * Can be used to change/extend the configurations on runtime.
+ * @param options full/partial configuration options.
+ * @returns {} extended configurations.
+ */
+ config(options: Pikaday.PikadayOptions): Pikaday.PikadayOptions;
+
/**
* Returns the selected date in a string format. If Moment.js exists
* (recommended) then Pikaday can return any format that Moment
From f614c7b3d4946dc60ec44af39bee91c52d8c2eb6 Mon Sep 17 00:00:00 2001
From: Erik Krogh Kristensen
Date: Fri, 5 Aug 2016 23:44:52 +0200
Subject: [PATCH 10/35] Changed changedAttributes method to return any, instead
of any | boolean. And added some JSDoc to describe its behaviour.
---
backbone/backbone-global.d.ts | 9 ++++++++-
backbone/backbone.d.ts | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/backbone/backbone-global.d.ts b/backbone/backbone-global.d.ts
index 3d27e35b5c..3dca269eb0 100644
--- a/backbone/backbone-global.d.ts
+++ b/backbone/backbone-global.d.ts
@@ -153,7 +153,14 @@ declare namespace Backbone {
/*private*/ set(attributeName: string, value: any, options?: ModelSetOptions): Model;
set(obj: any, options?: ModelSetOptions): Model;
- changedAttributes(attributes?: any): any | boolean;
+ /**
+ * Return an object containing all the attributes that have changed, or
+ * false if there are no changed attributes. Useful for determining what
+ * parts of a view need to be updated and/or what attributes need to be
+ * persisted to the server. Unset attributes will be set to undefined.
+ * You can also pass an attributes object to diff against the model,
+ * determining if there *would be* a change. */
+ changedAttributes(attributes?: any): any;
clear(options?: Silenceable): any;
clone(): Model;
destroy(options?: ModelDestroyOptions): any;
diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts
index 65e273a61f..d3887b4176 100644
--- a/backbone/backbone.d.ts
+++ b/backbone/backbone.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Backbone 1.0.0
+// Type definitions for Backbone 1.3.3
// Project: http://backbonejs.org/
// Definitions by: Boris Yankov , Natan Vivo
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
From 3305d0f7d9a3edbd4f7f1ad465c5d6ea2134ca7c Mon Sep 17 00:00:00 2001
From: Erin Coughlan
Date: Fri, 5 Aug 2016 15:27:43 -0700
Subject: [PATCH 11/35] Update MdPanel in angular-material.d.ts file
* Adds new methods in mdPanel to typings.
* Fixes types for MdPanelPosition top/bottom/left/right.
* Adds enums for MdPanelPosition and MdPanelAnimation.
---
angular-material/angular-material.d.ts | 32 ++++++++++++++++++++++----
1 file changed, 27 insertions(+), 5 deletions(-)
diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts
index c19dae9dbd..23da7bceb2 100644
--- a/angular-material/angular-material.d.ts
+++ b/angular-material/angular-material.d.ts
@@ -299,6 +299,7 @@ declare namespace angular.material {
locals?: {[index: string]: any};
resolve?: {[index: string]: angular.IPromise}
attachTo?: string|JQuery|Element;
+ propagateContainerEvents?: boolean;
panelClass?: string;
zIndex?: number; // default: 80
position?: IPanelPosition;
@@ -331,16 +332,18 @@ declare namespace angular.material {
addClass(newClass: string): void;
removeClass(oldClass: string): void;
toggleClass(toggleClass: string): void;
- focusOnOpen(): void;
+ updatePosition(position: IPanelPosition): void;
}
interface IPanelPosition {
absolute(): IPanelPosition;
relativeTo(someElement: string|JQuery|Element): IPanelPosition;
- top(opt_top: string): IPanelPosition; // default: '0'
- bottom(opt_bottom: string): IPanelPosition; // default: '0'
- left(opt_left: string): IPanelPosition; // default: '0'
- right(opt_right: string): IPanelPosition; // default: '0'
+ top(top?: string): IPanelPosition; // default: '0'
+ bottom(bottom?: string): IPanelPosition; // default: '0'
+ start(start?: string): IPanelPosition; // default: '0'
+ end(end?: string): IPanelPosition; // default: '0'
+ left(left?: string): IPanelPosition; // default: '0'
+ right(right?: string): IPanelPosition; // default: '0'
centerHorizontally(): IPanelPosition;
centerVertically(): IPanelPosition;
center(): IPanelPosition;
@@ -360,5 +363,24 @@ declare namespace angular.material {
open(opt_config: IPanelConfig): angular.IPromise;
newPanelPosition(): IPanelPosition;
newPanelAnimation(): IPanelAnimation;
+ xPosition: {
+ CENTER: string,
+ ALIGN_START: string,
+ ALIGN_END: string,
+ OFFSET_START: string,
+ OFFSET_END: string,
+ };
+ yPosition: {
+ CENTER: string,
+ ALIGN_TOPS: string,
+ ALIGN_BOTTOMS: string,
+ ABOVE: string,
+ BELOW: string,
+ };
+ animation: {
+ SLIDE: string,
+ SCALE: string,
+ FADE: string,
+ };
}
}
From d687574577a53395e1b6ebdb4207e0389f494040 Mon Sep 17 00:00:00 2001
From: Samir Aguiar
Date: Fri, 5 Aug 2016 19:33:05 -0300
Subject: [PATCH 12/35] Add addInitHandler and edit addLabel
---
amcharts/AmCharts.d.ts | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts
index 7268150c75..27998956b8 100644
--- a/amcharts/AmCharts.d.ts
+++ b/amcharts/AmCharts.d.ts
@@ -29,6 +29,16 @@ declare namespace AmCharts {
/** Create chart by params. */
function makeChart(selector: string, params: any, delay?: number): AmChart;
+
+ /** Set a method to be called before initializing the chart.
+ * When the method is called, the chart instance is passed as an attribute.
+ * You can use this feature to preprocess chart data or do some other things you need
+ * before initializing the chart.
+ * @param {Function} handler - The method to be called.
+ * @param {string[]} types - Which chart types should call this method. Defaults to all
+ * if none is passed.
+ */
+ function addInitHandler(handler: Function, types: string[]);
/** AmPieChart class creates pie/donut chart. In order to display pie chart you need to set at least three properties - dataProvider, titleField and valueField.
@example
@@ -1006,7 +1016,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
bold - specifies if text is bold (true/false),
url - url
*/
- addLabel(x: number, y: number, text: string, align: string, size: number, color: string, rotation: number, alpha: number, bold: boolean, url: string);
+ addLabel(x: number|string, y: number|string, text: string, align: string, size?: number, color?: string, rotation?: number, alpha?: number, bold?: boolean, url?: string);
/** Adds a legend to the chart.
By default, you don't need to create div for your legend, however if you want it to be positioned in some different way, you can create div anywhere you want and pass id or reference to your div as a second parameter.
(NOTE: This method will not work on StockPanel.)
From 0f4a73ef205e808cc824d81ff6839d3fa27df251 Mon Sep 17 00:00:00 2001
From: Batbold Gansukh
Date: Sat, 6 Aug 2016 16:24:14 +0900
Subject: [PATCH 13/35] Add SafeAnchor
---
react-bootstrap/react-bootstrap-tests.tsx | 10 +++++++++-
react-bootstrap/react-bootstrap.d.ts | 12 ++++++++++++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/react-bootstrap/react-bootstrap-tests.tsx b/react-bootstrap/react-bootstrap-tests.tsx
index c6976d8a05..e8646d79ea 100644
--- a/react-bootstrap/react-bootstrap-tests.tsx
+++ b/react-bootstrap/react-bootstrap-tests.tsx
@@ -14,7 +14,7 @@ import {
OverlayTrigger, Popover, ProgressBar,
Nav, NavItem, Navbar, NavDropdown,
Tabs, Tab, Pager, PageItem,
- Pagination, Alert, Carousel,
+ Pagination, Alert, Carousel, SafeAnchor,
Grid, Row, Col, Thumbnail, Image,
Label, Badge, Jumbotron, PageHeader,
Glyphicon, Table, Form, FormGroup,
@@ -634,6 +634,14 @@ export class ReactBootstrapTest extends Component {
+
+
+
+ }
+ maxButtons={10}/>
+
+
Holy guacamole! Best check yo self, you're not looking too good.
diff --git a/react-bootstrap/react-bootstrap.d.ts b/react-bootstrap/react-bootstrap.d.ts
index 8c9d50a304..c39efed388 100644
--- a/react-bootstrap/react-bootstrap.d.ts
+++ b/react-bootstrap/react-bootstrap.d.ts
@@ -110,6 +110,18 @@ declare namespace ReactBootstrap {
var ButtonGroup: React.ClassicComponentClass;
+ //
+ interface SafeAnchorProps extends React.HTMLProps {
+ href?: string;
+ onClick?: React.MouseEventHandler;
+ disabled?: boolean;
+ role?: string;
+ componentClass?: React.ReactType;
+ }
+ type SafeAnchor = React.ClassicComponent;
+ const SafeAnchor: React.ClassicComponentClass;
+
+
//
interface CheckboxProps extends React.HTMLProps {
bsClass?: string;
From 6c2b3ee80de7441bb7467d9ccd922ffbc933525b Mon Sep 17 00:00:00 2001
From: york yao
Date: Sat, 6 Aug 2016 20:19:56 +0800
Subject: [PATCH 14/35] add types of json-editor
---
json-editor/json-editor-tests.ts | 146 ++++++++++++++++++++++++
json-editor/json-editor.d.ts | 184 +++++++++++++++++++++++++++++++
2 files changed, 330 insertions(+)
create mode 100644 json-editor/json-editor-tests.ts
create mode 100644 json-editor/json-editor.d.ts
diff --git a/json-editor/json-editor-tests.ts b/json-editor/json-editor-tests.ts
new file mode 100644
index 0000000000..0492324555
--- /dev/null
+++ b/json-editor/json-editor-tests.ts
@@ -0,0 +1,146 @@
+///
+
+var element = document.getElementById('editor_holder');
+var editor = new JSONEditor(element, {});
+
+// Set an option globally
+JSONEditor.defaults.options.theme = 'bootstrap2';
+// Set an option during instantiation
+editor = new JSONEditor(element, {
+ theme: 'bootstrap2'
+});
+editor.on('ready', function () {
+ // Now the api methods will be available
+ editor.validate();
+});
+
+var editor2 = new JSONEditor<{ name: string; }>(element, {});
+editor2.setValue({ name: "John Smith" });
+var value = editor2.getValue();
+console.log(value.name) // Will log "John Smith"
+
+// Get a reference to a node within the editor
+var name2 = editor.getEditor('root.name');
+
+// `getEditor` will return null if the path is invalid
+if (name2) {
+ name2.setValue("John Smith");
+
+ console.log(name2.getValue());
+}
+
+var errors = editor.validate();
+
+if (errors.length) {
+ // errors is an array of objects, each with a `path`, `property`, and `message` parameter
+ // `property` is the schema keyword that triggered the validation error (e.g. "minLength")
+ // `path` is a dot separated path into the JSON object (e.g. "root.path.to.field")
+ console.log(errors);
+}
+else {
+ // It's valid!
+}
+
+// Validate an arbitrary value against the editor's schema
+var errors = editor.validate({
+ value: {
+ to: "test"
+ }
+});
+
+editor.on('change', function () {
+ // Do something
+});
+
+editor.off('change', function () {
+ // Do something
+});
+
+editor.watch('path.to.field', function () {
+ // Do something
+});
+
+editor.unwatch('path.to.field', function () {
+ // Do something
+});
+
+// Disable entire form
+editor.disable();
+
+// Disable part of the form
+editor.getEditor('root.location').disable();
+
+// Enable entire form
+editor.enable();
+
+// Enable part of the form
+editor.getEditor('root.location').enable();
+
+// Check if form is currently enabled
+if (editor.isEnabled()) alert("It's editable!");
+
+editor.destroy();
+
+JSONEditor.defaults.options.theme = 'foundation5';
+
+JSONEditor.plugins.sceditor.emoticonsEnabled = false;
+
+JSONEditor.plugins.epiceditor.basePath = 'epiceditor';
+
+JSONEditor.plugins.ace.theme = 'twilight';
+
+JSONEditor.defaults.editors.object.options.collapsed = true;
+
+JSONEditor.defaults.options.template = 'handlebars';
+
+var myengine = {
+ compile: function (template: any) {
+ // Compile should return a render function
+ return function (vars: any) {
+ // A real template engine would render the template here
+ var result = template;
+ return result;
+ }
+ }
+};
+
+// Set globally
+JSONEditor.defaults.options.template = myengine;
+
+// Override a specific translation
+JSONEditor.defaults.languages.en.error_minLength =
+ "This better be at least {{0}} characters long or else!";
+
+
+// Create your own language mapping
+// Any keys not defined here will fall back to the "en" language
+JSONEditor.defaults.languages.es = {
+ error_notset: "propiedad debe existir"
+};
+
+JSONEditor.defaults.language = "es";
+
+JSONEditor.defaults.resolvers.unshift(function (schema) {
+ if (schema.type === "object" && schema.format === "location") {
+ return "location";
+ }
+
+ // If no valid editor is returned, the next resolver function will be used
+});
+
+JSONEditor.plugins.selectize.enable = true;
+
+JSONEditor.defaults.custom_validators.push(function (schema, value, path) {
+ var errors: JSONEditorError[] = [];
+ if (schema.format === "date") {
+ if (!/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(value)) {
+ // Errors must be an object with `path`, `property`, and `message`
+ errors.push({
+ path: path,
+ property: 'format',
+ message: 'Dates must be in the format "YYYY-MM-DD"'
+ });
+ }
+ }
+ return errors;
+});
diff --git a/json-editor/json-editor.d.ts b/json-editor/json-editor.d.ts
new file mode 100644
index 0000000000..cbb0c9c29c
--- /dev/null
+++ b/json-editor/json-editor.d.ts
@@ -0,0 +1,184 @@
+// Type definitions for json-editor
+// Project: https://github.com/jdorn/json-editor
+// Definitions by: York Yao
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+type JSONEditorOptions = {
+ /**
+ * If true, JSON Editor will load external URLs in $ref via ajax.
+ */
+ ajax?: boolean;
+ /**
+ * If true, remove all "add row" buttons from arrays.
+ */
+ disable_array_add?: boolean;
+ /**
+ * If true, remove all "delete row" buttons from arrays.
+ */
+ disable_array_delete?: boolean;
+ /**
+ * If true, remove all "move up" and "move down" buttons from arrays.
+ */
+ disable_array_reorder?: boolean;
+ /**
+ * If true, remove all collapse buttons from objects and arrays.
+ */
+ disable_collapse?: boolean;
+ /**
+ * If true, remove all Edit JSON buttons from objects.
+ */
+ disable_edit_json?: boolean;
+ /**
+ * If true, remove all Edit Properties buttons from objects.
+ */
+ disable_properties?: boolean;
+ /**
+ * The first part of the `name` attribute of form inputs in the editor. An full example name is `root[person][name]` where "root" is the form_name_root.
+ */
+ form_name_root?: string;
+ /**
+ * The icon library to use for the editor.
+ */
+ iconlib?: boolean;
+ /**
+ * If true, objects can only contain properties defined with the properties keyword.
+ */
+ no_additional_properties?: boolean;
+ /**
+ * An object containing schema definitions for URLs. Allows you to pre-define external schemas.
+ */
+ refs?: any;
+ /**
+ * If true, all schemas that don't explicitly set the required property will be required.
+ */
+ required_by_default?: boolean;
+ /**
+ * If true, makes oneOf copy properties over when switching.
+ */
+ keep_oneof_values?: boolean;
+ /**
+ * A valid JSON Schema to use for the editor. Version 3 and Version 4 of the draft specification are supported.
+ */
+ schema?: any;
+ /**
+ * When to show validation errors in the UI. Valid values are interaction, change, always, and never.
+ */
+ show_errors?: "interaction" | "change" | "always" | "never";
+ /**
+ * Seed the editor with an initial value. This should be valid against the editor's schema.
+ */
+ startval?: TValue;
+ /**
+ * The JS template engine to use.
+ */
+ template?: string | { compile: (template: string) => (vars: any) => string };
+ /**
+ * The CSS theme to use.
+ */
+ theme?: string;
+ /**
+ * If true, only required properties will be included by default.
+ */
+ display_required_only?: boolean;
+}
+type JSONEditorError = {
+ path: string;
+ property: string;
+ message: string;
+}
+type JSONEditorObjectOptions = {
+ /**
+ * If set to true, the editor will start collapsed
+ */
+ collapsed?: boolean;
+ /**
+ * If set to true, the collapse button will be hidden
+ */
+ disable_collapse?: boolean;
+ /**
+ * If set to true, the Edit JSON button will be hidden
+ */
+ disable_edit_json?: boolean;
+ /**
+ * If set to true, the Edit Properties button will be hidden
+ */
+ disable_properties?: boolean;
+}
+type JSONEditorArrayOptions = {
+ /**
+ * If set to true, the editor will start collapsed
+ */
+ collapsed?: boolean;
+ /**
+ * If set to true, the "add row" button will be hidden
+ */
+ disable_array_add?: boolean;
+ /**
+ * If set to true, all of the "delete" buttons will be hidden
+ */
+ disable_array_delete?: boolean;
+ /**
+ * If set to true, just the "delete all rows" button will be hidden
+ */
+ disable_array_delete_all_rows?: boolean;
+ /**
+ * If set to true, just the "delete last row" buttons will be hidden
+ */
+ disable_array_delete_last_row?: boolean;
+ /**
+ * If set to true, the "move up/down" buttons will be hidden
+ */
+ disable_array_reorder?: boolean;
+ /**
+ * If set to true, the collapse button will be hidden
+ */
+ disable_collapse?: boolean;
+}
+declare class JSONEditor {
+ public static defaults: {
+ options: JSONEditorOptions;
+ editors: {
+ object: {
+ options: JSONEditorObjectOptions;
+ };
+ array: {
+ options: JSONEditorArrayOptions;
+ }
+ };
+ languages: any;
+ language: string;
+ resolvers: ((schema: any) => string)[];
+ custom_validators: (((schema: any, value: string, path: string) => JSONEditorError[]))[];
+ };
+ public static plugins: {
+ sceditor: {
+ emoticonsEnabled: boolean;
+ };
+ epiceditor: {
+ basePath: string;
+ };
+ ace: {
+ theme: string;
+ };
+ selectize: {
+ enable: boolean;
+ };
+ };
+ constructor(element: HTMLElement, options: JSONEditorOptions);
+ public on(event: string, fn: Function): JSONEditor;
+ public off(event: string, fn: Function): JSONEditor;
+ public watch(event: string, fn: Function): JSONEditor;
+ public unwatch(event: string, fn: Function): JSONEditor;
+ public validate(value?: TValue): JSONEditorError[];
+ public setValue(value: TValue): void;
+ public getValue(): TValue;
+ public getEditor(name: string): JSONEditor;
+ public disable(): void;
+ public enable(): void;
+ public isEnabled(): boolean;
+ public destroy(): void;
+}
+
+declare module "json-editor" {
+ export = JSONEditor;
+}
From ce2113633c9f4ac86fbcce2781bc7e8778076dc7 Mon Sep 17 00:00:00 2001
From: petebeegle
Date: Sat, 6 Aug 2016 13:08:37 -0400
Subject: [PATCH 15/35] callback: any
---
alexa-sdk/alexa-sdk-tests.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/alexa-sdk/alexa-sdk-tests.ts b/alexa-sdk/alexa-sdk-tests.ts
index 4ed5910f59..afd08a83e1 100644
--- a/alexa-sdk/alexa-sdk-tests.ts
+++ b/alexa-sdk/alexa-sdk-tests.ts
@@ -3,7 +3,7 @@
import Alexa = require("alexa-sdk");
-exports.handler = function(event: Alexa.RequestBody, context: Alexa.Context, callback) {
+exports.handler = function(event: Alexa.RequestBody, context: Alexa.Context, callback: any) {
var alexa = Alexa.handler(event, context);
alexa.registerHandlers(handlers);
alexa.execute();
From 1ca29955680803885d7dbb68ac075bdfa1c30f66 Mon Sep 17 00:00:00 2001
From: petebeegle
Date: Sat, 6 Aug 2016 13:17:52 -0400
Subject: [PATCH 16/35] es6 reccomendation
---
alexa-sdk/alexa-sdk-tests.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/alexa-sdk/alexa-sdk-tests.ts b/alexa-sdk/alexa-sdk-tests.ts
index afd08a83e1..b9f353f7ba 100644
--- a/alexa-sdk/alexa-sdk-tests.ts
+++ b/alexa-sdk/alexa-sdk-tests.ts
@@ -1,7 +1,7 @@
///
///
-import Alexa = require("alexa-sdk");
+import * as Alexa from "alexa-sdk";
exports.handler = function(event: Alexa.RequestBody, context: Alexa.Context, callback: any) {
var alexa = Alexa.handler(event, context);
From 3a430211d789d6709b38269fc373a94a91dce22c Mon Sep 17 00:00:00 2001
From: Peter Snider
Date: Sat, 6 Aug 2016 11:25:40 -0700
Subject: [PATCH 17/35] added namespace to expose interfaces
---
seneca/seneca-tests.ts | 4 +-
seneca/seneca.d.ts | 398 ++++++++++++++++++++---------------------
2 files changed, 200 insertions(+), 202 deletions(-)
diff --git a/seneca/seneca-tests.ts b/seneca/seneca-tests.ts
index 9bc411525f..f61279c749 100644
--- a/seneca/seneca-tests.ts
+++ b/seneca/seneca-tests.ts
@@ -5,8 +5,8 @@
* This file contains all of the example code that was on http://senecajs.org as of Mon June 16, 2016.
*/
-import SENECA = require('seneca')
-var seneca = SENECA()
+import * as SENECA from 'seneca'
+var seneca: SENECA.Instance = SENECA()
seneca.add({ cmd: 'salestax' }, function (args, callback) {
var rate = 0.23
diff --git a/seneca/seneca.d.ts b/seneca/seneca.d.ts
index 08fd71859d..9fea0e43e2 100644
--- a/seneca/seneca.d.ts
+++ b/seneca/seneca.d.ts
@@ -3,229 +3,227 @@
// Definitions by: Peter Snider
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/seneca
+declare function SNS(options?: SNS.Options): SNS.Instance;
-declare module "seneca" {
+declare namespace SNS {
type UnknownType = any;
- // function s(options?: Options): Seneca;
-
-
- // what does seneca do about logging?
- function log(): void;
-
-
- // module s {
-
- interface Options {
- [plugin_name: string]: any;
- tag?: string;
- // Standard length of identifiers for actions.
- idlen?: number;
- // Standard timeout for actions.
- timeout?: number; // milliseconds
- // Register (true) default plugins. Set false to not register when
- // using custom versions.
- default_plugins?: {
- basic?: boolean;
- 'mem-store'?: boolean;
- transport?: boolean;
- web?: boolean;
+ interface Options {
+ [plugin_name: string]: any;
+ tag?: string;
+ // Standard length of identifiers for actions.
+ idlen?: number;
+ // Standard timeout for actions.
+ timeout?: number; // milliseconds
+ // Register (true) default plugins. Set false to not register when
+ // using custom versions.
+ default_plugins?: {
+ basic?: boolean;
+ 'mem-store'?: boolean;
+ transport?: boolean;
+ web?: boolean;
+ };
+ // Settings for network REPL.
+ repl?: {
+ port?: number;
+ host?: string;
+ };
+ // Debug settings.
+ debug?: {
+ // Throw (some) errors from seneca.act.
+ fragile?: boolean;
+ // Fatal errors ... aren't fatal. Not for production!
+ undead?: boolean;
+ // Print debug info to console
+ print?: {
+ // Print options. Best used via --seneca.print.options.
+ options?: boolean;
};
- // Settings for network REPL.
- repl?: {
- port?: number;
- host?: string;
+ // Trace action caller and place in args.caller$.
+ act_caller?: boolean;
+ // Shorten all identifiers to 2 characters.
+ short_logs?: boolean;
+ // Record and log callpoints (calling code locations).
+ callpoint?: boolean;
+ };
+ // Enforce strict behaviours. Relax when backwards compatibility needed.
+ strict?: {
+ // Action result must be a plain object.
+ result?: boolean;
+ // Delegate fixedargs override action args.
+ fixedargs?: boolean;
+ // Adding a pattern overrides existing pattern only if matches exactly.
+ add?: boolean;
+ };
+ // Action cache. Makes inbound messages idempotent.
+ actcache?: {
+ active?: boolean;
+ size?: number;
+ };
+ // Action executor tracing. See gate-executor module.
+ trace?: {
+ act?: boolean;
+ stack?: boolean;
+ unknown?: string;
+ },
+ // Action statistics settings. See rolling-stats module.
+ stats?: {
+ size?: number;
+ interval?: number;
+ running?: boolean;
+ };
+ // Wait time for plugins to close gracefully.
+ deathdelay?: number;
+ // Default seneca-admin settings.
+ // TODO: move to seneca-admin!
+ admin?: {
+ local?: boolean;
+ prefix?: string;
+ };
+ // Plugin settings
+ plugin?: any;
+ // Internal settings.
+ internal?: {
+ // Close instance on these signals, if true.
+ close_signals?: {
+ SIGHUP?: boolean;
+ SIGTERM?: boolean;
+ SIGINT?: boolean;
+ SIGBREAK?: boolean;
};
- // Debug settings.
- debug?: {
- // Throw (some) errors from seneca.act.
- fragile?: boolean;
- // Fatal errors ... aren't fatal. Not for production!
- undead?: boolean;
- // Print debug info to console
- print?: {
- // Print options. Best used via --seneca.print.options.
- options?: boolean;
- };
- // Trace action caller and place in args.caller$.
- act_caller?: boolean;
- // Shorten all identifiers to 2 characters.
- short_logs?: boolean;
- // Record and log callpoints (calling code locations).
- callpoint?: boolean;
- };
- // Enforce strict behaviours. Relax when backwards compatibility needed.
- strict?: {
- // Action result must be a plain object.
- result?: boolean;
- // Delegate fixedargs override action args.
- fixedargs?: boolean;
- // Adding a pattern overrides existing pattern only if matches exactly.
- add?: boolean;
- };
- // Action cache. Makes inbound messages idempotent.
- actcache?: {
- active?: boolean;
- size?: number;
- };
- // Action executor tracing. See gate-executor module.
- trace?: {
- act?: boolean;
- stack?: boolean;
- unknown?: string;
- },
- // Action statistics settings. See rolling-stats module.
- stats?: {
- size?: number;
- interval?: number;
- running?: boolean;
- };
- // Wait time for plugins to close gracefully.
- deathdelay?: number;
- // Default seneca-admin settings.
- // TODO: move to seneca-admin!
- admin?: {
- local?: boolean;
- prefix?: string;
- };
- // Plugin settings
- plugin?: any;
- // Internal settings.
- internal?: {
- // Close instance on these signals, if true.
- close_signals?: {
- SIGHUP?: boolean;
- SIGTERM?: boolean;
- SIGINT?: boolean;
- SIGBREAK?: boolean;
- };
- actrouter?: UnknownType;
- clientrouter?: UnknownType;
- subrouter?: UnknownType;
- };
- // Log status at periodic intervals.
- status?: {
- interval?: number;
- // By default, does not run.
- running?: boolean;
- },
- // zig module settings for seneca.start() chaining.
- zig?: any;
- log?: {
- short?: boolean;
- };
- errhandler?: GlobalErrorHandler;
- }
+ actrouter?: UnknownType;
+ clientrouter?: UnknownType;
+ subrouter?: UnknownType;
+ };
+ // Log status at periodic intervals.
+ status?: {
+ interval?: number;
+ // By default, does not run.
+ running?: boolean;
+ },
+ // zig module settings for seneca.start() chaining.
+ zig?: any;
+ log?: {
+ short?: boolean;
+ };
+ errhandler?: GlobalErrorHandler;
+ }
- interface MinimalPattern {
- //role?: string;
- //cmd?: string;
- }
+ interface MinimalPattern {
+ //role?: string;
+ //cmd?: string;
+ }
- interface Optioner {
- set: (input: string | Options) => Options;
- get: () => Options;
- }
+ interface Optioner {
+ set: (input: string | Options) => Options;
+ get: () => Options;
+ }
- type ExecutorWorker = (callback: any) => void;
- type ExecutorCallback = (err: Error, result: any) => void;
- interface Executor {
- id: string;
- desc: string;
- fn: ExecutorWorker;
- cb: ExecutorCallback;
- gate: boolean;
- ungate: boolean;
- execute: UnknownType;
- }
+ type ExecutorWorker = (callback: any) => void;
+ type ExecutorCallback = (err: Error, result: any) => void;
+ interface Executor {
+ id: string;
+ desc: string;
+ fn: ExecutorWorker;
+ cb: ExecutorCallback;
+ gate: boolean;
+ ungate: boolean;
+ execute: UnknownType;
+ }
- interface PluginOptions {
- }
- type PluginModule = (options: any) => void;
+ interface PluginOptions {
+ }
+ type PluginModule = (options: any) => void;
- interface ClientOptions {
- }
+ interface ClientOptions {
+ }
- interface ListenOptions {
- }
+ interface ListenOptions {
+ }
- interface EntityDataWithQuery {
- [entityKey: string]: any;
- id?: string;
- sort$?: any;
- }
+ interface EntityDataWithQuery {
+ [entityKey: string]: any;
+ id?: string;
+ sort$?: any;
+ }
- type Pattern = string | MinimalPattern;
- type GlobalErrorHandler = (error: Error) => void;
- type AddCallback = (msg: any, respond: (error: Error, msg: any) => void) => void;
- type ActCallback = (error: Error, result: any) => void;
- type CloseCallback = (optional: any, done: (error: Error) => void) => void;
- type DatabaseID = string;
- type EntitySaveCallback = (error: Error, result: any) => void;
- type EntityLoadCallback = (error: Error, result: any) => void;
- type EntityRemoveCallback = (error: Error) => void;
- type EntityListCallback = (error: Error, result: any[]) => void;
+ type Pattern = string | MinimalPattern;
+ type GlobalErrorHandler = (error: Error) => void;
+ type AddCallback = (msg: any, respond: (error: Error, msg: any) => void) => void;
+ type ActCallback = (error: Error, result: any) => void;
+ type CloseCallback = (optional: any, done: (error: Error) => void) => void;
+ type DatabaseID = string;
+ type EntitySaveCallback = (error: Error, result: any) => void;
+ type EntityLoadCallback = (error: Error, result: any) => void;
+ type EntityRemoveCallback = (error: Error) => void;
+ type EntityListCallback = (error: Error, result: any[]) => void;
- interface Seneca {
- version: string;
-
- (options?: Options): Seneca;
- options(options: Options): void;
-
- error(handler: GlobalErrorHandler): void;
- on(eventName: string, callback: (error: Error) => void): any;
- close(callback: CloseCallback): void;
- use(module: PluginModule, options?: PluginOptions): this;
- use(name: string, options?: PluginOptions): this;
- client(options?: ClientOptions): this;
- listen(options?: ListenOptions): this;
-
- ready(callback: (error: Error) => void): void;
-
- add(pattern: Pattern, action: AddCallback): this;
- add(pattern: Pattern, paramspec: any, action: AddCallback): this;
- act(pattern: Pattern, respond: ActCallback): void;
- act(pattern: Pattern, msg: any, respond: ActCallback): void;
- make(entity_canon: string, properties?: any): Entity;
- make(base: string, entity_canon: string, properties?: any): Entity;
- make(zone: string, base: string, entity_canon: string, properties?: any): Entity;
-
- // @param name reference to plugin provided object
- export(name: string): void;
-
- pin(pattern: Pattern): void;
- }
- // NOTE: senecas documented use of:
- // var product = seneca.make('product')
- // product.name = 'Apple'
- // causes this error: error TS2339: Property 'name' does not exist on type 'Entity'.
- // Change such references to: product['name']
- interface Entity {
- (canon: any, seneca: any): void;
- [fieldname: string]: any;
- // there appear to be many more variants of make$(), but its unclear that they are intended for the public API
- make$(): Entity;
- make$(name: string): Entity;
- make$(base: string, name: string): Entity;
- make$(zone: string, base: string, name: string): Entity;
+ interface Instance {
+ version: string;
- save$(callback: EntitySaveCallback): void;
- save$(props: EntityDataWithQuery, callback: EntitySaveCallback): void;
- load$(id: DatabaseID | EntityDataWithQuery, callback: EntityLoadCallback): void;
- remove$(id: DatabaseID | EntityDataWithQuery, callback: EntityRemoveCallback): void;
- list$(query: EntityDataWithQuery, callback: EntityListCallback): void;
- }
+ options(options: Options): void;
- // }
+ error(handler: GlobalErrorHandler): void;
+ on(eventName: string, callback: (error: Error) => void): any;
+ close(callback: CloseCallback): void;
+ use(module: PluginModule, options?: PluginOptions): this;
+ use(name: string, options?: PluginOptions): this;
+ client(options?: ClientOptions): this;
+ listen(options?: ListenOptions): this;
- var sen: Seneca
- export = sen;
+ ready(callback: (error: Error) => void): void;
+ add(pattern: Pattern, action: AddCallback): this;
+ add(pattern: Pattern, paramspec: any, action: AddCallback): this;
+ act(pattern: Pattern, respond: ActCallback): void;
+ act(pattern: Pattern, msg: any, respond: ActCallback): void;
+ make(entity_canon: string, properties?: any): Entity;
+ make(base: string, entity_canon: string, properties?: any): Entity;
+ make(zone: string, base: string, entity_canon: string, properties?: any): Entity;
+
+ // @param name reference to plugin provided object
+ export(name: string): void;
+
+ pin(pattern: Pattern): void;
+ }
+
+
+ // NOTE: senecas documented use of:
+ // var product = seneca.make('product')
+ // product.name = 'Apple'
+ // causes this error: error TS2339: Property 'name' does not exist on type 'Entity'.
+ // Change such references to: product['name']
+ interface Entity {
+ (canon: any, seneca: any): void;
+ [fieldname: string]: any;
+ // there appear to be many more variants of make$(), but its unclear that they are intended for the public API
+ make$(): Entity;
+ make$(name: string): Entity;
+ make$(base: string, name: string): Entity;
+ make$(zone: string, base: string, name: string): Entity;
+
+ save$(callback: EntitySaveCallback): void;
+ save$(props: EntityDataWithQuery, callback: EntitySaveCallback): void;
+ load$(id: DatabaseID | EntityDataWithQuery, callback: EntityLoadCallback): void;
+ remove$(id: DatabaseID | EntityDataWithQuery, callback: EntityRemoveCallback): void;
+ list$(query: EntityDataWithQuery, callback: EntityListCallback): void;
+ }
+
}
+
+
+
+//export = SNS
+
+
+declare module "seneca" {
+ export = SNS;
+}
+
From 731a274a5878caaea8629aaf9aee0d9e65cbc2aa Mon Sep 17 00:00:00 2001
From: Luke
Date: Sat, 6 Aug 2016 15:33:57 -0400
Subject: [PATCH 18/35] Add include method definitions
chai-dom lets you chain like this:
expect(element).not.to.contain.text('Open');
Extend interface Include to reflect this.
---
chai-dom/chai-dom.d.ts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/chai-dom/chai-dom.d.ts b/chai-dom/chai-dom.d.ts
index 397bc17cb4..64cf97f516 100644
--- a/chai-dom/chai-dom.d.ts
+++ b/chai-dom/chai-dom.d.ts
@@ -24,6 +24,14 @@ declare namespace Chai {
value(text: string): Assertion;
}
+
+ interface Include {
+
+ text(text: string|string[]): Assertion;
+
+ html(text: string|string[]): Assertion;
+
+ }
}
From d667c03c0741bfa3f793a4c599785638a84ab5fe Mon Sep 17 00:00:00 2001
From: Peter Snider
Date: Sat, 6 Aug 2016 18:19:04 -0700
Subject: [PATCH 19/35] fixed return type of export()
---
seneca/seneca.d.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/seneca/seneca.d.ts b/seneca/seneca.d.ts
index 9fea0e43e2..6ef3eb4929 100644
--- a/seneca/seneca.d.ts
+++ b/seneca/seneca.d.ts
@@ -189,7 +189,7 @@ declare namespace SNS {
make(zone: string, base: string, entity_canon: string, properties?: any): Entity;
// @param name reference to plugin provided object
- export(name: string): void;
+ export(name: string): PluginModule;
pin(pattern: Pattern): void;
}
From 95143c70ba732ceaf0969deeda91334804d51714 Mon Sep 17 00:00:00 2001
From: petebeegle
Date: Sun, 7 Aug 2016 01:59:24 -0400
Subject: [PATCH 20/35] event => request body
+ other ts-y things
---
alexa-sdk/alexa-sdk-tests.ts | 6 +++---
alexa-sdk/alexa-sdk.d.ts | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/alexa-sdk/alexa-sdk-tests.ts b/alexa-sdk/alexa-sdk-tests.ts
index b9f353f7ba..e161c5bf38 100644
--- a/alexa-sdk/alexa-sdk-tests.ts
+++ b/alexa-sdk/alexa-sdk-tests.ts
@@ -3,13 +3,13 @@
import * as Alexa from "alexa-sdk";
-exports.handler = function(event: Alexa.RequestBody, context: Alexa.Context, callback: any) {
- var alexa = Alexa.handler(event, context);
+exports.handler = function(event: Alexa.RequestBody, context: Alexa.Context, callback: Function) {
+ let alexa = Alexa.handler(event, context);
alexa.registerHandlers(handlers);
alexa.execute();
};
-var handlers: Alexa.Handlers = {
+let handlers: Alexa.Handlers = {
'LaunchRequest': function () {
var self: Alexa.Handler = this;
self.emit('SayHello');
diff --git a/alexa-sdk/alexa-sdk.d.ts b/alexa-sdk/alexa-sdk.d.ts
index a39e325c63..335442c0b2 100644
--- a/alexa-sdk/alexa-sdk.d.ts
+++ b/alexa-sdk/alexa-sdk.d.ts
@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'alexa-sdk' {
- export function handler(event: RequestBody, context: Context, callback?: () => void): AlexaHandler;
+ export function handler(event: RequestBody, context: Context, callback?: Function): AlexaHandler;
export function CreateStateHandler(state: string, obj: any): any;
export var StateString: string;
@@ -31,7 +31,7 @@ declare module 'alexa-sdk' {
emitWithState: any;
state: any;
handler: any;
- event: any;
+ event: RequestBody;
attributes: any;
context: any;
name: any;
From d1905dd14ac4994943c473fc8e518b015bc5fb67 Mon Sep 17 00:00:00 2001
From: petebeegle
Date: Sun, 7 Aug 2016 02:10:38 -0400
Subject: [PATCH 21/35] AlexaHandler -> AlexaObject
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This was confusing with Handlers, Handler and AlexaHandler.
Handlers is a list of Handler objects. AlexaObject is the like parent
alexa… object… returned from the handler call yada yada
---
alexa-sdk/alexa-sdk.d.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/alexa-sdk/alexa-sdk.d.ts b/alexa-sdk/alexa-sdk.d.ts
index 335442c0b2..5866d8c4ee 100644
--- a/alexa-sdk/alexa-sdk.d.ts
+++ b/alexa-sdk/alexa-sdk.d.ts
@@ -4,11 +4,11 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'alexa-sdk' {
- export function handler(event: RequestBody, context: Context, callback?: Function): AlexaHandler;
+ export function handler(event: RequestBody, context: Context, callback?: Function): AlexaObject;
export function CreateStateHandler(state: string, obj: any): any;
export var StateString: string;
- interface AlexaHandler {
+ interface AlexaObject {
_event: any;
_context: any;
_callback: any;
From d90aaaf4a0604a89ea195194714027aaeb49ed53 Mon Sep 17 00:00:00 2001
From: Brian Surowiec
Date: Fri, 5 Aug 2016 17:59:45 -0400
Subject: [PATCH 22/35] Add support for hellosign-embedded
---
.../hellosign-embedded-tests.ts | 39 ++++
hellosign-embedded/hellosign-embedded.d.ts | 193 ++++++++++++++++++
2 files changed, 232 insertions(+)
create mode 100644 hellosign-embedded/hellosign-embedded-tests.ts
create mode 100644 hellosign-embedded/hellosign-embedded.d.ts
diff --git a/hellosign-embedded/hellosign-embedded-tests.ts b/hellosign-embedded/hellosign-embedded-tests.ts
new file mode 100644
index 0000000000..455171942e
--- /dev/null
+++ b/hellosign-embedded/hellosign-embedded-tests.ts
@@ -0,0 +1,39 @@
+///
+
+HelloSign.init('abc123');
+
+// some options
+HelloSign.open({
+ url: 'http://example.org',
+ messageListener: (e: HelloSign.MessageEvent) => {
+ if (e.event === HelloSign.EVENT_SIGNED) {
+ console.log('signed');
+ }
+ },
+ uxVersion: 2
+});
+
+// all options
+HelloSign.open({
+ url: 'http://example.org',
+ redirectUrl: 'https://github.com/DefinitelyTyped/DefinitelyTyped',
+ allowCancel: true,
+ messageListener: (e: HelloSign.MessageEvent) => {
+ if (e.event === HelloSign.EVENT_SIGNED) {
+ console.log('signed');
+ }
+ },
+ userCulture: HelloSign.CULTURES.EN_US,
+ debug: true,
+ skipDomainVerification: true,
+ container: document.getElementById('#hellosign-container'),
+ height: 1326,
+ hideHeader: true,
+ uxVersion: 2,
+ requester: 'hellosign@example.org',
+ whiteLabelingOptions: {
+ "page_background_color": "#f7f8f9"
+ }
+});
+
+HelloSign.close();
diff --git a/hellosign-embedded/hellosign-embedded.d.ts b/hellosign-embedded/hellosign-embedded.d.ts
new file mode 100644
index 0000000000..f215dac6bc
--- /dev/null
+++ b/hellosign-embedded/hellosign-embedded.d.ts
@@ -0,0 +1,193 @@
+// Type definitions for hellosign-embedded v1.0.3
+// Project: https://github.com/HelloFax/hellosign-embedded
+// Definitions by: Brian Surowiec
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+declare module HelloSign {
+ interface MessageEvent {
+ event: string;
+ }
+
+ interface ClientCultures {
+ /**
+ * English (United States)
+ *
+ * @default en_US
+ */
+ EN_US: string;
+
+ /**
+ * French (France)
+ *
+ * @default fr_FR
+ */
+ FR_FR: string;
+
+ /**
+ * German (Germany)
+ *
+ * @default de_DE
+ */
+ DE_DE: string;
+
+ /**
+ * Swedish (Sweden)
+ *
+ * @default sv_SE
+ */
+ SV_SE: string;
+
+ /**
+ * Chinese (China)
+ *
+ * @default zh_CN
+ */
+ ZH_CN: string;
+
+ /**
+ * Danish (Denmark)
+ *
+ * @default da_DK
+ */
+ DA_DK: string;
+
+ /**
+ * Dutch (The Netherlands)
+ * @default nl_NL
+ */
+ NL_NL: string;
+
+ /**
+ * The available client UI cultures
+ */
+ supportedCultures: string[];
+ }
+
+ interface OpenParameters {
+ /**
+ * The url to open in the child frame
+ */
+ url?: string;
+
+ /**
+ * Where to go after the signature is completed
+ */
+ redirectUrl?: string;
+
+ /**
+ * Whether a cancel button should be displayed
+ *
+ * @default true
+ */
+ allowCancel?: boolean;
+
+ /**
+ * A listener for X-window messages coming from the child frame
+ */
+ messageListener?: (eventData: MessageEvent) => void;
+
+ /**
+ * One of the HelloSign.CULTURES.supportedCultures
+ *
+ * @default HelloSign.CULTURES.EN_US
+ */
+ userCulture?: string;
+
+ /**
+ * When true, debugging statements will be written to the console
+ *
+ * @default false
+ */
+ debug?: boolean;
+
+ /**
+ * When true, domain verification step will be skipped if and only if the Signature Request was created with test_mode=1
+ *
+ * @default false
+ */
+ skipDomainVerification?: boolean;
+
+ /**
+ * DOM element that will contain the iframe on the page (defaults to document.body)
+ */
+ container?: Element;
+
+ /**
+ * Height of the iFrame (only applicable when a container is specified)
+ */
+ height?: number;
+
+ /**
+ * When true, the header will be hidden.
+ * This is only functional for customers with embedded branding enabled.
+ *
+ * @default false
+ */
+ hideHeader?: boolean;
+
+ /**
+ * The version of the embedded user experience to display to signers (1 = legacy, 2 = responsive).
+ * This option is only honored if your account has accessed the API prior to Nov 14, 2015.
+ */
+ uxVersion?: number;
+
+ /**
+ * The email of the person issuing a signature request.
+ * Required for allowing 'Me + Others' requests
+ */
+ requester?: string;
+
+ /**
+ * An associative array to be used to customize the app's signer page
+ */
+ whiteLabelingOptions?: Object;
+ }
+
+ interface HelloSignStatic {
+ /**
+ * The available client UI cultures
+ */
+ CULTURES: ClientCultures;
+
+ /**
+ * The signature request was signed
+ *
+ * @default signature_request_signed
+ */
+ EVENT_SIGNED: string;
+
+ /**
+ * The user closed the iFrame before completing
+ *
+ * @default signature_request_canceled
+ */
+ EVENT_CANCELED: string;
+
+ /**
+ * An error occurred in the iFrame
+ *
+ * @default error
+ */
+ EVENT_ERROR: string;
+
+ /**
+ * Initialize using your HelloSign API client ID.
+ *
+ * @param appClientId The API client ID the request is for.
+ */
+ init(appClientId: string): void;
+
+ /**
+ * Open the signing window.
+ *
+ * @param params The options to use when opening the signing window.
+ */
+ open(params: OpenParameters): void;
+
+ /**
+ * Close the signing window.
+ */
+ close(): void;
+ }
+}
+
+declare var HelloSign: HelloSign.HelloSignStatic;
From 4c9b7a9d213f05e4d6bb0c32f20c6b8664b33d7d Mon Sep 17 00:00:00 2001
From: Xuanyang Ge
Date: Mon, 8 Aug 2016 19:04:48 -0700
Subject: [PATCH 23/35] Add legendItemClick event to HighchartsPointEvents
---
highcharts/highcharts.d.ts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts
index 4ea165814f..7185587190 100644
--- a/highcharts/highcharts.d.ts
+++ b/highcharts/highcharts.d.ts
@@ -3183,6 +3183,14 @@ interface HighchartsPointEvents {
* @since 1.2.0
*/
update?: (event: Event) => boolean|void;
+ /**
+ * Fires when the legend item belonging to the pie point (slice) is clicked.
+ * The this keyword refers to the point itself. One parameter, event, is passed to the function.
+ * This contains common event information based on jQuery or MooTools depending on which library is used as the base for Highcharts.
+ * The default action is to toggle the visibility of the point. This can be prevented by calling event.preventDefault().
+ */
+ legendItemClick?: (event: Event) => boolean | void;
+
}
interface HighchartsHalo {
From 0d5b4c5596fb9ba754646764bfe994b7c5338092 Mon Sep 17 00:00:00 2001
From: Darren
Date: Tue, 9 Aug 2016 08:07:58 +0100
Subject: [PATCH 24/35] add/remove text track and poster for videojs
---
videojs/videojs.d.ts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/videojs/videojs.d.ts b/videojs/videojs.d.ts
index d0da6b10db..36ef99850f 100644
--- a/videojs/videojs.d.ts
+++ b/videojs/videojs.d.ts
@@ -48,6 +48,9 @@ interface VideoJSPlayer {
on(eventName: string, callback: () => void ): void;
off(eventName: string, callback: () => void ): void;
dispose(): void;
+ addRemoteTextTrack(options : {}) : HTMLTrackElement;
+ removeRemoteTextTrack(track : HTMLTrackElement) : void;
+ poster(val : string) : void;
}
interface VideoJSStatic {
From 177e3943a95daccecd011bd3e29f10679cd607e8 Mon Sep 17 00:00:00 2001
From: Darren
Date: Tue, 9 Aug 2016 08:13:15 +0100
Subject: [PATCH 25/35] videojs poster() returns self when setting
---
videojs/videojs.d.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/videojs/videojs.d.ts b/videojs/videojs.d.ts
index 36ef99850f..420aa2486d 100644
--- a/videojs/videojs.d.ts
+++ b/videojs/videojs.d.ts
@@ -50,7 +50,7 @@ interface VideoJSPlayer {
dispose(): void;
addRemoteTextTrack(options : {}) : HTMLTrackElement;
removeRemoteTextTrack(track : HTMLTrackElement) : void;
- poster(val : string) : void;
+ poster(val : string) : VideoJSPlayer;
}
interface VideoJSStatic {
From 6266d1d84ed2c64481a0dd7103b22e5c0fb18fa8 Mon Sep 17 00:00:00 2001
From: Darren
Date: Tue, 9 Aug 2016 08:19:25 +0100
Subject: [PATCH 26/35] videojs poster() may also return string
---
videojs/videojs.d.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/videojs/videojs.d.ts b/videojs/videojs.d.ts
index 420aa2486d..7fb5005092 100644
--- a/videojs/videojs.d.ts
+++ b/videojs/videojs.d.ts
@@ -50,7 +50,7 @@ interface VideoJSPlayer {
dispose(): void;
addRemoteTextTrack(options : {}) : HTMLTrackElement;
removeRemoteTextTrack(track : HTMLTrackElement) : void;
- poster(val : string) : VideoJSPlayer;
+ poster(val?: string) : string|VideoJSPlayer;
}
interface VideoJSStatic {
From 7aa3ecd72efc77a80aac3782a511a40b2aba5b47 Mon Sep 17 00:00:00 2001
From: york yao
Date: Tue, 9 Aug 2016 19:33:33 +0800
Subject: [PATCH 27/35] add types of get-port
---
get-port/get-port-tests.ts | 7 +++++++
get-port/get-port.d.ts | 9 +++++++++
2 files changed, 16 insertions(+)
create mode 100644 get-port/get-port-tests.ts
create mode 100644 get-port/get-port.d.ts
diff --git a/get-port/get-port-tests.ts b/get-port/get-port-tests.ts
new file mode 100644
index 0000000000..d414742230
--- /dev/null
+++ b/get-port/get-port-tests.ts
@@ -0,0 +1,7 @@
+///
+
+import * as getPort from "get-port";
+
+getPort().then(port => {
+ console.log(port);
+});
diff --git a/get-port/get-port.d.ts b/get-port/get-port.d.ts
new file mode 100644
index 0000000000..673c547f1c
--- /dev/null
+++ b/get-port/get-port.d.ts
@@ -0,0 +1,9 @@
+// Type definitions for ajv
+// Project: https://github.com/sindresorhus/get-port
+// Definitions by: York Yao
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module "get-port" {
+ var getPort: () => PromiseLike
+ export = getPort;
+}
From 2021c5dee03bc9dd0489251f5c327ff9c3eb2c99 Mon Sep 17 00:00:00 2001
From: Elliot S Chi
Date: Tue, 9 Aug 2016 13:37:49 -0700
Subject: [PATCH 28/35] feat: add optional string prop nodeName
---
react-swipeable/react-swipeable-tests.tsx | 5 +++--
react-swipeable/react-swipeable.d.ts | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/react-swipeable/react-swipeable-tests.tsx b/react-swipeable/react-swipeable-tests.tsx
index dec0414759..d28d6d348b 100644
--- a/react-swipeable/react-swipeable-tests.tsx
+++ b/react-swipeable/react-swipeable-tests.tsx
@@ -3,7 +3,7 @@
import Swipeable = require('react-swipeable');
import React = require('react');
-
+
var SampleComponent = React.createClass({
render: function () {
return (
@@ -18,7 +18,8 @@ var SampleComponent = React.createClass({
onSwipedDown={this.swipedDown}
onSwipedLeft={this.swipedLeft}
onSwiped={this.handleSwipeAction}
- preventDefaultTouchmoveEvent={false}>
+ preventDefaultTouchmoveEvent={false}
+ nodeName={"swipe"}>
This element can be swiped
diff --git a/react-swipeable/react-swipeable.d.ts b/react-swipeable/react-swipeable.d.ts
index 1e147a222f..db0d7b5e4f 100644
--- a/react-swipeable/react-swipeable.d.ts
+++ b/react-swipeable/react-swipeable.d.ts
@@ -39,6 +39,7 @@ declare namespace ReactSwipeableModule {
flickThreshold?: number;
delta?: number;
preventDefaultTouchmoveEvent?: boolean;
+ nodeName?: string;
}
interface ReactSwipeable extends React.ComponentClass { }
From 1766d1adfe2cc2f4716d6f6e962c28cf90e0b8a7 Mon Sep 17 00:00:00 2001
From: Elliot S Chi
Date: Tue, 9 Aug 2016 15:43:55 -0700
Subject: [PATCH 29/35] [react-autosuggest]: change theme properties to
optionals
---
react-autosuggest/react-autosuggest.d.ts | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/react-autosuggest/react-autosuggest.d.ts b/react-autosuggest/react-autosuggest.d.ts
index f53238b882..9436e961ea 100644
--- a/react-autosuggest/react-autosuggest.d.ts
+++ b/react-autosuggest/react-autosuggest.d.ts
@@ -31,15 +31,15 @@ declare namespace ReactAutosuggest {
}
interface Theme {
- container: string;
- containerOpen: string;
- input: string;
- sectionContainer: string;
- sectionSuggestionsContainer: string;
- sectionTitle: string;
- suggestion: string;
- suggestionFocused: string;
- suggestionsContainer: string;
+ container?: string;
+ containerOpen?: string;
+ input?: string;
+ sectionContainer?: string;
+ sectionSuggestionsContainer?: string;
+ sectionTitle?: string;
+ suggestion?: string;
+ suggestionFocused?: string;
+ suggestionsContainer?: string;
}
interface AutosuggestProps extends React.Props {
From 0592c4c74f3886ab7be9ac555bd4945cd4a66e59 Mon Sep 17 00:00:00 2001
From: Elliot S Chi
Date: Tue, 9 Aug 2016 15:45:25 -0700
Subject: [PATCH 30/35] undo
---
react-autosuggest/react-autosuggest.d.ts | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/react-autosuggest/react-autosuggest.d.ts b/react-autosuggest/react-autosuggest.d.ts
index 9436e961ea..f53238b882 100644
--- a/react-autosuggest/react-autosuggest.d.ts
+++ b/react-autosuggest/react-autosuggest.d.ts
@@ -31,15 +31,15 @@ declare namespace ReactAutosuggest {
}
interface Theme {
- container?: string;
- containerOpen?: string;
- input?: string;
- sectionContainer?: string;
- sectionSuggestionsContainer?: string;
- sectionTitle?: string;
- suggestion?: string;
- suggestionFocused?: string;
- suggestionsContainer?: string;
+ container: string;
+ containerOpen: string;
+ input: string;
+ sectionContainer: string;
+ sectionSuggestionsContainer: string;
+ sectionTitle: string;
+ suggestion: string;
+ suggestionFocused: string;
+ suggestionsContainer: string;
}
interface AutosuggestProps extends React.Props {
From 2fb8651931403d1e48d695cbb540e8b931d2bbbc Mon Sep 17 00:00:00 2001
From: ScottSWu
Date: Tue, 9 Aug 2016 16:21:39 -0700
Subject: [PATCH 31/35] Add additional patch methods in jsdiff
* Add `IUniDiff` struct, representing a unified diff
* Add `IHunk` struct, representing a section of modified lines and context
* Fix `createPatch` optional `options` argument
* Fix `applyPatch` to accept either a patch string, IUniDiff or IUniDiff array
* Add `createTwoFilesPatch`, `structuredPatch` and `applyPatches`
* Add test code for these new functions
---
diff/diff-tests.ts | 41 ++++++++++++++++++++++++++++++++++++++++-
diff/diff.d.ts | 32 ++++++++++++++++++++++++++++++--
2 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/diff/diff-tests.ts b/diff/diff-tests.ts
index 46d367bf68..20d75b38ea 100644
--- a/diff/diff-tests.ts
+++ b/diff/diff-tests.ts
@@ -49,5 +49,44 @@ function printDiff(diff:jsdiff.IDiffResult[]) {
console.log(addLineHeader(" ", part.value));
}
});
+}
-}
\ No newline at end of file
+function verifyPatchMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) {
+ var verifyPatch = jsdiff.parsePatch(
+ jsdiff.createTwoFilesPatch("oldFile.ts", "newFile.ts", oldStr, newStr,
+ "old", "new", { context: 1 }));
+ if (JSON.stringify(verifyPatch) !== JSON.stringify(uniDiff)) {
+ console.error("Patch did not match uniDiff");
+ }
+}
+
+function verifyApplyMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) {
+ var verifyApply = [
+ jsdiff.applyPatch(oldStr, uniDiff),
+ jsdiff.applyPatch(oldStr, [uniDiff])
+ ];
+ jsdiff.applyPatches([uniDiff], {
+ loadFile: (index: number, callback: (err: Error, data: string) => void) => {
+ callback(undefined, one);
+ },
+ patched: (index: number, content: string) => {
+ verifyApply.push(content);
+ },
+ complete: (err?: Error) => {
+ if (err) {
+ console.error(err);
+ }
+
+ verifyApply.forEach(result => {
+ if (result !== newStr) {
+ console.error("Result did not match newStr");
+ }
+ });
+ }
+ });
+}
+
+verifyPatchMethods(one, other, uniDiff);
+var uniDiff = jsdiff.structuredPatch("oldFile.ts", "newFile.ts", one, other,
+ "old", "new", { context: 1 });
+verifyApplyMethods(one, other, uniDiff);
diff --git a/diff/diff.d.ts b/diff/diff.d.ts
index b1f947300b..fc4708c2a1 100644
--- a/diff/diff.d.ts
+++ b/diff/diff.d.ts
@@ -16,6 +16,22 @@ declare namespace JsDiff {
componenets: IDiffResult[];
}
+ interface IHunk {
+ oldStart: number;
+ oldLines: number;
+ newStart: number;
+ newLines: number;
+ lines: string[];
+ }
+
+ interface IUniDiff {
+ oldFileName: string;
+ newFileName: string;
+ oldHeader: string;
+ newHeader: string;
+ hunks: IHunk[];
+ }
+
class Diff {
ignoreWhitespace:boolean;
@@ -46,9 +62,21 @@ declare namespace JsDiff {
function diffCss(oldStr:string, newStr:string):IDiffResult[];
- function createPatch(fileName:string, oldStr:string, newStr:string, oldHeader:string, newHeader:string):string;
+ function createPatch(fileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string;
- function applyPatch(oldStr:string, uniDiff:string):string;
+ function createTwoFilesPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string;
+
+ function structuredPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): IUniDiff;
+
+ function applyPatch(oldStr: string, uniDiff: string | IUniDiff | IUniDiff[]): string;
+
+ function applyPatches(uniDiff: IUniDiff[], options: {
+ loadFile: (index: number, callback: (err: Error, data: string) => void) => void,
+ patched: (index: number, content: string) => void,
+ complete: (err?: Error) => void
+ }): void;
+
+ function parsePatch(diffStr: string, options?: {strict: boolean}): IUniDiff[];
function convertChangesToXML(changes:IDiffResult[]):string;
From 7ed01f2c4fbdbae3fd3faaf6ec6f54c77b23e473 Mon Sep 17 00:00:00 2001
From: Chris Gervang
Date: Tue, 9 Aug 2016 17:44:38 -0700
Subject: [PATCH 32/35] Adding the missing func page.replace() to type def
According to the source code, this replace function exists but it is missing from our type definition. Please promptly merge. I've tested this on my local machine.
https://github.com/visionmedia/page.js/blob/master/page.js#L272
---
page/page.d.ts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/page/page.d.ts b/page/page.d.ts
index dd76823ecf..682322f3fa 100644
--- a/page/page.d.ts
+++ b/page/page.d.ts
@@ -86,6 +86,11 @@ declare namespace PageJS {
*
*/
redirect(page: string): void;
+ /**
+ * Replace `path` with optional `state` object.
+ *
+ */
+ replace(path: string, state?: any, init?: boolean, dispatch?: boolean): Context;
/**
* Navigate to the given path.
*
From 1e23523f880a40fa3c41d74a4eed7f8cf5b12aae Mon Sep 17 00:00:00 2001
From: kutynko
Date: Wed, 10 Aug 2016 11:59:45 +0300
Subject: [PATCH 33/35] Updated IFilterOptions
Updated column filter options according to latest official documentation
http://ui-grid.info/docs/#/api/ui.grid.class:GridOptions.columnDef#properties_filter
---
ui-grid/ui-grid-tests.ts | 3 ++-
ui-grid/ui-grid.d.ts | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ui-grid/ui-grid-tests.ts b/ui-grid/ui-grid-tests.ts
index 7d91d94748..5a088337cd 100644
--- a/ui-grid/ui-grid-tests.ts
+++ b/ui-grid/ui-grid-tests.ts
@@ -33,13 +33,14 @@ columnDef.filter = {
condition: 2,
term: 'yes',
placeholder: 'testing',
+ ariaLabel: 'testing',
noTerm: false,
flags: {
caseSensitive: true
},
type: 1,
selectOptions: [{value: 4, label: 'test'}],
- disableCancelButton: false
+ disableCancelFilterButton: false
};
columnDef.filter.condition = (searchTerm: string, cellValue: any, row: uiGrid.IGridRow, column: uiGrid.IGridColumn): boolean => {
return true;
diff --git a/ui-grid/ui-grid.d.ts b/ui-grid/ui-grid.d.ts
index a598bc9846..1ce953885f 100644
--- a/ui-grid/ui-grid.d.ts
+++ b/ui-grid/ui-grid.d.ts
@@ -3871,6 +3871,10 @@ declare namespace uiGrid {
term?: string;
/** String that will be set to the .placeholder attribute */
placeholder?: string;
+ /**
+ * String that will be set to the .ariaLabel attribute. This is what is read as a label to screen reader users.
+ */
+ ariaLabel?: string;
/**
* set this to true if you have defined a custom function in condition,
* and your custom function doesn't require a term
@@ -3895,7 +3899,7 @@ declare namespace uiGrid {
* If set to true then the 'x' button that cancels/clears the filter will not be shown.
* @default false
*/
- disableCancelButton?: boolean;
+ disableCancelFilterButton?: boolean;
}
export interface ISelectOption {
value: number | string;
From edf6a27cca6204a1b47e2844f1222866b3bb8f33 Mon Sep 17 00:00:00 2001
From: Francois Lecroart
Date: Wed, 10 Aug 2016 18:23:53 +0200
Subject: [PATCH 34/35] Add TypeDefinition for autosize plugin of jackmoore
original jquery-autosize plugin requred jquery but the new version
didn't need it anymore.
So I add a new definition for the new version of the plugin
see #10023
---
autosize/autosize-tests.ts | 10 ++++++++++
autosize/autosize.d.ts | 17 +++++++++++++++++
2 files changed, 27 insertions(+)
create mode 100644 autosize/autosize-tests.ts
create mode 100644 autosize/autosize.d.ts
diff --git a/autosize/autosize-tests.ts b/autosize/autosize-tests.ts
new file mode 100644
index 0000000000..23686fbd88
--- /dev/null
+++ b/autosize/autosize-tests.ts
@@ -0,0 +1,10 @@
+///
+
+// from a NodeList
+autosize(document.querySelectorAll('textarea'));
+
+// from a single Node
+autosize(document.querySelector('textarea'));
+
+// from a single element
+autosize(document.getElementById('my-textarea'));
diff --git a/autosize/autosize.d.ts b/autosize/autosize.d.ts
new file mode 100644
index 0000000000..0a8a696c3d
--- /dev/null
+++ b/autosize/autosize.d.ts
@@ -0,0 +1,17 @@
+// Type definitions for jquery.autosize 3.0.7
+// Project: http://www.jacklmoore.com/autosize/
+// Definitions by: Aaron T. King
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare namespace autosize {
+ interface AutosizeStatic {
+ (el: Element): void;
+ (el: NodeList): void;
+ }
+}
+
+declare var autosize: autosize.AutosizeStatic;
+
+declare module 'autosize' {
+ export = autosize;
+}
From ae242862e53ab784bb58563ab68080082fad0de2 Mon Sep 17 00:00:00 2001
From: Peter Snider
Date: Wed, 10 Aug 2016 14:09:28 -0700
Subject: [PATCH 35/35] moved decls within external namespace
---
seneca/seneca.d.ts | 435 ++++++++++++++++++++++-----------------------
1 file changed, 216 insertions(+), 219 deletions(-)
diff --git a/seneca/seneca.d.ts b/seneca/seneca.d.ts
index 6ef3eb4929..7db8f83b6c 100644
--- a/seneca/seneca.d.ts
+++ b/seneca/seneca.d.ts
@@ -3,227 +3,224 @@
// Definitions by: Peter Snider
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/seneca
-declare function SNS(options?: SNS.Options): SNS.Instance;
-
-declare namespace SNS {
-
- type UnknownType = any;
-
-
- interface Options {
- [plugin_name: string]: any;
- tag?: string;
- // Standard length of identifiers for actions.
- idlen?: number;
- // Standard timeout for actions.
- timeout?: number; // milliseconds
- // Register (true) default plugins. Set false to not register when
- // using custom versions.
- default_plugins?: {
- basic?: boolean;
- 'mem-store'?: boolean;
- transport?: boolean;
- web?: boolean;
- };
- // Settings for network REPL.
- repl?: {
- port?: number;
- host?: string;
- };
- // Debug settings.
- debug?: {
- // Throw (some) errors from seneca.act.
- fragile?: boolean;
- // Fatal errors ... aren't fatal. Not for production!
- undead?: boolean;
- // Print debug info to console
- print?: {
- // Print options. Best used via --seneca.print.options.
- options?: boolean;
- };
- // Trace action caller and place in args.caller$.
- act_caller?: boolean;
- // Shorten all identifiers to 2 characters.
- short_logs?: boolean;
- // Record and log callpoints (calling code locations).
- callpoint?: boolean;
- };
- // Enforce strict behaviours. Relax when backwards compatibility needed.
- strict?: {
- // Action result must be a plain object.
- result?: boolean;
- // Delegate fixedargs override action args.
- fixedargs?: boolean;
- // Adding a pattern overrides existing pattern only if matches exactly.
- add?: boolean;
- };
- // Action cache. Makes inbound messages idempotent.
- actcache?: {
- active?: boolean;
- size?: number;
- };
- // Action executor tracing. See gate-executor module.
- trace?: {
- act?: boolean;
- stack?: boolean;
- unknown?: string;
- },
- // Action statistics settings. See rolling-stats module.
- stats?: {
- size?: number;
- interval?: number;
- running?: boolean;
- };
- // Wait time for plugins to close gracefully.
- deathdelay?: number;
- // Default seneca-admin settings.
- // TODO: move to seneca-admin!
- admin?: {
- local?: boolean;
- prefix?: string;
- };
- // Plugin settings
- plugin?: any;
- // Internal settings.
- internal?: {
- // Close instance on these signals, if true.
- close_signals?: {
- SIGHUP?: boolean;
- SIGTERM?: boolean;
- SIGINT?: boolean;
- SIGBREAK?: boolean;
- };
- actrouter?: UnknownType;
- clientrouter?: UnknownType;
- subrouter?: UnknownType;
- };
- // Log status at periodic intervals.
- status?: {
- interval?: number;
- // By default, does not run.
- running?: boolean;
- },
- // zig module settings for seneca.start() chaining.
- zig?: any;
- log?: {
- short?: boolean;
- };
- errhandler?: GlobalErrorHandler;
- }
-
- interface MinimalPattern {
- //role?: string;
- //cmd?: string;
- }
-
- interface Optioner {
- set: (input: string | Options) => Options;
- get: () => Options;
- }
-
- type ExecutorWorker = (callback: any) => void;
- type ExecutorCallback = (err: Error, result: any) => void;
- interface Executor {
- id: string;
- desc: string;
- fn: ExecutorWorker;
- cb: ExecutorCallback;
- gate: boolean;
- ungate: boolean;
- execute: UnknownType;
- }
-
- interface PluginOptions {
- }
- type PluginModule = (options: any) => void;
-
- interface ClientOptions {
- }
-
- interface ListenOptions {
- }
-
- interface EntityDataWithQuery {
- [entityKey: string]: any;
- id?: string;
- sort$?: any;
- }
-
-
-
- type Pattern = string | MinimalPattern;
- type GlobalErrorHandler = (error: Error) => void;
- type AddCallback = (msg: any, respond: (error: Error, msg: any) => void) => void;
- type ActCallback = (error: Error, result: any) => void;
- type CloseCallback = (optional: any, done: (error: Error) => void) => void;
- type DatabaseID = string;
- type EntitySaveCallback = (error: Error, result: any) => void;
- type EntityLoadCallback = (error: Error, result: any) => void;
- type EntityRemoveCallback = (error: Error) => void;
- type EntityListCallback = (error: Error, result: any[]) => void;
-
-
-
-
- interface Instance {
- version: string;
-
- options(options: Options): void;
-
- error(handler: GlobalErrorHandler): void;
- on(eventName: string, callback: (error: Error) => void): any;
- close(callback: CloseCallback): void;
- use(module: PluginModule, options?: PluginOptions): this;
- use(name: string, options?: PluginOptions): this;
- client(options?: ClientOptions): this;
- listen(options?: ListenOptions): this;
-
- ready(callback: (error: Error) => void): void;
-
- add(pattern: Pattern, action: AddCallback): this;
- add(pattern: Pattern, paramspec: any, action: AddCallback): this;
- act(pattern: Pattern, respond: ActCallback): void;
- act(pattern: Pattern, msg: any, respond: ActCallback): void;
- make(entity_canon: string, properties?: any): Entity;
- make(base: string, entity_canon: string, properties?: any): Entity;
- make(zone: string, base: string, entity_canon: string, properties?: any): Entity;
-
- // @param name reference to plugin provided object
- export(name: string): PluginModule;
-
- pin(pattern: Pattern): void;
- }
-
-
- // NOTE: senecas documented use of:
- // var product = seneca.make('product')
- // product.name = 'Apple'
- // causes this error: error TS2339: Property 'name' does not exist on type 'Entity'.
- // Change such references to: product['name']
- interface Entity {
- (canon: any, seneca: any): void;
- [fieldname: string]: any;
- // there appear to be many more variants of make$(), but its unclear that they are intended for the public API
- make$(): Entity;
- make$(name: string): Entity;
- make$(base: string, name: string): Entity;
- make$(zone: string, base: string, name: string): Entity;
-
- save$(callback: EntitySaveCallback): void;
- save$(props: EntityDataWithQuery, callback: EntitySaveCallback): void;
- load$(id: DatabaseID | EntityDataWithQuery, callback: EntityLoadCallback): void;
- remove$(id: DatabaseID | EntityDataWithQuery, callback: EntityRemoveCallback): void;
- list$(query: EntityDataWithQuery, callback: EntityListCallback): void;
- }
-
-}
-
-
-
-//export = SNS
-
declare module "seneca" {
+
+ function SNS(options?: SNS.Options): SNS.Instance;
+
+ namespace SNS {
+
+ type UnknownType = any;
+
+
+ interface Options {
+ [plugin_name: string]: any;
+ tag?: string;
+ // Standard length of identifiers for actions.
+ idlen?: number;
+ // Standard timeout for actions.
+ timeout?: number; // milliseconds
+ // Register (true) default plugins. Set false to not register when
+ // using custom versions.
+ default_plugins?: {
+ basic?: boolean;
+ 'mem-store'?: boolean;
+ transport?: boolean;
+ web?: boolean;
+ };
+ // Settings for network REPL.
+ repl?: {
+ port?: number;
+ host?: string;
+ };
+ // Debug settings.
+ debug?: {
+ // Throw (some) errors from seneca.act.
+ fragile?: boolean;
+ // Fatal errors ... aren't fatal. Not for production!
+ undead?: boolean;
+ // Print debug info to console
+ print?: {
+ // Print options. Best used via --seneca.print.options.
+ options?: boolean;
+ };
+ // Trace action caller and place in args.caller$.
+ act_caller?: boolean;
+ // Shorten all identifiers to 2 characters.
+ short_logs?: boolean;
+ // Record and log callpoints (calling code locations).
+ callpoint?: boolean;
+ };
+ // Enforce strict behaviours. Relax when backwards compatibility needed.
+ strict?: {
+ // Action result must be a plain object.
+ result?: boolean;
+ // Delegate fixedargs override action args.
+ fixedargs?: boolean;
+ // Adding a pattern overrides existing pattern only if matches exactly.
+ add?: boolean;
+ };
+ // Action cache. Makes inbound messages idempotent.
+ actcache?: {
+ active?: boolean;
+ size?: number;
+ };
+ // Action executor tracing. See gate-executor module.
+ trace?: {
+ act?: boolean;
+ stack?: boolean;
+ unknown?: string;
+ },
+ // Action statistics settings. See rolling-stats module.
+ stats?: {
+ size?: number;
+ interval?: number;
+ running?: boolean;
+ };
+ // Wait time for plugins to close gracefully.
+ deathdelay?: number;
+ // Default seneca-admin settings.
+ // TODO: move to seneca-admin!
+ admin?: {
+ local?: boolean;
+ prefix?: string;
+ };
+ // Plugin settings
+ plugin?: any;
+ // Internal settings.
+ internal?: {
+ // Close instance on these signals, if true.
+ close_signals?: {
+ SIGHUP?: boolean;
+ SIGTERM?: boolean;
+ SIGINT?: boolean;
+ SIGBREAK?: boolean;
+ };
+ actrouter?: UnknownType;
+ clientrouter?: UnknownType;
+ subrouter?: UnknownType;
+ };
+ // Log status at periodic intervals.
+ status?: {
+ interval?: number;
+ // By default, does not run.
+ running?: boolean;
+ },
+ // zig module settings for seneca.start() chaining.
+ zig?: any;
+ log?: {
+ short?: boolean;
+ };
+ errhandler?: GlobalErrorHandler;
+ }
+
+ interface MinimalPattern {
+ //role?: string;
+ //cmd?: string;
+ }
+
+ interface Optioner {
+ set: (input: string | Options) => Options;
+ get: () => Options;
+ }
+
+ type ExecutorWorker = (callback: any) => void;
+ type ExecutorCallback = (err: Error, result: any) => void;
+ interface Executor {
+ id: string;
+ desc: string;
+ fn: ExecutorWorker;
+ cb: ExecutorCallback;
+ gate: boolean;
+ ungate: boolean;
+ execute: UnknownType;
+ }
+
+ interface PluginOptions {
+ }
+ type PluginModule = (options: any) => void;
+
+ interface ClientOptions {
+ }
+
+ interface ListenOptions {
+ }
+
+ interface EntityDataWithQuery {
+ [entityKey: string]: any;
+ id?: string;
+ sort$?: any;
+ }
+
+
+
+ type Pattern = string | MinimalPattern;
+ type GlobalErrorHandler = (error: Error) => void;
+ type AddCallback = (msg: any, respond: (error: Error, msg: any) => void) => void;
+ type ActCallback = (error: Error, result: any) => void;
+ type CloseCallback = (optional: any, done: (error: Error) => void) => void;
+ type DatabaseID = string;
+ type EntitySaveCallback = (error: Error, result: any) => void;
+ type EntityLoadCallback = (error: Error, result: any) => void;
+ type EntityRemoveCallback = (error: Error) => void;
+ type EntityListCallback = (error: Error, result: any[]) => void;
+
+
+
+
+ interface Instance {
+ version: string;
+
+ options(options: Options): void;
+
+ error(handler: GlobalErrorHandler): void;
+ on(eventName: string, callback: (error: Error) => void): any;
+ close(callback: CloseCallback): void;
+ use(module: PluginModule, options?: PluginOptions): this;
+ use(name: string, options?: PluginOptions): this;
+ client(options?: ClientOptions): this;
+ listen(options?: ListenOptions): this;
+
+ ready(callback: (error: Error) => void): void;
+
+ add(pattern: Pattern, action: AddCallback): this;
+ add(pattern: Pattern, paramspec: any, action: AddCallback): this;
+ act(pattern: Pattern, respond: ActCallback): void;
+ act(pattern: Pattern, msg: any, respond: ActCallback): void;
+ make(entity_canon: string, properties?: any): Entity;
+ make(base: string, entity_canon: string, properties?: any): Entity;
+ make(zone: string, base: string, entity_canon: string, properties?: any): Entity;
+
+ // @param name reference to plugin provided object
+ export(name: string): PluginModule;
+
+ pin(pattern: Pattern): void;
+ }
+
+
+ // NOTE: senecas documented use of:
+ // var product = seneca.make('product')
+ // product.name = 'Apple'
+ // causes this error: error TS2339: Property 'name' does not exist on type 'Entity'.
+ // Change such references to: product['name']
+ interface Entity {
+ (canon: any, seneca: any): void;
+ [fieldname: string]: any;
+ // there appear to be many more variants of make$(), but its unclear that they are intended for the public API
+ make$(): Entity;
+ make$(name: string): Entity;
+ make$(base: string, name: string): Entity;
+ make$(zone: string, base: string, name: string): Entity;
+
+ save$(callback: EntitySaveCallback): void;
+ save$(props: EntityDataWithQuery, callback: EntitySaveCallback): void;
+ load$(id: DatabaseID | EntityDataWithQuery, callback: EntityLoadCallback): void;
+ remove$(id: DatabaseID | EntityDataWithQuery, callback: EntityRemoveCallback): void;
+ list$(query: EntityDataWithQuery, callback: EntityListCallback): void;
+ }
+
+ }
+
export = SNS;
}