Merge branch 'patch-1' of github.com:smac89/DefinitelyTyped into patch-1

This commit is contained in:
smac89
2017-08-01 17:01:23 -06:00
978 changed files with 38483 additions and 12467 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
+1
View File
@@ -133,6 +133,7 @@ For a good example package, see [base64-js](https://github.com/DefinitelyTyped/D
* First, follow advice from the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html).
* Formatting: Either use all tabs, or always use 4 spaces.
* `function sum(nums: number[]): number`: Use `ReadonlyArray` if a function does not write to its parameters.
* `interface Foo { new(): Foo; }`:
This defines a type of objects that are new-able. You probably want `declare class Foo { constructor(); }`.
* `const Class: { new(): IClass; }`:
+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;
+18 -8
View File
@@ -16,13 +16,19 @@ amqp.connect('amqp://localhost')
.then(connection => {
return connection.createChannel()
.tap(channel => channel.checkQueue('myQueue'))
.then(channel => channel.consume('myQueue', newMsg => console.log('New Message: ' + newMsg.content.toString())))
.then(channel => {
return channel.consume('myQueue', newMsg => {
if (newMsg != null) {
// test promise api properties
if (newMsg.properties.contentType === 'application/json') {
console.log('New Message: ' + newMsg.content.toString());
}
}
});
})
.finally(() => connection.close());
});
// test promise api properties
let amqpMessage: amqp.Message;
amqpMessage.properties.contentType = 'application/json';
let amqpAssertExchangeOptions: amqp.Options.AssertExchange;
let anqpAssertExchangeReplies: amqp.Replies.AssertExchange;
@@ -49,7 +55,14 @@ amqpcb.connect('amqp://localhost', (err, connection) => {
if (!err) {
channel.assertQueue('myQueue', {}, (err, ok) => {
if (!err) {
channel.consume('myQueue', newMsg => console.log('New Message: ' + newMsg.content.toString()));
channel.consume('myQueue', newMsg => {
if (newMsg != null) {
// test callback api properties
if (newMsg.properties.contentType === 'application/json') {
console.log('New Message: ' + newMsg.content.toString());
}
}
});
}
});
}
@@ -57,8 +70,5 @@ amqpcb.connect('amqp://localhost', (err, connection) => {
}
});
// test callback api properties
let amqpcbMessage: amqpcb.Message;
amqpcbMessage.properties.contentType = 'application/json';
let amqpcbAssertExchangeOptions: amqpcb.Options.AssertExchange;
let anqpcbAssertExchangeReplies: amqpcb.Replies.AssertExchange;
+1 -1
View File
@@ -31,7 +31,7 @@ export interface Channel extends events.EventEmitter {
publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish): boolean;
sendToQueue(queue: string, content: Buffer, options?: Options.Publish): boolean;
consume(queue: string, onMessage: (msg: Message) => any, options?: Options.Consume, callback?: (err: any, ok: Replies.Consume) => void): void;
consume(queue: string, onMessage: (msg: Message | null) => any, options?: Options.Consume, callback?: (err: any, ok: Replies.Consume) => void): void;
cancel(consumerTag: string, callback?: (err: any, ok: Replies.Empty) => void): void;
get(queue: string, options?: Options.Get, callback?: (err: any, ok: Message | false) => void): void;
+1 -1
View File
@@ -40,7 +40,7 @@ export interface Channel extends events.EventEmitter {
publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish): boolean;
sendToQueue(queue: string, content: Buffer, options?: Options.Publish): boolean;
consume(queue: string, onMessage: (msg: Message) => any, options?: Options.Consume): Promise<Replies.Consume>;
consume(queue: string, onMessage: (msg: Message | null) => any, options?: Options.Consume): Promise<Replies.Consume>;
cancel(consumerTag: string): Promise<Replies.Empty>;
get(queue: string, options?: Options.Get): Promise<Message | false>;
+2 -2
View File
@@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
@@ -20,4 +20,4 @@
"callback_api.d.ts",
"amqplib-tests.ts"
]
}
}
@@ -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;
+5
View File
@@ -45,9 +45,14 @@ declare namespace mgcrea.ngStrap {
template?: string;
templateUrl?: string;
contentTemplate?: string;
prefixClass?: string;
prefixEvent?: string;
id?: string;
scope?: ng.IScope;
onBeforeHide?: (modal: IModal) => void;
onHide?: (modal: IModal) => void;
onBeforeShow?: (modal: IModal) => void;
onShow?: (modal: IModal) => void;
}
interface IModalScope extends ng.IScope {
+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';
*
+6
View File
@@ -1035,6 +1035,12 @@ declare namespace angular {
* Creates a Deferred object which represents a task which will finish in the future.
*/
defer<T>(): IDeferred<T>;
/**
* Returns a promise that resolves or rejects as soon as one of those promises resolves or rejects, with the value or reason from that promise.
*
* @param promises A list or hash of promises.
*/
race<T>(promises: Array<IPromise<T>> | {[key: string]: IPromise<T>}): IPromise<T>;
/**
* Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it.
*
-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({
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for arrify 1.0.1
// Type definitions for arrify 1.0
// Project: https://github.com/sindresorhus/arrify
// Definitions by: AnJun Wang <https://github.com/wanganjun>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+1 -1
View File
@@ -19,4 +19,4 @@
"index.d.ts",
"arrify-tests.ts"
]
}
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
@@ -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 {
+1
View File
@@ -130,6 +130,7 @@ num = proxyResult.statusCode;
proxyResult.headers["example"] = str;
proxyResult.headers["example"] = b;
proxyResult.headers["example"] = num;
b = proxyResult.isBase64Encoded;
str = proxyResult.body;
/* API Gateway CustomAuthorizer AuthResponse */
+1
View File
@@ -288,6 +288,7 @@ interface ProxyResult {
[header: string]: boolean | number | string;
},
body: string;
isBase64Encoded?: boolean;
}
/**
+1 -4
View File
@@ -1,7 +1,5 @@
import * as babel from "babel-core";
// Example from https://github.com/babel/babel/tree/master/packages/babel-core
const code = `class Example {}`;
const result = babel.transform(code, { /* options */ });
@@ -9,7 +7,6 @@ result.code; // Generated code
result.map; // Sourcemap
result.ast; // AST
// Examples from http://babeljs.io/docs/usage/api/
let options: babel.TransformOptions = {
plugins: [
@@ -23,7 +20,7 @@ let options: babel.TransformOptions = {
sourceMaps: true
};
babel.transformFile("filename.js", options, function (err, result) {
babel.transformFile("filename.js", options, (err, result) => {
result.code;
result.map;
result.ast;
+12 -17
View File
@@ -1,20 +1,17 @@
// Type definitions for babel-core v6.7
// Type definitions for babel-core 6.25
// 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
/// <reference types="babel-template" />
/// <reference types="babel-traverse" />
/// <reference types="babel-types" />
// TypeScript Version: 2.3
import * as t from 'babel-types';
export {t as types};
type Node = t.Node;
export type Node = t.Node;
export import template = require('babel-template');
export var version: string;
import traverse, {Visitor} from "babel-traverse";
export {traverse, Visitor};
export const version: string;
import traverse, { Visitor } from "babel-traverse";
export { traverse, Visitor };
/** Transforms the passed in `code`. Returning an object with the generated code, source map, and AST. */
export function transform(code: string, opts?: TransformOptions): BabelFileResult;
@@ -28,7 +25,6 @@ export function transformFileSync(filename: string, opts?: TransformOptions): Ba
export function transformFromAst(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult;
export interface TransformOptions {
/** Filename to use when reading from stdin - this will be used in source-maps, errors etc. Default: "unknown". */
filename?: string;
@@ -36,7 +32,7 @@ export interface TransformOptions {
filenameRelative?: string;
/** A source map object that the output source map will be based on. */
inputSourceMap?: Object;
inputSourceMap?: object;
/**
* This is an object of keys that represent different environments. For example, you may have:
@@ -44,7 +40,7 @@ export interface TransformOptions {
* which will use those options when the enviroment variable `BABEL_ENV` is set to `"production"`.
* If `BABEL_ENV` isn't set then `NODE_ENV` will be used, if it's not set then it defaults to `"development"`.
*/
env?: Object;
env?: object;
/** Retain line numbers - will result in really ugly code. Default: `false` */
retainLines?: boolean;
@@ -83,7 +79,7 @@ export interface TransformOptions {
* An optional callback that controls whether a comment should be output or not. Called as
* `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comments` option when used.
*/
shouldPrintComment?: (comment: string) => boolean;
shouldPrintComment?(comment: string): boolean;
/**
* Do not include superfluous whitespace characters and line terminators. When set to `"auto"`, `compact` is set to
@@ -120,7 +116,7 @@ export interface TransformOptions {
* Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`.
* If falsy value is returned then the generated module id is used.
*/
getModuleId?: (moduleName: string) => string;
getModuleId?(moduleName: string): string;
/** Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions. */
moduleRoot?: string;
@@ -138,7 +134,6 @@ export interface TransformOptions {
export interface BabelFileResult {
ast?: Node;
code?: string;
map?: Object;
map?: object;
}
export as namespace babel;
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
@@ -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" }
@@ -1,5 +1,3 @@
/// <reference types="babel-generator" />
// Example from https://github.com/babel/babel/tree/master/packages/babel-template
import template = require('babel-template');
import generate from 'babel-generator';
+4 -7
View File
@@ -1,13 +1,11 @@
// Type definitions for babel-template v6.7
// Type definitions for babel-template 6.25
// 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;
@@ -18,4 +16,3 @@ export = template;
declare function template(code: string, opts?: BabylonOptions): UseTemplate;
type UseTemplate = (nodes?: {[placeholder: string]: Node}) => Node;
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1 -8
View File
@@ -1,11 +1,7 @@
/// <reference types="babylon" />
import * as babylon from "babylon";
import traverse, {Visitor} from 'babel-traverse';
import traverse, { Visitor } from 'babel-traverse';
import * as t from 'babel-types';
// Examples from: https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md
const MyVisitor: Visitor = {
Identifier: {
@@ -24,7 +20,6 @@ const MyVisitor2: Visitor = {
}
};
// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-traverse
const code = `function square(n) {
return n * n;
@@ -41,11 +36,9 @@ traverse(ast, {
}
});
// Examples from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#writing-your-first-babel-plugin
const v1: Visitor = {
BinaryExpression(path) {
if (t.isIdentifier(path.node.left)) {
// ...
+378 -377
View File
@@ -1,13 +1,12 @@
// Type definitions for babel-traverse v6.7
// Type definitions for babel-traverse 6.25
// 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
/// <reference types="babel-types" />
// TypeScript Version: 2.3
import * as t from 'babel-types';
type Node = t.Node;
export type Node = t.Node;
export default function traverse(parent: Node | Node[], opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath<Node>): void;
@@ -54,7 +53,7 @@ export class Scope {
/** Possibly generate a memoised identifier if it is not static and has consequences. */
maybeGenerateMemoised(node: Node, dontPush?: boolean): t.Identifier;
checkBlockScopedCollisions(local: Node, kind: string, name: string, id: Object): void;
checkBlockScopedCollisions(local: Node, kind: string, name: string, id: object): void;
rename(oldName: string, newName?: string, block?: Node): void;
@@ -95,7 +94,7 @@ export class Scope {
getBlockParent(): Scope;
/** Walks the scope tree and gathers **all** bindings. */
getAllBindings(...kinds: string[]): Object;
getAllBindings(...kinds: string[]): object;
bindingIdentifierEquals(name: string, node: Node): boolean;
@@ -129,9 +128,9 @@ export class Binding {
kind: 'var' | 'let' | 'const' | 'module';
referenced: boolean;
references: number;
referencePaths: NodePath<Node>[];
referencePaths: Array<NodePath<Node>>;
constant: boolean;
constantViolations: NodePath<Node>[];
constantViolations: Array<NodePath<Node>>;
}
export interface Visitor extends VisitNodeObject<Node> {
@@ -317,21 +316,21 @@ export interface VisitNodeObject<T> {
exit?(path: NodePath<T>, state: any): void;
}
export class NodePath<T> {
export class NodePath<T = Node> {
constructor(hub: Hub, parent: Node);
parent: Node;
hub: Hub;
contexts: TraversalContext[];
data: Object;
data: object;
shouldSkip: boolean;
shouldStop: boolean;
removed: boolean;
state: any;
opts: Object;
skipKeys: Object;
opts: object;
skipKeys: object;
parentPath: NodePath<Node>;
context: TraversalContext;
container: Object | Object[];
container: object | object[];
listKey: string;
inList: boolean;
parentKey: string;
@@ -339,7 +338,7 @@ export class NodePath<T> {
node: T;
scope: Scope;
type: string;
typeAnnotation: Object;
typeAnnotation: object;
getScope(scope: Scope): Scope;
@@ -355,7 +354,8 @@ export class NodePath<T> {
getPathLocation(): string;
debug(buildMessage: Function): void;
// Example: https://github.com/babel/babel/blob/63204ae51e020d84a5b246312f5eeb4d981ab952/packages/babel-traverse/src/path/modification.js#L83
debug(buildMessage: () => string): void;
// ------------------------- ancestry -------------------------
/**
@@ -379,17 +379,20 @@ export class NodePath<T> {
* Earliest is defined as being "before" all the other nodes in terms of list container
* position and visiting key.
*/
getEarliestCommonAncestorFrom(paths: NodePath<Node>[]): NodePath<Node>;
getEarliestCommonAncestorFrom(paths: Array<NodePath<Node>>): Array<NodePath<Node>>;
/** Get the earliest path in the tree where the provided `paths` intersect. */
getDeepestCommonAncestorFrom(paths: NodePath<Node>[], filter?: Function): NodePath<Node>;
getDeepestCommonAncestorFrom(
paths: Array<NodePath<Node>>,
filter?: (deepest: Node, i: number, ancestries: Array<NodePath<Node>>) => NodePath<Node>
): NodePath<Node>;
/**
* Build an array of node paths containing the entire ancestry of the current node path.
*
* NOTE: The current node path is included in this.
*/
getAncestry(): NodePath<Node>[];
getAncestry(): Array<NodePath<Node>>;
inType(...candidateTypes: string[]): boolean;
@@ -570,11 +573,9 @@ export class NodePath<T> {
hoist(scope: Scope): void;
// ------------------------- family -------------------------
getStatementParent(): NodePath<Node>;
getOpposite(): NodePath<Node>;
getCompletionRecords(): NodePath<Node>[];
getCompletionRecords(): Array<NodePath<Node>>;
getSibling(key: string): NodePath<Node>;
@@ -594,362 +595,362 @@ export class NodePath<T> {
addComments(type: string, comments: any[]): void;
// ------------------------- isXXX -------------------------
isArrayExpression(opts?: Object): boolean;
isAssignmentExpression(opts?: Object): boolean;
isBinaryExpression(opts?: Object): boolean;
isDirective(opts?: Object): boolean;
isDirectiveLiteral(opts?: Object): boolean;
isBlockStatement(opts?: Object): boolean;
isBreakStatement(opts?: Object): boolean;
isCallExpression(opts?: Object): boolean;
isCatchClause(opts?: Object): boolean;
isConditionalExpression(opts?: Object): boolean;
isContinueStatement(opts?: Object): boolean;
isDebuggerStatement(opts?: Object): boolean;
isDoWhileStatement(opts?: Object): boolean;
isEmptyStatement(opts?: Object): boolean;
isExpressionStatement(opts?: Object): boolean;
isFile(opts?: Object): boolean;
isForInStatement(opts?: Object): boolean;
isForStatement(opts?: Object): boolean;
isFunctionDeclaration(opts?: Object): boolean;
isFunctionExpression(opts?: Object): boolean;
isIdentifier(opts?: Object): boolean;
isIfStatement(opts?: Object): boolean;
isLabeledStatement(opts?: Object): boolean;
isStringLiteral(opts?: Object): boolean;
isNumericLiteral(opts?: Object): boolean;
isNullLiteral(opts?: Object): boolean;
isBooleanLiteral(opts?: Object): boolean;
isRegExpLiteral(opts?: Object): boolean;
isLogicalExpression(opts?: Object): boolean;
isMemberExpression(opts?: Object): boolean;
isNewExpression(opts?: Object): boolean;
isProgram(opts?: Object): boolean;
isObjectExpression(opts?: Object): boolean;
isObjectMethod(opts?: Object): boolean;
isObjectProperty(opts?: Object): boolean;
isRestElement(opts?: Object): boolean;
isReturnStatement(opts?: Object): boolean;
isSequenceExpression(opts?: Object): boolean;
isSwitchCase(opts?: Object): boolean;
isSwitchStatement(opts?: Object): boolean;
isThisExpression(opts?: Object): boolean;
isThrowStatement(opts?: Object): boolean;
isTryStatement(opts?: Object): boolean;
isUnaryExpression(opts?: Object): boolean;
isUpdateExpression(opts?: Object): boolean;
isVariableDeclaration(opts?: Object): boolean;
isVariableDeclarator(opts?: Object): boolean;
isWhileStatement(opts?: Object): boolean;
isWithStatement(opts?: Object): boolean;
isAssignmentPattern(opts?: Object): boolean;
isArrayPattern(opts?: Object): boolean;
isArrowFunctionExpression(opts?: Object): boolean;
isClassBody(opts?: Object): boolean;
isClassDeclaration(opts?: Object): boolean;
isClassExpression(opts?: Object): boolean;
isExportAllDeclaration(opts?: Object): boolean;
isExportDefaultDeclaration(opts?: Object): boolean;
isExportNamedDeclaration(opts?: Object): boolean;
isExportSpecifier(opts?: Object): boolean;
isForOfStatement(opts?: Object): boolean;
isImportDeclaration(opts?: Object): boolean;
isImportDefaultSpecifier(opts?: Object): boolean;
isImportNamespaceSpecifier(opts?: Object): boolean;
isImportSpecifier(opts?: Object): boolean;
isMetaProperty(opts?: Object): boolean;
isClassMethod(opts?: Object): boolean;
isObjectPattern(opts?: Object): boolean;
isSpreadElement(opts?: Object): boolean;
isSuper(opts?: Object): boolean;
isTaggedTemplateExpression(opts?: Object): boolean;
isTemplateElement(opts?: Object): boolean;
isTemplateLiteral(opts?: Object): boolean;
isYieldExpression(opts?: Object): boolean;
isAnyTypeAnnotation(opts?: Object): boolean;
isArrayTypeAnnotation(opts?: Object): boolean;
isBooleanTypeAnnotation(opts?: Object): boolean;
isBooleanLiteralTypeAnnotation(opts?: Object): boolean;
isNullLiteralTypeAnnotation(opts?: Object): boolean;
isClassImplements(opts?: Object): boolean;
isClassProperty(opts?: Object): boolean;
isDeclareClass(opts?: Object): boolean;
isDeclareFunction(opts?: Object): boolean;
isDeclareInterface(opts?: Object): boolean;
isDeclareModule(opts?: Object): boolean;
isDeclareTypeAlias(opts?: Object): boolean;
isDeclareVariable(opts?: Object): boolean;
isExistentialTypeParam(opts?: Object): boolean;
isFunctionTypeAnnotation(opts?: Object): boolean;
isFunctionTypeParam(opts?: Object): boolean;
isGenericTypeAnnotation(opts?: Object): boolean;
isInterfaceExtends(opts?: Object): boolean;
isInterfaceDeclaration(opts?: Object): boolean;
isIntersectionTypeAnnotation(opts?: Object): boolean;
isMixedTypeAnnotation(opts?: Object): boolean;
isNullableTypeAnnotation(opts?: Object): boolean;
isNumericLiteralTypeAnnotation(opts?: Object): boolean;
isNumberTypeAnnotation(opts?: Object): boolean;
isStringLiteralTypeAnnotation(opts?: Object): boolean;
isStringTypeAnnotation(opts?: Object): boolean;
isThisTypeAnnotation(opts?: Object): boolean;
isTupleTypeAnnotation(opts?: Object): boolean;
isTypeofTypeAnnotation(opts?: Object): boolean;
isTypeAlias(opts?: Object): boolean;
isTypeAnnotation(opts?: Object): boolean;
isTypeCastExpression(opts?: Object): boolean;
isTypeParameterDeclaration(opts?: Object): boolean;
isTypeParameterInstantiation(opts?: Object): boolean;
isObjectTypeAnnotation(opts?: Object): boolean;
isObjectTypeCallProperty(opts?: Object): boolean;
isObjectTypeIndexer(opts?: Object): boolean;
isObjectTypeProperty(opts?: Object): boolean;
isQualifiedTypeIdentifier(opts?: Object): boolean;
isUnionTypeAnnotation(opts?: Object): boolean;
isVoidTypeAnnotation(opts?: Object): boolean;
isJSXAttribute(opts?: Object): boolean;
isJSXClosingElement(opts?: Object): boolean;
isJSXElement(opts?: Object): boolean;
isJSXEmptyExpression(opts?: Object): boolean;
isJSXExpressionContainer(opts?: Object): boolean;
isJSXIdentifier(opts?: Object): boolean;
isJSXMemberExpression(opts?: Object): boolean;
isJSXNamespacedName(opts?: Object): boolean;
isJSXOpeningElement(opts?: Object): boolean;
isJSXSpreadAttribute(opts?: Object): boolean;
isJSXText(opts?: Object): boolean;
isNoop(opts?: Object): boolean;
isParenthesizedExpression(opts?: Object): boolean;
isAwaitExpression(opts?: Object): boolean;
isBindExpression(opts?: Object): boolean;
isDecorator(opts?: Object): boolean;
isDoExpression(opts?: Object): boolean;
isExportDefaultSpecifier(opts?: Object): boolean;
isExportNamespaceSpecifier(opts?: Object): boolean;
isRestProperty(opts?: Object): boolean;
isSpreadProperty(opts?: Object): boolean;
isExpression(opts?: Object): boolean;
isBinary(opts?: Object): boolean;
isScopable(opts?: Object): boolean;
isBlockParent(opts?: Object): boolean;
isBlock(opts?: Object): boolean;
isStatement(opts?: Object): boolean;
isTerminatorless(opts?: Object): boolean;
isCompletionStatement(opts?: Object): boolean;
isConditional(opts?: Object): boolean;
isLoop(opts?: Object): boolean;
isWhile(opts?: Object): boolean;
isExpressionWrapper(opts?: Object): boolean;
isFor(opts?: Object): boolean;
isForXStatement(opts?: Object): boolean;
isFunction(opts?: Object): boolean;
isFunctionParent(opts?: Object): boolean;
isPureish(opts?: Object): boolean;
isDeclaration(opts?: Object): boolean;
isLVal(opts?: Object): boolean;
isLiteral(opts?: Object): boolean;
isImmutable(opts?: Object): boolean;
isUserWhitespacable(opts?: Object): boolean;
isMethod(opts?: Object): boolean;
isObjectMember(opts?: Object): boolean;
isProperty(opts?: Object): boolean;
isUnaryLike(opts?: Object): boolean;
isPattern(opts?: Object): boolean;
isClass(opts?: Object): boolean;
isModuleDeclaration(opts?: Object): boolean;
isExportDeclaration(opts?: Object): boolean;
isModuleSpecifier(opts?: Object): boolean;
isFlow(opts?: Object): boolean;
isFlowBaseAnnotation(opts?: Object): boolean;
isFlowDeclaration(opts?: Object): boolean;
isJSX(opts?: Object): boolean;
isNumberLiteral(opts?: Object): boolean;
isRegexLiteral(opts?: Object): boolean;
isReferencedIdentifier(opts?: Object): boolean;
isReferencedMemberExpression(opts?: Object): boolean;
isBindingIdentifier(opts?: Object): boolean;
isScope(opts?: Object): boolean;
isReferenced(opts?: Object): boolean;
isBlockScoped(opts?: Object): boolean;
isVar(opts?: Object): boolean;
isUser(opts?: Object): boolean;
isGenerated(opts?: Object): boolean;
isPure(opts?: Object): boolean;
isArrayExpression(opts?: object): boolean;
isAssignmentExpression(opts?: object): boolean;
isBinaryExpression(opts?: object): boolean;
isDirective(opts?: object): boolean;
isDirectiveLiteral(opts?: object): boolean;
isBlockStatement(opts?: object): boolean;
isBreakStatement(opts?: object): boolean;
isCallExpression(opts?: object): boolean;
isCatchClause(opts?: object): boolean;
isConditionalExpression(opts?: object): boolean;
isContinueStatement(opts?: object): boolean;
isDebuggerStatement(opts?: object): boolean;
isDoWhileStatement(opts?: object): boolean;
isEmptyStatement(opts?: object): boolean;
isExpressionStatement(opts?: object): boolean;
isFile(opts?: object): boolean;
isForInStatement(opts?: object): boolean;
isForStatement(opts?: object): boolean;
isFunctionDeclaration(opts?: object): boolean;
isFunctionExpression(opts?: object): boolean;
isIdentifier(opts?: object): boolean;
isIfStatement(opts?: object): boolean;
isLabeledStatement(opts?: object): boolean;
isStringLiteral(opts?: object): boolean;
isNumericLiteral(opts?: object): boolean;
isNullLiteral(opts?: object): boolean;
isBooleanLiteral(opts?: object): boolean;
isRegExpLiteral(opts?: object): boolean;
isLogicalExpression(opts?: object): boolean;
isMemberExpression(opts?: object): boolean;
isNewExpression(opts?: object): boolean;
isProgram(opts?: object): boolean;
isObjectExpression(opts?: object): boolean;
isObjectMethod(opts?: object): boolean;
isObjectProperty(opts?: object): boolean;
isRestElement(opts?: object): boolean;
isReturnStatement(opts?: object): boolean;
isSequenceExpression(opts?: object): boolean;
isSwitchCase(opts?: object): boolean;
isSwitchStatement(opts?: object): boolean;
isThisExpression(opts?: object): boolean;
isThrowStatement(opts?: object): boolean;
isTryStatement(opts?: object): boolean;
isUnaryExpression(opts?: object): boolean;
isUpdateExpression(opts?: object): boolean;
isVariableDeclaration(opts?: object): boolean;
isVariableDeclarator(opts?: object): boolean;
isWhileStatement(opts?: object): boolean;
isWithStatement(opts?: object): boolean;
isAssignmentPattern(opts?: object): boolean;
isArrayPattern(opts?: object): boolean;
isArrowFunctionExpression(opts?: object): boolean;
isClassBody(opts?: object): boolean;
isClassDeclaration(opts?: object): boolean;
isClassExpression(opts?: object): boolean;
isExportAllDeclaration(opts?: object): boolean;
isExportDefaultDeclaration(opts?: object): boolean;
isExportNamedDeclaration(opts?: object): boolean;
isExportSpecifier(opts?: object): boolean;
isForOfStatement(opts?: object): boolean;
isImportDeclaration(opts?: object): boolean;
isImportDefaultSpecifier(opts?: object): boolean;
isImportNamespaceSpecifier(opts?: object): boolean;
isImportSpecifier(opts?: object): boolean;
isMetaProperty(opts?: object): boolean;
isClassMethod(opts?: object): boolean;
isObjectPattern(opts?: object): boolean;
isSpreadElement(opts?: object): boolean;
isSuper(opts?: object): boolean;
isTaggedTemplateExpression(opts?: object): boolean;
isTemplateElement(opts?: object): boolean;
isTemplateLiteral(opts?: object): boolean;
isYieldExpression(opts?: object): boolean;
isAnyTypeAnnotation(opts?: object): boolean;
isArrayTypeAnnotation(opts?: object): boolean;
isBooleanTypeAnnotation(opts?: object): boolean;
isBooleanLiteralTypeAnnotation(opts?: object): boolean;
isNullLiteralTypeAnnotation(opts?: object): boolean;
isClassImplements(opts?: object): boolean;
isClassProperty(opts?: object): boolean;
isDeclareClass(opts?: object): boolean;
isDeclareFunction(opts?: object): boolean;
isDeclareInterface(opts?: object): boolean;
isDeclareModule(opts?: object): boolean;
isDeclareTypeAlias(opts?: object): boolean;
isDeclareVariable(opts?: object): boolean;
isExistentialTypeParam(opts?: object): boolean;
isFunctionTypeAnnotation(opts?: object): boolean;
isFunctionTypeParam(opts?: object): boolean;
isGenericTypeAnnotation(opts?: object): boolean;
isInterfaceExtends(opts?: object): boolean;
isInterfaceDeclaration(opts?: object): boolean;
isIntersectionTypeAnnotation(opts?: object): boolean;
isMixedTypeAnnotation(opts?: object): boolean;
isNullableTypeAnnotation(opts?: object): boolean;
isNumericLiteralTypeAnnotation(opts?: object): boolean;
isNumberTypeAnnotation(opts?: object): boolean;
isStringLiteralTypeAnnotation(opts?: object): boolean;
isStringTypeAnnotation(opts?: object): boolean;
isThisTypeAnnotation(opts?: object): boolean;
isTupleTypeAnnotation(opts?: object): boolean;
isTypeofTypeAnnotation(opts?: object): boolean;
isTypeAlias(opts?: object): boolean;
isTypeAnnotation(opts?: object): boolean;
isTypeCastExpression(opts?: object): boolean;
isTypeParameterDeclaration(opts?: object): boolean;
isTypeParameterInstantiation(opts?: object): boolean;
isObjectTypeAnnotation(opts?: object): boolean;
isObjectTypeCallProperty(opts?: object): boolean;
isObjectTypeIndexer(opts?: object): boolean;
isObjectTypeProperty(opts?: object): boolean;
isQualifiedTypeIdentifier(opts?: object): boolean;
isUnionTypeAnnotation(opts?: object): boolean;
isVoidTypeAnnotation(opts?: object): boolean;
isJSXAttribute(opts?: object): boolean;
isJSXClosingElement(opts?: object): boolean;
isJSXElement(opts?: object): boolean;
isJSXEmptyExpression(opts?: object): boolean;
isJSXExpressionContainer(opts?: object): boolean;
isJSXIdentifier(opts?: object): boolean;
isJSXMemberExpression(opts?: object): boolean;
isJSXNamespacedName(opts?: object): boolean;
isJSXOpeningElement(opts?: object): boolean;
isJSXSpreadAttribute(opts?: object): boolean;
isJSXText(opts?: object): boolean;
isNoop(opts?: object): boolean;
isParenthesizedExpression(opts?: object): boolean;
isAwaitExpression(opts?: object): boolean;
isBindExpression(opts?: object): boolean;
isDecorator(opts?: object): boolean;
isDoExpression(opts?: object): boolean;
isExportDefaultSpecifier(opts?: object): boolean;
isExportNamespaceSpecifier(opts?: object): boolean;
isRestProperty(opts?: object): boolean;
isSpreadProperty(opts?: object): boolean;
isExpression(opts?: object): boolean;
isBinary(opts?: object): boolean;
isScopable(opts?: object): boolean;
isBlockParent(opts?: object): boolean;
isBlock(opts?: object): boolean;
isStatement(opts?: object): boolean;
isTerminatorless(opts?: object): boolean;
isCompletionStatement(opts?: object): boolean;
isConditional(opts?: object): boolean;
isLoop(opts?: object): boolean;
isWhile(opts?: object): boolean;
isExpressionWrapper(opts?: object): boolean;
isFor(opts?: object): boolean;
isForXStatement(opts?: object): boolean;
isFunction(opts?: object): boolean;
isFunctionParent(opts?: object): boolean;
isPureish(opts?: object): boolean;
isDeclaration(opts?: object): boolean;
isLVal(opts?: object): boolean;
isLiteral(opts?: object): boolean;
isImmutable(opts?: object): boolean;
isUserWhitespacable(opts?: object): boolean;
isMethod(opts?: object): boolean;
isObjectMember(opts?: object): boolean;
isProperty(opts?: object): boolean;
isUnaryLike(opts?: object): boolean;
isPattern(opts?: object): boolean;
isClass(opts?: object): boolean;
isModuleDeclaration(opts?: object): boolean;
isExportDeclaration(opts?: object): boolean;
isModuleSpecifier(opts?: object): boolean;
isFlow(opts?: object): boolean;
isFlowBaseAnnotation(opts?: object): boolean;
isFlowDeclaration(opts?: object): boolean;
isJSX(opts?: object): boolean;
isNumberLiteral(opts?: object): boolean;
isRegexLiteral(opts?: object): boolean;
isReferencedIdentifier(opts?: object): boolean;
isReferencedMemberExpression(opts?: object): boolean;
isBindingIdentifier(opts?: object): boolean;
isScope(opts?: object): boolean;
isReferenced(opts?: object): boolean;
isBlockScoped(opts?: object): boolean;
isVar(opts?: object): boolean;
isUser(opts?: object): boolean;
isGenerated(opts?: object): boolean;
isPure(opts?: object): boolean;
// ------------------------- assertXXX -------------------------
assertArrayExpression(opts?: Object): void;
assertAssignmentExpression(opts?: Object): void;
assertBinaryExpression(opts?: Object): void;
assertDirective(opts?: Object): void;
assertDirectiveLiteral(opts?: Object): void;
assertBlockStatement(opts?: Object): void;
assertBreakStatement(opts?: Object): void;
assertCallExpression(opts?: Object): void;
assertCatchClause(opts?: Object): void;
assertConditionalExpression(opts?: Object): void;
assertContinueStatement(opts?: Object): void;
assertDebuggerStatement(opts?: Object): void;
assertDoWhileStatement(opts?: Object): void;
assertEmptyStatement(opts?: Object): void;
assertExpressionStatement(opts?: Object): void;
assertFile(opts?: Object): void;
assertForInStatement(opts?: Object): void;
assertForStatement(opts?: Object): void;
assertFunctionDeclaration(opts?: Object): void;
assertFunctionExpression(opts?: Object): void;
assertIdentifier(opts?: Object): void;
assertIfStatement(opts?: Object): void;
assertLabeledStatement(opts?: Object): void;
assertStringLiteral(opts?: Object): void;
assertNumericLiteral(opts?: Object): void;
assertNullLiteral(opts?: Object): void;
assertBooleanLiteral(opts?: Object): void;
assertRegExpLiteral(opts?: Object): void;
assertLogicalExpression(opts?: Object): void;
assertMemberExpression(opts?: Object): void;
assertNewExpression(opts?: Object): void;
assertProgram(opts?: Object): void;
assertObjectExpression(opts?: Object): void;
assertObjectMethod(opts?: Object): void;
assertObjectProperty(opts?: Object): void;
assertRestElement(opts?: Object): void;
assertReturnStatement(opts?: Object): void;
assertSequenceExpression(opts?: Object): void;
assertSwitchCase(opts?: Object): void;
assertSwitchStatement(opts?: Object): void;
assertThisExpression(opts?: Object): void;
assertThrowStatement(opts?: Object): void;
assertTryStatement(opts?: Object): void;
assertUnaryExpression(opts?: Object): void;
assertUpdateExpression(opts?: Object): void;
assertVariableDeclaration(opts?: Object): void;
assertVariableDeclarator(opts?: Object): void;
assertWhileStatement(opts?: Object): void;
assertWithStatement(opts?: Object): void;
assertAssignmentPattern(opts?: Object): void;
assertArrayPattern(opts?: Object): void;
assertArrowFunctionExpression(opts?: Object): void;
assertClassBody(opts?: Object): void;
assertClassDeclaration(opts?: Object): void;
assertClassExpression(opts?: Object): void;
assertExportAllDeclaration(opts?: Object): void;
assertExportDefaultDeclaration(opts?: Object): void;
assertExportNamedDeclaration(opts?: Object): void;
assertExportSpecifier(opts?: Object): void;
assertForOfStatement(opts?: Object): void;
assertImportDeclaration(opts?: Object): void;
assertImportDefaultSpecifier(opts?: Object): void;
assertImportNamespaceSpecifier(opts?: Object): void;
assertImportSpecifier(opts?: Object): void;
assertMetaProperty(opts?: Object): void;
assertClassMethod(opts?: Object): void;
assertObjectPattern(opts?: Object): void;
assertSpreadElement(opts?: Object): void;
assertSuper(opts?: Object): void;
assertTaggedTemplateExpression(opts?: Object): void;
assertTemplateElement(opts?: Object): void;
assertTemplateLiteral(opts?: Object): void;
assertYieldExpression(opts?: Object): void;
assertAnyTypeAnnotation(opts?: Object): void;
assertArrayTypeAnnotation(opts?: Object): void;
assertBooleanTypeAnnotation(opts?: Object): void;
assertBooleanLiteralTypeAnnotation(opts?: Object): void;
assertNullLiteralTypeAnnotation(opts?: Object): void;
assertClassImplements(opts?: Object): void;
assertClassProperty(opts?: Object): void;
assertDeclareClass(opts?: Object): void;
assertDeclareFunction(opts?: Object): void;
assertDeclareInterface(opts?: Object): void;
assertDeclareModule(opts?: Object): void;
assertDeclareTypeAlias(opts?: Object): void;
assertDeclareVariable(opts?: Object): void;
assertExistentialTypeParam(opts?: Object): void;
assertFunctionTypeAnnotation(opts?: Object): void;
assertFunctionTypeParam(opts?: Object): void;
assertGenericTypeAnnotation(opts?: Object): void;
assertInterfaceExtends(opts?: Object): void;
assertInterfaceDeclaration(opts?: Object): void;
assertIntersectionTypeAnnotation(opts?: Object): void;
assertMixedTypeAnnotation(opts?: Object): void;
assertNullableTypeAnnotation(opts?: Object): void;
assertNumericLiteralTypeAnnotation(opts?: Object): void;
assertNumberTypeAnnotation(opts?: Object): void;
assertStringLiteralTypeAnnotation(opts?: Object): void;
assertStringTypeAnnotation(opts?: Object): void;
assertThisTypeAnnotation(opts?: Object): void;
assertTupleTypeAnnotation(opts?: Object): void;
assertTypeofTypeAnnotation(opts?: Object): void;
assertTypeAlias(opts?: Object): void;
assertTypeAnnotation(opts?: Object): void;
assertTypeCastExpression(opts?: Object): void;
assertTypeParameterDeclaration(opts?: Object): void;
assertTypeParameterInstantiation(opts?: Object): void;
assertObjectTypeAnnotation(opts?: Object): void;
assertObjectTypeCallProperty(opts?: Object): void;
assertObjectTypeIndexer(opts?: Object): void;
assertObjectTypeProperty(opts?: Object): void;
assertQualifiedTypeIdentifier(opts?: Object): void;
assertUnionTypeAnnotation(opts?: Object): void;
assertVoidTypeAnnotation(opts?: Object): void;
assertJSXAttribute(opts?: Object): void;
assertJSXClosingElement(opts?: Object): void;
assertJSXElement(opts?: Object): void;
assertJSXEmptyExpression(opts?: Object): void;
assertJSXExpressionContainer(opts?: Object): void;
assertJSXIdentifier(opts?: Object): void;
assertJSXMemberExpression(opts?: Object): void;
assertJSXNamespacedName(opts?: Object): void;
assertJSXOpeningElement(opts?: Object): void;
assertJSXSpreadAttribute(opts?: Object): void;
assertJSXText(opts?: Object): void;
assertNoop(opts?: Object): void;
assertParenthesizedExpression(opts?: Object): void;
assertAwaitExpression(opts?: Object): void;
assertBindExpression(opts?: Object): void;
assertDecorator(opts?: Object): void;
assertDoExpression(opts?: Object): void;
assertExportDefaultSpecifier(opts?: Object): void;
assertExportNamespaceSpecifier(opts?: Object): void;
assertRestProperty(opts?: Object): void;
assertSpreadProperty(opts?: Object): void;
assertExpression(opts?: Object): void;
assertBinary(opts?: Object): void;
assertScopable(opts?: Object): void;
assertBlockParent(opts?: Object): void;
assertBlock(opts?: Object): void;
assertStatement(opts?: Object): void;
assertTerminatorless(opts?: Object): void;
assertCompletionStatement(opts?: Object): void;
assertConditional(opts?: Object): void;
assertLoop(opts?: Object): void;
assertWhile(opts?: Object): void;
assertExpressionWrapper(opts?: Object): void;
assertFor(opts?: Object): void;
assertForXStatement(opts?: Object): void;
assertFunction(opts?: Object): void;
assertFunctionParent(opts?: Object): void;
assertPureish(opts?: Object): void;
assertDeclaration(opts?: Object): void;
assertLVal(opts?: Object): void;
assertLiteral(opts?: Object): void;
assertImmutable(opts?: Object): void;
assertUserWhitespacable(opts?: Object): void;
assertMethod(opts?: Object): void;
assertObjectMember(opts?: Object): void;
assertProperty(opts?: Object): void;
assertUnaryLike(opts?: Object): void;
assertPattern(opts?: Object): void;
assertClass(opts?: Object): void;
assertModuleDeclaration(opts?: Object): void;
assertExportDeclaration(opts?: Object): void;
assertModuleSpecifier(opts?: Object): void;
assertFlow(opts?: Object): void;
assertFlowBaseAnnotation(opts?: Object): void;
assertFlowDeclaration(opts?: Object): void;
assertJSX(opts?: Object): void;
assertNumberLiteral(opts?: Object): void;
assertRegexLiteral(opts?: Object): void;
assertArrayExpression(opts?: object): void;
assertAssignmentExpression(opts?: object): void;
assertBinaryExpression(opts?: object): void;
assertDirective(opts?: object): void;
assertDirectiveLiteral(opts?: object): void;
assertBlockStatement(opts?: object): void;
assertBreakStatement(opts?: object): void;
assertCallExpression(opts?: object): void;
assertCatchClause(opts?: object): void;
assertConditionalExpression(opts?: object): void;
assertContinueStatement(opts?: object): void;
assertDebuggerStatement(opts?: object): void;
assertDoWhileStatement(opts?: object): void;
assertEmptyStatement(opts?: object): void;
assertExpressionStatement(opts?: object): void;
assertFile(opts?: object): void;
assertForInStatement(opts?: object): void;
assertForStatement(opts?: object): void;
assertFunctionDeclaration(opts?: object): void;
assertFunctionExpression(opts?: object): void;
assertIdentifier(opts?: object): void;
assertIfStatement(opts?: object): void;
assertLabeledStatement(opts?: object): void;
assertStringLiteral(opts?: object): void;
assertNumericLiteral(opts?: object): void;
assertNullLiteral(opts?: object): void;
assertBooleanLiteral(opts?: object): void;
assertRegExpLiteral(opts?: object): void;
assertLogicalExpression(opts?: object): void;
assertMemberExpression(opts?: object): void;
assertNewExpression(opts?: object): void;
assertProgram(opts?: object): void;
assertObjectExpression(opts?: object): void;
assertObjectMethod(opts?: object): void;
assertObjectProperty(opts?: object): void;
assertRestElement(opts?: object): void;
assertReturnStatement(opts?: object): void;
assertSequenceExpression(opts?: object): void;
assertSwitchCase(opts?: object): void;
assertSwitchStatement(opts?: object): void;
assertThisExpression(opts?: object): void;
assertThrowStatement(opts?: object): void;
assertTryStatement(opts?: object): void;
assertUnaryExpression(opts?: object): void;
assertUpdateExpression(opts?: object): void;
assertVariableDeclaration(opts?: object): void;
assertVariableDeclarator(opts?: object): void;
assertWhileStatement(opts?: object): void;
assertWithStatement(opts?: object): void;
assertAssignmentPattern(opts?: object): void;
assertArrayPattern(opts?: object): void;
assertArrowFunctionExpression(opts?: object): void;
assertClassBody(opts?: object): void;
assertClassDeclaration(opts?: object): void;
assertClassExpression(opts?: object): void;
assertExportAllDeclaration(opts?: object): void;
assertExportDefaultDeclaration(opts?: object): void;
assertExportNamedDeclaration(opts?: object): void;
assertExportSpecifier(opts?: object): void;
assertForOfStatement(opts?: object): void;
assertImportDeclaration(opts?: object): void;
assertImportDefaultSpecifier(opts?: object): void;
assertImportNamespaceSpecifier(opts?: object): void;
assertImportSpecifier(opts?: object): void;
assertMetaProperty(opts?: object): void;
assertClassMethod(opts?: object): void;
assertObjectPattern(opts?: object): void;
assertSpreadElement(opts?: object): void;
assertSuper(opts?: object): void;
assertTaggedTemplateExpression(opts?: object): void;
assertTemplateElement(opts?: object): void;
assertTemplateLiteral(opts?: object): void;
assertYieldExpression(opts?: object): void;
assertAnyTypeAnnotation(opts?: object): void;
assertArrayTypeAnnotation(opts?: object): void;
assertBooleanTypeAnnotation(opts?: object): void;
assertBooleanLiteralTypeAnnotation(opts?: object): void;
assertNullLiteralTypeAnnotation(opts?: object): void;
assertClassImplements(opts?: object): void;
assertClassProperty(opts?: object): void;
assertDeclareClass(opts?: object): void;
assertDeclareFunction(opts?: object): void;
assertDeclareInterface(opts?: object): void;
assertDeclareModule(opts?: object): void;
assertDeclareTypeAlias(opts?: object): void;
assertDeclareVariable(opts?: object): void;
assertExistentialTypeParam(opts?: object): void;
assertFunctionTypeAnnotation(opts?: object): void;
assertFunctionTypeParam(opts?: object): void;
assertGenericTypeAnnotation(opts?: object): void;
assertInterfaceExtends(opts?: object): void;
assertInterfaceDeclaration(opts?: object): void;
assertIntersectionTypeAnnotation(opts?: object): void;
assertMixedTypeAnnotation(opts?: object): void;
assertNullableTypeAnnotation(opts?: object): void;
assertNumericLiteralTypeAnnotation(opts?: object): void;
assertNumberTypeAnnotation(opts?: object): void;
assertStringLiteralTypeAnnotation(opts?: object): void;
assertStringTypeAnnotation(opts?: object): void;
assertThisTypeAnnotation(opts?: object): void;
assertTupleTypeAnnotation(opts?: object): void;
assertTypeofTypeAnnotation(opts?: object): void;
assertTypeAlias(opts?: object): void;
assertTypeAnnotation(opts?: object): void;
assertTypeCastExpression(opts?: object): void;
assertTypeParameterDeclaration(opts?: object): void;
assertTypeParameterInstantiation(opts?: object): void;
assertObjectTypeAnnotation(opts?: object): void;
assertObjectTypeCallProperty(opts?: object): void;
assertObjectTypeIndexer(opts?: object): void;
assertObjectTypeProperty(opts?: object): void;
assertQualifiedTypeIdentifier(opts?: object): void;
assertUnionTypeAnnotation(opts?: object): void;
assertVoidTypeAnnotation(opts?: object): void;
assertJSXAttribute(opts?: object): void;
assertJSXClosingElement(opts?: object): void;
assertJSXElement(opts?: object): void;
assertJSXEmptyExpression(opts?: object): void;
assertJSXExpressionContainer(opts?: object): void;
assertJSXIdentifier(opts?: object): void;
assertJSXMemberExpression(opts?: object): void;
assertJSXNamespacedName(opts?: object): void;
assertJSXOpeningElement(opts?: object): void;
assertJSXSpreadAttribute(opts?: object): void;
assertJSXText(opts?: object): void;
assertNoop(opts?: object): void;
assertParenthesizedExpression(opts?: object): void;
assertAwaitExpression(opts?: object): void;
assertBindExpression(opts?: object): void;
assertDecorator(opts?: object): void;
assertDoExpression(opts?: object): void;
assertExportDefaultSpecifier(opts?: object): void;
assertExportNamespaceSpecifier(opts?: object): void;
assertRestProperty(opts?: object): void;
assertSpreadProperty(opts?: object): void;
assertExpression(opts?: object): void;
assertBinary(opts?: object): void;
assertScopable(opts?: object): void;
assertBlockParent(opts?: object): void;
assertBlock(opts?: object): void;
assertStatement(opts?: object): void;
assertTerminatorless(opts?: object): void;
assertCompletionStatement(opts?: object): void;
assertConditional(opts?: object): void;
assertLoop(opts?: object): void;
assertWhile(opts?: object): void;
assertExpressionWrapper(opts?: object): void;
assertFor(opts?: object): void;
assertForXStatement(opts?: object): void;
assertFunction(opts?: object): void;
assertFunctionParent(opts?: object): void;
assertPureish(opts?: object): void;
assertDeclaration(opts?: object): void;
assertLVal(opts?: object): void;
assertLiteral(opts?: object): void;
assertImmutable(opts?: object): void;
assertUserWhitespacable(opts?: object): void;
assertMethod(opts?: object): void;
assertObjectMember(opts?: object): void;
assertProperty(opts?: object): void;
assertUnaryLike(opts?: object): void;
assertPattern(opts?: object): void;
assertClass(opts?: object): void;
assertModuleDeclaration(opts?: object): void;
assertExportDeclaration(opts?: object): void;
assertModuleSpecifier(opts?: object): void;
assertFlow(opts?: object): void;
assertFlowBaseAnnotation(opts?: object): void;
assertFlowDeclaration(opts?: object): void;
assertJSX(opts?: object): void;
assertNumberLiteral(opts?: object): void;
assertRegexLiteral(opts?: object): void;
}
export class Hub {
@@ -958,7 +959,7 @@ export class Hub {
options: any;
}
interface TraversalContext {
export interface TraversalContext {
parentPath: NodePath<Node>;
scope: Scope;
state: any;
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+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";
+1 -1
View File
@@ -96,7 +96,7 @@ declare namespace Bookshelf {
static where<T>(key: string, operatorOrValue: string | number | boolean, valueIfOperator?: string | number | boolean): T;
belongsTo<R extends Model<any>>(target: { new (...args: any[]): R }, foreignKey?: string, foreignKeyTarget?: string): R;
belongsToMany<R extends Model<any>>(target: { new (...args: any[]): R }, table?: string, foreignKey?: string, otherKey?: string): Collection<R>;
belongsToMany<R extends Model<any>>(target: { new (...args: any[]): R }, table?: string, foreignKey?: string, otherKey?: string, foreignKeyTarget?: string, otherKeyTarget?: string): Collection<R>;
count(column?: string, options?: SyncOptions): BlueBird<number>;
destroy(options?: DestroyOptions): BlueBird<T>;
fetch(options?: FetchOptions): BlueBird<T>;
+2 -1
View File
@@ -136,7 +136,8 @@ const gatewayTimeoutError = Boom.gatewayTimeout('message', {some: 'data'});
gatewayTimeoutError.data.some;
const gatewayTimeoutError2: Boom.BoomError = Boom.gatewayTimeout('message');
// wrap and create
// boomify, wrap, and create
const boomifiedError = Boom.boomify(new Error('test'), { statusCode: 400, message: 'some message' })
const wrappedError = Boom.wrap(new Error('test'), 400, 'some message');
+11 -1
View File
@@ -1,6 +1,8 @@
// Type definitions for boom 4.3
// Project: http://github.com/hapijs/boom
// Definitions by: Igor Rogatty <http://github.com/rogatty>, AJP <http://github.com/AJamesPhillips>
// Definitions by: Igor Rogatty <http://github.com/rogatty>
// AJP <http://github.com/AJamesPhillips>
// Jinesh Shah <http://github.com/jineshshah36>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -53,6 +55,14 @@ declare namespace Boom {
// Excluded this to aid typing of the other values. See tests for example casting to a custom interface to manipulate the payload
// [anyContent: string]: any;
}
/**
* Decorates an error with the boom properties
* @param error the error object to wrap. If error is already a boom object, it defaults to overriding the object with the new status code and message.
* @param options optional additional options
* @see {@link https://github.com/hapijs/boom#boomifyerror-options}
*/
export function boomify(error: Error, options?: { statusCode?: number, message?: string, override?: boolean }): BoomError<null>;
/**
* Decorates an error with the boom properties
+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" }
+30
View File
@@ -6,6 +6,7 @@
// Olivier Chevet <https://github.com/olivr70>,
// Matt Wistrand <https://github.com/mwistrand>,
// Josh Goldberg <https://github.com/joshuakgoldberg>
// Shaun Luttin <https://github.com/shaunluttin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// <reference types="assertion-error"/>
@@ -487,6 +488,24 @@ declare namespace Chai {
*/
isNotNaN<T>(value: T, message?: string): void;
/**
* Asserts that the target is neither null nor undefined.
*
* @type T Type of value.
* @param value Actual value.
* @param message Message to display on error.
*/
exists<T>(value: T, message?: string): void;
/**
* Asserts that the target is either null or undefined.
*
* @type T Type of value.
* @param value Actual value.
* @param message Message to display on error.
*/
notExists<T>(value: T, message?: string): void;
/**
* Asserts that value is undefined.
*
@@ -1318,6 +1337,17 @@ declare namespace Chai {
* @param message Message to display on error.
*/
notFrozen<T>(object: T, message?: string): void;
/**
* Asserts that the target contains values. For arrays and strings, it checks
* the length property. For Map and Set instances, it checks the size property.
* For non-function objects, it gets the count of own enumerable string keys.
*
* @type T Type of object.
* @param object Object to test.
* @param message Message to display on error.
*/
isNotEmpty<T>(object: T, message?: string): void;
}
export interface Config {
+1
View File
@@ -37,3 +37,4 @@ var timeString: string = chance.time();
var chanceConstructedWithSeed100 = new Chance(100);
var chanceCalledWithSeed100 = Chance()
var chanceConstructedWithStringSeed = new Chance("test")
+5 -4
View File
@@ -4,20 +4,21 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Chance {
type Seed = number | string;
interface Seeded {
seed: number;
seed: Seed;
}
type SeededChance = Chance & Seeded;
interface ChanceStatic {
(): Chance
(seed: number): SeededChance
(seed: Seed): SeededChance
(generator: () => any): Chance
new(): Chance;
new(seed: number): SeededChance;
new(seed: Seed): SeededChance;
new(generator: () => any): Chance;
}
@@ -156,7 +157,7 @@ declare namespace Chance {
// "Hidden"
cc_types(): CreditCardType[];
mersenne_twister(seed?: number): any; // API return type not defined in docs
mersenne_twister(seed?: Seed): any; // API return type not defined in docs
months(): Month[];
name_prefixes(): Name[];
provinces(): Name[];
+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;
@@ -17,6 +17,6 @@
},
"files": [
"index.d.ts",
"node-portscanner-tests.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 => {
+1 -1
View File
@@ -20,5 +20,5 @@ declare module "codemirror" {
* tokens will be converted to span elements as in an editor,
* and inserted into the node (through innerHTML).
*/
function runMode(text: string, modespec: any, callback: (HTMLElement | ((text: string, style: string) => void)), options? : { tabSize?: number; state?: any; }): void;
function runMode(text: string, modespec: any, callback: (HTMLElement | ((text: string, style: string | null) => void)), options? : { tabSize?: number; state?: any; }): void;
}
+9 -9
View File
@@ -163,7 +163,7 @@ declare namespace CodeMirror {
/** Sets the gutter marker for the given gutter (identified by its CSS class, see the gutters option) to the given value.
Value can be either null, to clear the marker, or a DOM element, to set it. The DOM element will be shown in the specified gutter next to the specified line. */
setGutterMarker(line: any, gutterID: string, value: HTMLElement): CodeMirror.LineHandle;
setGutterMarker(line: any, gutterID: string, value: HTMLElement | null): CodeMirror.LineHandle;
/** Remove all gutter markers in the gutter with the given ID. */
clearGutter(gutterID: string): void;
@@ -228,7 +228,7 @@ declare namespace CodeMirror {
setSize(width: any, height: any): void;
/** Scroll the editor to a given(pixel) position.Both arguments may be left as null or undefined to have no effect. */
scrollTo(x: number, y: number): void;
scrollTo(x?: number | null, y?: number | null): void;
/** Get an { left , top , width , height , clientWidth , clientHeight } object that represents the current scroll position, the size of the scrollable area,
and the size of the visible area(minus scrollbars). */
@@ -236,7 +236,7 @@ declare namespace CodeMirror {
/** Scrolls the given element into view. pos is a { line , ch } position, referring to a given character, null, to refer to the cursor.
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
scrollIntoView(pos: CodeMirror.Position, margin?: number): void;
scrollIntoView(pos: CodeMirror.Position | null, margin?: number): void;
/** Scrolls the given element into view. pos is a { left , top , right , bottom } object, in editor-local coordinates.
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
@@ -297,7 +297,7 @@ declare namespace CodeMirror {
/** The token's string. */
string: string;
/** The token type the mode assigned to the token, such as "keyword" or "comment" (may also be null). */
type: string;
type: string | null;
/** The mode's state at the end of this token. */
state: any;
};
@@ -464,7 +464,7 @@ declare namespace CodeMirror {
getLineHandle(num: number): CodeMirror.LineHandle;
/** Given a line handle, returns the current position of that line (or null when it is no longer in the document). */
getLineNumber(handle: CodeMirror.LineHandle): number;
getLineNumber(handle: CodeMirror.LineHandle): number | null;
/** Iterate over the whole document, and call f for each line, passing the line handle.
This is a faster way to visit a range of line handlers than calling getLineHandle for each of them.
@@ -522,7 +522,7 @@ declare namespace CodeMirror {
/** Retrieve the editor associated with a document. May return null. */
getEditor(): CodeMirror.Editor;
getEditor(): CodeMirror.Editor | null;
/** Create an identical copy of the given doc. When copyHistory is true , the history will also be copied.Can not be called directly on an editor. */
@@ -935,12 +935,12 @@ declare namespace CodeMirror {
/**
* Returns the next character in the stream without advancing it. Will return an null at the end of the line.
*/
peek(): string;
peek(): string | null;
/**
* Returns the next character in the stream and advances it. Also returns null when no more characters are available.
*/
next(): string;
next(): string | null;
/**
* match can be a character, a regular expression, or a function that takes a character and returns a boolean.
@@ -1016,7 +1016,7 @@ declare namespace CodeMirror {
* This function should read one token from the stream it is given as an argument, optionally update its state,
* and return a style string, or null for tokens that do not have to be styled. Multiple styles can be returned, separated by spaces.
*/
token(stream: StringStream, state: T): string;
token(stream: StringStream, state: T): string | null;
/**
* A function that produces a state object to be used at the start of a document.
@@ -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" }
+37 -35
View File
@@ -1,41 +1,43 @@
import * as Color from "color"
import Color = require('color');
var color: Color.Color = Color("white")
var colorOther: Color.Color = Color("black")
var colorRGB: Color.Color = Color({ r : 0, g : 0, b : 0 }, "rgb")
var colorInt: Color.Color = Color(0x000000)
const color: Color = new Color("white");
const colorOther: Color = new Color("black");
const colorRGB: Color = new Color({ r: 0, g: 0, b: 0 }, "rgb");
const colorInt: Color = new Color(0x000000);
const colorWithoutNew: Color = Color(0x000000);
const colorByStaticMethod: Color = Color.rgb({ r: 0, g: 0, b: 0 });
var hex: string = color.hex()
var percent: string = color.percentString()
var keyword: string | void = color.keyword()
var alpha: number = color.alpha()
var red: number = color.red()
var green: number = color.green()
var blue: number = color.blue()
var hue: number = color.hue()
var saturationl: number = color.saturationl()
var lightness: number = color.lightness()
var saturationv: number = color.saturationv()
var value: number = color.value()
var cyan: number = color.cyan()
var magenta: number = color.magenta()
var yellow: number = color.yellow()
var black: number = color.black()
var luminosity: number = color.luminosity()
var contrast: number = color.contrast(colorOther)
var dark: boolean = color.dark()
var light: boolean = color.light()
var level: string = color.level(colorOther)
const hex: string = color.hex();
const percent: string = color.percentString();
const keyword: string = color.keyword();
const alpha: number = color.alpha();
const red: number = color.red();
const green: number = color.green();
const blue: number = color.blue();
const hue: number = color.hue();
const saturationl: number = color.saturationl();
const lightness: number = color.lightness();
const saturationv: number = color.saturationv();
const value: number = color.value();
const cyan: number = color.cyan();
const magenta: number = color.magenta();
const yellow: number = color.yellow();
const black: number = color.black();
const luminosity: number = color.luminosity();
const contrast: number = color.contrast(colorOther);
const dark: boolean = color.dark();
const light: boolean = color.light();
const level: string = color.level(colorOther);
var x: number = color.x()
var y: number = color.y()
var z: number = color.z()
var l: number = color.l()
var a: number = color.a()
var b: number = color.b()
var rgbNumber: number = color.rgbNumber()
const x: number = color.x();
const y: number = color.y();
const z: number = color.z();
const l: number = color.l();
const a: number = color.a();
const b: number = color.b();
const rgbNumber: number = color.rgbNumber();
var chain: Color.Color = color
const chain: Color = color
.alpha(0)
.red(0)
.green(0)
@@ -54,7 +56,7 @@ var chain: Color.Color = color
.darken(0)
.saturate(0)
.desaturate(0)
.greyscale()
.grayscale()
.whiten(0)
.blacken(0)
.opaquer(0)
+127 -93
View File
@@ -1,101 +1,135 @@
// Type definitions for color 1.0
// Project: https://www.npmjs.com/package/color
// Definitions by: Karol Janyst <https://github.com/LKay>
// Type definitions for color 2.0
// Project: https://github.com/qix-/color#readme
// Definitions by: Junyoung Clare Jang <https://github.com/Airlun>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
declare namespace Color {
import convert = require('color-convert');
type ColorParam = string | { [param: string]: number } | number;
type ColorParam = Color | string | ArrayLike<number> | number | { [key: string]: any };
type ColorModel = "rgb" | "hsl" | "hsv" | "hwb" | "hcg" | "cmyk" | "xyz" | "lab" | "hex" | "gray" | "keyword";
interface Color {
toString(): string;
toJSON(): Color;
string(places?: number): string;
percentString(places?: number): string;
array(): number[];
object(): { alpha?: number } & { [key: string]: number };
unitArray(): number[];
unitObject(): { r: number, g: number, b: number, alpha?: number };
round(places?: number): Color;
alpha(): number;
alpha(val: number): Color;
red(): number;
red(val: number): Color;
green(): number;
green(val: number): Color;
blue(): number;
blue(val: number): Color;
hue(): number;
hue(val: number): Color;
saturationl(): number;
saturationl(val: number): Color;
lightness(): number;
lightness(val: number): Color;
saturationv(): number;
saturationv(val: number): Color;
value(): number;
value(val: number): Color;
chroma(): number;
chroma(val: number): Color;
gray(): number;
gray(val: number): Color;
white(): number;
white(val: number): Color;
wblack(): number;
wblack(val: number): Color;
cyan(): number;
cyan(val: number): Color;
magenta(): number;
magenta(val: number): Color;
yellow(): number;
yellow(val: number): Color;
black(): number;
black(val: number): Color;
x(): number;
x(val: number): Color;
y(): number;
y(val: number): Color;
z(): number;
z(val: number): Color;
l(): number;
l(val: number): Color;
a(): number;
a(val: number): Color;
b(): number;
b(val: number): Color;
keyword(): string;
keyword(val: string): Color;
hex(): string;
hex(val: string): Color;
rgbNumber(): number;
luminosity(): number;
contrast(color2: Color): number;
level(color2: Color): 'AAA' | 'AA' | '';
dark(): boolean;
light(): boolean;
negate(): Color;
lighten(ratio: number): Color;
darken(ratio: number): Color;
saturate(ratio: number): Color;
desaturate(ratio: number): Color;
whiten(ratio: number): Color;
blacken(ratio: number): Color;
grayscale(): Color;
fade(ratio: number): Color;
opaquer(ratio: number): Color;
rotate(degrees: number): Color;
mix(mixinColor: Color, weight?: number): Color;
interface Color {
(color: ColorParam | Color, model?: ColorModel) : Color;
toString(): string;
toJSON(): any;
string(places?: number): string;
percentString(placse?: number): string;
array(): number[];
object(): any;
unitArray(): any[];
unitObject(): any;
round(places?: number): Color;
alpha(alpha: number): Color;
alpha(): number;
red(red: number): Color;
red(): number;
green(green: number): Color;
green(): number;
blue(blue: number): Color;
blue(): number;
hue(hue: number): Color;
hue(): number;
saturationl(saturation: number): Color;
saturationl(): number;
lightness(lightness: number): Color;
lightness(): number;
saturationv(saturationv: number): Color;
saturationv(): number;
value(value: number): Color;
value(): number;
chroma(chroma: number): Color;
chroma(): number;
gray(value: number): Color;
gray(): number;
cyan(cyan: number): Color;
cyan(): number;
magenta(magenta: number): Color;
magenta(): number;
yellow(yellow: number): Color;
yellow(): number;
black(black: number): Color;
black(): number;
x(x: number): Color;
x(): number;
y(y: number): Color;
y(): number;
z(z: number): Color;
z(): number;
l(l: number): Color;
l(): number;
a(a: number): Color;
a(): number;
b(b: number): Color;
b(): number;
keyword(keyword: string): Color;
keyword(): string | undefined;
hex(color: string): Color;
hex(): string;
rgb(): Color;
hsl(): Color;
hsv(): Color;
hwb(): Color;
hcg(): Color;
cmyk(): Color;
xyz(): Color;
lab(): Color;
rgbNumber(): number;
luminosity(): number;
contrast(color: Color): number;
level(color: Color): string;
dark(): boolean;
light(): boolean;
negate(): Color;
lighten(value: number): Color;
darken(value: number): Color;
saturate(value: number): Color;
desaturate(value: number): Color;
whiten(value: number): Color;
blacken(value: number): Color;
greyscale(): Color;
fade(ratio: number): Color;
opaquer(value: number): Color;
rotate(value: number): Color;
mix(color: Color, value?: number): Color;
hsl(): Color;
}
rgb(...args: number[]): Color;
hsl(...args: number[]): Color;
hsv(...args: number[]): Color;
hwb(...args: number[]): Color;
cmyk(...args: number[]): Color;
xyz(...args: number[]): Color;
lab(...args: number[]): Color;
lch(...args: number[]): Color;
ansi16(...args: number[]): Color;
ansi256(...args: number[]): Color;
hcg(...args: number[]): Color;
apple(...args: number[]): Color;
}
declare const Color: Color.Color;
interface ColorConstructor {
(obj?: ColorParam, model?: keyof (typeof convert)): Color;
new(obj?: ColorParam, model?: keyof (typeof convert)): Color;
rgb(...val: number[]): Color;
rgb(color: ColorParam): Color;
hsl(...val: number[]): Color;
hsl(color: ColorParam): Color;
hsv(...val: number[]): Color;
hsv(color: ColorParam): Color;
hwb(...val: number[]): Color;
hwb(color: ColorParam): Color;
cmyk(...val: number[]): Color;
cmyk(color: ColorParam): Color;
xyz(...val: number[]): Color;
xyz(color: ColorParam): Color;
lab(...val: number[]): Color;
lab(color: ColorParam): Color;
lch(...val: number[]): Color;
lch(color: ColorParam): Color;
ansi16(...val: number[]): Color;
ansi16(color: ColorParam): Color;
ansi256(...val: number[]): Color;
ansi256(color: ColorParam): Color;
hcg(...val: number[]): Color;
hcg(color: ColorParam): Color;
apple(...val: number[]): Color;
apple(color: ColorParam): Color;
}
declare const Color: ColorConstructor;
export = Color;
export as namespace Color;
+1 -1
View File
@@ -19,4 +19,4 @@
"index.d.ts",
"color-tests.ts"
]
}
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+63
View File
@@ -0,0 +1,63 @@
import * as Color from "color"
var color: Color.Color = Color("white")
var colorOther: Color.Color = Color("black")
var colorRGB: Color.Color = Color({ r : 0, g : 0, b : 0 }, "rgb")
var colorInt: Color.Color = Color(0x000000)
var hex: string = color.hex()
var percent: string = color.percentString()
var keyword: string | void = color.keyword()
var alpha: number = color.alpha()
var red: number = color.red()
var green: number = color.green()
var blue: number = color.blue()
var hue: number = color.hue()
var saturationl: number = color.saturationl()
var lightness: number = color.lightness()
var saturationv: number = color.saturationv()
var value: number = color.value()
var cyan: number = color.cyan()
var magenta: number = color.magenta()
var yellow: number = color.yellow()
var black: number = color.black()
var luminosity: number = color.luminosity()
var contrast: number = color.contrast(colorOther)
var dark: boolean = color.dark()
var light: boolean = color.light()
var level: string = color.level(colorOther)
var x: number = color.x()
var y: number = color.y()
var z: number = color.z()
var l: number = color.l()
var a: number = color.a()
var b: number = color.b()
var rgbNumber: number = color.rgbNumber()
var chain: Color.Color = color
.alpha(0)
.red(0)
.green(0)
.blue(0)
.hue(0)
.saturationl(0)
.lightness(0)
.saturationv(0)
.value(0)
.cyan(0)
.magenta(0)
.yellow(0)
.black(0)
.negate()
.lighten(0)
.darken(0)
.saturate(0)
.desaturate(0)
.greyscale()
.whiten(0)
.blacken(0)
.opaquer(0)
.rotate(0)
.mix(colorOther, 0)
.hsl();
+101
View File
@@ -0,0 +1,101 @@
// Type definitions for color 1.0
// Project: https://www.npmjs.com/package/color
// Definitions by: Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Color {
type ColorParam = string | { [param: string]: number } | number;
type ColorModel = "rgb" | "hsl" | "hsv" | "hwb" | "hcg" | "cmyk" | "xyz" | "lab" | "hex" | "gray" | "keyword";
interface Color {
(color: ColorParam | Color, model?: ColorModel) : Color;
toString(): string;
toJSON(): any;
string(places?: number): string;
percentString(placse?: number): string;
array(): number[];
object(): any;
unitArray(): any[];
unitObject(): any;
round(places?: number): Color;
alpha(alpha: number): Color;
alpha(): number;
red(red: number): Color;
red(): number;
green(green: number): Color;
green(): number;
blue(blue: number): Color;
blue(): number;
hue(hue: number): Color;
hue(): number;
saturationl(saturation: number): Color;
saturationl(): number;
lightness(lightness: number): Color;
lightness(): number;
saturationv(saturationv: number): Color;
saturationv(): number;
value(value: number): Color;
value(): number;
chroma(chroma: number): Color;
chroma(): number;
gray(value: number): Color;
gray(): number;
cyan(cyan: number): Color;
cyan(): number;
magenta(magenta: number): Color;
magenta(): number;
yellow(yellow: number): Color;
yellow(): number;
black(black: number): Color;
black(): number;
x(x: number): Color;
x(): number;
y(y: number): Color;
y(): number;
z(z: number): Color;
z(): number;
l(l: number): Color;
l(): number;
a(a: number): Color;
a(): number;
b(b: number): Color;
b(): number;
keyword(keyword: string): Color;
keyword(): string | undefined;
hex(color: string): Color;
hex(): string;
rgb(): Color;
hsl(): Color;
hsv(): Color;
hwb(): Color;
hcg(): Color;
cmyk(): Color;
xyz(): Color;
lab(): Color;
rgbNumber(): number;
luminosity(): number;
contrast(color: Color): number;
level(color: Color): string;
dark(): boolean;
light(): boolean;
negate(): Color;
lighten(value: number): Color;
darken(value: number): Color;
saturate(value: number): Color;
desaturate(value: number): Color;
whiten(value: number): Color;
blacken(value: number): Color;
greyscale(): Color;
fade(ratio: number): Color;
opaquer(value: number): Color;
rotate(value: number): Color;
mix(color: Color, value?: number): Color;
hsl(): Color;
}
}
declare const Color: Color.Color;
export = Color;
export as namespace Color;
+27
View File
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../../",
"typeRoots": [
"../../"
],
"types": [],
"paths": {
"color": [
"color/v1"
]
},
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"color-tests.ts"
]
}
+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
};
}

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