Merge remote-tracking branch 'upstream/master'

This commit is contained in:
卞中杰
2017-07-26 10:26:31 +08:00
732 changed files with 22182 additions and 6947 deletions
+1 -1
View File
@@ -1,9 +1,9 @@
root = true
[*]
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
[{*.json,*.yml}]
indent_style = space
indent_size = 2
+6
View File
@@ -18,6 +18,12 @@
"sourceRepoURL": "https://github.com/doxout/anydb-sql",
"asOfVersion": "0.6.46"
},
{
"libraryName": "apn",
"typingsPackageName": "apn",
"sourceRepoURL": "https://github.com/node-apn/node-apn",
"asOfVersion": "2.1.2"
},
{
"libraryName": "Argon2",
"typingsPackageName": "argon2",
+1
View File
@@ -2,6 +2,7 @@ import * as Alexa from "alexa-sdk";
const handler = (event: Alexa.RequestBody<Alexa.Request>, context: Alexa.Context, callback: () => void) => {
let alexa = Alexa.handler(event, context);
alexa.resources = {};
alexa.registerHandlers(handlers);
alexa.execute();
};
+2
View File
@@ -3,6 +3,7 @@
// Definitions by: Pete Beegle <https://github.com/petebeegle>
// Huw <https://github.com/hoo29>
// pascalwhoop <https://github.com/pascalwhoop>
// Ben <https://github.com/blforce>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -20,6 +21,7 @@ export interface AlexaObject<T> extends Handler<T> {
state: any;
appId: any;
response: any;
resources: any;
dynamoDBTableName: any;
saveBeforeResponse: boolean;
registerHandlers: (...handlers: Array<Handlers<T>>) => any;
@@ -1,5 +1,5 @@
import * as angular from "angular";
import {ClipboardService} from "angular-clipboard";
import { ClipboardService } from "angular-clipboard";
interface TestScope extends ng.IScope {
[index: string]: any;
+1 -1
View File
@@ -15,7 +15,7 @@ declare namespace angular {
* ### Example
*
* ```
* import {Component} from 'angular2/core';
* import { Component } from 'angular2/core';
* import {bootstrap} from 'angular2/platform/browser';
* import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router';
*
-145
View File
@@ -1,145 +0,0 @@
import apn = require("apn");
//Hand made TypeScript tests
//==========================
//Create with a hex string
var device1 = new apn.Device("ca11ab1e");
//Create with a Buffer
var device2 = new apn.Device(new Buffer("ca55e77e"));
//Create the notification
var notification = new apn.Notification();
notification.alert = {
title: "The Title",
body: "This is the body",
};
notification.badge = 5;
//Fluid api
notification.setAlertTitle("The Title")
.setAlertText("This is the body")
.setLaunchImage("LaunchImage");
//Establish the connection
var connection = new apn.Connection({
cert: "path/to/cert.pem",
key: "path/to/cert.pem"
});
//Testing some specialized event listeners
connection.on("error", (error) => {
console.log("push error", error.name, error.message);
});
connection.on("transmissionError", (errorCode, notification, device) => {
console.log("push failed", errorCode, "notification", notification.alert, "device id: ", device.toString());
});
//Send it using hex string
connection.pushNotification(notification, "ba5eba11");
//Send it using Buffer
connection.pushNotification(notification, new Buffer("5ca1ab1e"));
//Send it using Device
connection.pushNotification(notification, device1);
//Connecting to feedback service
var feedbackService = new apn.Feedback({
cert: "path/to/cert.pem",
key: "path/to/cert.pem",
interval: 0
});
feedbackService.on("error", (error:Error) => {
console.log("push feedback error", error.name, error.message);
});
function processFeedbackData(device:apn.Device, time:number) {
}
feedbackService.on("feedback", (feedbackData) => {
feedbackData.forEach((data) => {
processFeedbackData(data.device, data.time);
})
});
feedbackService.start();
//Original examples from apn package
//==================================
//sending-to-multiple-devices.js
//------------------------------
var tokens = ["<insert token here>", "<insert token here>"];
if(tokens[0] === "<insert token here>") {
console.log("Please set token to a valid device token for the push notification service");
process.exit();
}
// Create a connection to the service using mostly default parameters.
var service = new apn.connection({ production: false });
service.on("connected", function() {
console.log("Connected");
});
service.on("transmitted", function(notification, device) {
console.log("Notification transmitted to:" + device.token.toString("hex"));
});
service.on("transmissionError", function(errCode, notification, device) {
console.error("Notification caused error: " + errCode + " for device ", device, notification);
if (errCode === 8) {
console.log("A error code of 8 indicates that the device token is invalid. This could be for a number of reasons - are you using the correct environment? i.e. Production vs. Sandbox");
}
});
service.on("timeout", function () {
console.log("Connection Timeout");
});
service.on("disconnected", function() {
console.log("Disconnected from APNS");
});
service.on("socketError", console.error);
// If you plan on sending identical paylods to many devices you can do something like this.
function pushNotificationToMany() {
console.log("Sending the same notification each of the devices with one call to pushNotification.");
var note = new apn.notification();
note.setAlertText("Hello, from node-apn!");
note.badge = 1;
service.pushNotification(note, tokens);
}
pushNotificationToMany();
// If you have a list of devices for which you want to send a customised notification you can create one and send it to and individual device.
function pushSomeNotifications() {
console.log("Sending a tailored notification to %d devices", tokens.length);
tokens.forEach(function(token, i) {
var note = new apn.notification();
note.setAlertText("Hello, from node-apn! You are number: " + i);
note.badge = i;
service.pushNotification(note, token);
});
}
pushSomeNotifications();
//feedback.js
//-----------
function handleFeedback(feedbackData:apn.FeedbackData[]) {
feedbackData.forEach(function(feedbackItem) {
console.log("Device: " + feedbackItem.device.toString() + " has been unreachable, since: " + feedbackItem.time);
});
}
// Setup a connection to the feedback service using a custom interval (10 seconds)
var feedback = new apn.feedback({ production: false, interval: 10 });
feedback.on("feedback", handleFeedback);
feedback.on("feedbackError", console.error);
-364
View File
@@ -1,364 +0,0 @@
// Type definitions for node-apn
// Project: https://github.com/argon/node-apn
// Definitions by: Zenorbi <https://github.com/zenorbi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference types="node"/>
import events = require("events");
import net = require("net");
export interface ConnectionOptions {
/**
* The filename of the connection certificate to load from disk, or a Buffer/String containing the certificate data. (Defaults to: `cert.pem`)
*/
cert?: string | Buffer;
/**
* The filename of the connection key to load from disk, or a Buffer/String containing the key data. (Defaults to: `key.pem`)
*/
key?: string | Buffer;
/**
* An array of trusted certificates. Each element should contain either a filename to load, or a Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs will be used. - You may need to use this as some environments don't include the CA used by Apple (entrust_2048).
*/
ca?: (string | Buffer)[];
/**
* File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing the PFX data. If supplied will always be used instead of certificate and key above.
*/
pfx?: string | Buffer;
/**
* The passphrase for the connection key, if required
*/
passphrase?: string;
/**
* Specifies which environment to connect to: Production (if true) or Sandbox - The hostname will be set automatically. (Defaults to NODE_ENV == "production", i.e. false unless the NODE_ENV environment variable is set accordingly)
*/
production?: boolean;
/**
* Enable when you are using a VoIP certificate to enable paylods up to 4096 bytes.
*/
voip?: boolean;
/**
* Gateway port (Defaults to: `2195`)
*/
port?: number;
/**
* Reject Unauthorized property to be passed through to tls.connect() (Defaults to `true`)
*/
rejectUnauthorized?: boolean;
/**
* Number of notifications to cache for error purposes (See "Handling Errors" below, (Defaults to: `1000`)
*/
cacheLength?: number;
/**
* Whether the cache should grow in response to messages being lost after errors. (Will still emit a 'cacheTooSmall' event) (Defaults to: `true`)
*/
autoAdjustCache?: boolean;
/**
* The maximum number of connections to create for sending messages. (Defaults to: `1`)
*/
maxConnections?: number;
/**
* The duration of time the module should wait, in milliseconds, when trying to establish a connection to Apple before failing. 0 = Disabled. {Defaults to: `10000`}
*/
connectTimeout?: number;
/**
* The duration the socket should stay alive with no activity in milliseconds. 0 = Disabled. (Defaults to: `3600000` - 1h)
*/
connectionTimeout?: number;
/**
* The maximum number of connection failures that will be tolerated before `apn` will "terminate". (Defaults to: 10)
*/
connectionRetryLimit?: number;
/**
* Whether to buffer notifications and resend them after failure. (Defaults to: `true`)
*/
buffersNotifications?: number;
/**
* Whether to aggresively empty the notification buffer while connected - if set to true node-apn may enter a tight loop under heavy load while delivering notifications. (Defaults to: `false`)
*/
fastMode?: boolean;
}
export declare class Connection extends events.EventEmitter {
constructor(options: ConnectionOptions);
/**
* This is the business end of the module. Create a `Notification` object and pass it in, along with a single recipient or an array of them and node-apn will take care of the rest, delivering the notification to each recipient.
*
* A "recipient" is either a `Device` object, a `String`, or a `Buffer` containing the device token. `Device` objects are used internally and will be created if necessary. Where applicable, all events will return a `Device` regardless of the type passed to this method.
*/
pushNotification(notification: Notification, recipient: Device | string | Buffer | (Device | string | Buffer)[]): void;
/**
* Used to manually adjust the "cacheLength" property in the options. This is ideal if you choose to use the `cacheTooSmall` event to tweak your environment. It is safe for increasing and reducing cache size.
*/
setCacheLength(newLength: number): void;
/**
* Indicate to node-apn that when the queue of pending notifications is fully drained that it should close all open connections. This will mean that if there are no other pending resources (open sockets, running timers, etc.) the application will terminate. If notifications are pushed after the connection has completely shutdown a new connection will be established and, if applicable, `shutdown` will need to be called again.
*/
shutdown(): void;
/**
* Emitted when an error occurs during initialisation of the module, usually due to a problem with the keys and certificates.
*/
on(event: "error", listener: (error: Error) => void): this;
/**
* Emitted when the connection socket experiences an error. This may be useful for debugging but no action should be necessary.
*/
on(event: "socketError", listener: (error: Error) => void): this;
/**
* Emitted when a notification has been sent to Apple - not a guarantee that it has been accepted by Apple, an error relating to it may occur later on. A notification may also be "transmitted" several times if a preceding notification caused an error requiring retransmission.
*/
on(event: "transmitted", listener: (notification: Notification, decive: Device) => void): this;
/**
* Emitted when all pending notifications have been transmitted to Apple and the pending queue is empty. This may be called more than once if a notification error occurs and notifications must be re-sent.
*/
on(event: "completed", listener: () => void): this;
/**
* Emitted when Apple returns a notification as invalid but the notification has already been expunged from the cache - usually due to high throughput and indicates that notifications will be getting lost. The parameter is an estimate of how many notifications have been lost. You should experiment with increasing the cache size or enabling ```autoAdjustCache``` if you see this frequently.
*
* **Note**: With ```autoAdjustCache``` enabled this event will still be emitted when an adjustment is triggered.
*/
on(event: "cacheTooSmall", listener: (sizeDifference: number) => void): this;
/**
* Emitted when a connection to Apple is successfully established. The parameter indicates the number of open connections. No action is required as the connection is managed internally.
*/
on(event: "connected", listener: (openSockets: net.Socket[]) => void): this;
/**
* Emitted when the connection to Apple has been closed, this could be for numerous reasons, for example an error has occurred or the connection has timed out. The parameter is the same as for `connected` and again, no action is required.
*/
on(event: "disconnected", listener: (openSockets: net.Socket[]) => void): this;
/**
* Emitted when the connectionTimeout option has been specified and no activity has occurred on a socket for a specified duration. The socket will be closed immediately after this event and a `disconnected` event will also be emitted.
*/
on(event: "timeout", listener: () => void): this;
/**
* Emitted when a message has been received from Apple stating that a notification was invalid or if an internal error occurred before that notification could be pushed to Apple. If the notification is still in the cache it will be passed as the second argument, otherwise null. Where possible the associated `Device` object will be passed as a third parameter, however in cases where the token supplied to the module cannot be parsed into a `Buffer` the supplied value will be returned.
* Error codes smaller than 512 correspond to those returned by Apple as per their [docs][errors]. Other errors are applicable to `node-apn` itself. Definitions can be found in `lib/errors.js`.
*/
on(event: "transmissionError", listener: (errorCode: number, notification: Notification, device: Device | Buffer) => void): this;
on(event: string, listener: Function): this;
}
export interface NotificationAlertOptions {
title?: string;
subtitle?: string;
body: string;
"title-loc-key"?: string;
"title-loc-args"?: string[];
"action-loc-key"?: string;
"loc-key"?: string;
"loc-args"?: string[];
"launch-image"?: string;
}
export declare class Notification {
/**
* The maximum number of retries which should be performed when sending a notification if an error occurs. A value of 0 will only allow one attempt at sending (0 retries). Set to -1 to disable (default).
*/
public retryLimit: number;
/**
* The UNIX timestamp representing when the notification should expire. This does not contribute to the 2048 byte payload size limit. An expiry of 0 indicates that the notification expires immediately.
*/
public expiry: number;
/**
* From Apple's Documentation, Provide one of the following values:
*
* - 10 - The push message is sent immediately. (Default)
* > The push notification must trigger an alert, sound, or badge on the device. It is an error use this priority for a push that contains only the content-available key.
* - 5 - The push message is sent at a time that conserves power on the device receiving it.
*/
public priority: number;
/**
* The encoding to use when transmitting the notification to APNS, defaults to `utf8`. `utf16le` is also possible but as each character is represented by a minimum of 2 bytes, will at least halve the possible payload size. If in doubt leave as default.
*/
public encoding: string;
/**
* This object represents the root JSON object that you can add custom information for your application to. The properties below will only be added to the payload (under `aps`) when the notification is prepared for sending.
*/
public payload: any;
/**
* The value to specify for `payload.aps.badge`
*/
public badge: number;
/**
* The value to specify for `payload.aps.sound`
*/
public sound: string;
/**
* The value to specify for `payload.aps.alert` can be either a `String` or an `Object` as outlined by the payload documentation.
*/
public alert: string | NotificationAlertOptions;
/**
* Setting this to true will specify "content-available" in the payload when it is compiled.
*/
public newsstandAvailable: boolean;
/**
* Setting this to true will specify "content-available" in the payload when it is compiled.
*/
public contentAvailable: boolean;
/**
* The value to specify for the `mdm` field where applicable.
*/
public mdm: string | Object;
/**
* The value to specify for `payload.aps['url-args']`. This used for Safari Push NOtifications and should be an array of values in accordance with the Web Payload Documentation.
*/
public urlArgs: string[];
/**
* When this parameter is set and `notification#trim()` is called it will attempt to truncate the string at the nearest space.
*/
public truncateAtWordEnd: boolean;
/**
* You can optionally pass in an object representing the payload, or configure properties on the returned object.
*/
constructor(payload?: any);
/**
* Set the `aps.alert` text body. This will use the most space-efficient means.
*/
setAlertText(alertText: string): Notification;
/**
* Set the `title` property of the `aps.alert` object - used with Safari Push Notifications
*/
setAlertTitle(alertTitle: string): Notification;
/**
* Set the `action` property of the `aps.alert` object - used with Safari Push Notifications
*/
setAlertAction(alertAction: string): Notification;
/**
* Set the `action-loc-key` property of the `aps.alert` object.
*/
setActionLocKey(key: string): Notification;
/**
* Set the `loc-key` property of the `aps.alert` object.
*/
setLocKey(key: string): Notification;
/**
* Set the `loc-args` property of the `aps.alert` object.
*/
setLocArgs(args: string[]): Notification;
/**
* Set the `launch-image` property of the `aps.alert` object.
*/
setLaunchImage(image: string): Notification;
/**
* Set the `mdm` property on the payload.
*/
setMDM(mdm: string | Object): Notification;
/**
* Set the `content-available` property of the `aps` object.
*/
setNewsstandAvailable(available: boolean): Notification;
/**
* Set the `content-available` property of the `aps` object.
*/
setContentAvailable(available: boolean): Notification;
/**
* Set the `url-args` property of the `aps` object.
*/
setUrlArgs(urlArgs: string[]): Notification;
/**
* Attempt to automatically trim the notification alert text body to meet the payload size limit of 2048 bytes.
*/
trim(): number;
}
export declare class Device {
public token: Buffer;
/**
* `deviceToken` can be a `Buffer` or a `String` containing a "hex" representation of the token. Throws an error if the deviceToken supplied is invalid.
*/
constructor(deviceToken: string | Buffer);
}
export interface FeedbackOptions {
/**
* The filename of the connection certificate to load from disk, or a Buffer/String containing the certificate data. (Defaults to: `cert.pem`)
*/
cert?: string | Buffer;
/**
* The filename of the connection key to load from disk, or a Buffer/String containing the key data. (Defaults to: `key.pem`)
*/
key?: string | Buffer;
/**
* An array of trusted certificates. Each element should contain either a filename to load, or a Buffer/String (in PEM format) to be used directly. If this is omitted several well known "root" CAs will be used. - You may need to use this as some environments don't include the CA used by Apple (entrust_2048).
*/
ca?: (string | Buffer)[];
/**
* File path for private key, certificate and CA certs in PFX or PKCS12 format, or a Buffer containing the PFX data. If supplied will be used instead of certificate and key above.
*/
pfx?: string | Buffer;
/**
* The passphrase for the connection key, if required
*/
passphrase?: string;
/**
* Specifies which environment to connect to: Production (if true) or Sandbox - The hostname will be set automatically. (Defaults to NODE_ENV == "production", i.e. false unless the NODE_ENV environment variable is set accordingly)
*/
production?: boolean;
/**
* Feedback server port (Defaults to: `2196`)
*/
port?: number;
/**
* Sets the behaviour for triggering the `feedback` event. When `true` the event will be triggered once per connection with an array of timestamp and device token tuples. Otherwise a `feedback` event will be emitted once per token received. (Defaults to: true)
*/
batchFeedback?: boolean;
/**
* The maximum number of tokens to pass when emitting the event - a value of 0 will cause all tokens to be passed after connection is reset. After this number of tokens are received the `feedback` event will be emitted. (Only applies when `batchFeedback` is enabled)
*/
batchSize?: number;
/**
* How often to automatically poll the feedback service. Set to `0` to disable. (Defaults to: `3600`)
*/
interval?: number;
}
export interface FeedbackData {
time: number;
device: Device;
}
/**
* Connection to the Apple Push Notification Feedback Service and if `interval` isn't disabled automatically begins polling the service. Many of the options are the same as `apn.Connection()`
*/
export declare class Feedback {
constructor(options: FeedbackOptions);
/**
* Trigger a query of the feedback service. If `interval` is non-zero then this method will be called automatically.
*/
start(): void;
/**
* You can cancel the interval by calling `feedback.cancel()`. If you do not wish to have the service automatically queried then set `interval` to 0 and use `feedback.start()` to manually invoke it one time.
*/
cancel(): void;
/**
* Emitted when an error occurs initialising the module. Usually caused by failing to load the certificates.
*/
on(event: "error", listener: (error: Error) => void): Feedback;
/**
* Emitted when an error occurs receiving or processing the feedback and in the case of a socket error occurring. These errors are usually informational and node-apn will automatically recover.
*/
on(event: "feedbackError", listener: (error: Error) => void): Feedback;
/**
* Emitted when data has been received from the feedback service, typically once per connection. `feedbackData` is an array of objects, each containing the `time` returned by the server (epoch time) and the `device` a `Buffer` containing the device token.
*/
on(event: "feedback", listener: (feedbackData: FeedbackData[]) => void): Feedback;
on(event: string, listener: Function): Feedback;
}
export declare enum Errors {
"noErrorsEncountered" = 0,
"processingError" = 1,
"missingDeviceToken" = 2,
"missingTopic" = 3,
"missingPayload" = 4,
"invalidTokenSize" = 5,
"invalidTopicSize" = 6,
"invalidPayloadSize" = 7,
"invalidToken" = 8,
"apnsShutdown" = 10,
"none" = 255,
"retryLimitExceeded" = 512,
"moduleInitialisationFailed" = 513,
"connectionRetryLimitExceeded" = 514, // When a connection is unable to be established. Usually because of a network / SSL error this will be emitted
"connectionTerminated" = 515
}
//Lowercase aliases
export { Connection as connection };
export { Device as device };
export { Errors as error };
export { Feedback as feedback };
export { Notification as notification };
+1 -1
View File
@@ -1,7 +1,7 @@
// near copy of each of the tests from https://github.com/nodeca/argparse/tree/master/examples
import {ArgumentParser, RawDescriptionHelpFormatter} from 'argparse';
import { ArgumentParser, RawDescriptionHelpFormatter } from 'argparse';
var args: any;
var simpleExample = new ArgumentParser({
@@ -13,3 +13,6 @@ let options = {
let div = document.createElement("div");
let amcRating = new AskmethatRating(div, 2 , options);
options.readonly = true;
amcRating.defaultOptions = options;
+12 -1
View File
@@ -75,7 +75,12 @@ export class AskmethatRating {
*
* @return options based on @type AskmethatRatingOptions
*/
readonly defaultOptions: any;
/**
* @function set the default option for the rating
*
* @return options based on @type AskmethatRatingOptions
*/
defaultOptions: AskmethatRatingOptions;
/**
* constructor with div element, default rating value & default options
*
@@ -122,6 +127,12 @@ export class AskmethatRating {
* Update readonly status if needed for the rating
*/
private mutationEvent();
/**
* This is fired by mutation observer when an attribute changed in the hidden input
* Is protected to have some unit tests
* @param {MutationRecord[]} mutations list of mutations record
*/
protected mutationDisableEvent(mutations: MutationRecord[]): void;
/**
* @function static method to retrieve with identifier the value
* @param {string} identifier: string container identifier
+1 -1
View File
@@ -5,7 +5,7 @@
/// <reference types="node" />
import {Stream} from 'stream';
import { Stream } from 'stream';
export function array(arr: any[], message ?: string): void;
+1 -1
View File
@@ -1,4 +1,4 @@
import {nextTick} from 'async.nexttick';
import { nextTick } from 'async.nexttick';
function calledOnNextTick(a: string): number {
return parseInt(a, 10);
+1 -1
View File
@@ -5,7 +5,7 @@
/// <reference types="node" />
import {Server} from "https";
import { Server } from "https";
declare namespace createServer {
interface Options {
+3 -1
View File
@@ -1,7 +1,9 @@
// Type definitions for babel-core v6.7
// Project: https://github.com/babel/babel/tree/master/packages/babel-core
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="babel-template" />
/// <reference types="babel-traverse" />
@@ -12,7 +14,7 @@ export {t as types};
type Node = t.Node;
export import template = require('babel-template');
export var version: string;
import traverse, {Visitor} from "babel-traverse";
import traverse, {Visitor } from "babel-traverse";
export {traverse, Visitor};
@@ -1,5 +1,5 @@
// Example from https://github.com/babel/babel/tree/master/packages/babel-generator
import {parse} from 'babylon';
import { parse } from 'babylon';
import generate from 'babel-generator';
const code = 'class Example {}';
@@ -0,0 +1,10 @@
import jsx from "babel-plugin-syntax-jsx";
// Example taken from the babel plugin handbook:
// https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#-enabling-syntax-in-plugins
export default function myBabelPlugin() {
return {
visitor: {},
inherits: jsx,
};
}
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for babel-plugin-syntax-jsx 6.18
// Project: https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx
// Definitions by: Marvin Hagemeister <https://github.com/marvinhagemeister>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// NB: This export doesn't match the handbook example, where `jsx` is the default export.
// But it does match the runtime behaviour (at least at the time of this writing). For some reason,
// babel-plugin-syntax-jsx/lib/index.js has this line at the bottom: module.exports = exports["default"];
declare function jsx(): {
manipulateOptions(opts: any, parserOpts: { plugins: string[] }): void;
};
export default jsx;
@@ -17,6 +17,6 @@
},
"files": [
"index.d.ts",
"apn-tests.ts"
"babel-plugin-syntax-jsx-tests.ts"
]
}
}
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+3 -1
View File
@@ -1,13 +1,15 @@
// Type definitions for babel-template v6.7
// Project: https://github.com/babel/babel/tree/master/packages/babel-template
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="babylon" />
/// <reference types="babel-types" />
import {BabylonOptions} from 'babylon';
import { BabylonOptions } from 'babylon';
import * as t from 'babel-types';
type Node = t.Node;
+1 -1
View File
@@ -2,7 +2,7 @@
import * as babylon from "babylon";
import traverse, {Visitor} from 'babel-traverse';
import traverse, {Visitor } from 'babel-traverse';
import * as t from 'babel-types';
+2
View File
@@ -1,7 +1,9 @@
// Type definitions for babel-traverse v6.7
// Project: https://github.com/babel/babel/tree/master/packages/babel-traverse
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="babel-types" />
+2 -6
View File
@@ -1,7 +1,3 @@
/// <reference types="babel-traverse" />
// Examples from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-types
import traverse from "babel-traverse";
import * as t from "babel-types";
@@ -25,13 +21,13 @@ if (t.isBinaryExpression(ast)) {
ast.right;
ast.operator;
}
t.assertBinaryExpression(ast);
t.assertBinaryExpression(ast, { operator: "*" });
var exp: t.Expression = t.nullLiteral();
const exp: t.Expression = t.nullLiteral();
// React examples:
// https://github.com/babel/babel/blob/4e50b2d9d9c376cee7a2cbf56553fe5b982ea53c/packages/babel-plugin-transform-react-inline-elements/src/index.js#L61
traverse(ast, {
JSXElement(path, file) {
+430 -383
View File
@@ -1,9 +1,10 @@
// Type definitions for babel-types v6.25
// Type definitions for babel-types 6.25
// Project: https://github.com/babel/babel/tree/master/packages/babel-types
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Sam Baxter <https://github.com/baxtersa>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
export interface Comment {
value: string;
@@ -34,9 +35,9 @@ export interface SourceLocation {
export interface Node {
type: string;
leadingComments?: Array<Comment>;
innerComments?: Array<Comment>;
trailingComments?: Array<Comment>;
leadingComments?: Comment[];
innerComments?: Comment[];
trailingComments?: Comment[];
start: number;
end: number;
loc: SourceLocation;
@@ -150,7 +151,7 @@ export interface ForStatement extends Node {
export interface FunctionDeclaration extends Node {
type: "FunctionDeclaration";
id: Identifier;
params: Array<LVal>;
params: LVal[];
body: BlockStatement;
generator: boolean;
async: boolean;
@@ -161,7 +162,7 @@ export interface FunctionDeclaration extends Node {
export interface FunctionExpression extends Node {
type: "FunctionExpression";
id: Identifier;
params: Array<LVal>;
params: LVal[];
body: BlockStatement;
generator: boolean;
async: boolean;
@@ -254,7 +255,7 @@ export interface ObjectMethod extends Node {
value: Expression;
decorators?: Decorator[];
id: Identifier;
params: Array<LVal>;
params: LVal[];
body: BlockStatement;
generator: boolean;
async: boolean;
@@ -361,14 +362,14 @@ export interface AssignmentPattern extends Node {
export interface ArrayPattern extends Node {
type: "ArrayPattern";
elements: Array<Expression>;
elements: Expression[];
typeAnnotation?: TypeAnnotation;
}
export interface ArrowFunctionExpression extends Node {
type: "ArrowFunctionExpression";
id: Identifier;
params: Array<LVal>;
params: LVal[];
body: BlockStatement | Expression;
generator: boolean;
async: boolean;
@@ -474,7 +475,7 @@ export interface ClassMethod extends Node {
static: boolean;
decorators?: Decorator[];
id: Identifier;
params: Array<LVal>;
params: LVal[];
body: BlockStatement;
generator: boolean;
async: boolean;
@@ -872,12 +873,33 @@ export interface SpreadProperty extends Node {
argument: Expression;
}
export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | BooleanLiteral | NullLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | TypeCastExpression | JSXElement | JSXEmptyExpression | JSXIdentifier | JSXMemberExpression | ParenthesizedExpression | AwaitExpression | BindExpression | DoExpression;
export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression
| ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | BooleanLiteral
| NullLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression
| SequenceExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression
| ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression
| TypeCastExpression | JSXElement | JSXEmptyExpression | JSXIdentifier | JSXMemberExpression
| ParenthesizedExpression | AwaitExpression | BindExpression | DoExpression;
export type Binary = BinaryExpression | LogicalExpression;
export type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassDeclaration | ClassExpression | ForOfStatement | ClassMethod;
export type BlockParent = BlockStatement | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ForOfStatement | ClassMethod;
export type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement
| FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement
| ArrowFunctionExpression | ClassDeclaration | ClassExpression | ForOfStatement | ClassMethod;
export type BlockParent = BlockStatement | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration
| FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression
| ForOfStatement | ClassMethod;
export type Block = BlockStatement | Program;
export type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForStatement | FunctionDeclaration | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WhileStatement | WithStatement | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ForOfStatement | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias;
export type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement
| EmptyStatement | ExpressionStatement | ForInStatement | ForStatement | FunctionDeclaration | IfStatement
| LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration
| WhileStatement | WithStatement | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration
| ExportNamedDeclaration | ForOfStatement | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface
| DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias;
export type Terminatorless = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement | YieldExpression | AwaitExpression;
export type CompletionStatement = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement;
export type Conditional = ConditionalExpression | IfStatement;
@@ -889,7 +911,11 @@ export type ForXStatement = ForInStatement | ForOfStatement;
export type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod;
export type FunctionParent = FunctionDeclaration | FunctionExpression | Program | ObjectMethod | ArrowFunctionExpression | ClassMethod;
export type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | BooleanLiteral | NullLiteral | ArrowFunctionExpression | ClassDeclaration | ClassExpression;
export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias;
export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration
| ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction
| DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias;
export type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern;
export type Literal = StringLiteral | NumericLiteral | BooleanLiteral | NullLiteral | RegExpLiteral | TemplateLiteral;
export type Immutable = StringLiteral | NumericLiteral | BooleanLiteral | NullLiteral | JSXAttribute | JSXClosingElement | JSXElement | JSXExpressionContainer | JSXOpeningElement;
@@ -903,15 +929,36 @@ export type Class = ClassDeclaration | ClassExpression;
export type ModuleDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration;
export type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration;
export type ModuleSpecifier = ExportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier;
export type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | ClassImplements | ClassProperty | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | ExistentialTypeParam | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | InterfaceExtends | InterfaceDeclaration | IntersectionTypeAnnotation | MixedTypeAnnotation | NullableTypeAnnotation | NumericLiteralTypeAnnotation | NumberTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameterDeclaration | TypeParameterInstantiation | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | QualifiedTypeIdentifier | UnionTypeAnnotation | VoidTypeAnnotation;
export type FlowTypeAnnotation = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | FunctionTypeAnnotation | GenericTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | NullableTypeAnnotation | NumericLiteralTypeAnnotation | NumberTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAnnotation | ObjectTypeAnnotation | UnionTypeAnnotation | VoidTypeAnnotation;
export type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation
| ClassImplements | ClassProperty | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule
| DeclareTypeAlias | DeclareVariable | ExistentialTypeParam | FunctionTypeAnnotation | FunctionTypeParam
| GenericTypeAnnotation | InterfaceExtends | InterfaceDeclaration | IntersectionTypeAnnotation
| MixedTypeAnnotation | NullableTypeAnnotation | NumericLiteralTypeAnnotation | NumberTypeAnnotation
| StringLiteralTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation
| TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameterDeclaration
| TypeParameterInstantiation | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer
| ObjectTypeProperty | QualifiedTypeIdentifier | UnionTypeAnnotation | VoidTypeAnnotation;
export type FlowTypeAnnotation = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation
| BooleanLiteralTypeAnnotation | FunctionTypeAnnotation | GenericTypeAnnotation | IntersectionTypeAnnotation
| MixedTypeAnnotation | NullableTypeAnnotation | NumericLiteralTypeAnnotation | NumberTypeAnnotation
| StringLiteralTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation
| TypeofTypeAnnotation | TypeAnnotation | ObjectTypeAnnotation | UnionTypeAnnotation | VoidTypeAnnotation;
export type FlowBaseAnnotation = AnyTypeAnnotation | BooleanTypeAnnotation | MixedTypeAnnotation | NumberTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | VoidTypeAnnotation;
export type FlowDeclaration = DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias;
export type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText;
export type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer
| JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText;
export function arrayExpression(elements?: Array<Expression | SpreadElement>): ArrayExpression;
export function assignmentExpression(operator?: string, left?: LVal, right?: Expression): AssignmentExpression;
export function binaryExpression(operator?: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left?: Expression, right?: Expression): BinaryExpression;
export function binaryExpression(
operator?: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=",
left?: Expression,
right?: Expression
): BinaryExpression;
export function directive(value?: DirectiveLiteral): Directive;
export function directiveLiteral(value?: string): DirectiveLiteral;
export function blockStatement(body?: Statement[], directives?: Directive[]): BlockStatement;
@@ -927,8 +974,8 @@ export function expressionStatement(expression?: Expression): ExpressionStatemen
export function file(program?: Program, comments?: Comment[], tokens?: any[]): File;
export function forInStatement(left?: VariableDeclaration | LVal, right?: Expression, body?: Statement): ForInStatement;
export function forStatement(init?: VariableDeclaration | Expression, test?: Expression, update?: Expression, body?: Statement): ForStatement;
export function functionDeclaration(id?: Identifier, params?: Array<LVal>, body?: BlockStatement, generator?: boolean, async?: boolean): FunctionDeclaration;
export function functionExpression(id?: Identifier, params?: Array<LVal>, body?: BlockStatement, generator?: boolean, async?: boolean): FunctionExpression;
export function functionDeclaration(id?: Identifier, params?: LVal[], body?: BlockStatement, generator?: boolean, async?: boolean): FunctionDeclaration;
export function functionExpression(id?: Identifier, params?: LVal[], body?: BlockStatement, generator?: boolean, async?: boolean): FunctionExpression;
export function identifier(name?: string): Identifier;
export function ifStatement(test?: Expression, consequent?: Statement, alternate?: Statement): IfStatement;
export function labeledStatement(label?: Identifier, body?: Statement): LabeledStatement;
@@ -942,7 +989,7 @@ export function memberExpression(object?: Expression | Super, property?: Express
export function newExpression(callee?: Expression | Super, _arguments?: Array<Expression | SpreadElement>): NewExpression;
export function program(body?: Array<Statement | ModuleDeclaration>, directives?: Directive[]): Program;
export function objectExpression(properties?: Array<ObjectProperty | ObjectMethod | SpreadProperty>): ObjectExpression;
export function objectMethod(kind?: "get" | "set" | "method", key?: Expression, params?: Array<LVal>, body?: BlockStatement, computed?: boolean): ObjectMethod;
export function objectMethod(kind?: "get" | "set" | "method", key?: Expression, params?: LVal[], body?: BlockStatement, computed?: boolean): ObjectMethod;
export function objectProperty(key?: Expression, value?: Expression, computed?: boolean, shorthand?: boolean, decorators?: Decorator[]): ObjectProperty;
export function restElement(argument?: LVal, typeAnnotation?: TypeAnnotation): RestElement;
export function returnStatement(argument?: Expression): ReturnStatement;
@@ -959,8 +1006,8 @@ export function variableDeclarator(id?: LVal, init?: Expression): VariableDeclar
export function whileStatement(test?: Expression, body?: BlockStatement | Statement): WhileStatement;
export function withStatement(object?: Expression, body?: BlockStatement | Statement): WithStatement;
export function assignmentPattern(left?: Identifier, right?: Expression): AssignmentPattern;
export function arrayPattern(elements?: Array<Expression>, typeAnnotation?: TypeAnnotation): ArrayPattern;
export function arrowFunctionExpression(params?: Array<LVal>, body?: BlockStatement | Expression, async?: boolean): ArrowFunctionExpression;
export function arrayPattern(elements?: Expression[], typeAnnotation?: TypeAnnotation): ArrayPattern;
export function arrowFunctionExpression(params?: LVal[], body?: BlockStatement | Expression, async?: boolean): ArrowFunctionExpression;
export function classBody(body?: Array<ClassMethod | ClassProperty>): ClassBody;
export function classDeclaration(id?: Identifier, superClass?: Expression, body?: ClassBody, decorators?: Decorator[]): ClassDeclaration;
export function classExpression(id?: Identifier, superClass?: Expression, body?: ClassBody, decorators?: Decorator[]): ClassExpression;
@@ -974,11 +1021,11 @@ export function importDefaultSpecifier(local?: Identifier): ImportDefaultSpecifi
export function importNamespaceSpecifier(local?: Identifier): ImportNamespaceSpecifier;
export function importSpecifier(local?: Identifier, imported?: Identifier): ImportSpecifier;
export function metaProperty(meta?: string, property?: string): MetaProperty;
export function classMethod(kind?: "constructor" | "method" | "get" | "set", key?: Expression, params?: Array<LVal>, body?: BlockStatement, computed?: boolean, _static?: boolean): ClassMethod;
export function classMethod(kind?: "constructor" | "method" | "get" | "set", key?: Expression, params?: LVal[], body?: BlockStatement, computed?: boolean, _static?: boolean): ClassMethod;
export function objectPattern(properties?: Array<AssignmentProperty | RestProperty>, typeAnnotation?: TypeAnnotation): ObjectPattern;
export function spreadElement(argument?: Expression): SpreadElement;
export function taggedTemplateExpression(tag?: Expression, quasi?: TemplateLiteral): TaggedTemplateExpression;
export function templateElement(value?: {cooked?: string; raw?: string;}, tail?: boolean): TemplateElement;
export function templateElement(value?: { cooked?: string; raw?: string; }, tail?: boolean): TemplateElement;
export function templateLiteral(quasis?: TemplateElement[], expressions?: Expression[]): TemplateLiteral;
export function yieldExpression(argument?: Expression, delegate?: boolean): YieldExpression;
export function anyTypeAnnotation(): AnyTypeAnnotation;
@@ -1044,367 +1091,367 @@ export function exportNamespaceSpecifier(exported?: Identifier): ExportNamespace
export function restProperty(argument?: LVal): RestProperty;
export function spreadProperty(argument?: Expression): SpreadProperty;
export function isArrayExpression(node: Object, opts?: Object): node is ArrayExpression;
export function isAssignmentExpression(node: Object, opts?: Object): node is AssignmentExpression;
export function isBinaryExpression(node: Object, opts?: Object): node is BinaryExpression;
export function isDirective(node: Object, opts?: Object): node is Directive;
export function isDirectiveLiteral(node: Object, opts?: Object): node is DirectiveLiteral;
export function isBlockStatement(node: Object, opts?: Object): node is BlockStatement;
export function isBreakStatement(node: Object, opts?: Object): node is BreakStatement;
export function isCallExpression(node: Object, opts?: Object): node is CallExpression;
export function isCatchClause(node: Object, opts?: Object): node is CatchClause;
export function isConditionalExpression(node: Object, opts?: Object): node is ConditionalExpression;
export function isContinueStatement(node: Object, opts?: Object): node is ContinueStatement;
export function isDebuggerStatement(node: Object, opts?: Object): node is DebuggerStatement;
export function isDoWhileStatement(node: Object, opts?: Object): node is DoWhileStatement;
export function isEmptyStatement(node: Object, opts?: Object): node is EmptyStatement;
export function isExpressionStatement(node: Object, opts?: Object): node is ExpressionStatement;
export function isFile(node: Object, opts?: Object): node is File;
export function isForInStatement(node: Object, opts?: Object): node is ForInStatement;
export function isForStatement(node: Object, opts?: Object): node is ForStatement;
export function isFunctionDeclaration(node: Object, opts?: Object): node is FunctionDeclaration;
export function isFunctionExpression(node: Object, opts?: Object): node is FunctionExpression;
export function isIdentifier(node: Object, opts?: Object): node is Identifier;
export function isIfStatement(node: Object, opts?: Object): node is IfStatement;
export function isLabeledStatement(node: Object, opts?: Object): node is LabeledStatement;
export function isStringLiteral(node: Object, opts?: Object): node is StringLiteral;
export function isNumericLiteral(node: Object, opts?: Object): node is NumericLiteral;
export function isNullLiteral(node: Object, opts?: Object): node is NullLiteral;
export function isBooleanLiteral(node: Object, opts?: Object): node is BooleanLiteral;
export function isRegExpLiteral(node: Object, opts?: Object): node is RegExpLiteral;
export function isLogicalExpression(node: Object, opts?: Object): node is LogicalExpression;
export function isMemberExpression(node: Object, opts?: Object): node is MemberExpression;
export function isNewExpression(node: Object, opts?: Object): node is NewExpression;
export function isProgram(node: Object, opts?: Object): node is Program;
export function isObjectExpression(node: Object, opts?: Object): node is ObjectExpression;
export function isObjectMethod(node: Object, opts?: Object): node is ObjectMethod;
export function isObjectProperty(node: Object, opts?: Object): node is ObjectProperty;
export function isRestElement(node: Object, opts?: Object): node is RestElement;
export function isReturnStatement(node: Object, opts?: Object): node is ReturnStatement;
export function isSequenceExpression(node: Object, opts?: Object): node is SequenceExpression;
export function isSwitchCase(node: Object, opts?: Object): node is SwitchCase;
export function isSwitchStatement(node: Object, opts?: Object): node is SwitchStatement;
export function isThisExpression(node: Object, opts?: Object): node is ThisExpression;
export function isThrowStatement(node: Object, opts?: Object): node is ThrowStatement;
export function isTryStatement(node: Object, opts?: Object): node is TryStatement;
export function isUnaryExpression(node: Object, opts?: Object): node is UnaryExpression;
export function isUpdateExpression(node: Object, opts?: Object): node is UpdateExpression;
export function isVariableDeclaration(node: Object, opts?: Object): node is VariableDeclaration;
export function isVariableDeclarator(node: Object, opts?: Object): node is VariableDeclarator;
export function isWhileStatement(node: Object, opts?: Object): node is WhileStatement;
export function isWithStatement(node: Object, opts?: Object): node is WithStatement;
export function isAssignmentPattern(node: Object, opts?: Object): node is AssignmentPattern;
export function isArrayPattern(node: Object, opts?: Object): node is ArrayPattern;
export function isArrowFunctionExpression(node: Object, opts?: Object): node is ArrowFunctionExpression;
export function isClassBody(node: Object, opts?: Object): node is ClassBody;
export function isClassDeclaration(node: Object, opts?: Object): node is ClassDeclaration;
export function isClassExpression(node: Object, opts?: Object): node is ClassExpression;
export function isExportAllDeclaration(node: Object, opts?: Object): node is ExportAllDeclaration;
export function isExportDefaultDeclaration(node: Object, opts?: Object): node is ExportDefaultDeclaration;
export function isExportNamedDeclaration(node: Object, opts?: Object): node is ExportNamedDeclaration;
export function isExportSpecifier(node: Object, opts?: Object): node is ExportSpecifier;
export function isForOfStatement(node: Object, opts?: Object): node is ForOfStatement;
export function isImportDeclaration(node: Object, opts?: Object): node is ImportDeclaration;
export function isImportDefaultSpecifier(node: Object, opts?: Object): node is ImportDefaultSpecifier;
export function isImportNamespaceSpecifier(node: Object, opts?: Object): node is ImportNamespaceSpecifier;
export function isImportSpecifier(node: Object, opts?: Object): node is ImportSpecifier;
export function isMetaProperty(node: Object, opts?: Object): node is MetaProperty;
export function isClassMethod(node: Object, opts?: Object): node is ClassMethod;
export function isObjectPattern(node: Object, opts?: Object): node is ObjectPattern;
export function isSpreadElement(node: Object, opts?: Object): node is SpreadElement;
export function isSuper(node: Object, opts?: Object): node is Super;
export function isTaggedTemplateExpression(node: Object, opts?: Object): node is TaggedTemplateExpression;
export function isTemplateElement(node: Object, opts?: Object): node is TemplateElement;
export function isTemplateLiteral(node: Object, opts?: Object): node is TemplateLiteral;
export function isYieldExpression(node: Object, opts?: Object): node is YieldExpression;
export function isAnyTypeAnnotation(node: Object, opts?: Object): node is AnyTypeAnnotation;
export function isArrayTypeAnnotation(node: Object, opts?: Object): node is ArrayTypeAnnotation;
export function isBooleanTypeAnnotation(node: Object, opts?: Object): node is BooleanTypeAnnotation;
export function isBooleanLiteralTypeAnnotation(node: Object, opts?: Object): node is BooleanLiteralTypeAnnotation;
export function isNullLiteralTypeAnnotation(node: Object, opts?: Object): node is NullLiteralTypeAnnotation;
export function isClassImplements(node: Object, opts?: Object): node is ClassImplements;
export function isClassProperty(node: Object, opts?: Object): node is ClassProperty;
export function isDeclareClass(node: Object, opts?: Object): node is DeclareClass;
export function isDeclareFunction(node: Object, opts?: Object): node is DeclareFunction;
export function isDeclareInterface(node: Object, opts?: Object): node is DeclareInterface;
export function isDeclareModule(node: Object, opts?: Object): node is DeclareModule;
export function isDeclareTypeAlias(node: Object, opts?: Object): node is DeclareTypeAlias;
export function isDeclareVariable(node: Object, opts?: Object): node is DeclareVariable;
export function isExistentialTypeParam(node: Object, opts?: Object): node is ExistentialTypeParam;
export function isFunctionTypeAnnotation(node: Object, opts?: Object): node is FunctionTypeAnnotation;
export function isFunctionTypeParam(node: Object, opts?: Object): node is FunctionTypeParam;
export function isGenericTypeAnnotation(node: Object, opts?: Object): node is GenericTypeAnnotation;
export function isInterfaceExtends(node: Object, opts?: Object): node is InterfaceExtends;
export function isInterfaceDeclaration(node: Object, opts?: Object): node is InterfaceDeclaration;
export function isIntersectionTypeAnnotation(node: Object, opts?: Object): node is IntersectionTypeAnnotation;
export function isMixedTypeAnnotation(node: Object, opts?: Object): node is MixedTypeAnnotation;
export function isNullableTypeAnnotation(node: Object, opts?: Object): node is NullableTypeAnnotation;
export function isNumericLiteralTypeAnnotation(node: Object, opts?: Object): node is NumericLiteralTypeAnnotation;
export function isNumberTypeAnnotation(node: Object, opts?: Object): node is NumberTypeAnnotation;
export function isStringLiteralTypeAnnotation(node: Object, opts?: Object): node is StringLiteralTypeAnnotation;
export function isStringTypeAnnotation(node: Object, opts?: Object): node is StringTypeAnnotation;
export function isThisTypeAnnotation(node: Object, opts?: Object): node is ThisTypeAnnotation;
export function isTupleTypeAnnotation(node: Object, opts?: Object): node is TupleTypeAnnotation;
export function isTypeofTypeAnnotation(node: Object, opts?: Object): node is TypeofTypeAnnotation;
export function isTypeAlias(node: Object, opts?: Object): node is TypeAlias;
export function isTypeAnnotation(node: Object, opts?: Object): node is TypeAnnotation;
export function isTypeCastExpression(node: Object, opts?: Object): node is TypeCastExpression;
export function isTypeParameterDeclaration(node: Object, opts?: Object): node is TypeParameterDeclaration;
export function isTypeParameterInstantiation(node: Object, opts?: Object): node is TypeParameterInstantiation;
export function isObjectTypeAnnotation(node: Object, opts?: Object): node is ObjectTypeAnnotation;
export function isObjectTypeCallProperty(node: Object, opts?: Object): node is ObjectTypeCallProperty;
export function isObjectTypeIndexer(node: Object, opts?: Object): node is ObjectTypeIndexer;
export function isObjectTypeProperty(node: Object, opts?: Object): node is ObjectTypeProperty;
export function isQualifiedTypeIdentifier(node: Object, opts?: Object): node is QualifiedTypeIdentifier;
export function isUnionTypeAnnotation(node: Object, opts?: Object): node is UnionTypeAnnotation;
export function isVoidTypeAnnotation(node: Object, opts?: Object): node is VoidTypeAnnotation;
export function isJSXAttribute(node: Object, opts?: Object): node is JSXAttribute;
export function isJSXClosingElement(node: Object, opts?: Object): node is JSXClosingElement;
export function isJSXElement(node: Object, opts?: Object): node is JSXElement;
export function isJSXEmptyExpression(node: Object, opts?: Object): node is JSXEmptyExpression;
export function isJSXExpressionContainer(node: Object, opts?: Object): node is JSXExpressionContainer;
export function isJSXIdentifier(node: Object, opts?: Object): node is JSXIdentifier;
export function isJSXMemberExpression(node: Object, opts?: Object): node is JSXMemberExpression;
export function isJSXNamespacedName(node: Object, opts?: Object): node is JSXNamespacedName;
export function isJSXOpeningElement(node: Object, opts?: Object): node is JSXOpeningElement;
export function isJSXSpreadAttribute(node: Object, opts?: Object): node is JSXSpreadAttribute;
export function isJSXText(node: Object, opts?: Object): node is JSXText;
export function isNoop(node: Object, opts?: Object): node is Noop;
export function isParenthesizedExpression(node: Object, opts?: Object): node is ParenthesizedExpression;
export function isAwaitExpression(node: Object, opts?: Object): node is AwaitExpression;
export function isBindExpression(node: Object, opts?: Object): node is BindExpression;
export function isDecorator(node: Object, opts?: Object): node is Decorator;
export function isDoExpression(node: Object, opts?: Object): node is DoExpression;
export function isExportDefaultSpecifier(node: Object, opts?: Object): node is ExportDefaultSpecifier;
export function isExportNamespaceSpecifier(node: Object, opts?: Object): node is ExportNamespaceSpecifier;
export function isRestProperty(node: Object, opts?: Object): node is RestProperty;
export function isSpreadProperty(node: Object, opts?: Object): node is SpreadProperty;
export function isExpression(node: Object, opts?: Object): node is Expression;
export function isBinary(node: Object, opts?: Object): node is Binary;
export function isScopable(node: Object, opts?: Object): node is Scopable;
export function isBlockParent(node: Object, opts?: Object): node is BlockParent;
export function isBlock(node: Object, opts?: Object): node is Block;
export function isStatement(node: Object, opts?: Object): node is Statement;
export function isTerminatorless(node: Object, opts?: Object): node is Terminatorless;
export function isCompletionStatement(node: Object, opts?: Object): node is CompletionStatement;
export function isConditional(node: Object, opts?: Object): node is Conditional;
export function isLoop(node: Object, opts?: Object): node is Loop;
export function isWhile(node: Object, opts?: Object): node is While;
export function isExpressionWrapper(node: Object, opts?: Object): node is ExpressionWrapper;
export function isFor(node: Object, opts?: Object): node is For;
export function isForXStatement(node: Object, opts?: Object): node is ForXStatement;
export function isFunction(node: Object, opts?: Object): node is Function;
export function isFunctionParent(node: Object, opts?: Object): node is FunctionParent;
export function isPureish(node: Object, opts?: Object): node is Pureish;
export function isDeclaration(node: Object, opts?: Object): node is Declaration;
export function isLVal(node: Object, opts?: Object): node is LVal;
export function isLiteral(node: Object, opts?: Object): node is Literal;
export function isImmutable(node: Object, opts?: Object): node is Immutable;
export function isUserWhitespacable(node: Object, opts?: Object): node is UserWhitespacable;
export function isMethod(node: Object, opts?: Object): node is Method;
export function isObjectMember(node: Object, opts?: Object): node is ObjectMember;
export function isProperty(node: Object, opts?: Object): node is Property;
export function isUnaryLike(node: Object, opts?: Object): node is UnaryLike;
export function isPattern(node: Object, opts?: Object): node is Pattern;
export function isClass(node: Object, opts?: Object): node is Class;
export function isModuleDeclaration(node: Object, opts?: Object): node is ModuleDeclaration;
export function isExportDeclaration(node: Object, opts?: Object): node is ExportDeclaration;
export function isModuleSpecifier(node: Object, opts?: Object): node is ModuleSpecifier;
export function isFlow(node: Object, opts?: Object): node is Flow;
export function isFlowBaseAnnotation(node: Object, opts?: Object): node is FlowBaseAnnotation;
export function isFlowDeclaration(node: Object, opts?: Object): node is FlowDeclaration;
export function isJSX(node: Object, opts?: Object): node is JSX;
export function isNumberLiteral(node: Object, opts?: Object): node is NumericLiteral;
export function isRegexLiteral(node: Object, opts?: Object): node is RegExpLiteral;
export function isArrayExpression(node: object, opts?: object): node is ArrayExpression;
export function isAssignmentExpression(node: object, opts?: object): node is AssignmentExpression;
export function isBinaryExpression(node: object, opts?: object): node is BinaryExpression;
export function isDirective(node: object, opts?: object): node is Directive;
export function isDirectiveLiteral(node: object, opts?: object): node is DirectiveLiteral;
export function isBlockStatement(node: object, opts?: object): node is BlockStatement;
export function isBreakStatement(node: object, opts?: object): node is BreakStatement;
export function isCallExpression(node: object, opts?: object): node is CallExpression;
export function isCatchClause(node: object, opts?: object): node is CatchClause;
export function isConditionalExpression(node: object, opts?: object): node is ConditionalExpression;
export function isContinueStatement(node: object, opts?: object): node is ContinueStatement;
export function isDebuggerStatement(node: object, opts?: object): node is DebuggerStatement;
export function isDoWhileStatement(node: object, opts?: object): node is DoWhileStatement;
export function isEmptyStatement(node: object, opts?: object): node is EmptyStatement;
export function isExpressionStatement(node: object, opts?: object): node is ExpressionStatement;
export function isFile(node: object, opts?: object): node is File;
export function isForInStatement(node: object, opts?: object): node is ForInStatement;
export function isForStatement(node: object, opts?: object): node is ForStatement;
export function isFunctionDeclaration(node: object, opts?: object): node is FunctionDeclaration;
export function isFunctionExpression(node: object, opts?: object): node is FunctionExpression;
export function isIdentifier(node: object, opts?: object): node is Identifier;
export function isIfStatement(node: object, opts?: object): node is IfStatement;
export function isLabeledStatement(node: object, opts?: object): node is LabeledStatement;
export function isStringLiteral(node: object, opts?: object): node is StringLiteral;
export function isNumericLiteral(node: object, opts?: object): node is NumericLiteral;
export function isNullLiteral(node: object, opts?: object): node is NullLiteral;
export function isBooleanLiteral(node: object, opts?: object): node is BooleanLiteral;
export function isRegExpLiteral(node: object, opts?: object): node is RegExpLiteral;
export function isLogicalExpression(node: object, opts?: object): node is LogicalExpression;
export function isMemberExpression(node: object, opts?: object): node is MemberExpression;
export function isNewExpression(node: object, opts?: object): node is NewExpression;
export function isProgram(node: object, opts?: object): node is Program;
export function isObjectExpression(node: object, opts?: object): node is ObjectExpression;
export function isObjectMethod(node: object, opts?: object): node is ObjectMethod;
export function isObjectProperty(node: object, opts?: object): node is ObjectProperty;
export function isRestElement(node: object, opts?: object): node is RestElement;
export function isReturnStatement(node: object, opts?: object): node is ReturnStatement;
export function isSequenceExpression(node: object, opts?: object): node is SequenceExpression;
export function isSwitchCase(node: object, opts?: object): node is SwitchCase;
export function isSwitchStatement(node: object, opts?: object): node is SwitchStatement;
export function isThisExpression(node: object, opts?: object): node is ThisExpression;
export function isThrowStatement(node: object, opts?: object): node is ThrowStatement;
export function isTryStatement(node: object, opts?: object): node is TryStatement;
export function isUnaryExpression(node: object, opts?: object): node is UnaryExpression;
export function isUpdateExpression(node: object, opts?: object): node is UpdateExpression;
export function isVariableDeclaration(node: object, opts?: object): node is VariableDeclaration;
export function isVariableDeclarator(node: object, opts?: object): node is VariableDeclarator;
export function isWhileStatement(node: object, opts?: object): node is WhileStatement;
export function isWithStatement(node: object, opts?: object): node is WithStatement;
export function isAssignmentPattern(node: object, opts?: object): node is AssignmentPattern;
export function isArrayPattern(node: object, opts?: object): node is ArrayPattern;
export function isArrowFunctionExpression(node: object, opts?: object): node is ArrowFunctionExpression;
export function isClassBody(node: object, opts?: object): node is ClassBody;
export function isClassDeclaration(node: object, opts?: object): node is ClassDeclaration;
export function isClassExpression(node: object, opts?: object): node is ClassExpression;
export function isExportAllDeclaration(node: object, opts?: object): node is ExportAllDeclaration;
export function isExportDefaultDeclaration(node: object, opts?: object): node is ExportDefaultDeclaration;
export function isExportNamedDeclaration(node: object, opts?: object): node is ExportNamedDeclaration;
export function isExportSpecifier(node: object, opts?: object): node is ExportSpecifier;
export function isForOfStatement(node: object, opts?: object): node is ForOfStatement;
export function isImportDeclaration(node: object, opts?: object): node is ImportDeclaration;
export function isImportDefaultSpecifier(node: object, opts?: object): node is ImportDefaultSpecifier;
export function isImportNamespaceSpecifier(node: object, opts?: object): node is ImportNamespaceSpecifier;
export function isImportSpecifier(node: object, opts?: object): node is ImportSpecifier;
export function isMetaProperty(node: object, opts?: object): node is MetaProperty;
export function isClassMethod(node: object, opts?: object): node is ClassMethod;
export function isObjectPattern(node: object, opts?: object): node is ObjectPattern;
export function isSpreadElement(node: object, opts?: object): node is SpreadElement;
export function isSuper(node: object, opts?: object): node is Super;
export function isTaggedTemplateExpression(node: object, opts?: object): node is TaggedTemplateExpression;
export function isTemplateElement(node: object, opts?: object): node is TemplateElement;
export function isTemplateLiteral(node: object, opts?: object): node is TemplateLiteral;
export function isYieldExpression(node: object, opts?: object): node is YieldExpression;
export function isAnyTypeAnnotation(node: object, opts?: object): node is AnyTypeAnnotation;
export function isArrayTypeAnnotation(node: object, opts?: object): node is ArrayTypeAnnotation;
export function isBooleanTypeAnnotation(node: object, opts?: object): node is BooleanTypeAnnotation;
export function isBooleanLiteralTypeAnnotation(node: object, opts?: object): node is BooleanLiteralTypeAnnotation;
export function isNullLiteralTypeAnnotation(node: object, opts?: object): node is NullLiteralTypeAnnotation;
export function isClassImplements(node: object, opts?: object): node is ClassImplements;
export function isClassProperty(node: object, opts?: object): node is ClassProperty;
export function isDeclareClass(node: object, opts?: object): node is DeclareClass;
export function isDeclareFunction(node: object, opts?: object): node is DeclareFunction;
export function isDeclareInterface(node: object, opts?: object): node is DeclareInterface;
export function isDeclareModule(node: object, opts?: object): node is DeclareModule;
export function isDeclareTypeAlias(node: object, opts?: object): node is DeclareTypeAlias;
export function isDeclareVariable(node: object, opts?: object): node is DeclareVariable;
export function isExistentialTypeParam(node: object, opts?: object): node is ExistentialTypeParam;
export function isFunctionTypeAnnotation(node: object, opts?: object): node is FunctionTypeAnnotation;
export function isFunctionTypeParam(node: object, opts?: object): node is FunctionTypeParam;
export function isGenericTypeAnnotation(node: object, opts?: object): node is GenericTypeAnnotation;
export function isInterfaceExtends(node: object, opts?: object): node is InterfaceExtends;
export function isInterfaceDeclaration(node: object, opts?: object): node is InterfaceDeclaration;
export function isIntersectionTypeAnnotation(node: object, opts?: object): node is IntersectionTypeAnnotation;
export function isMixedTypeAnnotation(node: object, opts?: object): node is MixedTypeAnnotation;
export function isNullableTypeAnnotation(node: object, opts?: object): node is NullableTypeAnnotation;
export function isNumericLiteralTypeAnnotation(node: object, opts?: object): node is NumericLiteralTypeAnnotation;
export function isNumberTypeAnnotation(node: object, opts?: object): node is NumberTypeAnnotation;
export function isStringLiteralTypeAnnotation(node: object, opts?: object): node is StringLiteralTypeAnnotation;
export function isStringTypeAnnotation(node: object, opts?: object): node is StringTypeAnnotation;
export function isThisTypeAnnotation(node: object, opts?: object): node is ThisTypeAnnotation;
export function isTupleTypeAnnotation(node: object, opts?: object): node is TupleTypeAnnotation;
export function isTypeofTypeAnnotation(node: object, opts?: object): node is TypeofTypeAnnotation;
export function isTypeAlias(node: object, opts?: object): node is TypeAlias;
export function isTypeAnnotation(node: object, opts?: object): node is TypeAnnotation;
export function isTypeCastExpression(node: object, opts?: object): node is TypeCastExpression;
export function isTypeParameterDeclaration(node: object, opts?: object): node is TypeParameterDeclaration;
export function isTypeParameterInstantiation(node: object, opts?: object): node is TypeParameterInstantiation;
export function isObjectTypeAnnotation(node: object, opts?: object): node is ObjectTypeAnnotation;
export function isObjectTypeCallProperty(node: object, opts?: object): node is ObjectTypeCallProperty;
export function isObjectTypeIndexer(node: object, opts?: object): node is ObjectTypeIndexer;
export function isObjectTypeProperty(node: object, opts?: object): node is ObjectTypeProperty;
export function isQualifiedTypeIdentifier(node: object, opts?: object): node is QualifiedTypeIdentifier;
export function isUnionTypeAnnotation(node: object, opts?: object): node is UnionTypeAnnotation;
export function isVoidTypeAnnotation(node: object, opts?: object): node is VoidTypeAnnotation;
export function isJSXAttribute(node: object, opts?: object): node is JSXAttribute;
export function isJSXClosingElement(node: object, opts?: object): node is JSXClosingElement;
export function isJSXElement(node: object, opts?: object): node is JSXElement;
export function isJSXEmptyExpression(node: object, opts?: object): node is JSXEmptyExpression;
export function isJSXExpressionContainer(node: object, opts?: object): node is JSXExpressionContainer;
export function isJSXIdentifier(node: object, opts?: object): node is JSXIdentifier;
export function isJSXMemberExpression(node: object, opts?: object): node is JSXMemberExpression;
export function isJSXNamespacedName(node: object, opts?: object): node is JSXNamespacedName;
export function isJSXOpeningElement(node: object, opts?: object): node is JSXOpeningElement;
export function isJSXSpreadAttribute(node: object, opts?: object): node is JSXSpreadAttribute;
export function isJSXText(node: object, opts?: object): node is JSXText;
export function isNoop(node: object, opts?: object): node is Noop;
export function isParenthesizedExpression(node: object, opts?: object): node is ParenthesizedExpression;
export function isAwaitExpression(node: object, opts?: object): node is AwaitExpression;
export function isBindExpression(node: object, opts?: object): node is BindExpression;
export function isDecorator(node: object, opts?: object): node is Decorator;
export function isDoExpression(node: object, opts?: object): node is DoExpression;
export function isExportDefaultSpecifier(node: object, opts?: object): node is ExportDefaultSpecifier;
export function isExportNamespaceSpecifier(node: object, opts?: object): node is ExportNamespaceSpecifier;
export function isRestProperty(node: object, opts?: object): node is RestProperty;
export function isSpreadProperty(node: object, opts?: object): node is SpreadProperty;
export function isExpression(node: object, opts?: object): node is Expression;
export function isBinary(node: object, opts?: object): node is Binary;
export function isScopable(node: object, opts?: object): node is Scopable;
export function isBlockParent(node: object, opts?: object): node is BlockParent;
export function isBlock(node: object, opts?: object): node is Block;
export function isStatement(node: object, opts?: object): node is Statement;
export function isTerminatorless(node: object, opts?: object): node is Terminatorless;
export function isCompletionStatement(node: object, opts?: object): node is CompletionStatement;
export function isConditional(node: object, opts?: object): node is Conditional;
export function isLoop(node: object, opts?: object): node is Loop;
export function isWhile(node: object, opts?: object): node is While;
export function isExpressionWrapper(node: object, opts?: object): node is ExpressionWrapper;
export function isFor(node: object, opts?: object): node is For;
export function isForXStatement(node: object, opts?: object): node is ForXStatement;
// tslint:disable-next-line ban-types
export function isFunction(node: object, opts?: object): node is Function;
export function isFunctionParent(node: object, opts?: object): node is FunctionParent;
export function isPureish(node: object, opts?: object): node is Pureish;
export function isDeclaration(node: object, opts?: object): node is Declaration;
export function isLVal(node: object, opts?: object): node is LVal;
export function isLiteral(node: object, opts?: object): node is Literal;
export function isImmutable(node: object, opts?: object): node is Immutable;
export function isUserWhitespacable(node: object, opts?: object): node is UserWhitespacable;
export function isMethod(node: object, opts?: object): node is Method;
export function isObjectMember(node: object, opts?: object): node is ObjectMember;
export function isProperty(node: object, opts?: object): node is Property;
export function isUnaryLike(node: object, opts?: object): node is UnaryLike;
export function isPattern(node: object, opts?: object): node is Pattern;
export function isClass(node: object, opts?: object): node is Class;
export function isModuleDeclaration(node: object, opts?: object): node is ModuleDeclaration;
export function isExportDeclaration(node: object, opts?: object): node is ExportDeclaration;
export function isModuleSpecifier(node: object, opts?: object): node is ModuleSpecifier;
export function isFlow(node: object, opts?: object): node is Flow;
export function isFlowBaseAnnotation(node: object, opts?: object): node is FlowBaseAnnotation;
export function isFlowDeclaration(node: object, opts?: object): node is FlowDeclaration;
export function isJSX(node: object, opts?: object): node is JSX;
export function isNumberLiteral(node: object, opts?: object): node is NumericLiteral;
export function isRegexLiteral(node: object, opts?: object): node is RegExpLiteral;
export function isReferencedIdentifier(node: Object, opts?: Object): boolean;
export function isReferencedMemberExpression(node: Object, opts?: Object): boolean;
export function isBindingIdentifier(node: Object, opts?: Object): boolean;
export function isScope(node: Object, opts?: Object): boolean;
export function isReferenced(node: Object, opts?: Object): boolean;
export function isBlockScoped(node: Object, opts?: Object): boolean;
export function isVar(node: Object, opts?: Object): boolean;
export function isUser(node: Object, opts?: Object): boolean;
export function isGenerated(node: Object, opts?: Object): boolean;
export function isPure(node: Object, opts?: Object): boolean;
export function isReferencedIdentifier(node: object, opts?: object): boolean;
export function isReferencedMemberExpression(node: object, opts?: object): boolean;
export function isBindingIdentifier(node: object, opts?: object): boolean;
export function isScope(node: object, opts?: object): boolean;
export function isReferenced(node: object, opts?: object): boolean;
export function isBlockScoped(node: object, opts?: object): boolean;
export function isVar(node: object, opts?: object): boolean;
export function isUser(node: object, opts?: object): boolean;
export function isGenerated(node: object, opts?: object): boolean;
export function isPure(node: object, opts?: object): boolean;
// React specific
interface ReactHelpers {
export interface ReactHelpers {
isCompatTag(tagName?: string): boolean;
buildChildren(node: Object): Object[];
buildChildren(node: object): Node[];
}
export const react: ReactHelpers;
export function assertArrayExpression(node: Object, opts?: Object): void;
export function assertAssignmentExpression(node: Object, opts?: Object): void;
export function assertBinaryExpression(node: Object, opts?: Object): void;
export function assertDirective(node: Object, opts?: Object): void;
export function assertDirectiveLiteral(node: Object, opts?: Object): void;
export function assertBlockStatement(node: Object, opts?: Object): void;
export function assertBreakStatement(node: Object, opts?: Object): void;
export function assertCallExpression(node: Object, opts?: Object): void;
export function assertCatchClause(node: Object, opts?: Object): void;
export function assertConditionalExpression(node: Object, opts?: Object): void;
export function assertContinueStatement(node: Object, opts?: Object): void;
export function assertDebuggerStatement(node: Object, opts?: Object): void;
export function assertDoWhileStatement(node: Object, opts?: Object): void;
export function assertEmptyStatement(node: Object, opts?: Object): void;
export function assertExpressionStatement(node: Object, opts?: Object): void;
export function assertFile(node: Object, opts?: Object): void;
export function assertForInStatement(node: Object, opts?: Object): void;
export function assertForStatement(node: Object, opts?: Object): void;
export function assertFunctionDeclaration(node: Object, opts?: Object): void;
export function assertFunctionExpression(node: Object, opts?: Object): void;
export function assertIdentifier(node: Object, opts?: Object): void;
export function assertIfStatement(node: Object, opts?: Object): void;
export function assertLabeledStatement(node: Object, opts?: Object): void;
export function assertStringLiteral(node: Object, opts?: Object): void;
export function assertNumericLiteral(node: Object, opts?: Object): void;
export function assertNullLiteral(node: Object, opts?: Object): void;
export function assertBooleanLiteral(node: Object, opts?: Object): void;
export function assertRegExpLiteral(node: Object, opts?: Object): void;
export function assertLogicalExpression(node: Object, opts?: Object): void;
export function assertMemberExpression(node: Object, opts?: Object): void;
export function assertNewExpression(node: Object, opts?: Object): void;
export function assertProgram(node: Object, opts?: Object): void;
export function assertObjectExpression(node: Object, opts?: Object): void;
export function assertObjectMethod(node: Object, opts?: Object): void;
export function assertObjectProperty(node: Object, opts?: Object): void;
export function assertRestElement(node: Object, opts?: Object): void;
export function assertReturnStatement(node: Object, opts?: Object): void;
export function assertSequenceExpression(node: Object, opts?: Object): void;
export function assertSwitchCase(node: Object, opts?: Object): void;
export function assertSwitchStatement(node: Object, opts?: Object): void;
export function assertThisExpression(node: Object, opts?: Object): void;
export function assertThrowStatement(node: Object, opts?: Object): void;
export function assertTryStatement(node: Object, opts?: Object): void;
export function assertUnaryExpression(node: Object, opts?: Object): void;
export function assertUpdateExpression(node: Object, opts?: Object): void;
export function assertVariableDeclaration(node: Object, opts?: Object): void;
export function assertVariableDeclarator(node: Object, opts?: Object): void;
export function assertWhileStatement(node: Object, opts?: Object): void;
export function assertWithStatement(node: Object, opts?: Object): void;
export function assertAssignmentPattern(node: Object, opts?: Object): void;
export function assertArrayPattern(node: Object, opts?: Object): void;
export function assertArrowFunctionExpression(node: Object, opts?: Object): void;
export function assertClassBody(node: Object, opts?: Object): void;
export function assertClassDeclaration(node: Object, opts?: Object): void;
export function assertClassExpression(node: Object, opts?: Object): void;
export function assertExportAllDeclaration(node: Object, opts?: Object): void;
export function assertExportDefaultDeclaration(node: Object, opts?: Object): void;
export function assertExportNamedDeclaration(node: Object, opts?: Object): void;
export function assertExportSpecifier(node: Object, opts?: Object): void;
export function assertForOfStatement(node: Object, opts?: Object): void;
export function assertImportDeclaration(node: Object, opts?: Object): void;
export function assertImportDefaultSpecifier(node: Object, opts?: Object): void;
export function assertImportNamespaceSpecifier(node: Object, opts?: Object): void;
export function assertImportSpecifier(node: Object, opts?: Object): void;
export function assertMetaProperty(node: Object, opts?: Object): void;
export function assertClassMethod(node: Object, opts?: Object): void;
export function assertObjectPattern(node: Object, opts?: Object): void;
export function assertSpreadElement(node: Object, opts?: Object): void;
export function assertSuper(node: Object, opts?: Object): void;
export function assertTaggedTemplateExpression(node: Object, opts?: Object): void;
export function assertTemplateElement(node: Object, opts?: Object): void;
export function assertTemplateLiteral(node: Object, opts?: Object): void;
export function assertYieldExpression(node: Object, opts?: Object): void;
export function assertAnyTypeAnnotation(node: Object, opts?: Object): void;
export function assertArrayTypeAnnotation(node: Object, opts?: Object): void;
export function assertBooleanTypeAnnotation(node: Object, opts?: Object): void;
export function assertBooleanLiteralTypeAnnotation(node: Object, opts?: Object): void;
export function assertNullLiteralTypeAnnotation(node: Object, opts?: Object): void;
export function assertClassImplements(node: Object, opts?: Object): void;
export function assertClassProperty(node: Object, opts?: Object): void;
export function assertDeclareClass(node: Object, opts?: Object): void;
export function assertDeclareFunction(node: Object, opts?: Object): void;
export function assertDeclareInterface(node: Object, opts?: Object): void;
export function assertDeclareModule(node: Object, opts?: Object): void;
export function assertDeclareTypeAlias(node: Object, opts?: Object): void;
export function assertDeclareVariable(node: Object, opts?: Object): void;
export function assertExistentialTypeParam(node: Object, opts?: Object): void;
export function assertFunctionTypeAnnotation(node: Object, opts?: Object): void;
export function assertFunctionTypeParam(node: Object, opts?: Object): void;
export function assertGenericTypeAnnotation(node: Object, opts?: Object): void;
export function assertInterfaceExtends(node: Object, opts?: Object): void;
export function assertInterfaceDeclaration(node: Object, opts?: Object): void;
export function assertIntersectionTypeAnnotation(node: Object, opts?: Object): void;
export function assertMixedTypeAnnotation(node: Object, opts?: Object): void;
export function assertNullableTypeAnnotation(node: Object, opts?: Object): void;
export function assertNumericLiteralTypeAnnotation(node: Object, opts?: Object): void;
export function assertNumberTypeAnnotation(node: Object, opts?: Object): void;
export function assertStringLiteralTypeAnnotation(node: Object, opts?: Object): void;
export function assertStringTypeAnnotation(node: Object, opts?: Object): void;
export function assertThisTypeAnnotation(node: Object, opts?: Object): void;
export function assertTupleTypeAnnotation(node: Object, opts?: Object): void;
export function assertTypeofTypeAnnotation(node: Object, opts?: Object): void;
export function assertTypeAlias(node: Object, opts?: Object): void;
export function assertTypeAnnotation(node: Object, opts?: Object): void;
export function assertTypeCastExpression(node: Object, opts?: Object): void;
export function assertTypeParameterDeclaration(node: Object, opts?: Object): void;
export function assertTypeParameterInstantiation(node: Object, opts?: Object): void;
export function assertObjectTypeAnnotation(node: Object, opts?: Object): void;
export function assertObjectTypeCallProperty(node: Object, opts?: Object): void;
export function assertObjectTypeIndexer(node: Object, opts?: Object): void;
export function assertObjectTypeProperty(node: Object, opts?: Object): void;
export function assertQualifiedTypeIdentifier(node: Object, opts?: Object): void;
export function assertUnionTypeAnnotation(node: Object, opts?: Object): void;
export function assertVoidTypeAnnotation(node: Object, opts?: Object): void;
export function assertJSXAttribute(node: Object, opts?: Object): void;
export function assertJSXClosingElement(node: Object, opts?: Object): void;
export function assertJSXElement(node: Object, opts?: Object): void;
export function assertJSXEmptyExpression(node: Object, opts?: Object): void;
export function assertJSXExpressionContainer(node: Object, opts?: Object): void;
export function assertJSXIdentifier(node: Object, opts?: Object): void;
export function assertJSXMemberExpression(node: Object, opts?: Object): void;
export function assertJSXNamespacedName(node: Object, opts?: Object): void;
export function assertJSXOpeningElement(node: Object, opts?: Object): void;
export function assertJSXSpreadAttribute(node: Object, opts?: Object): void;
export function assertJSXText(node: Object, opts?: Object): void;
export function assertNoop(node: Object, opts?: Object): void;
export function assertParenthesizedExpression(node: Object, opts?: Object): void;
export function assertAwaitExpression(node: Object, opts?: Object): void;
export function assertBindExpression(node: Object, opts?: Object): void;
export function assertDecorator(node: Object, opts?: Object): void;
export function assertDoExpression(node: Object, opts?: Object): void;
export function assertExportDefaultSpecifier(node: Object, opts?: Object): void;
export function assertExportNamespaceSpecifier(node: Object, opts?: Object): void;
export function assertRestProperty(node: Object, opts?: Object): void;
export function assertSpreadProperty(node: Object, opts?: Object): void;
export function assertExpression(node: Object, opts?: Object): void;
export function assertBinary(node: Object, opts?: Object): void;
export function assertScopable(node: Object, opts?: Object): void;
export function assertBlockParent(node: Object, opts?: Object): void;
export function assertBlock(node: Object, opts?: Object): void;
export function assertStatement(node: Object, opts?: Object): void;
export function assertTerminatorless(node: Object, opts?: Object): void;
export function assertCompletionStatement(node: Object, opts?: Object): void;
export function assertConditional(node: Object, opts?: Object): void;
export function assertLoop(node: Object, opts?: Object): void;
export function assertWhile(node: Object, opts?: Object): void;
export function assertExpressionWrapper(node: Object, opts?: Object): void;
export function assertFor(node: Object, opts?: Object): void;
export function assertForXStatement(node: Object, opts?: Object): void;
export function assertFunction(node: Object, opts?: Object): void;
export function assertFunctionParent(node: Object, opts?: Object): void;
export function assertPureish(node: Object, opts?: Object): void;
export function assertDeclaration(node: Object, opts?: Object): void;
export function assertLVal(node: Object, opts?: Object): void;
export function assertLiteral(node: Object, opts?: Object): void;
export function assertImmutable(node: Object, opts?: Object): void;
export function assertUserWhitespacable(node: Object, opts?: Object): void;
export function assertMethod(node: Object, opts?: Object): void;
export function assertObjectMember(node: Object, opts?: Object): void;
export function assertProperty(node: Object, opts?: Object): void;
export function assertUnaryLike(node: Object, opts?: Object): void;
export function assertPattern(node: Object, opts?: Object): void;
export function assertClass(node: Object, opts?: Object): void;
export function assertModuleDeclaration(node: Object, opts?: Object): void;
export function assertExportDeclaration(node: Object, opts?: Object): void;
export function assertModuleSpecifier(node: Object, opts?: Object): void;
export function assertFlow(node: Object, opts?: Object): void;
export function assertFlowBaseAnnotation(node: Object, opts?: Object): void;
export function assertFlowDeclaration(node: Object, opts?: Object): void;
export function assertJSX(node: Object, opts?: Object): void;
export function assertNumberLiteral(node: Object, opts?: Object): void;
export function assertRegexLiteral(node: Object, opts?: Object): void;
export function assertArrayExpression(node: object, opts?: object): void;
export function assertAssignmentExpression(node: object, opts?: object): void;
export function assertBinaryExpression(node: object, opts?: object): void;
export function assertDirective(node: object, opts?: object): void;
export function assertDirectiveLiteral(node: object, opts?: object): void;
export function assertBlockStatement(node: object, opts?: object): void;
export function assertBreakStatement(node: object, opts?: object): void;
export function assertCallExpression(node: object, opts?: object): void;
export function assertCatchClause(node: object, opts?: object): void;
export function assertConditionalExpression(node: object, opts?: object): void;
export function assertContinueStatement(node: object, opts?: object): void;
export function assertDebuggerStatement(node: object, opts?: object): void;
export function assertDoWhileStatement(node: object, opts?: object): void;
export function assertEmptyStatement(node: object, opts?: object): void;
export function assertExpressionStatement(node: object, opts?: object): void;
export function assertFile(node: object, opts?: object): void;
export function assertForInStatement(node: object, opts?: object): void;
export function assertForStatement(node: object, opts?: object): void;
export function assertFunctionDeclaration(node: object, opts?: object): void;
export function assertFunctionExpression(node: object, opts?: object): void;
export function assertIdentifier(node: object, opts?: object): void;
export function assertIfStatement(node: object, opts?: object): void;
export function assertLabeledStatement(node: object, opts?: object): void;
export function assertStringLiteral(node: object, opts?: object): void;
export function assertNumericLiteral(node: object, opts?: object): void;
export function assertNullLiteral(node: object, opts?: object): void;
export function assertBooleanLiteral(node: object, opts?: object): void;
export function assertRegExpLiteral(node: object, opts?: object): void;
export function assertLogicalExpression(node: object, opts?: object): void;
export function assertMemberExpression(node: object, opts?: object): void;
export function assertNewExpression(node: object, opts?: object): void;
export function assertProgram(node: object, opts?: object): void;
export function assertObjectExpression(node: object, opts?: object): void;
export function assertObjectMethod(node: object, opts?: object): void;
export function assertObjectProperty(node: object, opts?: object): void;
export function assertRestElement(node: object, opts?: object): void;
export function assertReturnStatement(node: object, opts?: object): void;
export function assertSequenceExpression(node: object, opts?: object): void;
export function assertSwitchCase(node: object, opts?: object): void;
export function assertSwitchStatement(node: object, opts?: object): void;
export function assertThisExpression(node: object, opts?: object): void;
export function assertThrowStatement(node: object, opts?: object): void;
export function assertTryStatement(node: object, opts?: object): void;
export function assertUnaryExpression(node: object, opts?: object): void;
export function assertUpdateExpression(node: object, opts?: object): void;
export function assertVariableDeclaration(node: object, opts?: object): void;
export function assertVariableDeclarator(node: object, opts?: object): void;
export function assertWhileStatement(node: object, opts?: object): void;
export function assertWithStatement(node: object, opts?: object): void;
export function assertAssignmentPattern(node: object, opts?: object): void;
export function assertArrayPattern(node: object, opts?: object): void;
export function assertArrowFunctionExpression(node: object, opts?: object): void;
export function assertClassBody(node: object, opts?: object): void;
export function assertClassDeclaration(node: object, opts?: object): void;
export function assertClassExpression(node: object, opts?: object): void;
export function assertExportAllDeclaration(node: object, opts?: object): void;
export function assertExportDefaultDeclaration(node: object, opts?: object): void;
export function assertExportNamedDeclaration(node: object, opts?: object): void;
export function assertExportSpecifier(node: object, opts?: object): void;
export function assertForOfStatement(node: object, opts?: object): void;
export function assertImportDeclaration(node: object, opts?: object): void;
export function assertImportDefaultSpecifier(node: object, opts?: object): void;
export function assertImportNamespaceSpecifier(node: object, opts?: object): void;
export function assertImportSpecifier(node: object, opts?: object): void;
export function assertMetaProperty(node: object, opts?: object): void;
export function assertClassMethod(node: object, opts?: object): void;
export function assertObjectPattern(node: object, opts?: object): void;
export function assertSpreadElement(node: object, opts?: object): void;
export function assertSuper(node: object, opts?: object): void;
export function assertTaggedTemplateExpression(node: object, opts?: object): void;
export function assertTemplateElement(node: object, opts?: object): void;
export function assertTemplateLiteral(node: object, opts?: object): void;
export function assertYieldExpression(node: object, opts?: object): void;
export function assertAnyTypeAnnotation(node: object, opts?: object): void;
export function assertArrayTypeAnnotation(node: object, opts?: object): void;
export function assertBooleanTypeAnnotation(node: object, opts?: object): void;
export function assertBooleanLiteralTypeAnnotation(node: object, opts?: object): void;
export function assertNullLiteralTypeAnnotation(node: object, opts?: object): void;
export function assertClassImplements(node: object, opts?: object): void;
export function assertClassProperty(node: object, opts?: object): void;
export function assertDeclareClass(node: object, opts?: object): void;
export function assertDeclareFunction(node: object, opts?: object): void;
export function assertDeclareInterface(node: object, opts?: object): void;
export function assertDeclareModule(node: object, opts?: object): void;
export function assertDeclareTypeAlias(node: object, opts?: object): void;
export function assertDeclareVariable(node: object, opts?: object): void;
export function assertExistentialTypeParam(node: object, opts?: object): void;
export function assertFunctionTypeAnnotation(node: object, opts?: object): void;
export function assertFunctionTypeParam(node: object, opts?: object): void;
export function assertGenericTypeAnnotation(node: object, opts?: object): void;
export function assertInterfaceExtends(node: object, opts?: object): void;
export function assertInterfaceDeclaration(node: object, opts?: object): void;
export function assertIntersectionTypeAnnotation(node: object, opts?: object): void;
export function assertMixedTypeAnnotation(node: object, opts?: object): void;
export function assertNullableTypeAnnotation(node: object, opts?: object): void;
export function assertNumericLiteralTypeAnnotation(node: object, opts?: object): void;
export function assertNumberTypeAnnotation(node: object, opts?: object): void;
export function assertStringLiteralTypeAnnotation(node: object, opts?: object): void;
export function assertStringTypeAnnotation(node: object, opts?: object): void;
export function assertThisTypeAnnotation(node: object, opts?: object): void;
export function assertTupleTypeAnnotation(node: object, opts?: object): void;
export function assertTypeofTypeAnnotation(node: object, opts?: object): void;
export function assertTypeAlias(node: object, opts?: object): void;
export function assertTypeAnnotation(node: object, opts?: object): void;
export function assertTypeCastExpression(node: object, opts?: object): void;
export function assertTypeParameterDeclaration(node: object, opts?: object): void;
export function assertTypeParameterInstantiation(node: object, opts?: object): void;
export function assertObjectTypeAnnotation(node: object, opts?: object): void;
export function assertObjectTypeCallProperty(node: object, opts?: object): void;
export function assertObjectTypeIndexer(node: object, opts?: object): void;
export function assertObjectTypeProperty(node: object, opts?: object): void;
export function assertQualifiedTypeIdentifier(node: object, opts?: object): void;
export function assertUnionTypeAnnotation(node: object, opts?: object): void;
export function assertVoidTypeAnnotation(node: object, opts?: object): void;
export function assertJSXAttribute(node: object, opts?: object): void;
export function assertJSXClosingElement(node: object, opts?: object): void;
export function assertJSXElement(node: object, opts?: object): void;
export function assertJSXEmptyExpression(node: object, opts?: object): void;
export function assertJSXExpressionContainer(node: object, opts?: object): void;
export function assertJSXIdentifier(node: object, opts?: object): void;
export function assertJSXMemberExpression(node: object, opts?: object): void;
export function assertJSXNamespacedName(node: object, opts?: object): void;
export function assertJSXOpeningElement(node: object, opts?: object): void;
export function assertJSXSpreadAttribute(node: object, opts?: object): void;
export function assertJSXText(node: object, opts?: object): void;
export function assertNoop(node: object, opts?: object): void;
export function assertParenthesizedExpression(node: object, opts?: object): void;
export function assertAwaitExpression(node: object, opts?: object): void;
export function assertBindExpression(node: object, opts?: object): void;
export function assertDecorator(node: object, opts?: object): void;
export function assertDoExpression(node: object, opts?: object): void;
export function assertExportDefaultSpecifier(node: object, opts?: object): void;
export function assertExportNamespaceSpecifier(node: object, opts?: object): void;
export function assertRestProperty(node: object, opts?: object): void;
export function assertSpreadProperty(node: object, opts?: object): void;
export function assertExpression(node: object, opts?: object): void;
export function assertBinary(node: object, opts?: object): void;
export function assertScopable(node: object, opts?: object): void;
export function assertBlockParent(node: object, opts?: object): void;
export function assertBlock(node: object, opts?: object): void;
export function assertStatement(node: object, opts?: object): void;
export function assertTerminatorless(node: object, opts?: object): void;
export function assertCompletionStatement(node: object, opts?: object): void;
export function assertConditional(node: object, opts?: object): void;
export function assertLoop(node: object, opts?: object): void;
export function assertWhile(node: object, opts?: object): void;
export function assertExpressionWrapper(node: object, opts?: object): void;
export function assertFor(node: object, opts?: object): void;
export function assertForXStatement(node: object, opts?: object): void;
export function assertFunction(node: object, opts?: object): void;
export function assertFunctionParent(node: object, opts?: object): void;
export function assertPureish(node: object, opts?: object): void;
export function assertDeclaration(node: object, opts?: object): void;
export function assertLVal(node: object, opts?: object): void;
export function assertLiteral(node: object, opts?: object): void;
export function assertImmutable(node: object, opts?: object): void;
export function assertUserWhitespacable(node: object, opts?: object): void;
export function assertMethod(node: object, opts?: object): void;
export function assertObjectMember(node: object, opts?: object): void;
export function assertProperty(node: object, opts?: object): void;
export function assertUnaryLike(node: object, opts?: object): void;
export function assertPattern(node: object, opts?: object): void;
export function assertClass(node: object, opts?: object): void;
export function assertModuleDeclaration(node: object, opts?: object): void;
export function assertExportDeclaration(node: object, opts?: object): void;
export function assertModuleSpecifier(node: object, opts?: object): void;
export function assertFlow(node: object, opts?: object): void;
export function assertFlowBaseAnnotation(node: object, opts?: object): void;
export function assertFlowDeclaration(node: object, opts?: object): void;
export function assertJSX(node: object, opts?: object): void;
export function assertNumberLiteral(node: object, opts?: object): void;
export function assertRegexLiteral(node: object, opts?: object): void;
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+2
View File
@@ -1,7 +1,9 @@
// Type definitions for babelify v7.3.0
// Project: https://github.com/babel/babelify
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="node" />
-1
View File
@@ -12,7 +12,6 @@ assert(node.start === 0);
assert(node.end === 38);
assert(node.loc.start > node.loc.end);
babylon.parse(code, {
sourceType: "module", // default: "script"
plugins: ["jsx"] // default: []
+3 -3
View File
@@ -1,9 +1,9 @@
// Type definitions for babylon v6.16.1
// Type definitions for babylon 6.16
// Project: https://github.com/babel/babylon
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="babel-types" />
// TypeScript Version: 2.3
import { File, Expression } from 'babel-types';
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1,4 +1,4 @@
import {IncomingMessage} from 'http';
import { IncomingMessage } from 'http';
import auth = require('basic-auth');
const loginData = auth(undefined! as IncomingMessage);
+45 -9
View File
@@ -1,14 +1,50 @@
/// <reference types="mocha" />
/// <reference types="node" />
import assert = require('assert');
import { BinTree, RBTree } from 'bintrees';
let treeA = new RBTree((a:number, b:number) => a - b);
describe('bintrees', () => {
it('builds a simple tree', () => {
let treeA = new RBTree((a: number, b: number) => a - b);
treeA.insert(5);
treeA.insert(3);
treeA.remove(3);
treeA.insert(5);
treeA.insert(3);
treeA.remove(3);
let treeB = new BinTree((a:string, b:string) => a.length - b.length);
assert.equal(treeA.size, 1);
});
it('builds a tree of strings', () => {
let treeB = new BinTree((a:string, b:string) => a.length - b.length);
treeB.insert('hi');
treeB.insert('there');
treeB.insert('how');
treeB.insert('are'); // ignored
treeB.remove('how');
assert.equal(treeB.size, 2);
assert.equal(treeB.min(), 'hi');
});
it('maintains a tree of objects', () => {
interface C {
id: number
}
let treeC = new BinTree<C>((a: C, b: C) => a.id - b.id);
treeC.insert({ id: 100 });
treeC.insert({ id: 110 });
treeC.insert({ id: 105 });
let ids: number[] = [];
treeC.each((val: C) => {
ids.push(val.id);
});
assert.deepEqual(ids, [100, 105, 110]);
});
});
treeB.insert('hi');
treeB.insert('there');
treeB.insert('how');
treeB.insert('are');
+6 -6
View File
@@ -5,8 +5,8 @@
declare module 'bintrees' {
type Callback = <T>(item: T) => void;
type Comparator = <T>(a: T, b: T) => number;
type Callback<T> = (item: T) => void;
type Comparator<T> = (a: T, b: T) => number;
class Iterator<T> {
constructor(tree: TreeBase<T>);
@@ -37,14 +37,14 @@ declare module 'bintrees' {
iterator(): Iterator<T>;
each(cb: Callback): void;
each(cb: Callback<T>): void;
reach(cb: Callback): void;
reach(cb: Callback<T>): void;
}
export class RBTree<T> extends TreeBase<T> {
constructor(comparator: Comparator);
constructor(comparator: Comparator<T>);
insert(item: T): boolean;
@@ -52,7 +52,7 @@ declare module 'bintrees' {
}
export class BinTree<T> extends TreeBase<T> {
constructor(comparator: Comparator);
constructor(comparator: Comparator<T>);
insert(item: T): boolean;
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -5,7 +5,7 @@
///<reference types="node"/>
import {EventEmitter} from 'events';
import { EventEmitter } from 'events';
import * as stream from "stream";
import * as child_process from "child_process";
+2 -1
View File
@@ -7,7 +7,8 @@
/// <reference types="jquery" />
interface JQuery {
bootstrapTable(options?: any): JQuery;
bootstrapTable(options?: any): JQuery;
bootstrapTable(method: string, parameter?: any): JQuery;
}
declare var bootstrapTable: JQueryStatic;
+1 -1
View File
@@ -5,7 +5,7 @@
/// <reference types="node" />
import {IncomingMessage as Request, ServerResponse as Response} from 'http';
import { IncomingMessage as Request, ServerResponse as Response } from 'http';
declare namespace BwipJs {
export function loadFont(fontName:string, sizeMulti: number, fontFile: string): void;
+27
View File
@@ -0,0 +1,27 @@
import Catbox = require("catbox");
const Memory: Catbox.EnginePrototypeOrObject = {
start(callback: Catbox.CallBackNoResult) {},
stop() {},
get() {},
set() {},
drop() {},
isReady(): boolean { return true; },
validateSegmentName(segment: string): null { return null; },
};
const client = new Catbox.Client(Memory, { partition: 'cache' });
const cache = new Catbox.Policy({
expiresIn: 5000,
}, client, 'cache');
cache.set('foo', 'bar', 5000, () => {});
cache.get('foo', () => {});
cache.drop('foo', () => {});
cache.isReady();
cache.stats();
+91 -28
View File
@@ -6,12 +6,8 @@
import * as Boom from 'boom';
export interface CallBackNoResult {
(err?: Boom.BoomError): void;
}
export interface CallBackWithResult<T> {
(err: Boom.BoomError | null | undefined, result: T): void;
}
export type CallBackNoResult = (err?: Boom.BoomError) => void;
export type CallBackWithResult<T> = (err: Boom.BoomError | null | undefined, result: T) => void;
/**
* Client
@@ -20,14 +16,44 @@ export interface CallBackWithResult<T> {
* * function - a prototype function with the signature function(options). catbox will call new func(options).
* * object - a pre instantiated client implementation object. Does not support passing options.
* options - the strategy configuration object. Each strategy defines its own configuration options with the following common options:
* * partition - the partition name used to isolate the cached results across multiple clients. The partition name is used as the MongoDB database name, the Riak bucket, or as a key prefix in Redis and Memcached. To share the cache across multiple clients, use the same partition name.
* * partition - the partition name used to isolate the cached results across multiple clients. The partition name is used as the MongoDB database name,
* the Riak bucket, or as a key prefix in Redis and Memcached. To share the cache across multiple clients, use the same partition name.
* @see {@link https://github.com/hapijs/catbox#client}
*/
export interface Client extends ClientApi {
new(engine: EnginePrototypeOrObject, options: ClientOptions): Client;
export class Client implements ClientApi {
constructor(engine: EnginePrototypeOrObject, options: ClientOptions);
/** start(callback) - creates a connection to the cache server. Must be called before any other method is available. The callback signature is function(err). */
start(callback: CallBackNoResult): void;
/** stop() - terminates the connection to the cache server. */
stop(): void;
/**
* get(key, callback) - retrieve an item from the cache engine if found where:
* * key - a cache key object (see [ICacheKey]).
* * callback - a function with the signature function(err, cached). If the item is not found, both err and cached are null. If found, the cached object is returned
*/
get(key: CacheKey, callback: CallBackWithResult<null | CachedObject>): CacheItem;
/**
* set(key, value, ttl, callback) - store an item in the cache for a specified length of time, where:
* * key - a cache key object (see [ICacheKey]).
* * value - the string or object value to be stored.
* * ttl - a time-to-live value in milliseconds after which the item is automatically removed from the cache (or is marked invalid).
* * callback - a function with the signature function(err).
*/
set(key: CacheKey, value: CacheItem, ttl: number, callback: CallBackNoResult): void;
/**
* drop(key, callback) - remove an item from cache where:
* * key - a cache key object (see [ICacheKey]).
* * callback - a function with the signature function(err).
*/
drop(key: CacheKey, callback: CallBackNoResult): void;
/** isReady() - returns true if cache engine determines itself as ready, false if it is not ready. */
isReady(): boolean;
/** validateSegmentName(segment) - returns null if the segment name is valid (see below), otherwise should return an instance of Error with an appropriate message. */
validateSegmentName(segment: string): null | Boom.BoomError;
}
type EnginePrototypeOrObject = EnginePrototype | ClientApi;
export type EnginePrototypeOrObject = EnginePrototype | ClientApi;
/**
* A prototype CatBox engine function
@@ -50,7 +76,7 @@ export interface ClientApi {
* get(key, callback) - retrieve an item from the cache engine if found where:
* * key - a cache key object (see [ICacheKey]).
* * callback - a function with the signature function(err, cached). If the item is not found, both err and cached are null. If found, the cached object is returned
*/
*/
get(key: CacheKey, callback: CallBackWithResult<null | CachedObject>): CacheItem;
/**
* set(key, value, ttl, callback) - store an item in the cache for a specified length of time, where:
@@ -92,21 +118,52 @@ export interface CachedObject {
ttl: number;
}
type CacheItem = any;
export type CacheItem = any;
export interface ClientOptions {
partition: string;
}
/**
* The Policy object provides a convenient cache interface by setting a global policy which is automatically applied to every storage action. The object is constructed using new Policy(options, [cache, segment]) where:
* The Policy object provides a convenient cache interface by setting a global policy which is automatically applied to every storage action.
* The object is constructed using new Policy(options, [cache, segment]) where:
* * options - an object with the IPolicyOptions structure
* * cache - a Client instance (which has already been started).
* * segment - required when cache is provided. The segment name used to isolate cached items within the cache partition.
* @see {@link https://github.com/hapijs/catbox#policy}
*/
export interface Policy extends PolicyAPI {
new(options: PolicyOptions, cache: Client, segment: string): Policy;
export class Policy implements PolicyAPI {
constructor(options: PolicyOptions, cache: Client, segment: string);
/**
* get(id, callback) - retrieve an item from the cache. If the item is not found and the generateFunc method was provided,
* a new value is generated, stored in the cache, and returned. Multiple concurrent requests are queued and processed once. The method arguments are:
* * id - the unique item identifier (within the policy segment). Can be a string or an object with the required 'id' key.
* * callback - the return function.
*/
get(id: string | {id: string}, callback: PolicyGetCallback): CacheItem;
/**
* set(id, value, ttl, callback) - store an item in the cache where:
* * id - the unique item identifier (within the policy segment).
* * value - the string or object value to be stored.
* * ttl - a time-to-live override value in milliseconds after which the item is automatically removed from the cache (or is marked invalid).
* This should be set to 0 in order to use the caching rules configured when creating the Policy object.
* * callback - a function with the signature function(err).
*/
set(id: string | {id: string}, value: CacheItem, ttl: number | null, callback: CallBackNoResult): void;
/**
* drop(id, callback) - remove the item from cache where:
* * id - the unique item identifier (within the policy segment).
* * callback - a function with the signature function(err).
*/
drop(id: string | {id: string}, callback: CallBackNoResult): void;
/** ttl(created) - given a created timestamp in milliseconds, returns the time-to-live left based on the configured rules. */
ttl(created: number): number;
/** rules(options) - changes the policy rules after construction (note that items already stored will not be affected) */
rules(options: PolicyOptions): void;
/** isReady() - returns true if cache engine determines itself as ready, false if it is not ready or if there is no cache engine set. */
isReady(): boolean;
/** stats - an object with cache statistics */
stats(): CacheStatisticsObject;
}
/**
@@ -116,7 +173,8 @@ export interface Policy extends PolicyAPI {
*/
export interface PolicyAPI {
/**
* get(id, callback) - retrieve an item from the cache. If the item is not found and the generateFunc method was provided, a new value is generated, stored in the cache, and returned. Multiple concurrent requests are queued and processed once. The method arguments are:
* get(id, callback) - retrieve an item from the cache. If the item is not found and the generateFunc method was provided,
* a new value is generated, stored in the cache, and returned. Multiple concurrent requests are queued and processed once. The method arguments are:
* * id - the unique item identifier (within the policy segment). Can be a string or an object with the required 'id' key.
* * callback - the return function.
*/
@@ -125,7 +183,8 @@ export interface PolicyAPI {
* set(id, value, ttl, callback) - store an item in the cache where:
* * id - the unique item identifier (within the policy segment).
* * value - the string or object value to be stored.
* * ttl - a time-to-live override value in milliseconds after which the item is automatically removed from the cache (or is marked invalid). This should be set to 0 in order to use the caching rules configured when creating the Policy object.
* * ttl - a time-to-live override value in milliseconds after which the item is automatically removed from the cache (or is marked invalid).
* This should be set to 0 in order to use the caching rules configured when creating the Policy object.
* * callback - a function with the signature function(err).
*/
set(id: string | {id: string}, value: CacheItem, ttl: number | null, callback: CallBackNoResult): void;
@@ -152,9 +211,7 @@ export interface PolicyAPI {
* @param cached - null if a valid item was not found in the cache, or IPolicyGetCallbackCachedOptions
* @param report - an object with logging information about the generation operation
*/
export interface PolicyGetCallback{
(err: null | Boom.BoomError, value: CacheItem, cached: PolicyGetCallbackCachedOptions, report: PolicyGetCallbackReportLog): void;
}
export type PolicyGetCallback = (err: null | Boom.BoomError, value: CacheItem, cached: PolicyGetCallbackCachedOptions, report: PolicyGetCallbackReportLog) => void;
export interface PolicyGetCallbackCachedOptions {
/** item - the cached value. */
@@ -178,14 +235,19 @@ export interface PolicyOptions {
/** generateFunc - a function used to generate a new cache item if one is not found in the cache when calling get(). The method's signature is function(id, next) where: */
generateFunc?: GenerateFunc;
/**
* staleIn - number of milliseconds to mark an item stored in cache as stale and attempt to regenerate it when generateFunc is provided. Must be less than expiresIn. Alternatively function that returns staleIn value in milliseconds. The function signature is function(stored, ttl) where:
* staleIn - number of milliseconds to mark an item stored in cache as stale and attempt to regenerate it when generateFunc is provided.
* Must be less than expiresIn. Alternatively function that returns staleIn value in milliseconds. The function signature is function(stored, ttl) where:
* * stored - the timestamp when the item was stored in the cache (in milliseconds).
* * ttl - the remaining time-to-live (not the original value used when storing the object).
*/
*/
staleIn?: number | ((stored: number, ttl: number) => number);
/** staleTimeout - number of milliseconds to wait before returning a stale value while generateFunc is generating a fresh value. */
staleTimeout?: number;
/** generateTimeout - number of milliseconds to wait before returning a timeout error when the generateFunc function takes too long to return a value. When the value is eventually returned, it is stored in the cache for future requests. Required if generateFunc is present. Set to false to disable timeouts which may cause all get() requests to get stuck forever. */
/**
* generateTimeout - number of milliseconds to wait before returning a timeout error when the generateFunc function takes too long to return a value.
* When the value is eventually returned, it is stored in the cache for future requests. Required if generateFunc is present.
* Set to false to disable timeouts which may cause all get() requests to get stuck forever.
*/
generateTimeout?: number | false;
/** dropOnError - if true, an error or timeout in the generateFunc causes the stale value to be evicted from the cache. Defaults to true. */
dropOnError?: boolean;
@@ -193,7 +255,10 @@ export interface PolicyOptions {
generateOnReadError?: boolean;
/** generateIgnoreWriteError - if false, an upstream cache write error will be passed back with the generated value when calling the get() method. Defaults to true. */
generateIgnoreWriteError?: boolean;
/** pendingGenerateTimeout - number of milliseconds while generateFunc call is in progress for a given id, before a subsequent generateFunc call is allowed. Defaults to 0, no blocking of concurrent generateFunc calls beyond staleTimeout. */
/**
* pendingGenerateTimeout - number of milliseconds while generateFunc call is in progress for a given id, before a subsequent generateFunc call is allowed.
* Defaults to 0, no blocking of concurrent generateFunc calls beyond staleTimeout.
*/
pendingGenerateTimeout?: number;
}
@@ -208,9 +273,7 @@ export interface PolicyOptions {
* * ttl - the cache ttl value in milliseconds. Set to 0 to skip storing in the cache. Defaults to the cache global policy.
* @see {@link https://github.com/hapijs/catbox#policy}
*/
export interface GenerateFunc {
(id: string, next: ((err: null | Boom.BoomError, value: CacheItem, ttl?: number) => void)): void;
}
export type GenerateFunc = (id: string, next: ((err: null | Boom.BoomError, value: CacheItem, ttl?: number) => void)) => void;
/**
* An object with logging information about the generation operation containing the following keys (as relevant):
@@ -242,6 +305,6 @@ export interface CacheStatisticsObject {
stales: number;
/** generates - number of calls to the generate function. */
generates: number;
/** errors - cache operations errors. TODO check this*/
/** errors - cache operations errors. TODO check this */
errors: number;
}
+3 -2
View File
@@ -16,6 +16,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts"
"index.d.ts",
"catbox-tests.ts"
]
}
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+2
View File
@@ -159,6 +159,8 @@ declare namespace Chart {
elements?: ChartElementsOptions;
scales?: ChartScales;
cutoutPercentage?: number;
circumference?: number;
rotation?: number;
}
interface ChartFontOptions {
+1 -1
View File
@@ -6,7 +6,7 @@
/// <reference types="node" />
import * as fs from 'fs';
import {EventEmitter} from 'events';
import { EventEmitter } from 'events';
/**
* The object's keys are all the directories (using absolute paths unless the `cwd` option was
@@ -0,0 +1,8 @@
import * as clear from 'clear-require';
clear('my-module'); // clear specific module from require cache
clear.all(); // clear all of the require cache
clear.match(new RegExp('^.*$')); // clear all modules which match the RegExp
clear.match(/^.*$/); // similar to above but using /regex/ notation
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for clear-require 2.0
// Project: https://github.com/sindresorhus/clear-module
// Definitions by: dan-j <https://github.com/dan-j>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface ClearRequire {
(moduleId: string): boolean;
all(): void;
match(regex: RegExp): void;
}
declare const clear: ClearRequire;
export = clear;
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"clear-require-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
@@ -1,4 +1,4 @@
import {compile} from 'closure-compiler';
import { compile } from 'closure-compiler';
compile('some.source()', {'check-only': null},
(err: Error, stdout: string, stderr: string): void => {
@@ -0,0 +1,6 @@
import * as color from 'color-convert';
import * as conv from 'color-convert/conversions';
let hsv: [number, number, number] = color.rgb.hsv([1, 2, 3]);
let hsv_raw: [number, number, number] = color.rgb.hsv.raw([1, 2, 3]);
let aaa: [number, number, number] = color.rgb.hsv([1, 2, 3]);
+136
View File
@@ -0,0 +1,136 @@
import * as cssKeywords from 'color-name';
export type RGB = [number, number, number];
export type HSL = [number, number, number];
export type HSV = [number, number, number];
export type HWB = [number, number, number];
export type CMYK = [number, number, number, number];
export type XYZ = [number, number, number];
export type LAB = [number, number, number];
export type LCH = [number, number, number];
export type HEX = string;
export type KEYWORD = keyof typeof cssKeywords;
export type ANSI16 = number;
export type ANSI256 = number;
export type HCG = [number, number, number];
export type APPLE = [number, number, number];
export type GRAY = [number];
export namespace rgb {
const channels: 3;
const labels: 'rgb';
function hsl(rgb: RGB): HSL;
function hsv(rgb: RGB): HSV;
function hwb(rgb: RGB): HWB;
function cmyk(rgb: RGB): CMYK;
function keyword(rgb: RGB): KEYWORD;
function xyz(rgb: RGB): XYZ;
function lab(rgb: RGB): LAB;
function ansi16(rgb: RGB): ANSI16;
function ansi256(rgb: RGB): ANSI256;
function hex(rgb: RGB): HEX;
function hcg(rgb: RGB): HCG;
function apple(rgb: RGB): APPLE;
function gray(rgb: RGB): GRAY;
}
export namespace hsl {
const channels: 3;
const labels: 'hsl';
function rgb(hsl: HSL): RGB;
function hsv(hsl: HSL): HSV;
function hcg(hsl: HSL): HCG;
}
export namespace hsv {
const channels: 3;
const labels: 'hsv';
function rgb(hsv: HSV): RGB;
function hsl(hsv: HSV): HSL;
function ansi16(hsv: HSV): ANSI16;
function hcg(hsv: HSV): HCG;
}
export namespace hwb {
const channels: 3;
const labels: 'hwb';
function rgb(hwb: HWB): RGB;
function hcg(hwb: HWB): HCG;
}
export namespace cmyk {
const channels: 4;
const labels: 'cmyk';
function rgb(cmyk: CMYK): RGB;
}
export namespace xyz {
const channels: 3;
const labels: 'xyz';
function rgb(xyz: XYZ): RGB;
function lab(xyz: XYZ): LAB;
}
export namespace lab {
const channels: 3;
const labels: 'lab';
function xyz(lab: LAB): XYZ;
function lch(lab: LAB): LCH;
}
export namespace lch {
const channels: 3;
const labels: 'lch';
function lab(lch: LCH): LAB;
}
export namespace hex {
const channels: 1;
const labels: ['hex'];
function rgb(hex: HEX): RGB;
}
export namespace keyword {
const channels: 1;
const labels: ['keyword'];
function rgb(keyword: KEYWORD): RGB;
}
export namespace ansi16 {
const channels: 1;
const labels: ['ansi16'];
function rgb(ansi16: ANSI16): RGB;
}
export namespace ansi256 {
const channels: 1;
const labels: ['ansi256'];
function rgb(ansi256: ANSI256): RGB;
}
export namespace hcg {
const channels: 3;
const labels: ['h', 'c', 'g'];
function rgb(hcg: HCG): RGB;
function hsv(hcg: HCG): HSV;
function hsl(hcg: HCG): HSL;
function hwb(hcg: HCG): HWB;
}
export namespace apple {
const channels: 3;
const labels: ['r16', 'g16', 'b16'];
function rgb(apple: APPLE): RGB;
}
export namespace gray {
const channels: 1;
const labels: ['gray'];
function rgb(gray: GRAY): RGB;
function hsl(gray: GRAY): HSL;
function hsv(gray: GRAY): HSV;
function hwb(gray: GRAY): HWB;
function cmyk(gray: GRAY): CMYK;
function lab(gray: GRAY): LAB;
function hex(gray: GRAY): HEX;
}
+98
View File
@@ -0,0 +1,98 @@
// Type definitions for color-convert 1.9
// Project: https://github.com/qix-/color-convert#readme
// Definitions by: Junyoung Clare Jang <https://github.com/Airlun>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import conversions = require('./conversions');
import route = require('./route');
export const rgb: typeof conversions.rgb & route.rgb & {
[F in keyof route.rgb]: {
raw: route.rgb[F]
}
};
export const hsl: typeof conversions.hsl & route.hsl & {
[F in keyof route.hsl]: {
raw: route.hsl[F]
}
};
export const hsv: typeof conversions.hsv & route.hsv & {
[F in keyof route.hsv]: {
raw: route.hsv[F]
}
};
export const hwb: typeof conversions.hwb & route.hwb & {
[F in keyof route.hwb]: {
raw: route.hwb[F]
}
};
export const cmyk: typeof conversions.cmyk & route.cmyk & {
[F in keyof route.cmyk]: {
raw: route.cmyk[F]
}
};
export const xyz: typeof conversions.xyz & route.xyz & {
[F in keyof route.xyz]: {
raw: route.xyz[F]
}
};
export const lab: typeof conversions.lab & route.lab & {
[F in keyof route.lab]: {
raw: route.lab[F]
}
};
export const lch: typeof conversions.lch & route.lch & {
[F in keyof route.lch]: {
raw: route.lch[F]
}
};
export const hex: typeof conversions.hex & route.hex & {
[F in keyof route.hex]: {
raw: route.hex[F]
}
};
export const keyword: typeof conversions.keyword & route.keyword & {
[F in keyof route.keyword]: {
raw: route.keyword[F]
}
};
export const ansi16: typeof conversions.ansi16 & route.ansi16 & {
[F in keyof route.ansi16]: {
raw: route.ansi16[F]
}
};
export const ansi256: typeof conversions.ansi256 & route.ansi256 & {
[F in keyof route.ansi256]: {
raw: route.ansi256[F]
}
};
export const hcg: typeof conversions.hcg & route.hcg & {
[F in keyof route.hcg]: {
raw: route.hcg[F]
}
};
export const apple: typeof conversions.apple & route.apple & {
[F in keyof route.apple]: {
raw: route.apple[F]
}
};
export const gray: typeof conversions.gray & route.gray & {
[F in keyof route.gray]: {
raw: route.gray[F]
}
};
+262
View File
@@ -0,0 +1,262 @@
import conversions = require('./conversions');
declare namespace route {
interface rgb {
hsl(from: conversions.RGB): conversions.HSL;
hsv(from: conversions.RGB): conversions.HSV;
hwb(from: conversions.RGB): conversions.HWB;
cmyk(from: conversions.RGB): conversions.CMYK;
xyz(from: conversions.RGB): conversions.XYZ;
lab(from: conversions.RGB): conversions.LAB;
lch(from: conversions.RGB): conversions.LCH;
hex(from: conversions.RGB): conversions.HEX;
keyword(from: conversions.RGB): conversions.KEYWORD;
ansi16(from: conversions.RGB): conversions.ANSI16;
ansi256(from: conversions.RGB): conversions.ANSI256;
hcg(from: conversions.RGB): conversions.HCG;
apple(from: conversions.RGB): conversions.APPLE;
gray(from: conversions.RGB): conversions.GRAY;
}
interface hsl {
rgb(from: conversions.HSL): conversions.RGB;
hsv(from: conversions.HSL): conversions.HSV;
hwb(from: conversions.HSL): conversions.HWB;
cmyk(from: conversions.HSL): conversions.CMYK;
xyz(from: conversions.HSL): conversions.XYZ;
lab(from: conversions.HSL): conversions.LAB;
lch(from: conversions.HSL): conversions.LCH;
hex(from: conversions.HSL): conversions.HEX;
keyword(from: conversions.HSL): conversions.KEYWORD;
ansi16(from: conversions.HSL): conversions.ANSI16;
ansi256(from: conversions.HSL): conversions.ANSI256;
hcg(from: conversions.HSL): conversions.HCG;
apple(from: conversions.HSL): conversions.APPLE;
gray(from: conversions.HSL): conversions.GRAY;
}
interface hsv {
rgb(from: conversions.HSV): conversions.RGB;
hsl(from: conversions.HSV): conversions.HSL;
hwb(from: conversions.HSV): conversions.HWB;
cmyk(from: conversions.HSV): conversions.CMYK;
xyz(from: conversions.HSV): conversions.XYZ;
lab(from: conversions.HSV): conversions.LAB;
lch(from: conversions.HSV): conversions.LCH;
hex(from: conversions.HSV): conversions.HEX;
keyword(from: conversions.HSV): conversions.KEYWORD;
ansi16(from: conversions.HSV): conversions.ANSI16;
ansi256(from: conversions.HSV): conversions.ANSI256;
hcg(from: conversions.HSV): conversions.HCG;
apple(from: conversions.HSV): conversions.APPLE;
gray(from: conversions.HSV): conversions.GRAY;
}
interface hwb {
rgb(from: conversions.HWB): conversions.RGB;
hsl(from: conversions.HWB): conversions.HSL;
hsv(from: conversions.HWB): conversions.HSV;
cmyk(from: conversions.HWB): conversions.CMYK;
xyz(from: conversions.HWB): conversions.XYZ;
lab(from: conversions.HWB): conversions.LAB;
lch(from: conversions.HWB): conversions.LCH;
hex(from: conversions.HWB): conversions.HEX;
keyword(from: conversions.HWB): conversions.KEYWORD;
ansi16(from: conversions.HWB): conversions.ANSI16;
ansi256(from: conversions.HWB): conversions.ANSI256;
hcg(from: conversions.HWB): conversions.HCG;
apple(from: conversions.HWB): conversions.APPLE;
gray(from: conversions.HWB): conversions.GRAY;
}
interface cmyk {
rgb(from: conversions.CMYK): conversions.RGB;
hsl(from: conversions.CMYK): conversions.HSL;
hsv(from: conversions.CMYK): conversions.HSV;
hwb(from: conversions.CMYK): conversions.HWB;
xyz(from: conversions.CMYK): conversions.XYZ;
lab(from: conversions.CMYK): conversions.LAB;
lch(from: conversions.CMYK): conversions.LCH;
hex(from: conversions.CMYK): conversions.HEX;
keyword(from: conversions.CMYK): conversions.KEYWORD;
ansi16(from: conversions.CMYK): conversions.ANSI16;
ansi256(from: conversions.CMYK): conversions.ANSI256;
hcg(from: conversions.CMYK): conversions.HCG;
apple(from: conversions.CMYK): conversions.APPLE;
gray(from: conversions.CMYK): conversions.GRAY;
}
interface xyz {
rgb(from: conversions.XYZ): conversions.RGB;
hsl(from: conversions.XYZ): conversions.HSL;
hsv(from: conversions.XYZ): conversions.HSV;
hwb(from: conversions.XYZ): conversions.HWB;
cmyk(from: conversions.XYZ): conversions.CMYK;
lab(from: conversions.XYZ): conversions.LAB;
lch(from: conversions.XYZ): conversions.LCH;
hex(from: conversions.XYZ): conversions.HEX;
keyword(from: conversions.XYZ): conversions.KEYWORD;
ansi16(from: conversions.XYZ): conversions.ANSI16;
ansi256(from: conversions.XYZ): conversions.ANSI256;
hcg(from: conversions.XYZ): conversions.HCG;
apple(from: conversions.XYZ): conversions.APPLE;
gray(from: conversions.XYZ): conversions.GRAY;
}
interface lab {
rgb(from: conversions.LAB): conversions.RGB;
hsl(from: conversions.LAB): conversions.HSL;
hsv(from: conversions.LAB): conversions.HSV;
hwb(from: conversions.LAB): conversions.HWB;
cmyk(from: conversions.LAB): conversions.CMYK;
xyz(from: conversions.LAB): conversions.XYZ;
lch(from: conversions.LAB): conversions.LCH;
hex(from: conversions.LAB): conversions.HEX;
keyword(from: conversions.LAB): conversions.KEYWORD;
ansi16(from: conversions.LAB): conversions.ANSI16;
ansi256(from: conversions.LAB): conversions.ANSI256;
hcg(from: conversions.LAB): conversions.HCG;
apple(from: conversions.LAB): conversions.APPLE;
gray(from: conversions.LAB): conversions.GRAY;
}
interface lch {
rgb(from: conversions.LCH): conversions.RGB;
hsl(from: conversions.LCH): conversions.HSL;
hsv(from: conversions.LCH): conversions.HSV;
hwb(from: conversions.LCH): conversions.HWB;
cmyk(from: conversions.LCH): conversions.CMYK;
xyz(from: conversions.LCH): conversions.XYZ;
lab(from: conversions.LCH): conversions.LAB;
hex(from: conversions.LCH): conversions.HEX;
keyword(from: conversions.LCH): conversions.KEYWORD;
ansi16(from: conversions.LCH): conversions.ANSI16;
ansi256(from: conversions.LCH): conversions.ANSI256;
hcg(from: conversions.LCH): conversions.HCG;
apple(from: conversions.LCH): conversions.APPLE;
gray(from: conversions.LCH): conversions.GRAY;
}
interface hex {
rgb(from: conversions.HEX): conversions.RGB;
hsl(from: conversions.HEX): conversions.HSL;
hsv(from: conversions.HEX): conversions.HSV;
hwb(from: conversions.HEX): conversions.HWB;
cmyk(from: conversions.HEX): conversions.CMYK;
xyz(from: conversions.HEX): conversions.XYZ;
lab(from: conversions.HEX): conversions.LAB;
lch(from: conversions.HEX): conversions.LCH;
keyword(from: conversions.HEX): conversions.KEYWORD;
ansi16(from: conversions.HEX): conversions.ANSI16;
ansi256(from: conversions.HEX): conversions.ANSI256;
hcg(from: conversions.HEX): conversions.HCG;
apple(from: conversions.HEX): conversions.APPLE;
gray(from: conversions.HEX): conversions.GRAY;
}
interface keyword {
rgb(from: conversions.KEYWORD): conversions.RGB;
hsl(from: conversions.KEYWORD): conversions.HSL;
hsv(from: conversions.KEYWORD): conversions.HSV;
hwb(from: conversions.KEYWORD): conversions.HWB;
cmyk(from: conversions.KEYWORD): conversions.CMYK;
xyz(from: conversions.KEYWORD): conversions.XYZ;
lab(from: conversions.KEYWORD): conversions.LAB;
lch(from: conversions.KEYWORD): conversions.LCH;
hex(from: conversions.KEYWORD): conversions.HEX;
ansi16(from: conversions.KEYWORD): conversions.ANSI16;
ansi256(from: conversions.KEYWORD): conversions.ANSI256;
hcg(from: conversions.KEYWORD): conversions.HCG;
apple(from: conversions.KEYWORD): conversions.APPLE;
gray(from: conversions.KEYWORD): conversions.GRAY;
}
interface ansi16 {
rgb(from: conversions.ANSI16): conversions.RGB;
hsl(from: conversions.ANSI16): conversions.HSL;
hsv(from: conversions.ANSI16): conversions.HSV;
hwb(from: conversions.ANSI16): conversions.HWB;
cmyk(from: conversions.ANSI16): conversions.CMYK;
xyz(from: conversions.ANSI16): conversions.XYZ;
lab(from: conversions.ANSI16): conversions.LAB;
lch(from: conversions.ANSI16): conversions.LCH;
hex(from: conversions.ANSI16): conversions.HEX;
keyword(from: conversions.ANSI16): conversions.KEYWORD;
ansi256(from: conversions.ANSI16): conversions.ANSI256;
hcg(from: conversions.ANSI16): conversions.HCG;
apple(from: conversions.ANSI16): conversions.APPLE;
gray(from: conversions.ANSI16): conversions.GRAY;
}
interface ansi256 {
rgb(from: conversions.ANSI256): conversions.RGB;
hsl(from: conversions.ANSI256): conversions.HSL;
hsv(from: conversions.ANSI256): conversions.HSV;
hwb(from: conversions.ANSI256): conversions.HWB;
cmyk(from: conversions.ANSI256): conversions.CMYK;
xyz(from: conversions.ANSI256): conversions.XYZ;
lab(from: conversions.ANSI256): conversions.LAB;
lch(from: conversions.ANSI256): conversions.LCH;
hex(from: conversions.ANSI256): conversions.HEX;
keyword(from: conversions.ANSI256): conversions.KEYWORD;
ansi16(from: conversions.ANSI256): conversions.ANSI16;
hcg(from: conversions.ANSI256): conversions.HCG;
apple(from: conversions.ANSI256): conversions.APPLE;
gray(from: conversions.ANSI256): conversions.GRAY;
}
interface hcg {
rgb(from: conversions.HCG): conversions.RGB;
hsl(from: conversions.HCG): conversions.HSL;
hsv(from: conversions.HCG): conversions.HSV;
hwb(from: conversions.HCG): conversions.HWB;
cmyk(from: conversions.HCG): conversions.CMYK;
xyz(from: conversions.HCG): conversions.XYZ;
lab(from: conversions.HCG): conversions.LAB;
lch(from: conversions.HCG): conversions.LCH;
hex(from: conversions.HCG): conversions.HEX;
keyword(from: conversions.HCG): conversions.KEYWORD;
ansi16(from: conversions.HCG): conversions.ANSI16;
ansi256(from: conversions.HCG): conversions.ANSI256;
apple(from: conversions.HCG): conversions.APPLE;
gray(from: conversions.HCG): conversions.GRAY;
}
interface apple {
rgb(from: conversions.APPLE): conversions.RGB;
hsl(from: conversions.APPLE): conversions.HSL;
hsv(from: conversions.APPLE): conversions.HSV;
hwb(from: conversions.APPLE): conversions.HWB;
cmyk(from: conversions.APPLE): conversions.CMYK;
xyz(from: conversions.APPLE): conversions.XYZ;
lab(from: conversions.APPLE): conversions.LAB;
lch(from: conversions.APPLE): conversions.LCH;
hex(from: conversions.APPLE): conversions.HEX;
keyword(from: conversions.APPLE): conversions.KEYWORD;
ansi16(from: conversions.APPLE): conversions.ANSI16;
ansi256(from: conversions.APPLE): conversions.ANSI256;
hcg(from: conversions.APPLE): conversions.HCG;
gray(from: conversions.APPLE): conversions.GRAY;
}
interface gray {
rgb(from: conversions.GRAY): conversions.RGB;
hsl(from: conversions.GRAY): conversions.HSL;
hsv(from: conversions.GRAY): conversions.HSV;
hwb(from: conversions.GRAY): conversions.HWB;
cmyk(from: conversions.GRAY): conversions.CMYK;
xyz(from: conversions.GRAY): conversions.XYZ;
lab(from: conversions.GRAY): conversions.LAB;
lch(from: conversions.GRAY): conversions.LCH;
hex(from: conversions.GRAY): conversions.HEX;
keyword(from: conversions.GRAY): conversions.KEYWORD;
ansi16(from: conversions.GRAY): conversions.ANSI16;
ansi256(from: conversions.GRAY): conversions.ANSI256;
hcg(from: conversions.GRAY): conversions.HCG;
apple(from: conversions.GRAY): conversions.APPLE;
}
}
declare function route(fromModel: 'rgb'): route.rgb;
declare function route(fromModel: 'hsl'): route.hsl;
declare function route(fromModel: 'hsv'): route.hsv;
declare function route(fromModel: 'hwb'): route.hwb;
declare function route(fromModel: 'cmyk'): route.cmyk;
declare function route(fromModel: 'xyz'): route.xyz;
declare function route(fromModel: 'lab'): route.lab;
declare function route(fromModel: 'lch'): route.lch;
declare function route(fromModel: 'hex'): route.hex;
declare function route(fromModel: 'keyword'): route.keyword;
declare function route(fromModel: 'ansi16'): route.ansi16;
declare function route(fromModel: 'ansi256'): route.ansi256;
declare function route(fromModel: 'hcg'): route.hcg;
declare function route(fromModel: 'apple'): route.apple;
declare function route(fromModel: 'gray'): route.gray;
export = route;
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"conversions.d.ts",
"route.d.ts",
"color-convert-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+5
View File
@@ -0,0 +1,5 @@
import * as colorname from 'color-name';
let color: [number, number, number] = colorname.aliceblue;
color = colorname.darkkhaki;
color = colorname.gainsboro;
+161
View File
@@ -0,0 +1,161 @@
// Type definitions for color-name 1.1
// Project: https://www.npmjs.com/package/color-name
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Tuple of Red, Green, and Blue
* @example
* // Red = 55, Green = 70, Blue = 0
* const rgb: RGB = [55, 70, 0];
*/
export type RGB = [number, number, number];
export const aliceblue: RGB;
export const antiquewhite: RGB;
export const aqua: RGB;
export const aquamarine: RGB;
export const azure: RGB;
export const beige: RGB;
export const bisque: RGB;
export const black: RGB;
export const blanchedalmond: RGB;
export const blue: RGB;
export const blueviolet: RGB;
export const brown: RGB;
export const burlywood: RGB;
export const cadetblue: RGB;
export const chartreuse: RGB;
export const chocolate: RGB;
export const coral: RGB;
export const cornflowerblue: RGB;
export const cornsilk: RGB;
export const crimson: RGB;
export const cyan: RGB;
export const darkblue: RGB;
export const darkcyan: RGB;
export const darkgoldenrod: RGB;
export const darkgray: RGB;
export const darkgreen: RGB;
export const darkgrey: RGB;
export const darkkhaki: RGB;
export const darkmagenta: RGB;
export const darkolivegreen: RGB;
export const darkorange: RGB;
export const darkorchid: RGB;
export const darkred: RGB;
export const darksalmon: RGB;
export const darkseagreen: RGB;
export const darkslateblue: RGB;
export const darkslategray: RGB;
export const darkslategrey: RGB;
export const darkturquoise: RGB;
export const darkviolet: RGB;
export const deeppink: RGB;
export const deepskyblue: RGB;
export const dimgray: RGB;
export const dimgrey: RGB;
export const dodgerblue: RGB;
export const firebrick: RGB;
export const floralwhite: RGB;
export const forestgreen: RGB;
export const fuchsia: RGB;
export const gainsboro: RGB;
export const ghostwhite: RGB;
export const gold: RGB;
export const goldenrod: RGB;
export const gray: RGB;
export const green: RGB;
export const greenyellow: RGB;
export const grey: RGB;
export const honeydew: RGB;
export const hotpink: RGB;
export const indianred: RGB;
export const indigo: RGB;
export const ivory: RGB;
export const khaki: RGB;
export const lavender: RGB;
export const lavenderblush: RGB;
export const lawngreen: RGB;
export const lemonchiffon: RGB;
export const lightblue: RGB;
export const lightcoral: RGB;
export const lightcyan: RGB;
export const lightgoldenrodyellow: RGB;
export const lightgray: RGB;
export const lightgreen: RGB;
export const lightgrey: RGB;
export const lightpink: RGB;
export const lightsalmon: RGB;
export const lightseagreen: RGB;
export const lightskyblue: RGB;
export const lightslategray: RGB;
export const lightslategrey: RGB;
export const lightsteelblue: RGB;
export const lightyellow: RGB;
export const lime: RGB;
export const limegreen: RGB;
export const linen: RGB;
export const magenta: RGB;
export const maroon: RGB;
export const mediumaquamarine: RGB;
export const mediumblue: RGB;
export const mediumorchid: RGB;
export const mediumpurple: RGB;
export const mediumseagreen: RGB;
export const mediumslateblue: RGB;
export const mediumspringgreen: RGB;
export const mediumturquoise: RGB;
export const mediumvioletred: RGB;
export const midnightblue: RGB;
export const mintcream: RGB;
export const mistyrose: RGB;
export const moccasin: RGB;
export const navajowhite: RGB;
export const navy: RGB;
export const oldlace: RGB;
export const olive: RGB;
export const olivedrab: RGB;
export const orange: RGB;
export const orangered: RGB;
export const orchid: RGB;
export const palegoldenrod: RGB;
export const palegreen: RGB;
export const paleturquoise: RGB;
export const palevioletred: RGB;
export const papayawhip: RGB;
export const peachpuff: RGB;
export const peru: RGB;
export const pink: RGB;
export const plum: RGB;
export const powderblue: RGB;
export const purple: RGB;
export const rebeccapurple: RGB;
export const red: RGB;
export const rosybrown: RGB;
export const royalblue: RGB;
export const saddlebrown: RGB;
export const salmon: RGB;
export const sandybrown: RGB;
export const seagreen: RGB;
export const seashell: RGB;
export const sienna: RGB;
export const silver: RGB;
export const skyblue: RGB;
export const slateblue: RGB;
export const slategray: RGB;
export const slategrey: RGB;
export const snow: RGB;
export const springgreen: RGB;
export const steelblue: RGB;
export const tan: RGB;
export const teal: RGB;
export const thistle: RGB;
export const tomato: RGB;
export const turquoise: RGB;
export const violet: RGB;
export const wheat: RGB;
export const white: RGB;
export const whitesmoke: RGB;
export const yellow: RGB;
export const yellowgreen: RGB;
+20
View File
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"baseUrl": "../",
"forceConsistentCasingInFileNames": true,
"lib": [
"es6"
],
"module": "commonjs",
"noEmit": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"types": [],
"typeRoots": ["../"]
},
"files": [
"index.d.ts",
"color-name-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+38
View File
@@ -0,0 +1,38 @@
import * as colorString from 'color-string';
let colorDescriptor: colorString.ColorDescriptor | null;
colorDescriptor = colorString.get('#FFF');
colorDescriptor = colorString.get('#FFFA');
colorDescriptor = colorString.get('#FFFFFFAA');
colorDescriptor = colorString.get('hsl(360, 100%, 50%)');
colorDescriptor = colorString.get('hwb(60, 3%, 60%)');
let color: colorString.Color | null;
color = colorString.get.rgb('#FFF');
color = colorString.get.rgb('blue');
color = colorString.get.rgb('rgba(200, 60, 60, 0.3)');
color = colorString.get.rgb('rgb(200, 200, 200)');
color = colorString.get.hsl('hsl(360, 100%, 50%)');
color = colorString.get.hsl('hsla(360, 60%, 50%, 0.4)');
color = colorString.get.hwb('hwb(60, 3%, 60%)');
color = colorString.get.hwb('hwb(60, 3%, 60%, 0.6)');
color = colorString.get.rgb('invalid color string');
let stringifiedColor: string;
stringifiedColor = colorString.to.hex([255, 255, 255]);
stringifiedColor = colorString.to.hex([0, 0, 255, 0.4]);
stringifiedColor = colorString.to.hex([0, 0, 255], 0.4);
stringifiedColor = colorString.to.rgb([255, 255, 255]);
stringifiedColor = colorString.to.rgb([0, 0, 255, 0.4]);
stringifiedColor = colorString.to.rgb([0, 0, 255], 0.4);
stringifiedColor = colorString.to.rgb.percent([0, 0, 255]);
stringifiedColor = colorString.to.keyword([255, 255, 0]);
stringifiedColor = colorString.to.hsl([360, 100, 100]);
stringifiedColor = colorString.to.hwb([50, 3, 15]);
stringifiedColor = colorString.to.rgb(0, [0, 255], 0.4);
stringifiedColor = colorString.to.rgb([0, 0], [255], 0.4);
stringifiedColor = colorString.to.rgb([0], 0, [255, 0.4]);
+31
View File
@@ -0,0 +1,31 @@
// Type definitions for color-string 1.5
// Project: https://github.com/qix-/color-string#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Dan Marshall <https://github.com/danmarshall>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export type Color = [number, number, number, number];
export interface ColorDescriptor {
model: 'rgb' | 'hsl' | 'hwb';
value: Color;
}
export function get(colorString: string): ColorDescriptor | null;
export namespace get {
function hsl(colorString: string): Color | null;
function hwb(colorString: string): Color | null;
function rgb(colorString: string): Color | null;
}
export namespace to {
function hex(...args: Array<number | number[]>): string;
function rgb(...args: Array<number | number[]>): string;
namespace rgb {
function percent(...args: Array<number | number[]>): string;
}
function keyword(...args: Array<number | number[]>): string;
function hsl(...args: Array<number | number[]>): string;
function hwb(...args: Array<number | number[]>): string;
}
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"color-string-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/expressjs/timeout
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="express" />
+1 -1
View File
@@ -7,7 +7,7 @@
import {IncomingMessage as HttpIncomingMessage} from "http";
import { IncomingMessage as HttpIncomingMessage } from "http";
declare namespace Consul {
+27 -2
View File
@@ -1,6 +1,31 @@
import express = require('express');
import cookieParser = require('cookie-parser');
var app = express();
const app = express();
app.use(cookieParser('optional secret string'));
let obj: object;
let str: string;
let notTrue: false;
let undef: undefined;
const res = cookieParser.JSONCookie('foo');
if (typeof res === 'undefined') {
undef = res;
} else {
obj = res;
}
const res2 = cookieParser.JSONCookies({foo: 'bar'});
const jsonRes: { foo?: object } = res2;
const res3 = cookieParser.signedCookie('', 'keyboard cat');
cookieParser.signedCookie('', ['keyboard', 'cat']);
if (typeof res3 === 'string') {
str = res3;
} else {
notTrue = res3;
}
const res4 = cookieParser.signedCookies({foo: 'bar'}, 'keyboard cat');
const signedCookieRes: { foo?: string | false } = res4;
+19 -5
View File
@@ -1,12 +1,26 @@
// Type definitions for cookie-parser v1.3.4
// Type definitions for cookie-parser 1.4
// Project: https://github.com/expressjs/cookie-parser
// Definitions by: Santi Albo <https://github.com/santialbo/>
// BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import * as express from 'express';
declare function cookieParser(secret?: string | string[], options?: cookieParser.CookieParseOptions): express.RequestHandler;
declare namespace cookieParser {
interface CookieParseOptions {
decode?(val: string): string;
}
import express = require('express');
declare function e(secret?: string, options?: any): express.RequestHandler;
declare namespace e { }
export = e;
function JSONCookie(jsonCookie: string): object | undefined;
function JSONCookies<T extends { [key: string]: string }>(jsonCookies: T): { [P in keyof T]: object | undefined };
function signedCookie(cookie: string, secret: string | string[]): string | false;
function signedCookies<T extends { [key: string]: string }>(cookies: T, secret: string | string[]): { [P in keyof T]?: string | false};
}
export = cookieParser;
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+4 -6
View File
@@ -1,23 +1,21 @@
import cookie = require('cookie');
function test_serialize(): void {
var retVal: string;
let retVal: string;
retVal = cookie.serialize('foo', 'bar');
retVal = cookie.serialize('foo', 'bar', { httpOnly: true });
}
function test_parse(): void {
var retVal: { [key: string]: string };
let retVal: { [key: string]: string };
retVal = cookie.parse('foo=bar; bar=baz;');
retVal = cookie.parse('foo=bar; bar=baz', { decode: x => x });
}
function test_options(): void {
var serializeOptions: cookie.CookieSerializeOptions = {
const serializeOptions: cookie.CookieSerializeOptions = {
encode: (x: string) => x,
path: '/',
expires: new Date(),
@@ -27,7 +25,7 @@ function test_options(): void {
httpOnly: false
};
var parseOptios: cookie.CookieParseOptions = {
const parseOptios: cookie.CookieParseOptions = {
decode: (x: string) => x
};
}
+7 -5
View File
@@ -1,15 +1,16 @@
// Type definitions for cookie v0.3.0
// Type definitions for cookie 0.3
// Project: https://github.com/jshttp/cookie
// Definitions by: Pine Mizune <https://github.com/pine613>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface CookieSerializeOptions {
export interface CookieSerializeOptions {
/**
* Specifies the value for the Domain Set-Cookie attribute. By default, no
* domain is set, and most clients will consider the cookie to apply to only
* the current domain.
*/
domain?: string;
/**
* Specifies a function that will be used to encode a cookie's value. Since
* value of a cookie has a limited character set (and must be a simple
@@ -20,7 +21,8 @@ interface CookieSerializeOptions {
* encode a JavaScript string into UTF-8 byte sequences and then URL-encode
* any that fall outside of the cookie range.
*/
encode?: (val: string) => string;
encode?(val: string): string;
/**
* Specifies the `Date` object to be the value for the `Expires`
* `Set-Cookie` attribute. By default, no expiration is set, and most
@@ -83,7 +85,7 @@ interface CookieSerializeOptions {
secure?: boolean;
}
interface CookieParseOptions {
export interface CookieParseOptions {
/**
* Specifies a function that will be used to decode a cookie's value. Since
* the value of a cookie has a limited character set (and must be a simple
@@ -96,7 +98,7 @@ interface CookieParseOptions {
* *Note* if an error is thrown from this function, the original, non-decoded
* cookie value will be returned as the cookie's value.
*/
decode?: (val: string) => string;
decode?(val: string): string;
}
/**
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+13 -10
View File
@@ -62,7 +62,7 @@ function StepSample() {
});
Then(/^I should see "(.*)" as the page title$/, {timeout: 60 * 1000}, function (title: string, callback: Callback) {
var pageTitle = this.browser.text('title');
const pageTitle = this.browser.text('title');
if (title === pageTitle) {
callback();
@@ -75,38 +75,41 @@ function StepSample() {
// https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js
Given(/^a table step with Table raw$/, function (table: Table) {
var expected = [
const expected = [
['Cucumber', 'Cucumis sativus'],
['Burr Gherkin', 'Cucumis anguria']
];
assert.deepEqual(table.raw(), expected);
const actual: string[][] = table.raw();
assert.deepEqual(actual, expected);
});
Given(/^a table step with Table rows$/, function (table: Table) {
var expected = [
const expected = [
['Apricot', '5'],
['Brocolli', '2'],
['Cucumber', '10']
];
assert.deepEqual(table.rows(), expected)
const actual: string[][] = table.rows();
assert.deepEqual(actual, expected);
});
Given(/^a table step with Table rowHash$/, function (table: Table) {
var expected = {
const expected = {
'Cucumber': 'Cucumis sativus',
'Burr Gherkin': 'Cucumis anguria'
};
assert.deepEqual(table.rowsHash(), expected)
const actual: { [firstCol:string]: string } = table.rowsHash();
assert.deepEqual(actual, expected);
});
Given(/^a table step$/, function (table: Table) {
var expected = [
const expected = [
{'Vegetable': 'Apricot', 'Rating': '5'},
{'Vegetable': 'Brocolli', 'Rating': '2'},
{'Vegetable': 'Cucumber', 'Rating': '10'}
];
assert.deepEqual(table.hashes(), expected)
const actual: { [colName:string]: string }[] = table.hashes();
assert.deepEqual(actual, expected);
});
defineParameterType({
+4 -4
View File
@@ -13,10 +13,10 @@ declare namespace cucumber {
}
export interface TableDefinition {
raw: () => Array<any>;
rows: () => Array<any>;
rowsHash: () => {};
hashes: () => {};
raw: () => Array<Array<string>>;
rows: () => Array<Array<string>>;
rowsHash: () => { [firstCol:string]: string };
hashes: () => Array<{ [colName:string]: string }>;
}
type StepDefinitionParam = string | number | CallbackStepDefinition | TableDefinition;
+17 -14
View File
@@ -5,17 +5,17 @@ function StepSample() {
type Callback = cucumber.CallbackStepDefinition;
type Table = cucumber.TableDefinition;
type HookScenario = cucumber.HookScenario;
var step = <cucumber.StepDefinitions>this;
var hook = <cucumber.Hooks>this;
const step = <cucumber.StepDefinitions>this;
const hook = <cucumber.Hooks>this;
hook.Before(function (scenario: HookScenario, callback: Callback) {
scenario.isFailed() && callback.pending();
});
hook.Before({ timeout: 1000 }, function(scenario: HookScenario, callback: Callback) {
callback();
});
hook.After({ timeout: 1000 }, function(scenario: HookScenario, callback: Callback) {
callback();
});
@@ -39,7 +39,7 @@ function StepSample() {
});
step.Then(/^I should see "(.*)" as the page title$/, {timeout: 60 * 1000}, function (title: string, callback: Callback) {
var pageTitle = this.browser.text('title');
const pageTitle = this.browser.text('title');
if (title === pageTitle) {
callback();
@@ -52,38 +52,41 @@ function StepSample() {
// https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js
step.Given(/^a table step with Table raw$/, function (table: Table) {
var expected = [
const expected = [
['Cucumber', 'Cucumis sativus'],
['Burr Gherkin', 'Cucumis anguria']
];
assert.deepEqual(table.raw(), expected);
const actual: string[][] = table.raw();
assert.deepEqual(actual, expected);
});
step.Given(/^a table step with Table rows$/, function (table: Table) {
var expected = [
const expected = [
['Apricot', '5'],
['Brocolli', '2'],
['Cucumber', '10']
];
assert.deepEqual(table.rows(), expected)
const actual: string[][] = table.rows();
assert.deepEqual(actual, expected);
});
step.Given(/^a table step with Table rowHash$/, function (table: Table) {
var expected = {
const expected = {
'Cucumber': 'Cucumis sativus',
'Burr Gherkin': 'Cucumis anguria'
};
assert.deepEqual(table.rowsHash(), expected)
const actual: { [firstCol:string]: string } = table.rowsHash();
assert.deepEqual(actual, expected);
});
step.Given(/^a table step$/, function (table: Table) {
var expected = [
const expected = [
{'Vegetable': 'Apricot', 'Rating': '5'},
{'Vegetable': 'Brocolli', 'Rating': '2'},
{'Vegetable': 'Cucumber', 'Rating': '10'}
];
assert.deepEqual(table.hashes(), expected)
const actual: { [colName:string]: string }[] = table.hashes();
assert.deepEqual(actual, expected);
});
}
+4 -4
View File
@@ -13,10 +13,10 @@ declare namespace cucumber {
}
export interface TableDefinition {
raw: () => Array<any>;
rows: () => Array<any>;
rowsHash: () => {};
hashes: () => {};
raw: () => Array<Array<string>>;
rows: () => Array<Array<string>>;
rowsHash: () => { [firstCol:string]: string };
hashes: () => Array<{ [colName:string]: string }>;
}
type StepDefinitionParam = string | CallbackStepDefinition | TableDefinition;
+36 -2
View File
@@ -3,7 +3,7 @@
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.0.4
// Last module patch version validated against: 1.0.8
import { Selection, TransitionLike } from 'd3-selection';
@@ -82,6 +82,10 @@ export interface Axis<Domain> {
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
*
* This method has no effect if the scale does not implement scale.ticks, as with band and point scales.
*
* This method is also a convenience function for axis.tickArguments.
*
* @param count Number of ticks that should be rendered
* @param specifier An optional format specifier to customize how the tick values are formatted.
*/
@@ -91,6 +95,8 @@ export interface Axis<Domain> {
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
* Use with a TIME SCALE ONLY.
*
* This method is also a convenience function for axis.tickArguments.
*
* @param interval A time interval used to generate date-based ticks. This is typically a TimeInterval/CountableTimeInterval as defined
* in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15).
* @param specifier An optional format specifier to customize how the tick values are formatted.
@@ -99,17 +105,31 @@ export interface Axis<Domain> {
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
*
* The meaning of the arguments depends on the axis’ scale type: most commonly, the arguments are a suggested count for the number of ticks
* (or a time interval for time scales), and an optional format specifier to customize how the tick values are formatted.
*
* This method has no effect if the scale does not implement scale.ticks, as with band and point scales.
*
* To set the tick values explicitly, use axis.tickValues. To set the tick format explicitly, use axis.tickFormat.
*
* This method is also a convenience function for axis.tickArguments.
*/
ticks(arg0: any, ...args: any[]): this;
/**
* Get an array containing the currently set arguments to be passed into scale.ticks and scale.tickFormat.
* Get an array containing the currently set arguments to be passed into scale.ticks and scale.tickFormat, which defaults to the empty array.
*/
tickArguments(): any[];
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
*
* This method has no effect if the scale does not implement scale.ticks, as with band and point scales.
* To set the tick values explicitly, use axis.tickValues. To set the tick format explicitly, use axis.tickFormat.
*
* See also axis.ticks.
*
* @param args An array containing a single element representing the count, i.e. number of ticks to be rendered.
*/
tickArguments(args: [number]): this;
@@ -117,6 +137,11 @@ export interface Axis<Domain> {
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
*
* This method has no effect if the scale does not implement scale.ticks, as with band and point scales.
* To set the tick values explicitly, use axis.tickValues. To set the tick format explicitly, use axis.tickFormat.
*
* See also axis.ticks.
*
* @param args An array containing two elements. The first element represents the count, i.e. number of ticks to be rendered. The second
* element is a string representing the format specifier to customize how the tick values are formatted.
*/
@@ -126,6 +151,8 @@ export interface Axis<Domain> {
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
* Use with a TIME SCALE ONLY.
*
* See also axis.ticks.
*
* @param args An array containing a single element representing a time interval used to generate date-based ticks.
* This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15).
*/
@@ -135,6 +162,8 @@ export interface Axis<Domain> {
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
* Use with a TIME SCALE ONLY.
*
* See also axis.ticks.
*
* @param args An array containing two elements. The first element represents a time interval used to generate date-based ticks.
* This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15).
* The second element is a string representing the format specifier to customize how the tick values are formatted.
@@ -144,6 +173,11 @@ export interface Axis<Domain> {
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
*
* This method has no effect if the scale does not implement scale.ticks, as with band and point scales.
* To set the tick values explicitly, use axis.tickValues. To set the tick format explicitly, use axis.tickFormat.
*
* See also axis.ticks.
*
* @param args An array with arguments suitable for the scale to be used for tick generation
*/
tickArguments(args: any[]): this;
+2 -2
View File
@@ -6,8 +6,8 @@
* are not intended as functional tests.
*/
import {hsv, HSVColor} from 'd3-hsv';
import {rgb, RGBColor} from 'd3-color';
import { hsv, HSVColor } from 'd3-hsv';
import { rgb, RGBColor } from 'd3-color';
let c: RGBColor;
let cHSV: HSVColor;
+1 -1
View File
@@ -5,7 +5,7 @@
// Last module patch version validated against: 0.0.3
import {Color, RGBColor, ColorSpaceObject, ColorCommonInstance} from 'd3-color';
import { Color, RGBColor, ColorSpaceObject, ColorCommonInstance } from 'd3-color';
export type ColorSpaceObjectWithHSV = ColorSpaceObject | HSVColor;
+2 -2
View File
@@ -5,8 +5,8 @@
// Last module patch version validated against: 1.0.0
import {Selection, BaseType, ArrayLike, ValueFn} from 'd3-selection';
import {Transition} from 'd3-transition';
import { Selection, BaseType, ArrayLike, ValueFn } from 'd3-selection';
import { Transition } from 'd3-transition';
/**
* An object mapping attribute (or style or property) names to value accessors
+2 -2
View File
@@ -1319,10 +1319,10 @@ customSymbol = d3Shape.symbolTriangle;
customSymbol = d3Shape.symbolWye;
// -----------------------------------------------------------------------------------
// Test pointRadius
// Test pointRadial
// -----------------------------------------------------------------------------------
let coordinatates: [number, number] = d3Shape.pointRadius(0, 12);
let coordinatates: [number, number] = d3Shape.pointRadial(0, 12);
// -----------------------------------------------------------------------------------
// Test Stacks
+2 -2
View File
@@ -2436,7 +2436,7 @@ export const symbolTriangle: SymbolType;
export const symbolWye: SymbolType;
// -----------------------------------------------------------------------------------
// pointRadius
// pointRadial
// -----------------------------------------------------------------------------------
/**
@@ -2444,7 +2444,7 @@ export const symbolWye: SymbolType;
* @param angle Angle in radians, with 0 at -y (12 o’clock) and positive angles proceeding clockwise.
* @param radius Radius.
*/
export function pointRadius(angle: number, radius: number): [number, number];
export function pointRadial(angle: number, radius: number): [number, number];
// -----------------------------------------------------------------------------------
// STACKS
+3 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.0.4
// Last module patch version validated against: 1.0.7
// ---------------------------------------------------------------
// Interfaces
@@ -151,6 +151,8 @@ export interface CountableTimeInterval extends TimeInterval {
*
* This method can be used in conjunction with interval.range to ensure that two overlapping ranges are consistent.
*
* The returned filtered interval does not support interval.count. See also interval.filter.
*
* @param step Number of steps.
*/
every(step: number): TimeInterval | null;
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: Gert Braspenning <https://github.com/brspnnggrt>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import {Primitive} from "d3";
import { Primitive } from "d3";
declare module "d3" {
type TooltipDirection = ("n" | "s" | "e" | "w" | "nw" | "ne" | "sw" | "se");
+100
View File
@@ -385,6 +385,106 @@ svgZoom.translateBy(
return 30;
});
// translateTo() -------------------------------------------------------------------------------------
// use on selection
svgZoom.translateTo(svgOverlay, 20, 50);
// svgZoom.translateTo(groupsSelection, 20, 50); // fails, as groupSelection mismachtes DOM Element type and datum type
svgZoom.translateTo(
svgOverlay,
20,
function(datum, index, groups) {
const that: SVGRectElement = this;
const d: SVGDatum = datum;
const i: number = index;
const g: SVGRectElement[] | ArrayLike<SVGRectElement> = groups;
console.log('Owner SVG Element of svg rect: ', this.ownerSVGElement); // this is of type SVGRectElement
console.log('Filter Brush Event status as per datum: ', d.filterBrushEvent); // datum type is SVGDatum
return 30;
});
svgZoom.translateTo(
svgOverlay,
function(datum, index, groups) {
const that: SVGRectElement = this;
const d: SVGDatum = datum;
const i: number = index;
const g: SVGRectElement[] | ArrayLike<SVGRectElement> = groups;
console.log('Owner SVG Element of svg rect: ', this.ownerSVGElement); // this is of type SVGRectElement
console.log('Filter Brush Event status as per datum: ', d.filterBrushEvent); // datum type is SVGDatum
return 30;
},
50);
svgZoom.translateTo(
svgOverlay,
function(datum, index, groups) {
const that: SVGRectElement = this;
const d: SVGDatum = datum;
const i: number = index;
const g: SVGRectElement[] | ArrayLike<SVGRectElement> = groups;
console.log('Owner SVG Element of svg rect: ', this.ownerSVGElement); // this is of type SVGRectElement
console.log('Filter Brush Event status as per datum: ', d.filterBrushEvent); // datum type is SVGDatum
return 30;
},
function(datum, index, groups) {
const that: SVGRectElement = this;
const d: SVGDatum = datum;
const i: number = index;
const g: SVGRectElement[] | ArrayLike<SVGRectElement> = groups;
console.log('Owner SVG Element of svg rect: ', this.ownerSVGElement); // this is of type SVGRectElement
console.log('Filter Brush Event status as per datum: ', d.filterBrushEvent); // datum type is SVGDatum
return 30;
});
// use on transition
svgZoom.translateTo(svgOverlayTransition, 20, 50);
// svgZoom.translateTo(groupsTransition, 20, 50); // fails, as groupTransition mismachtes DOM Element type and datum type
svgZoom.translateTo(
svgOverlayTransition,
20,
function(datum, index, groups) {
const that: SVGRectElement = this;
const d: SVGDatum = datum;
const i: number = index;
const g: SVGRectElement[] | ArrayLike<SVGRectElement> = groups;
console.log('Owner SVG Element of svg rect: ', this.ownerSVGElement); // this is of type SVGRectElement
console.log('Filter Brush Event status as per datum: ', d.filterBrushEvent); // datum type is SVGDatum
return 30;
});
svgZoom.translateTo(
svgOverlayTransition,
function(datum, index, groups) {
const that: SVGRectElement = this;
const d: SVGDatum = datum;
const i: number = index;
const g: SVGRectElement[] | ArrayLike<SVGRectElement> = groups;
console.log('Owner SVG Element of svg rect: ', this.ownerSVGElement); // this is of type SVGRectElement
console.log('Filter Brush Event status as per datum: ', d.filterBrushEvent); // datum type is SVGDatum
return 30;
},
50);
svgZoom.translateTo(
svgOverlayTransition,
function(datum, index, groups) {
const that: SVGRectElement = this;
const d: SVGDatum = datum;
const i: number = index;
const g: SVGRectElement[] | ArrayLike<SVGRectElement> = groups;
console.log('Owner SVG Element of svg rect: ', this.ownerSVGElement); // this is of type SVGRectElement
console.log('Filter Brush Event status as per datum: ', d.filterBrushEvent); // datum type is SVGDatum
return 30;
},
function(datum, index, groups) {
const that: SVGRectElement = this;
const d: SVGDatum = datum;
const i: number = index;
const g: SVGRectElement[] | ArrayLike<SVGRectElement> = groups;
console.log('Owner SVG Element of svg rect: ', this.ownerSVGElement); // this is of type SVGRectElement
console.log('Filter Brush Event status as per datum: ', d.filterBrushEvent); // datum type is SVGDatum
return 30;
});
// scaleBy() -------------------------------------------------------------------------------------
// use on selection
+166 -32
View File
@@ -1,9 +1,9 @@
// Type definitions for d3JS d3-zoom module 1.3
// Type definitions for d3JS d3-zoom module 1.5
// Project: https://github.com/d3/d3-zoom/
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.3.0
// Last module patch version validated against: 1.5.0
import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection';
import { ZoomView, ZoomInterpolator } from 'd3-interpolate';
@@ -127,7 +127,7 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
/**
* Translates the current zoom transform of the selected elements by x and y,
* such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y.
* such that the new t(x1) = t(x0) + kx and t(y1) = t(y0) + ky.
*
* x is provided as a constant for all elements.
* y is provided as a constant for all elements.
@@ -139,13 +139,13 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
translateBy(selection: Selection<ZoomRefElement, Datum, any, any>, x: number, y: number): void;
/**
* Translates the current zoom transform of the selected elements by x and y,
* such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y.
* such that the new t(x1) = t(x0) + kx and t(y1) = t(y0) + ky.
*
* x is provided by a value function evaluated for each element in the selection.
* y is provided as a constant for all elements.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param selection A D3 selection of elements.
* @param x A value function which is evaluated for each selected element,
@@ -156,13 +156,13 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
translateBy(selection: Selection<ZoomRefElement, Datum, any, any>, x: ValueFn<ZoomRefElement, Datum, number>, y: number): void;
/**
* Translates the current zoom transform of the selected elements by x and y,
* such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y.
* such that the new t(x1) = t(x0) + kx and t(y1) = t(y0) + ky.
*
* x is provided as a constant for all elements.
* y is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param selection A D3 selection of elements.
* @param x Amount of translation in x-direction.
@@ -173,13 +173,13 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
translateBy(selection: Selection<ZoomRefElement, Datum, any, any>, x: number, y: ValueFn<ZoomRefElement, Datum, number>): void;
/**
* Translates the current zoom transform of the selected elements by x and y,
* such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y.
* such that the new t(x1) = t(x0) + kx and t(y1) = t(y0) + ky.
*
* x is provided by a value function evaluated for each element in the selection.
* y is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param selection A D3 selection of elements.
* @param x A value function which is evaluated for each selected element,
@@ -192,13 +192,13 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
translateBy(selection: Selection<ZoomRefElement, Datum, any, any>, x: ValueFn<ZoomRefElement, Datum, number>, y: ValueFn<ZoomRefElement, Datum, number>): void;
/**
* Defines a “zoom” tween translating the current transform for the transitioning elements by x and y,
* such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y.
* such that the new t(x1) = t(x0) + kx and t(y1) = t(y0) + ky.
*
* x is provided as a constant for all elements.
* y is provided as a constant for all elements.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param x Amount of translation in x-direction.
@@ -207,13 +207,13 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
translateBy(transition: TransitionLike<ZoomRefElement, Datum>, x: number, y: number): void;
/**
* Defines a “zoom” tween translating the current transform for the transitioning elements by x and y,
* such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y.
* such that the new t(x1) = t(x0) + kx and t(y1) = t(y0) + ky.
*
* x is provided by a value function evaluated for each element in the selection.
* y is provided as a constant for all elements.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param x A value function which is evaluated for each selected element,
@@ -224,13 +224,13 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
translateBy(transition: TransitionLike<ZoomRefElement, Datum>, x: ValueFn<ZoomRefElement, Datum, number>, y: number): void;
/**
* Defines a “zoom” tween translating the current transform for the transitioning elements by x and y,
* such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y.
* such that the new t(x1) = t(x0) + kx and t(y1) = t(y0) + ky.
*
* x is provided as a constant for all elements.
* y is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param x Amount of translation in x-direction.
@@ -241,13 +241,13 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
translateBy(transition: TransitionLike<ZoomRefElement, Datum>, x: number, y: ValueFn<ZoomRefElement, Datum, number>): void;
/**
* Defines a “zoom” tween translating the current transform for the transitioning elements by x and y,
* such that the new t(x1) = t(x0) + k × x and t(y1) = t(y0) + k × y.
* such that the new t(x1) = t(x0) + kx and t(y1) = t(y0) + ky.
*
* x is provided by a value function evaluated for each element in the selection.
* y is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param x A value function which is evaluated for each selected element,
@@ -260,24 +260,158 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
translateBy(transition: TransitionLike<ZoomRefElement, Datum>, x: ValueFn<ZoomRefElement, Datum, number>, y: ValueFn<ZoomRefElement, Datum, number>): void;
/**
* Scales the current zoom transform of the selected elements by k, such that the new k(1) = k(0) × k.
* Translates the current zoom transform of the selected elements such that the specified position ⟨x,y⟩ appears at the center of the viewport extent.
* The new tx = cx - kx and ty = cy - ky, where ⟨cx,cy⟩ is the center.
*
* x is provided as a constant for all elements.
* y is provided as a constant for all elements.
*
* @param selection A D3 selection of elements.
* @param x Target x-position of translation.
* @param y Target y-position of translation.
*/
translateTo(selection: Selection<ZoomRefElement, Datum, any, any>, x: number, y: number): void;
/**
* Translates the current zoom transform of the selected elements such that the specified position ⟨x,y⟩ appears at the center of the viewport extent.
* The new tx = cx - kx and ty = cy - ky, where ⟨cx,cy⟩ is the center.
*
* x is provided by a value function evaluated for each element in the selection.
* y is provided as a constant for all elements.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param selection A D3 selection of elements.
* @param x A value function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.The function returns the target x-position of translation.
* @param y Target y-position of translation.
*/
translateTo(selection: Selection<ZoomRefElement, Datum, any, any>, x: ValueFn<ZoomRefElement, Datum, number>, y: number): void;
/**
* Translates the current zoom transform of the selected elements such that the specified position ⟨x,y⟩ appears at the center of the viewport extent.
* The new tx = cx - kx and ty = cy - ky, where ⟨cx,cy⟩ is the center.
*
* x is provided as a constant for all elements.
* y is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param selection A D3 selection of elements.
* @param x Target x-position of translation.
* @param y A value function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.The function returns the target y-position of translation.
*/
translateTo(selection: Selection<ZoomRefElement, Datum, any, any>, x: number, y: ValueFn<ZoomRefElement, Datum, number>): void;
/**
* Translates the current zoom transform of the selected elements such that the specified position ⟨x,y⟩ appears at the center of the viewport extent.
* The new tx = cx - kx and ty = cy - ky, where ⟨cx,cy⟩ is the center.
*
* x is provided by a value function evaluated for each element in the selection.
* y is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param selection A D3 selection of elements.
* @param x A value function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.The function returns the target x-position of translation.
* @param y A value function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.The function returns the target y-position of translation.
*/
translateTo(selection: Selection<ZoomRefElement, Datum, any, any>, x: ValueFn<ZoomRefElement, Datum, number>, y: ValueFn<ZoomRefElement, Datum, number>): void;
/**
* Defines a “zoom” tween translating the current transform for the transitioning elements such that the specified position ⟨x,y⟩ appears at the center of the viewport extent.
* The new tx = cx - kx and ty = cy - ky, where ⟨cx,cy⟩ is the center.
*
* x is provided as a constant for all elements.
* y is provided as a constant for all elements.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param x Target x-position of translation.
* @param y Target y-position of translation.
*/
translateTo(transition: TransitionLike<ZoomRefElement, Datum>, x: number, y: number): void;
/**
* Defines a “zoom” tween translating the current transform for the transitioning elements such that the specified position ⟨x,y⟩ appears at the center of the viewport extent.
* The new tx = cx - kx and ty = cy - ky, where ⟨cx,cy⟩ is the center.
*
* x is provided by a value function evaluated for each element in the selection.
* y is provided as a constant for all elements.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param x A value function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.The function returns the target x-position of translation.
* @param y Target y-position of translation.
*/
translateTo(transition: TransitionLike<ZoomRefElement, Datum>, x: ValueFn<ZoomRefElement, Datum, number>, y: number): void;
/**
* Defines a “zoom” tween translating the current transform for the transitioning elements such that the specified position ⟨x,y⟩ appears at the center of the viewport extent.
* The new tx = cx - kx and ty = cy - ky, where ⟨cx,cy⟩ is the center.
*
* x is provided as a constant for all elements.
* y is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param x Target x-position of translation.
* @param y A value function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.The function returns the target y-position of translation.
*/
translateTo(transition: TransitionLike<ZoomRefElement, Datum>, x: number, y: ValueFn<ZoomRefElement, Datum, number>): void;
/**
* Defines a “zoom” tween translating the current transform for the transitioning elements such that the specified position ⟨x,y⟩ appears at the center of the viewport extent.
* The new tx = cx - kx and ty = cy - ky, where ⟨cx,cy⟩ is the center.
*
* x is provided by a value function evaluated for each element in the selection.
* y is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param x A value function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.The function returns the target x-position of translation.
* @param y A value function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.The function returns the target y-position of translation.
*/
translateTo(transition: TransitionLike<ZoomRefElement, Datum>, x: ValueFn<ZoomRefElement, Datum, number>, y: ValueFn<ZoomRefElement, Datum, number>): void;
/**
* Scales the current zoom transform of the selected elements by k, such that the new k(1) = k(0)k.
*
* k is provided as a constant for all elements.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param selection A D3 selection of elements.
* @param k Scale factor.
*/
scaleBy(selection: Selection<ZoomRefElement, Datum, any, any>, k: number): void;
/**
* Scales the current zoom transform of the selected elements by k, such that the new k(1) = k(0) × k.
* Scales the current zoom transform of the selected elements by k, such that the new k(1) = k(0)k.
*
* k is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param selection A D3 selection of elements.
* @param k A value function which is evaluated for each selected element,
@@ -286,24 +420,24 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
*/
scaleBy(selection: Selection<ZoomRefElement, Datum, any, any>, k: ValueFn<ZoomRefElement, Datum, number>): void;
/**
* Defines a “zoom” tween translating scaling the current transform of the selected elements by k, such that the new k(1) = k(0) × k.
* Defines a “zoom” tween translating scaling the current transform of the selected elements by k, such that the new k(1) = k(0)k.
*
* k is provided as a constant for all elements.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param k Scale factor.
*/
scaleBy(transition: TransitionLike<ZoomRefElement, Datum>, k: number): void;
/**
* Defines a “zoom” tween translating scaling the current transform of the selected elements by k, such that the new k(1) = k(0) × k.
* Defines a “zoom” tween translating scaling the current transform of the selected elements by k, such that the new k(1) = k(0)k.
*
* k is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param k A value function which is evaluated for each selected element,
@@ -318,7 +452,7 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
* k is provided as a constant for all elements.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param selection A D3 selection of elements.
* @param k New scale.
@@ -330,7 +464,7 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
* k is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param selection A D3 selection of elements.
* @param k A value function which is evaluated for each selected element,
@@ -344,7 +478,7 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
* k is provided as a constant for all elements.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param k New scale.
@@ -356,7 +490,7 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
* k is provided by a value function evaluated for each element in the selection.
*
* This method is a convenience method for zoom.transform.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExten, and zoom.translateExtent.
* In contrast to zoom.transform, however, it is subject to the constraints imposed by zoom.extent, zoom.scaleExtent, and zoom.translateExtent.
*
* @param transition A D3 transition on elements.
* @param k A value function which is evaluated for each selected element,
@@ -644,21 +778,21 @@ export interface ZoomTransform {
/**
* Return the transformation of the specified point which is a two-element array of numbers [x, y].
* The returned point is equal to [x × k + tx, y × k + ty].
* The returned point is equal to [xk + tx, yk + ty].
*
* @param point Point coordinates [x, y]
*/
apply(point: [number, number]): [number, number];
/**
* Return the transformation of the specified x-coordinate, x × k + tx.
* Return the transformation of the specified x-coordinate, xk + tx.
*
* @param x Value of x-coordinate.
*/
applyX(x: number): number;
/**
* Return the transformation of the specified y-coordinate, y × k + ty.
* Return the transformation of the specified y-coordinate, yk + ty.
*
* @param y Value of y-coordinate.
*/
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for D3JS d3 standard bundle 4.9
// Type definitions for D3JS d3 standard bundle 4.10
// Project: https://github.com/d3/d3
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+20 -3
View File
@@ -11,16 +11,33 @@ export namespace graphlib {
edge(id: any): any;
nodes(): string[];
node(id: any): any;
setDefaultEdgeLabel(callback: () => void): Graph;
setEdge(sourceId: string, targetId: string, options?: { [key: string]: any }): Graph;
setGraph(options: { [key: string]: any }): Graph;
setDefaultEdgeLabel(callback: string|(() => string|void)): Graph;
setDefaultNodeLabel(callback: string|(() => string|void)): Graph;
setEdge(sourceId: string, targetId: string, options?: { [key: string]: any }, value?: string): Graph;
setEdge(params: {v: string, w: string, name?: string}, value?: string): Graph;
setGraph(label: GraphLabel): Graph;
setNode(id: string, node: { [key: string]: any }): Graph;
graph(): GraphLabel;
constructor(opt?: {directed?: boolean, multigraph?: boolean, compound?: boolean});
setParent(name: string, parentName: string): void;
hasNode(name: string): boolean;
}
}
export interface GraphLabel {
width?: number;
height?: number;
compound?: boolean;
rankdir?: string;
nodesep?: number;
edgesep?: number;
}
export function layout(graph: graphlib.Graph): void;
export interface Edge {
v: string;
w: string;
name?: string;
}
+24
View File
@@ -0,0 +1,24 @@
import * as deasync from "deasync";
function asyncFunction(input: number, cb: (res: number) => void) {}
function handle(res: number) {}
// base case
asyncFunction(42, handle);
// deasync
let wrapped = deasync(asyncFunction);
handle(wrapped(42));
// deasync.loopWhile
let done = false;
asyncFunction(42, () => {
done = true;
});
deasync.loopWhile(() => !done);
// deasync.runLoopOnce
deasync.runLoopOnce();
// deasync.sleep
deasync.sleep(100);
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for deasync 0.1
// Project: https://github.com/abbr/deasync
// Definitions by: Matt Rollins <https://github.com/Sicilica>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
export = deasync;
declare function deasync(fn: (...args: any[]) => void): (...args: any[]) => any;
declare namespace deasync {
function loopWhile(pred: () => boolean): void;
function runLoopOnce(): void;
function sleep(ms: number): void;
}
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"deasync-tests.ts"
]
}
+4
View File
@@ -0,0 +1,4 @@
{
"extends": "dtslint/dt.json",
"rules": {}
}
+1 -1
View File
@@ -1,4 +1,4 @@
import {DM, Event, EventId} from 'debessmann';
import { DM, Event, EventId } from 'debessmann';
let eventId: EventId = {seq: 0, time: new Date()};
let e: Event = {_id: eventId, headers: {header1: 'header1Val'}};
+1 -1
View File
@@ -1,4 +1,4 @@
import {redditHot, hackerHot, wilsonScore} from 'decay';
import { redditHot, hackerHot, wilsonScore } from 'decay';
const upvotes = 42;
const downvotes = 12;
+1 -1
View File
@@ -1,4 +1,4 @@
import {Required} from 'decorum';
import { Required } from 'decorum';
import {Email} from 'decorum';
import {MinLength} from 'decorum';
import {MaxLength} from 'decorum';
+9
View File
@@ -427,6 +427,15 @@ declare namespace Dockerode {
GlobalIPv6PrefixLen: number;
MacAddress: string;
}
};
Node?: {
ID: string;
IP: string;
Addr: string;
Name: string;
Cpus: number;
Memory: number;
Labels: any;
}
};
}
+12
View File
@@ -240,3 +240,15 @@ const rpr2 = new ddb.RangePartitionResolver((obj: any) => obj.foo, [ partitionKe
const rangePartitionKey1: any = rpr1.getPartitionKey(document1);
const rangeCollectionLink1: string = rpr1.resolveForCreate(hashPartitionKey1);
const rangeCollectionLinks1: string[] = rpr1.resolveForRead(hashPartitionKey1);
/** UriFactory methods */
const dbUri = ddb.UriFactory.createDatabaseUri('dbfoo');
const colUri = ddb.UriFactory.createDocumentCollectionUri('dbfoo', 'colbar');
const docUri = ddb.UriFactory.createDocumentUri('dbfoo', 'colbar', 'doc1');
const permUri = ddb.UriFactory.createPermissionUri('dbfoo', 'userId', 'permission1');
const sprocUri = ddb.UriFactory.createStoredProcedureUri('dbfoo', 'colbar', 'sproc1');
const triggerUri = ddb.UriFactory.createTriggerUri('dbfoo', 'colbar', 'trigger1');
const udfUri = ddb.UriFactory.createUserDefinedFunctionUri('dbfoo', 'colbar', 'udf1');
const conflictUri = ddb.UriFactory.createConflictUri('dbfoo', 'colbar', 'conflict1');
const attachUri = ddb.UriFactory.createAttachmentUri('dbfoo', 'colbar', 'doc1', 'attachment1');
const partitionKeyRangeUri = ddb.UriFactory.createPartitionKeyRangesUri('dbfoo', 'colbar');
+104 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for DocumentDB 1.10
// Project: https://github.com/Azure/azure-documentdb-node
// Definitions by: Noel Abrahams <https://github.com/NoelAbrahams>, Brett Gutstein <https://github.com/brettferdosi>, Chris Stone <https://github.com/ctstone>
// Definitions by: Noel Abrahams <https://github.com/NoelAbrahams>, Brett Gutstein <https://github.com/brettferdosi>, Chris Stone <https://github.com/ctstone>, Yifan Wu <https://github.com/yifanwu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/documentdb
/// <reference types="node" />
@@ -1340,6 +1340,109 @@ export class DocumentClient {
getWriteEndpoint(callback: RequestCallback<string>): void;
}
export class UriFactory {
/**
* Given a database id, this creates a database link.
* @param {string} databaseId -The database id
* @returns {string} -A database link in the format of dbs/{0} with {0} being a Uri escaped version of the databaseId
* @description Would be used when creating or deleting a DocumentCollection or a User in Azure DocumentDB database service
*/
static createDatabaseUri(databaseId: string): string;
/**
* Given a database and collection id, this creates a collection link.
* @param {string} databaseId -The database id
* @param {string} collectionId -The collection id
* @returns {string} A collection link in the format of dbs/{0}/colls/{1} with {0} being a Uri escaped version of the databaseId and {1} being collectionId
* @description Would be used when updating or deleting a DocumentCollection, creating a Document, a StoredProcedure, a
* Trigger, a UserDefinedFunction, or when executing a query with CreateDocumentQuery in Azure DocumentDB database service.
*/
static createDocumentCollectionUri(databaseId: string, collectionId: string): string;
/**
* Given a database and collection id, this creates a collection link.
* @param {string} databaseId -The database id
* @param {string} collectionId -The collection id
* @param {string} documentId -The document id
* @returns {string} -A document link in the format of dbs/{0}/colls/{1}/docs/{2} with {0}
* being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the documentId
* @description Would be used when creating an Attachment, or when replacing or deleting a Document in Azure DocumentDB database service
*/
static createDocumentUri(databaseId: string, collectionId: string, documentId: string): string;
/**
* Given a database, collection and document id, this creates a document link.
* @param {string} databaseId -The database Id
* @param {string} userId -The user Id
* @param {string} permissionId - The permissionId
* @returns {string} A permission link in the format of dbs/{0}/users/{1}/permissions/{2} with {0} being a Uri escaped version of the databaseId, {1} being userId and {2} being permissionId
* @description Would be used when replacing or deleting a Permission in Azure DocumentDB database service.
*/
static createPermissionUri(databaseId: string, userId: string, permissionId: string): string;
/**
* Given a database, collection and stored proc id, this creates a stored proc link.
* @param {string} databaseId -The database Id
* @param {string} collectionId -The collection Id
* @param {string} storedProcedureId -The stored procedure Id
* @returns {string} -A stored procedure link in the format of dbs/{0}/colls/{1}/sprocs/{2}
* with {0} being a Uri escaped version of the databaseId,
* {1} being collectionId and {2} being the storedProcedureId
* @description Would be used when replacing, executing, or deleting a StoredProcedure in Azure DocumentDB database service.
*/
static createStoredProcedureUri(databaseId: string, collectionId: string, storedProcedureId: string): string;
/**
* @summary Given a database, collection and trigger id, this creates a trigger link.
* @param {string} databaseId -The database Id
* @param {string} collectionId -The collection Id
* @param {string} triggerId -The trigger Id
* @returns {string} -A trigger link in the format of dbs/{0}/colls/{1}/triggers/{2}
* with {0} being a Uri escaped version of the databaseId,
* {1} being collectionId and {2} being the triggerId
* @description Would be used when replacing, executing, or deleting a Trigger in Azure DocumentDB database service
*/
static createTriggerUri(databaseId: string, collectionId: string, triggerId: string): string;
/**
* @summary Given a database, collection and udf id, this creates a udf link.
* @param {string} databaseId -The database Id
* @param {string} collectionId -The collection Id
* @param {string} udfId -The User Defined Function Id
* @returns {string} -A udf link in the format of dbs/{0}/colls/{1}/udfs/{2} with {0} being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the udfId
* @description Would be used when replacing, executing, or deleting a UserDefinedFunction in Azure DocumentDB database service
*/
static createUserDefinedFunctionUri(databaseId: string, collectionId: string, udfId: string): string;
/**
* @summary
* @param {string} databaseId -The database Id
* @param {string} collectionId -The collection Id
* @param {string} conflictId -The conflict Id
* @returns {string} -A conflict link in the format of dbs/{0}/colls/{1}/conflicts/{2}
* with {0} being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the conflictId
* @description Would be used when creating a Conflict in Azure DocumentDB database service.
*/
static createConflictUri(databaseId: string, collectionId: string, conflictId: string): string;
/**
* @summary Given a database, collection and conflict id, this creates a conflict link.
* @param {string} databaseId -The database Id
* @param {string} collectionId -The collection Id
* @param {string} documentId -The document Id\
* @param {string} attachmentId -The attachment Id
* @returns {string} -A conflict link in the format of dbs/{0}/colls/{1}/conflicts/{2} with {0} being a Uri escaped version of the databaseId,
* {1} being collectionId and {2} being the conflictId
* @description Would be used when creating a Conflict in Azure DocumentDB database service.
*/
static createAttachmentUri(databaseId: string, collectionId: string, documentId: string, attachmentId: string): string;
/**
* @summary Given a database and collection, this creates a partition key ranges link in the Azure DocumentDB database service.
* @param {string} databaseId -The database Id
* @param {string} collectionId -The collection Id
* @returns {string} -A partition key ranges link in the format of dbs/{0}/colls/{1}/pkranges with {0} being a Uri escaped version of the databaseId and {1} being collectionId
*/
static createPartitionKeyRangesUri(databaseId: string, collectionId: string): string;
}
export type MediaReadMode = 'Buffered' | 'Streamed';
export type ConsistencyLevel = 'Strong' | 'BoundedStaleness' | 'Session' | 'Eventual';
export type IndexingMode = 'Consistent' | 'Lazy';
+1 -1
View File
@@ -1,4 +1,4 @@
import {push, pull} from 'dookie';
import { push, pull } from 'dookie';
(async () => {
await push('mongodb://localhost:27017/test', {test: [{ok: 1}, {ok: 2}]});
+17 -5
View File
@@ -1,11 +1,23 @@
/// <reference types="node"/>
import dotProp = require('dot-prop');
import { get, has, set } from 'dot-prop';
import * as dotProp from 'dot-prop';
dotProp.get({foo: {bar: 'unicorn'}}, 'foo.bar');
get({foo: {bar: 'unicorn'}}, 'foo.bar');
dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep');
dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep', 'default value');
dotProp.get({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot');
const obj = {foo: {bar: 'a'}};
dotProp.set(obj, 'foo.bar', 'b');
set(obj, 'foo.bar', 'b');
console.log(obj);
dotProp.set(obj, 'foo.baz', 'x');
dotProp.set(obj, 'foo.dot\\.dot', 'unicorn');
console.log(obj);
has({foo: {bar: 'unicorn'}}, 'foo.bar');
dotProp.has({foo: {bar: 'unicorn'}}, 'foo.bar');
dotProp.delete(obj, 'foo.bar');
console.log(obj);
(<any> obj).foo.bar = {x: 'y', y: 'x'};
dotProp.delete(obj, 'foo.bar.x');
console.log(obj);
+13 -4
View File
@@ -1,8 +1,17 @@
// Type definitions for dot-prop
// Project: https://github.com/sindresorhus/dot-prop
// Type definitions for dot-prop 4.1
// Project: https://github.com/sindresorhus/dot-prop#readme
// Definitions by: Sam Verschueren <https://github.com/samverschueren>
// BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
interface DotProp {
get(obj: object, path: string, defaultValue?: any): any;
set(obj: object, path: string, value: any): void;
has(obj: object, path: string): boolean;
delete(obj: object, path: string): boolean;
}
export declare function get(object: any, path: string): any;
export declare function set(object: any, path: string, value: any): void;
declare const dotProp: DotProp;
export = dotProp;
+2 -2
View File
@@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
@@ -19,4 +19,4 @@
"index.d.ts",
"dot-prop-tests.ts"
]
}
}

Some files were not shown because too many files have changed in this diff Show More