mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 19:51:53 +00:00
Remove duplicate declaration files (#12277)
This commit is contained in:
@@ -1 +0,0 @@
|
||||
--noImplicitAny --module commonjs
|
||||
Vendored
-105
@@ -1,105 +0,0 @@
|
||||
// Type definitions for bit-array v0.2.2
|
||||
// Project: https://github.com/bramstein/bit-array
|
||||
// Definitions by: Mudkip <https://github.com/mudkipme>
|
||||
// Definitions: https://github.com/mudkipme/DefinitelyTyped
|
||||
|
||||
declare module "bit-array" {
|
||||
|
||||
class BitArray {
|
||||
/**
|
||||
* Creates a new empty BitArray with the given length or initialises the BitArray with the given hex representation.
|
||||
*/
|
||||
constructor(size: number, hex?: string);
|
||||
|
||||
/**
|
||||
* Returns the total number of bits in this BitArray.
|
||||
*/
|
||||
size(): number;
|
||||
|
||||
/**
|
||||
* Sets the bit at index to a value (boolean.)
|
||||
*/
|
||||
set(index: number, value: boolean): BitArray;
|
||||
|
||||
/**
|
||||
* Toggles the bit at index. If the bit is on, it is turned off. Likewise, if the bit is off it is turned on.
|
||||
*/
|
||||
toggle(index: number): BitArray;
|
||||
|
||||
/**
|
||||
* Returns the value of the bit at index (boolean.)
|
||||
*/
|
||||
get(index: number): boolean;
|
||||
|
||||
/**
|
||||
* Resets the BitArray so that it is empty and can be re-used.
|
||||
*/
|
||||
reset(): BitArray;
|
||||
|
||||
/**
|
||||
* Returns a copy of this BitArray.
|
||||
*/
|
||||
copy(): BitArray;
|
||||
|
||||
/**
|
||||
* Returns true if this BitArray equals another. Two BitArrays are considered
|
||||
* equal if both have the same length and bit pattern.
|
||||
*/
|
||||
equals(x: BitArray): boolean;
|
||||
|
||||
/**
|
||||
* Returns the JSON representation of this BitArray.
|
||||
*/
|
||||
toJSON(): string;
|
||||
|
||||
/**
|
||||
* Returns a string representation of the BitArray with bits
|
||||
* in mathemetical order.
|
||||
*/
|
||||
toBinaryString(): string;
|
||||
|
||||
/**
|
||||
* Returns a hexadecimal string representation of the BitArray
|
||||
* with bits in logical order.
|
||||
*/
|
||||
toHexString(): string;
|
||||
|
||||
/**
|
||||
* Returns a string representation of the BitArray with bits
|
||||
* in logical order.
|
||||
*/
|
||||
toString(): string;
|
||||
|
||||
/**
|
||||
* Convert the BitArray to an Array of boolean values (slow).
|
||||
*/
|
||||
toArray(): boolean[];
|
||||
|
||||
/**
|
||||
* Returns the total number of bits set to one in this BitArray.
|
||||
*/
|
||||
count(): number;
|
||||
|
||||
/**
|
||||
* Inverts this BitArray.
|
||||
*/
|
||||
not(): BitArray;
|
||||
|
||||
/**
|
||||
* Bitwise OR on the values of this BitArray using BitArray x.
|
||||
*/
|
||||
or(x: BitArray): BitArray;
|
||||
|
||||
/**
|
||||
* Bitwise AND on the values of this BitArray using BitArray x.
|
||||
*/
|
||||
and(x: BitArray): BitArray;
|
||||
|
||||
/**
|
||||
* Bitwise XOR on the values of this BitArray using BitArray x.
|
||||
*/
|
||||
xor(x: BitArray): BitArray;
|
||||
}
|
||||
|
||||
export = BitArray;
|
||||
}
|
||||
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
// Type definitions for bunyan-config 0.2.0
|
||||
// Project: https://github.com/LSEducation/bunyan-config
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../bunyan/bunyan.d.ts"/>
|
||||
|
||||
declare module "bunyan-config" {
|
||||
import * as bunyan from "bunyan";
|
||||
|
||||
/**
|
||||
* Configuration.
|
||||
* @interface
|
||||
*/
|
||||
interface Configuration {
|
||||
name: string;
|
||||
streams?: bunyan.Stream[];
|
||||
level?: string | number;
|
||||
stream?: NodeJS.WritableStream;
|
||||
serializers?: {};
|
||||
src?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param {Configuration} [jsonConfig] A JSON configuration.
|
||||
* @return {LoggerOptions} A logger options.
|
||||
*/
|
||||
function bunyanConfig(jsonConfig?: Configuration): bunyan.LoggerOptions;
|
||||
export = bunyanConfig;
|
||||
}
|
||||
Vendored
-495
@@ -1,495 +0,0 @@
|
||||
// Type definitions for Cash
|
||||
// Project: https://github.com/kenwheeler/cash
|
||||
// Definitions by: Ashok Vishwakarma <https://github.com/akvlko>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* OffsetType
|
||||
* return type for cash.offset(), cash.position()
|
||||
*/
|
||||
interface OffsetType {
|
||||
top: number;
|
||||
left: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* CashStatic
|
||||
* Static declaration for CashJs accessible directly using Cash object or $
|
||||
*/
|
||||
interface CashStatic {
|
||||
/**
|
||||
* isArray
|
||||
* Check if the argument is an array.
|
||||
* @type method
|
||||
* @argument any
|
||||
* @return boolean
|
||||
*/
|
||||
isArray(n: any): boolean;
|
||||
|
||||
/**
|
||||
* isFunction
|
||||
* Check if the argument is a function.
|
||||
* @type method
|
||||
* @argument any
|
||||
* @return boolean
|
||||
*/
|
||||
isFunction(n: any): boolean;
|
||||
|
||||
/**
|
||||
* isNumeric
|
||||
* Check if the argument is numeric.
|
||||
* @type method
|
||||
* @type method
|
||||
* @argument any
|
||||
* @return boolean
|
||||
*/
|
||||
isNumeric(n: any): boolean;
|
||||
|
||||
/**
|
||||
* isString
|
||||
* Check if the argument is a string.
|
||||
* @type method
|
||||
* @argument str any
|
||||
* @return boolean
|
||||
*/
|
||||
isString(str: any): boolean;
|
||||
|
||||
/**
|
||||
* extend
|
||||
* Extends target object with properties from the source object. If no target is provided, cash itself will be extended.
|
||||
* @type method
|
||||
* @argument target any, source any
|
||||
*/
|
||||
extend(target: any, source: any): any;
|
||||
|
||||
/**
|
||||
* matches
|
||||
* Checks a selector against an element, returning a boolean value for match.
|
||||
* @type method
|
||||
* @argument element Cash, selector string
|
||||
* @return boolean
|
||||
*/
|
||||
matches(element: Cash, selector: string): boolean;
|
||||
|
||||
/**
|
||||
* parseHTML
|
||||
* Returns a collection from an HTML string.
|
||||
* @type method
|
||||
* @argument htmlString string
|
||||
* @return Cash
|
||||
*/
|
||||
parseHTML(htmlString: string): Cash;
|
||||
|
||||
/**
|
||||
* each
|
||||
* Iterates through a collection and calls the callback method on each.
|
||||
* @type method
|
||||
* @argument collection Array, callback Function
|
||||
* @return Array
|
||||
*/
|
||||
each(collection: Array<any>, callback: Function): Array<any>;
|
||||
|
||||
/**
|
||||
* fn: use to extend cash for plugin development
|
||||
* @type property
|
||||
*/
|
||||
fn: any;
|
||||
|
||||
/**
|
||||
* selector declaration for Cash to use $(<argument>)
|
||||
*/
|
||||
(selector: string, context?: Element|Cash): Cash;
|
||||
(element: Element): Cash;
|
||||
(elementArray: Element[]): Cash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cash
|
||||
* Interface for CashJs
|
||||
* Refer https://github.com/kenwheeler/cash for documentation and uses of the methods and properties
|
||||
*/
|
||||
interface Cash {
|
||||
/**
|
||||
* add
|
||||
* Returns a new collection with the element(s) added to the end.
|
||||
*/
|
||||
add(selector: string|Cash|Element, context?: Element): Cash;
|
||||
|
||||
/**
|
||||
* addClass
|
||||
* Adds the className argument to collection elements.
|
||||
*/
|
||||
addClass(c: string): Cash;
|
||||
|
||||
/**
|
||||
* after
|
||||
* Inserts content or elements after the collection.
|
||||
*/
|
||||
after(selector: Element|String): Cash;
|
||||
|
||||
/**
|
||||
* append
|
||||
* Appends the target element to the each element in the collection.
|
||||
*/
|
||||
append(content: string|Element|Cash): Cash;
|
||||
|
||||
/**
|
||||
* appendTo
|
||||
* Adds the elements in a collection to the target element(s).
|
||||
*/
|
||||
appendTo(parent: string|Element|Cash): Cash;
|
||||
|
||||
/**
|
||||
* attr
|
||||
* Without attrValue, returns the attribute value of the first element in the collection.
|
||||
* With attrValue, sets the attribute value of each element of the collection.
|
||||
*/
|
||||
attr(name: string): any;
|
||||
attr(name: string, value: string): Cash;
|
||||
|
||||
/**
|
||||
* before
|
||||
* Inserts content or elements before the collection.
|
||||
*/
|
||||
before(selector: string|Element): Cash;
|
||||
|
||||
/**
|
||||
* children
|
||||
* Without a selector specified, returns a collection of child elements.
|
||||
* With a selector, returns child elements that match the selector.
|
||||
*/
|
||||
children(selector?: string): Cash;
|
||||
|
||||
/**
|
||||
* closest
|
||||
* Returns the closest matching selector up the DOM tree.
|
||||
*/
|
||||
closest(selector?: string): Cash;
|
||||
|
||||
/**
|
||||
* clone
|
||||
* Returns a clone of the collection.
|
||||
*/
|
||||
clone(): Cash;
|
||||
|
||||
/**
|
||||
* css
|
||||
* Returns a CSS property value when just property is supplied.
|
||||
* Sets a CSS property when property and value are supplied, and set multiple properties when an object is supplied.
|
||||
* Properties will be autoprefixed if needed for the user's browser.
|
||||
*/
|
||||
css(prop: any): any;
|
||||
css(prop: string, value: any): Cash;
|
||||
|
||||
/**
|
||||
* data
|
||||
* Link some data (string, object, array, etc.) to an element when both key and value are supplied.
|
||||
* If only a key is supplied, returns the linked data and falls back to data attribute value if no data is already linked.
|
||||
* Multiple data can be set when an object is supplied.
|
||||
*/
|
||||
data(name: any): any;
|
||||
data(name: string, value: any): Cash;
|
||||
|
||||
/**
|
||||
* each
|
||||
* Iterates over a collection with callback(value, index, array).
|
||||
*/
|
||||
each(callback: Function): Cash;
|
||||
|
||||
/**
|
||||
* empty
|
||||
* Empties an elements interior markup.
|
||||
*/
|
||||
empty(): Cash;
|
||||
|
||||
/**
|
||||
* eq
|
||||
* Returns a collection with the element at index.
|
||||
*/
|
||||
eq(index: number): Cash;
|
||||
|
||||
/**
|
||||
* extend
|
||||
* Adds properties to the cash collection prototype.
|
||||
*/
|
||||
extend(target: any): any;
|
||||
|
||||
/**
|
||||
* filter
|
||||
* Returns the collection that results from applying the filter method.
|
||||
*/
|
||||
filter(selector: Function): Cash;
|
||||
|
||||
/**
|
||||
* find
|
||||
* Returns selector match descendants from the first element in the collection.
|
||||
*/
|
||||
find(selector: string): Cash;
|
||||
|
||||
/**
|
||||
* first
|
||||
* Returns the first element in the collection.
|
||||
*/
|
||||
first(): Cash;
|
||||
|
||||
/**
|
||||
* get
|
||||
* Returns the element at the index.
|
||||
*/
|
||||
get(index: number): HTMLElement;
|
||||
|
||||
/**
|
||||
* has
|
||||
* Returns boolean result of the selector argument against the collection.
|
||||
*/
|
||||
has(selector: string): boolean;
|
||||
|
||||
/**
|
||||
* hasClass
|
||||
* Returns the boolean result of checking if the first element in the collection has the className attribute.
|
||||
*/
|
||||
hasClass(c: string): boolean;
|
||||
|
||||
/**
|
||||
* height
|
||||
* Returns the height of the element.
|
||||
*/
|
||||
height(): number;
|
||||
|
||||
/**
|
||||
* html
|
||||
* Returns the HTML text of the first element in the collection, sets the HTML if provided.
|
||||
*/
|
||||
html(): string;
|
||||
html(content: string): Cash;
|
||||
|
||||
/**
|
||||
* index
|
||||
* Returns the index of the element in its parent if an element or selector isn't provided.
|
||||
* Returns index within element or selector if it is.
|
||||
*/
|
||||
index(elem?: Element): number;
|
||||
|
||||
/**
|
||||
* innerHeight
|
||||
* Returns the height of the element + padding.
|
||||
*/
|
||||
innerHeight(): number;
|
||||
|
||||
/**
|
||||
* innerWidth
|
||||
* Returns the width of the element + padding.
|
||||
*/
|
||||
innerWidth(): number;
|
||||
|
||||
/**
|
||||
* insertAfter
|
||||
* Inserts collection after specified element.
|
||||
*/
|
||||
insertAfter(selector: string|Element|Cash): Cash;
|
||||
|
||||
/**
|
||||
* insertBefore
|
||||
* Inserts collection before specified element.
|
||||
*/
|
||||
insertBefore(selector: string|Element|Cash): Cash;
|
||||
|
||||
/**
|
||||
* is
|
||||
* Returns whether the provided selector, element or collection matches any element in the collection.
|
||||
*/
|
||||
is(selector: string|Element|Cash): boolean;
|
||||
|
||||
/**
|
||||
* last
|
||||
* Returns last element in the collection.
|
||||
*/
|
||||
last(): Cash;
|
||||
|
||||
/**
|
||||
* next
|
||||
* Returns next sibling.
|
||||
*/
|
||||
next(): Cash;
|
||||
|
||||
/**
|
||||
* not
|
||||
* Filters collection by false match on selector.
|
||||
*/
|
||||
not(selector: string|Element|Cash): Cash;
|
||||
|
||||
/**
|
||||
* off
|
||||
* Removes event listener from collection elements.
|
||||
*/
|
||||
off(eventName: string, callback: Function): Cash;
|
||||
|
||||
/**
|
||||
* offset
|
||||
* Get the coordinates of the first element in a collection relative to the document.
|
||||
*/
|
||||
offset(): OffsetType;
|
||||
|
||||
/**
|
||||
* offsetParent
|
||||
* Get the first element's ancestor that's positioned.
|
||||
*/
|
||||
offsetParent(): OffsetType;
|
||||
|
||||
/**
|
||||
* on
|
||||
* Adds event listener to collection elements. Event is delegated if delegate is supplied.
|
||||
*/
|
||||
on(eventName: string|Array<string>, delegate: any, callback?: Function, runOnce?: boolean): Cash;
|
||||
|
||||
/**
|
||||
* one
|
||||
* Adds event listener to collection elements that only triggers once for each element.
|
||||
* Event is delegated if delegate is supplied.
|
||||
*/
|
||||
one(eventName: string|Array<string>, delegate: any, callback?: Function, runOnce?: boolean): Cash;
|
||||
|
||||
/**
|
||||
* outerHeight
|
||||
* Returns the outer height of the element. Includes margins if margin is set to true.
|
||||
*/
|
||||
outerHeight(flag?: boolean): number;
|
||||
|
||||
/**
|
||||
* outerWidth
|
||||
* Returns the outer width of the element. Includes margins if margin is set to true.
|
||||
*/
|
||||
outerWidth(flag?: boolean): number;
|
||||
|
||||
/**
|
||||
* parent
|
||||
* Returns parent element.
|
||||
*/
|
||||
parent(): Cash;
|
||||
|
||||
/**
|
||||
* parents
|
||||
* Returns collection of elements who are parents of element. Optionally filtering by selector.
|
||||
*/
|
||||
parents(selector?: string): Cash;
|
||||
|
||||
/**
|
||||
* position
|
||||
* Get the coordinates of the first element in a collection relative to its offsetParent.
|
||||
*/
|
||||
position(): OffsetType;
|
||||
|
||||
/**
|
||||
* prepend
|
||||
* Prepends element to the each element in collection.
|
||||
*/
|
||||
prepend(content: string): Cash;
|
||||
|
||||
/**
|
||||
* prependTo
|
||||
* Prepends elements in a collection to the target element(s).
|
||||
*/
|
||||
prependTo(parent: string|Element|Cash): Cash;
|
||||
|
||||
/**
|
||||
* prev
|
||||
* Returns the previous adjacent element.
|
||||
*/
|
||||
prev(): Cash;
|
||||
|
||||
/**
|
||||
* prop
|
||||
* Returns a property value when just property is supplied.
|
||||
* Sets a property when property and value are supplied, and sets multiple properties when an object is supplied.
|
||||
*/
|
||||
prop(name: string): any;
|
||||
prop(name: string, value: string): Cash;
|
||||
|
||||
/**
|
||||
* ready
|
||||
* Calls callback method on DOMContentLoaded.
|
||||
*/
|
||||
ready(fn: Function): void;
|
||||
|
||||
/**
|
||||
* remove
|
||||
* Removes collection elements from the DOM.
|
||||
*/
|
||||
remove(): Cash;
|
||||
|
||||
/**
|
||||
* removeAttr
|
||||
* Removes attribute from collection elements.
|
||||
*/
|
||||
removeAttr(name: string): Cash;
|
||||
|
||||
/**
|
||||
* removeClass
|
||||
* Removes className from collection elements.
|
||||
* Accepts space-separated classNames for removing multiple classes.
|
||||
* Providing no arguments will remove all classes.
|
||||
*/
|
||||
removeClass(c?: string): Cash;
|
||||
|
||||
/**
|
||||
* removeData
|
||||
* Removes linked data and data-attributes from collection elements.
|
||||
*/
|
||||
removeData(key: string): Cash;
|
||||
|
||||
/**
|
||||
* removeProp
|
||||
* Removes property from collection elements.
|
||||
*/
|
||||
removeProp(name: string): Cash;
|
||||
|
||||
/**
|
||||
* serialize
|
||||
* When called on a form, serializes and returns form data.
|
||||
*/
|
||||
serialize(): string;
|
||||
|
||||
/**
|
||||
* siblings
|
||||
* Returns a collection of sibling elements.
|
||||
*/
|
||||
siblings(): Cash;
|
||||
|
||||
/**
|
||||
* text
|
||||
* Returns the inner text of the first element in the collection, sets the text if textContent is provided.
|
||||
*/
|
||||
text(): string;
|
||||
text(content?: string): Cash;
|
||||
|
||||
/**
|
||||
* toggleClass
|
||||
* Adds or removes className from collection elements based on if the element already has the class.
|
||||
* Accepts space-separated classNames for toggling multiple classes, and an optional force boolean to ensure classes are added (true) or removed (false).
|
||||
*/
|
||||
toggleClass(c: string, state?: boolean): Cash;
|
||||
|
||||
/**
|
||||
* trigger
|
||||
* Triggers supplied event on elements in collection. Data can be passed along as the second parameter.
|
||||
*/
|
||||
trigger(eventName: string, data?: any): Cash;
|
||||
|
||||
/**
|
||||
* val
|
||||
* Returns an inputs value. If value is supplied, sets all inputs in collection's value to the value argument.
|
||||
*/
|
||||
val(): any;
|
||||
val(value?: string): Cash;
|
||||
|
||||
/**
|
||||
* width
|
||||
* Returns the width of the element.
|
||||
*/
|
||||
width(): number;
|
||||
}
|
||||
|
||||
declare module "cash" {
|
||||
export = CashStatic;
|
||||
}
|
||||
declare var cash: CashStatic;
|
||||
Vendored
-216
@@ -1,216 +0,0 @@
|
||||
// Type definitions for cheap-ruler 2.4.1
|
||||
// Project: https://github.com/mapbox/cheap-ruler
|
||||
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "cheap-ruler" {
|
||||
type BBox = [number, number, number, number] | number[]
|
||||
type Point = [number, number] | number[]
|
||||
type Line = Array<Point>
|
||||
type Points = Array<Point>
|
||||
type Polygon = Array<Array<Point>>
|
||||
|
||||
interface TemplateUnits {
|
||||
kilometers: number
|
||||
miles: number
|
||||
nauticalmiles: number
|
||||
meters: number
|
||||
metres: number
|
||||
yards: number
|
||||
feet: number
|
||||
inches: number
|
||||
}
|
||||
interface InterfacePointOnLine {
|
||||
point: Point
|
||||
index: number
|
||||
t: number
|
||||
}
|
||||
class CheapRuler {
|
||||
/**
|
||||
* Given two points of the form [longitude, latitude], returns the distance.
|
||||
*
|
||||
* @param {Point} a point [longitude, latitude]
|
||||
* @param {Point} b point [longitude, latitude]
|
||||
* @returns {number} distance
|
||||
* @example
|
||||
* var distance = ruler.distance([30.5, 50.5], [30.51, 50.49]);
|
||||
* //=distance
|
||||
*/
|
||||
distance(a: Point, b: Point): number;
|
||||
|
||||
/**
|
||||
* Returns the bearing between two points in angles.
|
||||
*
|
||||
* @param {Point} a point [longitude, latitude]
|
||||
* @param {Point} b point [longitude, latitude]
|
||||
* @returns {number} bearing
|
||||
* @example
|
||||
* var bearing = ruler.bearing([30.5, 50.5], [30.51, 50.49]);
|
||||
* //=bearing
|
||||
*/
|
||||
bearing(a: Point, b: Point): number;
|
||||
|
||||
/**
|
||||
* Returns a new point given distance and bearing from the starting point.
|
||||
*
|
||||
* @param {Point} p point [longitude, latitude]
|
||||
* @param {number} dist distance
|
||||
* @param {number} bearing
|
||||
* @returns {Point} point [longitude, latitude]
|
||||
* @example
|
||||
* var point = ruler.destination([30.5, 50.5], 0.1, 90);
|
||||
* //=point
|
||||
*/
|
||||
destination(p: Point, dist: number, bearing: number): Point;
|
||||
|
||||
/**
|
||||
* Given a line (an array of points), returns the total line distance.
|
||||
*
|
||||
* @param {Points} points [longitude, latitude]
|
||||
* @returns {number} total line distance
|
||||
* @example
|
||||
* var length = ruler.lineDistance([
|
||||
* [-67.031, 50.458], [-67.031, 50.534],
|
||||
* [-66.929, 50.534], [-66.929, 50.458]
|
||||
* ]);
|
||||
* //=length
|
||||
*/
|
||||
lineDistance(points: Points): number;
|
||||
|
||||
/**
|
||||
* Given a polygon (an array of rings, where each ring is an array of points), returns the area.
|
||||
*
|
||||
* @param {Polygon} polygon
|
||||
* @returns {number} area value in the specified units (square kilometers by default)
|
||||
* @example
|
||||
* var area = ruler.area([[
|
||||
* [-67.031, 50.458], [-67.031, 50.534], [-66.929, 50.534],
|
||||
* [-66.929, 50.458], [-67.031, 50.458]
|
||||
* ]]);
|
||||
* //=area
|
||||
*/
|
||||
area(polygon: Polygon): number;
|
||||
|
||||
/**
|
||||
* Returns the point at a specified distance along the line.
|
||||
*
|
||||
* @param {Line} line
|
||||
* @param {number} dist distance
|
||||
* @returns {Point} point [longitude, latitude]
|
||||
* @example
|
||||
* var point = ruler.along(line, 2.5);
|
||||
* //=point
|
||||
*/
|
||||
along(line: Line, dist: number): Point
|
||||
|
||||
/**
|
||||
* Returns an object of the form {point, index} where point is closest point on the line from the given point, and index is the start index of the segment with the closest point.
|
||||
*
|
||||
* @pointOnLine
|
||||
* @param {Line} line
|
||||
* @param {Point} p point [longitude, latitude]
|
||||
* @returns {Object} {point, index}
|
||||
* @example
|
||||
* var point = ruler.pointOnLine(line, [-67.04, 50.5]).point;
|
||||
* //=point
|
||||
*/
|
||||
pointOnLine(line: Line, p: Point): InterfacePointOnLine
|
||||
|
||||
/**
|
||||
* Returns a part of the given line between the start and the stop points (or their closest points on the line).
|
||||
*
|
||||
* @param {Point} start point [longitude, latitude]
|
||||
* @param {Point} stop point [longitude, latitude]
|
||||
* @param {Line} line
|
||||
* @returns {Line} line part of a line
|
||||
* @example
|
||||
* var line2 = ruler.lineSlice([-67.04, 50.5], [-67.05, 50.56], line1);
|
||||
* //=line2
|
||||
*/
|
||||
lineSlice(start: Point, stop: Point, line: Line): Line
|
||||
|
||||
/**
|
||||
* Returns a part of the given line between the start and the stop points indicated by distance along the line.
|
||||
*
|
||||
* @param {number} start distance
|
||||
* @param {number} stop distance
|
||||
* @param {Line} line
|
||||
* @returns {Line} line part of a line
|
||||
* @example
|
||||
* var line2 = ruler.lineSliceAlong(10, 20, line1);
|
||||
* //=line2
|
||||
*/
|
||||
lineSliceAlong(start: number, stop: number, line: Line): Line
|
||||
|
||||
/**
|
||||
* Given a point, returns a bounding box object ([w, s, e, n]) created from the given point buffered by a given distance.
|
||||
*
|
||||
* @param {Point} p point [longitude, latitude]
|
||||
* @param {number} buffer
|
||||
* @returns {BBox} box object ([w, s, e, n])
|
||||
* @example
|
||||
* var bbox = ruler.bufferPoint([30.5, 50.5], 0.01);
|
||||
* //=bbox
|
||||
*/
|
||||
bufferPoint(p: Point, buffer: number): BBox
|
||||
|
||||
/**
|
||||
* Given a bounding box, returns the box buffered by a given distance.
|
||||
*
|
||||
* @param {BBox} box object ([w, s, e, n])
|
||||
* @param {number} buffer
|
||||
* @returns {BBox} box object ([w, s, e, n])
|
||||
* @example
|
||||
* var bbox = ruler.bufferBBox([30.5, 50.5, 31, 51], 0.2);
|
||||
* //=bbox
|
||||
*/
|
||||
bufferBBox(bbox: BBox, buffer: number): BBox
|
||||
|
||||
/**
|
||||
* Returns true if the given point is inside in the given bounding box, otherwise false.
|
||||
*
|
||||
* @param {Point} p point [longitude, latitude]
|
||||
* @param {Point} box object ([w, s, e, n])
|
||||
* @returns {boolean}
|
||||
* @example
|
||||
* var inside = ruler.insideBBox([30.5, 50.5], [30, 50, 31, 51]);
|
||||
* //=inside
|
||||
*/
|
||||
insideBBox(p: Point, bbox: BBox): boolean
|
||||
}
|
||||
/**
|
||||
* A collection of very fast approximations to common geodesic measurements. Useful for performance-sensitive code that measures things on a city scale.
|
||||
*
|
||||
* @param {number} lat latitude
|
||||
* @param {string} [units='kilometers']
|
||||
* @returns {CheapRuler}
|
||||
* @example
|
||||
* var ruler = cheapRuler(35.05, 'miles');
|
||||
* //=ruler
|
||||
*/
|
||||
function cheapRuler(lat: number, units?: string): CheapRuler;
|
||||
namespace cheapRuler {
|
||||
/**
|
||||
* Multipliers for converting between units.
|
||||
*
|
||||
* @example
|
||||
* // convert 50 meters to yards
|
||||
* 50 * cheapRuler.units.yards / cheapRuler.units.meters;
|
||||
*/
|
||||
const units: TemplateUnits
|
||||
|
||||
/**
|
||||
* Creates a ruler object from tile coordinates (y and z). Convenient in tile-reduce scripts.
|
||||
*
|
||||
* @param {number} y
|
||||
* @param {number} z
|
||||
* @param {string} [units='kilometers']
|
||||
* @returns {CheapRuler}
|
||||
* @example
|
||||
* var ruler = cheapRuler.fromTile(1567, 12);
|
||||
* //=ruler
|
||||
*/
|
||||
function fromTile(y: number, z: number, units?: string): CheapRuler;
|
||||
}
|
||||
export = cheapRuler
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// Type definitions for css-modules-require-hook 4.0.3
|
||||
// Project: https://github.com/css-modules/css-modules-require-hook
|
||||
// Definitions by: Cedric van Putten <https://bycedric.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'css-modules-require-hook' {
|
||||
interface Options {
|
||||
/** Helps you to invalidate cache of all require calls. */
|
||||
devMode?: boolean;
|
||||
/** Attach the require hook to additional file extensions. */
|
||||
extensions?: string | string[];
|
||||
/** Provides possibility to exclude particular files from processing. */
|
||||
ignore?: string | RegExp | ((filepath: string) => boolean);
|
||||
/** In rare cases you may want to precompile styles, before they will be passed to the PostCSS pipeline. */
|
||||
preprocessCss?: Function;
|
||||
/** In rare cases you may want to get compiled styles in runtime, so providing this option helps. */
|
||||
processCss?: Function;
|
||||
/** Provides possibility to pass custom options to the LazyResult instance. */
|
||||
processorOpts?: Object;
|
||||
/** Camelizes exported class names. */
|
||||
camelCase?: boolean;
|
||||
/** Appends custom plugins to the end of the PostCSS pipeline. */
|
||||
append?: any[];
|
||||
/** Prepends custom plugins to the beginning of the PostCSS pipeline. */
|
||||
prepend?: any[];
|
||||
/** Provides the full list of PostCSS plugins to the pipeline. */
|
||||
use?: any[];
|
||||
/** Short alias for the postcss-modules-extract-imports plugin's createImportedName option. */
|
||||
createImportedName?: Function;
|
||||
/** Short alias for the postcss-modules-scope plugin's option. */
|
||||
generateScopedName?: string | Function;
|
||||
/** Short alias for the generic-names helper option. */
|
||||
hashPrefix?: string;
|
||||
/** Short alias for the postcss-modules-local-by-default plugin's option. */
|
||||
mode?: string;
|
||||
/** Provides absolute path to the project directory. */
|
||||
rootDir?: string;
|
||||
}
|
||||
|
||||
var requireHook: (options?: Options) => void;
|
||||
|
||||
export = requireHook;
|
||||
}
|
||||
Vendored
-77
@@ -1,77 +0,0 @@
|
||||
// Type definitions for dateformat v1.0.12
|
||||
// Project: https://github.com/felixge/node-dateformat
|
||||
// Definitions by: Kombu <https://github.com/aicest>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* dateFormat.masks
|
||||
*
|
||||
* Predefined Formats
|
||||
*
|
||||
* https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L107
|
||||
*/
|
||||
interface DateFormatMasks {
|
||||
default: string;
|
||||
shortDate: string;
|
||||
mediumDate: string;
|
||||
longDate: string;
|
||||
fullDate: string;
|
||||
shortTime: string;
|
||||
mediumTime: string;
|
||||
longTime: string;
|
||||
isoDate: string;
|
||||
isoTime: string;
|
||||
isoDateTime: string;
|
||||
isoUtcDateTime: string;
|
||||
expiresHeaderFormat: string;
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* dateFormat.i18n
|
||||
*
|
||||
* Internationalization strings
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```
|
||||
* dateFormat.i18n = {
|
||||
* dayNames: [
|
||||
* 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat',
|
||||
* 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
|
||||
* ],
|
||||
* monthNames: [
|
||||
* 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',
|
||||
* 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'
|
||||
* ]
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L124
|
||||
*/
|
||||
interface DateFormatI18n {
|
||||
dayNames: string[];
|
||||
monthNames: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* dateFormat()
|
||||
*
|
||||
* Accepts a date, a mask, or a date and a mask.
|
||||
* Returns a formatted version of the given date.
|
||||
* The date defaults to the current date/time.
|
||||
* The mask defaults to dateFormat.masks.default.
|
||||
*
|
||||
* https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L18
|
||||
*/
|
||||
interface DateFormatStatic {
|
||||
(date?: Date | string | number, mask?: string, utc?: boolean, gmt?: boolean): string;
|
||||
(mask?: string, utc?: boolean, gmt?: boolean): string;
|
||||
masks: DateFormatMasks;
|
||||
i18n: DateFormatI18n;
|
||||
}
|
||||
|
||||
declare module 'dateformat' {
|
||||
const dateFormat: DateFormatStatic;
|
||||
export = dateFormat;
|
||||
}
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
// Type definitions for defaults 1.0.3
|
||||
// Project: https://github.com/tmpvar/defaults/
|
||||
// Definitions by: Ibtihel CHNAB <https://github.com/IbtihelCHNAB/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function defaults(options: any, defaultOptions: any): any;
|
||||
|
||||
declare module "defaults" {
|
||||
export = defaults;
|
||||
}
|
||||
Vendored
-56236
File diff suppressed because it is too large
Load Diff
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
// Type definitions for electron 1.3.3
|
||||
// Project: https://github.com/electron-userland/electron-prebuilt
|
||||
// Definitions by: rhysd <https://github.com/rhysd>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'electron' {
|
||||
var electron: string;
|
||||
export = electron;
|
||||
}
|
||||
|
||||
Vendored
-5765
File diff suppressed because it is too large
Load Diff
Vendored
-43
@@ -1,43 +0,0 @@
|
||||
// Type definitions for express-mung 0.4.2
|
||||
// Project: https://github.com/richardschneider/express-mung
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts"/>
|
||||
/// <reference path="../node/node.d.ts"/>
|
||||
|
||||
declare module "express-mung" {
|
||||
import { Request, Response } from "express";
|
||||
import * as http from "http";
|
||||
|
||||
type Transform = (body: {}, request: Request, response: Response) => any;
|
||||
type TransformHeader = (body: http.IncomingMessage, request: Request, response: Response) => any;
|
||||
|
||||
/**
|
||||
* Transform the JSON body of the response.
|
||||
* @param {Transform} fn A transformation function.
|
||||
* @return {any} The body.
|
||||
*/
|
||||
export function json(fn: Transform): any;
|
||||
|
||||
/**
|
||||
* Transform the JSON body of the response.
|
||||
* @param {Transform} fn A transformation function.
|
||||
* @return {any} The body.
|
||||
*/
|
||||
export function jsonAsync(fn: Transform): PromiseLike<any>;
|
||||
|
||||
/**
|
||||
* Transform the HTTP headers of the response.
|
||||
* @param {Transform} fn A transformation function.
|
||||
* @return {any} The body.
|
||||
*/
|
||||
export function headers(fn: TransformHeader): any;
|
||||
|
||||
/**
|
||||
* Transform the HTTP headers of the response.
|
||||
* @param {Transform} fn A transformation function.
|
||||
* @return {any} The body.
|
||||
*/
|
||||
export function headersAsync(fn: TransformHeader): PromiseLike<any>;
|
||||
}
|
||||
Vendored
-98
@@ -1,98 +0,0 @@
|
||||
// Type definitions for hapi-decorators v0.4.3
|
||||
// Project: https://github.com/knownasilya/hapi-decorators
|
||||
// Definitions by: Ken Howard <http://github.com/kenhowardpdx>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../hapi/hapi.d.ts" />
|
||||
|
||||
declare module 'hapi-decorators' {
|
||||
import * as hapi from 'hapi';
|
||||
interface ControllerStatic {
|
||||
new (): Controller;
|
||||
}
|
||||
export interface Controller {
|
||||
baseUrl: string;
|
||||
routes: () => hapi.IRouteConfiguration[];
|
||||
}
|
||||
export function controller(baseUrl: string): (target: ControllerStatic) => void;
|
||||
interface IRouteSetup {
|
||||
(target: any, key: any, descriptor: any): any;
|
||||
}
|
||||
interface IRouteDecorator {
|
||||
(method: string, path: string): IRouteSetup;
|
||||
}
|
||||
interface IRouteConfig {
|
||||
(path: string): IRouteSetup;
|
||||
}
|
||||
export const route: IRouteDecorator;
|
||||
export const get: IRouteConfig;
|
||||
export const post: IRouteConfig;
|
||||
export const put: IRouteConfig;
|
||||
// export const delete: IRouteConfig;
|
||||
export const patch: IRouteConfig;
|
||||
export const all: IRouteConfig;
|
||||
export function config(config: hapi.IRouteAdditionalConfigurationOptions): (target: any, key: any, descriptor: any) => any;
|
||||
interface IValidateConfig {
|
||||
/** validation rules for incoming request headers.Values allowed:
|
||||
* trueany headers allowed (no validation performed).This is the default.
|
||||
falseno headers allowed (this will cause all valid HTTP requests to fail).
|
||||
a Joi validation object.
|
||||
a validation function using the signature function(value, options, next) where:
|
||||
valuethe object containing the request headers.
|
||||
optionsthe server validation options.
|
||||
next(err, value)the callback function called when validation is completed.
|
||||
*/
|
||||
headers?: boolean | hapi.IJoi | hapi.IValidationFunction;
|
||||
/** validation rules for incoming request path parameters, after matching the path against the route and extracting any parameters then stored in request.params.Values allowed:
|
||||
trueany path parameters allowed (no validation performed).This is the default.
|
||||
falseno path variables allowed.
|
||||
a Joi validation object.
|
||||
a validation function using the signature function(value, options, next) where:
|
||||
valuethe object containing the path parameters.
|
||||
optionsthe server validation options.
|
||||
next(err, value)the callback function called when validation is completed. */
|
||||
params?: boolean | hapi.IJoi | hapi.IValidationFunction;
|
||||
/** validation rules for an incoming request URI query component (the key- value part of the URI between '?' and '#').The query is parsed into its individual key- value pairs (using the qs module) and stored in request.query prior to validation.Values allowed:
|
||||
trueany query parameters allowed (no validation performed).This is the default.
|
||||
falseno query parameters allowed.
|
||||
a Joi validation object.
|
||||
a validation function using the signature function(value, options, next) where:
|
||||
valuethe object containing the query parameters.
|
||||
optionsthe server validation options.
|
||||
next(err, value)the callback function called when validation is completed. */
|
||||
query?: boolean | hapi.IJoi | hapi.IValidationFunction;
|
||||
/** validation rules for an incoming request payload (request body).Values allowed:
|
||||
trueany payload allowed (no validation performed).This is the default.
|
||||
falseno payload allowed.
|
||||
a Joi validation object.
|
||||
a validation function using the signature function(value, options, next) where:
|
||||
valuethe object containing the payload object.
|
||||
optionsthe server validation options.
|
||||
next(err, value)the callback function called when validation is completed. */
|
||||
payload?: boolean | hapi.IJoi | hapi.IValidationFunction;
|
||||
/** an optional object with error fields copied into every validation error response. */
|
||||
errorFields?: any;
|
||||
/** determines how to handle invalid requests.Allowed values are:
|
||||
'error'return a Bad Request (400) error response.This is the default value.
|
||||
'log'log the error but continue processing the request.
|
||||
'ignore'take no action.
|
||||
OR a custom error handler function with the signature 'function(request, reply, source, error)` where:
|
||||
requestthe request object.
|
||||
replythe continuation reply interface.
|
||||
sourcethe source of the invalid field (e.g. 'path', 'query', 'payload').
|
||||
errorthe error object prepared for the client response (including the validation function error under error.data). */
|
||||
failAction?: string | hapi.IRouteFailFunction;
|
||||
/** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */
|
||||
options?: any;
|
||||
}
|
||||
export function validate(config: IValidateConfig): (target: any, key: any, descriptor: any) => any;
|
||||
interface ICacheConfig {
|
||||
privacy?: string;
|
||||
expiresIn?: number;
|
||||
expiresAt?: number;
|
||||
}
|
||||
export function cache(cacheConfig: ICacheConfig): (target: any, key: any, descriptor: any) => any;
|
||||
export function pre(pre: {
|
||||
[key: string]: any;
|
||||
}): (target: any, key: any, descriptor: any) => any;
|
||||
}
|
||||
Vendored
-2
@@ -3,8 +3,6 @@
|
||||
// Definitions by: Ken Howard <http://github.com/kenhowardpdx>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="hapi"/>
|
||||
|
||||
import * as hapi from 'hapi';
|
||||
interface ControllerStatic {
|
||||
new (): Controller;
|
||||
|
||||
Vendored
-19
@@ -1,19 +0,0 @@
|
||||
// Type definitions for hyperscript
|
||||
// Project: https://github.com/dominictarr/hyperscript
|
||||
// Definitions by: Mike Linkovich <https://github.com/spacejack>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'hyperscript' {
|
||||
|
||||
interface HyperScript {
|
||||
/** Creates an HTML element */
|
||||
(tagName: string, ...args: any[]): HTMLElement;
|
||||
/** Cleans up any event handlers created by this hyperscript context */
|
||||
cleanup(): void;
|
||||
/** Creates a new hyperscript context */
|
||||
context(): HyperScript;
|
||||
}
|
||||
|
||||
const h: HyperScript;
|
||||
export = h;
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
// Type definitions for jquery-alertable 1.0.2
|
||||
// Project: https://github.com/claviska/jquery-alertable
|
||||
// Definitions by: Steven Robertson <https://github.com/stever>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
interface JQueryStatic {
|
||||
alertable: Alertable;
|
||||
}
|
||||
|
||||
interface Alertable {
|
||||
alert(message: string, options?: AlertableOptions): JQueryPromise<void>;
|
||||
confirm(message: string, options?: AlertableOptions): JQueryPromise<void>;
|
||||
prompt(message: string, options?: AlertableOptions): JQueryPromise<void>;
|
||||
defaults: AlertableOptions;
|
||||
}
|
||||
|
||||
interface AlertableOptions {
|
||||
container?: string;
|
||||
html?: boolean;
|
||||
cancelButton?: string;
|
||||
okButton?: string;
|
||||
overlay?: string;
|
||||
prompt?: string;
|
||||
modal?: string;
|
||||
hide?: Function;
|
||||
show?: Function;
|
||||
}
|
||||
-84
@@ -1,84 +0,0 @@
|
||||
// Type definitions for jQuery Flagstrap Plugin v1.0
|
||||
// Project: https://github.com/blazeworx/flagstrap
|
||||
// Definitions by: Felipe de Sena Garcia <https://github.com/felipedgarcia>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare module jQueryFlagStrap {
|
||||
interface FlagStrapOptions {
|
||||
/**
|
||||
* Default: uniquely generated
|
||||
* the `name` attribute for the actual `select` input
|
||||
*/
|
||||
inputName: string;
|
||||
/**
|
||||
* Default: uniquely generated
|
||||
* the `id` attribute for the actual `select` input
|
||||
*/
|
||||
inputId?: string;
|
||||
/**
|
||||
* Default: "btn-md"
|
||||
* The bootstrap button size `class` for this drop down
|
||||
*/
|
||||
buttonSize: string;
|
||||
/**
|
||||
* Default: "btn-default"
|
||||
* The bootstrap button type `class` for this drop down
|
||||
*/
|
||||
buttonType: string;
|
||||
/**
|
||||
* Default: "20px"
|
||||
* The `margin` between `flag` and `text label`
|
||||
*/
|
||||
labelMargin: string;
|
||||
/**
|
||||
* Default: false
|
||||
* Scrollable or full height drop down
|
||||
*/
|
||||
scrollable: boolean;
|
||||
/**
|
||||
* Default: "250px"
|
||||
* `max-height` for the scrollable drop down
|
||||
*/
|
||||
scrollableHeight?: string;
|
||||
/**
|
||||
* Default: (all)
|
||||
* Only show specific countries
|
||||
* Example:
|
||||
*
|
||||
* {"GB": "United Kingdom", "US": "United States"}
|
||||
*
|
||||
* will only show the USA and UK.
|
||||
*/
|
||||
countries?: Object;
|
||||
/**
|
||||
* Default: {value: "", text: "Please select a country"}
|
||||
* Set the placeholder value and text. To disable the placeholder define as (boolean) false.
|
||||
*/
|
||||
placeholder: boolean | FlagStrapPlaceholderOptions;
|
||||
/**
|
||||
* Default: null
|
||||
* This callback gets called each time the select is changed. It receives two parameters, the new value, and the select element.
|
||||
*/
|
||||
onSelect?(value: any, element: any): void;
|
||||
}
|
||||
|
||||
interface FlagStrapStatic {
|
||||
flagStrap?: void;
|
||||
}
|
||||
|
||||
interface FlagStrapPlaceholderOptions {
|
||||
value: string;
|
||||
text: string;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* A lightwieght jQuery plugin for creating Bootstrap 3 compatible country select boxes with flags.
|
||||
*/
|
||||
|
||||
flagStrap(): void;
|
||||
flagStrap(options: jQueryFlagStrap.FlagStrapOptions): void;
|
||||
}
|
||||
Vendored
-44
@@ -1,44 +0,0 @@
|
||||
// Type definitions for klaw v1.3.0
|
||||
// Project: https://github.com/jprichardson/node-klaw
|
||||
// Definitions by: Matthew McEachen <https://github.com/mceachen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "klaw" {
|
||||
|
||||
import * as fs from "fs"
|
||||
import { Readable, ReadableOptions } from 'stream'
|
||||
|
||||
function K(root: string, options?: K.Options): K.Walker
|
||||
|
||||
namespace K {
|
||||
interface Item {
|
||||
path: string
|
||||
stats: fs.Stats
|
||||
}
|
||||
|
||||
type QueueMethod = "shift" | "pop"
|
||||
|
||||
interface Options extends ReadableOptions {
|
||||
queueMethod?: QueueMethod
|
||||
pathSorter?: (a: Array<Item>) => Array<Item>
|
||||
fs?: any // fs or mock-fs
|
||||
filter?: (a: Item) => boolean
|
||||
}
|
||||
|
||||
type Event = "close" | "data" | "end" | "readable" | "error"
|
||||
|
||||
interface Walker {
|
||||
on(event: Event, listener: Function): this
|
||||
on(event: "close", listener: () => void): this
|
||||
on(event: "data", listener: (item: Item) => void): this
|
||||
on(event: "end", listener: () => void): this
|
||||
on(event: "readable", listener: () => void): this
|
||||
on(event: "error", listener: (err: Error) => void): this
|
||||
read(): Item
|
||||
}
|
||||
}
|
||||
|
||||
export = K
|
||||
}
|
||||
Vendored
-27
@@ -1,27 +0,0 @@
|
||||
// Type definitions for koa-send v3.x
|
||||
// Project: https://github.com/koajs/send
|
||||
// Definitions by: Peter Safranek <https://github.com/pe8ter>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../koa/koa.d.ts" />
|
||||
|
||||
declare module "koa-send" {
|
||||
|
||||
import * as Koa from "koa";
|
||||
|
||||
interface ISendOptions {
|
||||
root?: string;
|
||||
index?: string;
|
||||
maxAge?: number;
|
||||
hidden?: boolean;
|
||||
format?: boolean;
|
||||
gzip?: boolean;
|
||||
setHeaders?: Function;
|
||||
}
|
||||
|
||||
function send(ctx: Koa.Context, path: string, opts?: ISendOptions): Promise<string>;
|
||||
|
||||
namespace send {}
|
||||
|
||||
export = send;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Type definitions for localforage-cordovasqlitedriver module v1.0+
|
||||
// Project: https://github.com/thgreasi/localForage-cordovaSQLiteDriver
|
||||
// Definitions by: Thodoris Greasidis <https://github.com/thgreasi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../localForage/localForage.d.ts" />
|
||||
|
||||
declare module "localforage-cordovasqlitedriver" {
|
||||
var cordovaSQLiteDriver: LocalForageDriver;
|
||||
export = cordovaSQLiteDriver;
|
||||
}
|
||||
Vendored
-26
@@ -1,26 +0,0 @@
|
||||
// Type definitions for logat 1.x.x
|
||||
// Project: https://github.com/krvikash35/logat
|
||||
// Definitions by: Vikash <https://github.com/krvikash35/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'logat'{
|
||||
|
||||
interface LogOptionsI {
|
||||
logLevel?: number,
|
||||
logMethod?: number,
|
||||
logFileName?: string
|
||||
}
|
||||
|
||||
class Logger extends NodeJS.EventEmitter {
|
||||
error(...args: any[]): void;
|
||||
warn(...args: any[]): void;
|
||||
info(...args: any[]): void;
|
||||
debug(...args: any[]): void;
|
||||
getOptions(): LogOptionsI;
|
||||
setOptions(options: LogOptionsI): void;
|
||||
}
|
||||
|
||||
export = new Logger();
|
||||
}
|
||||
Vendored
-71
@@ -1,71 +0,0 @@
|
||||
// Type definitions for memwatch-next 0.3.0
|
||||
// Project: https://github.com/marcominetti/node-memwatch
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "memwatch-next" {
|
||||
type EventCallback = (data: LeakInformation | StatsInformation | Object) => void;
|
||||
|
||||
/**
|
||||
* Compare the state of your heap between two points in time, telling you what has been allocated, and what has been released.
|
||||
* @class
|
||||
*/
|
||||
export class HeapDiff {
|
||||
/**
|
||||
* Compute the diff.
|
||||
*/
|
||||
end: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stats information.
|
||||
* @interface
|
||||
*/
|
||||
export interface StatsInformation {
|
||||
current_base: number;
|
||||
estimated_base: number;
|
||||
heap_compactions: number;
|
||||
max: number;
|
||||
min: number;
|
||||
num_full_gc: number;
|
||||
num_inc_gc: number;
|
||||
usage_trend: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Leak information.
|
||||
* @interface
|
||||
*/
|
||||
export interface LeakInformation {
|
||||
/**
|
||||
* End date.
|
||||
* @type {Date}
|
||||
*/
|
||||
end: Date,
|
||||
|
||||
/**
|
||||
* Growth.
|
||||
* @type {number}
|
||||
*/
|
||||
growth: number;
|
||||
|
||||
/**
|
||||
* Reason leak.
|
||||
* @type {string}
|
||||
*/
|
||||
reason: string;
|
||||
|
||||
/**
|
||||
* Start date.
|
||||
* @type {Date}
|
||||
*/
|
||||
start: Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to a event.
|
||||
* @param {string} eventName A event name.
|
||||
* @param {EventCallback} callback A callback;
|
||||
*/
|
||||
export function on(eventName: string, callback: EventCallback): void;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Type definitions for moment-duration-format v1.3.0
|
||||
// Project: https://github.com/jsmreese/moment-duration-format
|
||||
// Definitions by: Swint De Coninck <https://github.com/SwintDC>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
declare namespace moment {
|
||||
interface Duration {
|
||||
format(template: string, precision?: string, settings?: any): string;
|
||||
}
|
||||
}
|
||||
Vendored
-67
@@ -1,67 +0,0 @@
|
||||
// Type definitions for msgpack-lite 0.1.20
|
||||
// Project: https://github.com/kawanet/msgpack-lite
|
||||
// Definitions by: Endel Dreyer <https://github.com/endel/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
declare module "msgpack-lite" {
|
||||
import { Transform } from "stream";
|
||||
|
||||
namespace MsgpackLite {
|
||||
interface BufferOptions { codec: any; }
|
||||
|
||||
interface Encoder {
|
||||
bufferish: any;
|
||||
maxBufferSize: number;
|
||||
minBufferSize: number;
|
||||
offset: number;
|
||||
start: number;
|
||||
write: (chunk: any) => void;
|
||||
fetch: () => void;
|
||||
flush: () => void;
|
||||
push: (chunk: any) => void;
|
||||
pull: () => number;
|
||||
read: () => number;
|
||||
reserve: (length: number) => number;
|
||||
send: (buffer: Buffer) => void;
|
||||
encode: (chunk: any) => void;
|
||||
end: (chunk: any) => void;
|
||||
}
|
||||
|
||||
interface Decoder {
|
||||
bufferish: any;
|
||||
offset: number;
|
||||
fetch: () => void;
|
||||
flush: () => void;
|
||||
pull: () => number;
|
||||
read: () => number;
|
||||
write: (chunk: any) => void;
|
||||
reserve: (length: number) => number;
|
||||
decode: (chunk: any) => void;
|
||||
push: (chunk: any) => void;
|
||||
end: (chunk: any) => void;
|
||||
}
|
||||
|
||||
interface EncodeStream extends Transform {
|
||||
encoder: Encoder;
|
||||
}
|
||||
interface DecodeStream extends Transform {
|
||||
decoder: Decoder;
|
||||
}
|
||||
|
||||
interface Codec {
|
||||
new (options?: any): Codec;
|
||||
options: any;
|
||||
init (): void;
|
||||
}
|
||||
|
||||
export function encode(input: any, options?: BufferOptions): any;
|
||||
export function decode(input: Buffer | Uint8Array | Array<number>, options?: BufferOptions): any;
|
||||
export function createEncodeStream (): EncodeStream;
|
||||
export function createDecodeStream (): DecodeStream;
|
||||
export function createCodec (options?: any): Codec;
|
||||
export function codec (): { preset: Codec };
|
||||
}
|
||||
|
||||
export = MsgpackLite;
|
||||
}
|
||||
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
// Type definitions for murmurhash3js v3.0.1
|
||||
// Project: https://github.com/pid/murmurHash3js
|
||||
// Definitions by: Dave Lee <https://github.com/dlee-nvisia>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'murmurhash3js' {
|
||||
export module x86 {
|
||||
function hash32(val: string, seed?: number): string;
|
||||
function hash128(val: string, seed?: number): string;
|
||||
}
|
||||
|
||||
export module x64 {
|
||||
function hash128(val: string, seed?: number): string;
|
||||
}
|
||||
}
|
||||
Vendored
-36
@@ -1,36 +0,0 @@
|
||||
// Type definitions for ndarray v1.0.18
|
||||
// Project: https://github.com/scijs/ndarray
|
||||
// Definitions by: Giff Song <https://github.com/pawsong/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'ndarray' {
|
||||
type Data =
|
||||
Array<number> | Int8Array | Int16Array | Int32Array |
|
||||
Uint8Array | Uint16Array | Uint32Array |
|
||||
Float32Array | Float64Array | Uint8ClampedArray;
|
||||
|
||||
interface ndarray {
|
||||
data: Data;
|
||||
shape: number[];
|
||||
stride: number[];
|
||||
offset: number;
|
||||
dtype: 'int8' | 'int16' | 'int32' | 'uint8' | 'uint16' |'uint32' |
|
||||
'float32' | 'float64' | 'array'| 'uint8_clamped' | 'buffer' | 'generic';
|
||||
size: number;
|
||||
order: number[];
|
||||
dimension: number;
|
||||
get(...args: number[]): number;
|
||||
set(...args: number[]): number;
|
||||
index(...args: number[]): number;
|
||||
lo(...args: number[]): ndarray;
|
||||
hi(...args: number[]): ndarray;
|
||||
step(...args: number[]): ndarray;
|
||||
transpose(...args: number[]): ndarray;
|
||||
pick(...args: number[]): ndarray;
|
||||
}
|
||||
|
||||
function ndarray(data: Data, shape?: number[], stride?: number[], offset?: number): ndarray;
|
||||
|
||||
namespace ndarray { }
|
||||
export = ndarray;
|
||||
}
|
||||
Vendored
-32
@@ -1,32 +0,0 @@
|
||||
// Type definitions for ngeohash v0.6.0
|
||||
// Project: https://github.com/sunng87/node-geohash
|
||||
// Definitions by: Erik Rothoff Andersson <https://github.com/erkie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/
|
||||
|
||||
declare namespace ngeohash {
|
||||
interface GeographicPoint {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
}
|
||||
|
||||
type GeographicBoundingBox = [number, number, number, number];
|
||||
type NSEW = [number, number];
|
||||
|
||||
function encode(latitude: number, longitude: number, precision?: number): string;
|
||||
function decode(hashstring: string): GeographicPoint;
|
||||
function decode_bbox(hashstring: string): GeographicBoundingBox;
|
||||
function bboxes(minlat: number, minlon: number, maxlat: number, maxlon: number, precision?: number): Array<string>;
|
||||
function neighbor(hashstring: string, direction: NSEW): string;
|
||||
function neighbors(hashstring: string): Array<string>;
|
||||
|
||||
function encode_int(latitude: number, longitude: number, bitDepth?: number): number;
|
||||
function decode_int(hashinteger: number, bitDepth?: number): GeographicPoint;
|
||||
function decode_bbox_int(hashinteger: number, bitDepth?: number): GeographicBoundingBox;
|
||||
function bboxes_int(minlat: number, minlon: number, maxlat: number, maxlon: number, bitDepth?: number): number;
|
||||
function neighbor_int(hashinteger: number, direction: NSEW, bitDepth?: number): number;
|
||||
function neighbors_int(hashinteger: number, bitDepth?: number): number;
|
||||
}
|
||||
|
||||
declare module "ngeohash" {
|
||||
export = ngeohash;
|
||||
}
|
||||
Vendored
-155
@@ -1,155 +0,0 @@
|
||||
// Type definitions for PEM v1.8.3
|
||||
// Project: https://github.com/andris9/pem
|
||||
// Definitions by: Anthony Trinh <https://github.com/tony19>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "pem" {
|
||||
/**
|
||||
* Creates a private key
|
||||
*
|
||||
* @param {Number} [keyBitsize=2048] Size of the key, defaults to 2048bit (can also be a function)
|
||||
* @param {Object} [options] object of cipher and password {cipher:'aes128',password:'xxx'}, defaults empty object
|
||||
* @param {Function} callback Callback function with an error object and {key}
|
||||
*/
|
||||
function createPrivateKey(keyBitsize: Number, options: Object, callback: Function): void;
|
||||
function createPrivateKey(keyBitsize: Number, callback: Function): void;
|
||||
function createPrivateKey(options: Object, callback: Function): void;
|
||||
function createPrivateKey(callback: Function): void;
|
||||
|
||||
/**
|
||||
* Creates a dhparam key
|
||||
*
|
||||
* @param {Number} [keyBitsize=512] Size of the key, defaults to 512bit
|
||||
* @param {Function} callback Callback function with an error object and {dhparam}
|
||||
*/
|
||||
function createDhparam(keyBitsize: Number, callback: Function): void;
|
||||
function createDhparam(callback: Function): void;
|
||||
|
||||
/**
|
||||
* Creates a Certificate Signing Request
|
||||
*
|
||||
* If client key is undefined, a new key is created automatically. The used key is included
|
||||
* in the callback return as clientKey
|
||||
*
|
||||
* @param {Object} [options] Optional options object
|
||||
* @param {String} [options.clientKey] Optional client key to use
|
||||
* @param {Number} [options.keyBitsize] If clientKey is undefined, bit size to use for generating a new key (defaults to 2048)
|
||||
* @param {String} [options.hash] Hash function to use (either md5 sha1 or sha256, defaults to sha256)
|
||||
* @param {String} [options.country] CSR country field
|
||||
* @param {String} [options.state] CSR state field
|
||||
* @param {String} [options.locality] CSR locality field
|
||||
* @param {String} [options.organization] CSR organization field
|
||||
* @param {String} [options.organizationUnit] CSR organizational unit field
|
||||
* @param {String} [options.commonName='localhost'] CSR common name field
|
||||
* @param {String} [options.emailAddress] CSR email address field
|
||||
* @param {String} [options.csrConfigFile] CSR config file
|
||||
* @param {Array} [options.altNames] is a list of subjectAltNames in the subjectAltName field
|
||||
* @param {Function} callback Callback function with an error object and {csr, clientKey}
|
||||
*/
|
||||
function createCSR(options: Object, callback: Function): void;
|
||||
function createCSR(callback: Function): void;
|
||||
|
||||
/**
|
||||
* Creates a certificate based on a CSR. If CSR is not defined, a new one
|
||||
* will be generated automatically. For CSR generation all the options values
|
||||
* can be used as with createCSR.
|
||||
*
|
||||
* @param {Object} [options] Optional options object
|
||||
* @param {String} [options.serviceKey] Private key for signing the certificate, if not defined a new one is generated
|
||||
* @param {String} [options.serviceKeyPassword] Password of the service key
|
||||
* @param {Boolean} [options.selfSigned] If set to true and serviceKey is not defined, use clientKey for signing
|
||||
* @param {String} [options.hash] Hash function to use (either md5 sha1 or sha256, defaults to sha256)
|
||||
* @param {String} [options.csr] CSR for the certificate, if not defined a new one is generated
|
||||
* @param {Number} [options.days] Certificate expire time in days
|
||||
* @param {String} [options.clientKeyPassword] Password of the client key
|
||||
* @param {String} [options.extFile] extension config file - without '-extensions v3_req'
|
||||
* @param {String} [options.config] extension config file - with '-extensions v3_req'
|
||||
* @param {Function} callback Callback function with an error object and {certificate, csr, clientKey, serviceKey}
|
||||
*/
|
||||
function createCertificate(options: Object, callback: Function): void;
|
||||
function createCertificate(callback: Function): void;
|
||||
|
||||
/**
|
||||
* Reads subject data from a certificate or a CSR
|
||||
*
|
||||
* @param {String} certificate PEM encoded CSR or certificate
|
||||
* @param {Function} callback Callback function with an error object and {country, state, locality, organization, organizationUnit, commonName, emailAddress}
|
||||
*/
|
||||
function readCertificateInfo(certificate: string, callback: Function): void;
|
||||
function readCertificateInfo(callback: Function): void;
|
||||
|
||||
/**
|
||||
* Exports a public key from a private key, CSR or certificate
|
||||
*
|
||||
* @param {String} certificate PEM encoded private key, CSR or certificate
|
||||
* @param {Function} callback Callback function with an error object and {publicKey}
|
||||
*/
|
||||
function getPublicKey(certificate: string, callback: Function): void;
|
||||
function getPublicKey(callback: Function): void;
|
||||
|
||||
/**
|
||||
* Gets the fingerprint for a certificate
|
||||
*
|
||||
* @param {String} certificate PEM encoded certificate
|
||||
* @param {String} hash Hash function to use (either md5 sha1 or sha256, defaults to sha256)
|
||||
* @param {Function} callback Callback function with an error object and {fingerprint}
|
||||
*/
|
||||
function getFingerprint(certificate: string, hash: string, callback: Function): void;
|
||||
function getFingerprint(certificate: string, callback: Function): void;
|
||||
function getFingerprint(callback: Function): void;
|
||||
|
||||
/**
|
||||
* Gets the modulus from a certificate, a CSR or a private key
|
||||
*
|
||||
* @param {String} certificate PEM encoded, CSR PEM encoded, or private key
|
||||
* @param {String} password password for the certificate
|
||||
* @param {Function} callback Callback function with an error object and {modulus}
|
||||
*/
|
||||
function getModulus(certificate: string, password: string, callback: Function): void;
|
||||
function getModulus(certificate: string, callback: Function): void;
|
||||
|
||||
/**
|
||||
* Gets the size and prime of DH parameters
|
||||
*
|
||||
* @param {String} dh DH parameters PEM encoded
|
||||
* @param {Function} callback Callback function with an error object and {size, prime}
|
||||
*/
|
||||
function getDhparamInfo(dh: string, callback: Function): void;
|
||||
|
||||
/**
|
||||
* Exports private key and certificate to a PKCS12 keystore
|
||||
*
|
||||
* @param {String} key PEM encoded private key
|
||||
* @param {String} certificate PEM encoded certificate
|
||||
* @param {String} password Password of the result PKCS12 file
|
||||
* @param {Object} [options] object of cipher and optional client key password {cipher:'aes128', clientKeyPassword: 'xxx'}
|
||||
* @param {Function} callback Callback function with an error object and {pkcs12}
|
||||
*/
|
||||
function createPkcs12(key: string, certificate: string, password: string, options: Object, callback: Function): void;
|
||||
function createPkcs12(key: string, certificate: string, password: string, callback: Function): void;
|
||||
|
||||
/**
|
||||
* Reads private key and certificate from a PKCS12 keystore
|
||||
* @param {String} bufferOrPath
|
||||
* @param {Object} [options] object of cipher and optional client key password {cipher:'aes128', clientKeyPassword: 'xxx'}
|
||||
* @param {Function} callback Callback function with an error object and {pkcs12}
|
||||
* @returns the result of the callback
|
||||
*/
|
||||
function readPkcs12(bufferOrPath: string, options: Object, callback: Function): any;
|
||||
function readPkcs12(options: Object, callback: Function): any;
|
||||
|
||||
/**
|
||||
* Verifies the signing chain of the passed certificate
|
||||
*
|
||||
* @param {String} certificate PEM encoded certificate
|
||||
* @param {Array} ca List of CA certificates
|
||||
* @param {Function} callback Callback function with an error object and a boolean valid
|
||||
*/
|
||||
function verifySigningChain(certificate: string, ca: Array<string>, callback: Function): void;
|
||||
|
||||
/**
|
||||
* config the pem module
|
||||
* @param {Object} options
|
||||
*/
|
||||
function config(options: Object): void;
|
||||
}
|
||||
-134
@@ -1,134 +0,0 @@
|
||||
// Type definitions for perfect-scrollbar v0.6.12
|
||||
// Project: https://github.com/noraesae/perfect-scrollbar
|
||||
// Definitions by: Kombu <https://github.com/aicest>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
/**
|
||||
* https://github.com/noraesae/perfect-scrollbar/blob/master/src/js/plugin/default-setting.js#L3
|
||||
* https://github.com/noraesae/perfect-scrollbar#optional-parameters
|
||||
*/
|
||||
interface PerfectScrollbarSettings {
|
||||
|
||||
/**
|
||||
* It is a list of handlers to use to scroll the element.
|
||||
* https://github.com/noraesae/perfect-scrollbar#handlers
|
||||
* https://github.com/noraesae/perfect-scrollbar/blob/master/src/js/plugin/initialize.js#L9
|
||||
*/
|
||||
handlers?: ('click-rail' |
|
||||
'drag-scrollbar' |
|
||||
'keyboard' |
|
||||
'wheel' |
|
||||
'touch' |
|
||||
'selection')[];
|
||||
|
||||
/**
|
||||
* When set to an integer value, the thumb part of the scrollbar will not expand over that number of pixels.
|
||||
* https://github.com/noraesae/perfect-scrollbar#maxscrollbarlength
|
||||
*/
|
||||
maxScrollbarLength?: number;
|
||||
|
||||
/**
|
||||
* When set to an integer value, the thumb part of the scrollbar will not shrink below that number of pixels.
|
||||
* https://github.com/noraesae/perfect-scrollbar#minscrollbarlength
|
||||
*/
|
||||
minScrollbarLength?: number;
|
||||
|
||||
/**
|
||||
* The number of pixels the content width can surpass the container width without enabling the X axis scroll bar.
|
||||
* Allows some "wiggle room" or "offset break", so that X axis scroll bar is not enabled just because of a few pixels.
|
||||
* https://github.com/noraesae/perfect-scrollbar#scrollxmarginoffset
|
||||
*/
|
||||
scrollXMarginOffset?: number;
|
||||
|
||||
/**
|
||||
* The number of pixels the content height can surpass the container height without enabling the Y axis scroll bar.
|
||||
* Allows some "wiggle room" or "offset break", so that Y axis scroll bar is not enabled just because of a few pixels.
|
||||
* https://github.com/noraesae/perfect-scrollbar#scrollymarginoffset
|
||||
*/
|
||||
scrollYMarginOffset?: number;
|
||||
|
||||
/**
|
||||
* When set to false, when clicking on a rail, the click event will be allowed to propagate.
|
||||
* https://github.com/noraesae/perfect-scrollbar#stoppropagationonclick
|
||||
*/
|
||||
stopPropagationOnClick?: boolean;
|
||||
|
||||
/**
|
||||
* When set to true, the scroll bar in X axis will not be available, regardless of the content width.
|
||||
* https://github.com/noraesae/perfect-scrollbar#suppressscrollx
|
||||
*/
|
||||
suppressScrollX?: boolean;
|
||||
|
||||
/**
|
||||
* When set to true, the scroll bar in Y axis will not be available, regardless of the content height.
|
||||
* https://github.com/noraesae/perfect-scrollbar#suppressscrolly
|
||||
*/
|
||||
suppressScrollY?: boolean;
|
||||
|
||||
/**
|
||||
* If this option is true, when the scroll reaches the end of the side, touch scrolling will be propagated to parent element.
|
||||
* https://github.com/noraesae/perfect-scrollbar#swipepropagation
|
||||
*/
|
||||
swipePropagation?: boolean;
|
||||
|
||||
/**
|
||||
* When set to true, and only one (vertical or horizontal) scrollbar is visible then both vertical and horizontal scrolling will affect the scrollbar.
|
||||
* https://github.com/noraesae/perfect-scrollbar#usebothwheelaxes
|
||||
*/
|
||||
useBothWheelAxes?: boolean;
|
||||
|
||||
/**
|
||||
* If this option is true, when the scroll reaches the end of the side, mousewheel event will be propagated to parent element.
|
||||
* https://github.com/noraesae/perfect-scrollbar#wheelpropagation
|
||||
*/
|
||||
wheelPropagation?: boolean;
|
||||
|
||||
/**
|
||||
* The scroll speed applied to mousewheel event.
|
||||
* https://github.com/noraesae/perfect-scrollbar#wheelspeed
|
||||
*/
|
||||
wheelSpeed?: number;
|
||||
|
||||
/**
|
||||
* A string.
|
||||
* It's a class name added to the container element.
|
||||
* The class name is prepended with `ps-theme-`.
|
||||
* So default theme class name is `ps-theme-default`.
|
||||
* In order to create custom themes with scss use `ps-container($theme)` mixin, where `$theme` is a scss map.
|
||||
* https://github.com/noraesae/perfect-scrollbar#theme
|
||||
*/
|
||||
theme?: string;
|
||||
}
|
||||
|
||||
declare module 'perfect-scrollbar' {
|
||||
|
||||
/**
|
||||
* https://github.com/noraesae/perfect-scrollbar/blob/master/src/js/plugin/initialize.js#L19
|
||||
*/
|
||||
export function initialize(element: HTMLElement, settings?: PerfectScrollbarSettings): void;
|
||||
|
||||
/**
|
||||
* https://github.com/noraesae/perfect-scrollbar/blob/master/src/js/plugin/update.js#L9
|
||||
*/
|
||||
export function update(element: HTMLElement): void;
|
||||
|
||||
/**
|
||||
* https://github.com/noraesae/perfect-scrollbar/blob/master/src/js/plugin/destroy.js#L7
|
||||
*/
|
||||
export function destroy(element: HTMLElement): void;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
|
||||
/**
|
||||
* https://github.com/noraesae/perfect-scrollbar/blob/master/src/js/adaptor/jquery.js#L6
|
||||
*/
|
||||
perfectScrollbar(settingOrCommand?: PerfectScrollbarSettings | 'update' | 'destroy'): JQuery;
|
||||
}
|
||||
|
||||
declare module 'perfect-scrollbar/jquery' {
|
||||
function mountJQuery(jQuery: JQueryStatic): void;
|
||||
export = mountJQuery;
|
||||
}
|
||||
Vendored
-334
@@ -1,334 +0,0 @@
|
||||
// Type definitions for Recompose v0.20.2
|
||||
// Project: https://github.com/acdlite/recompose
|
||||
// Definitions by: Iskander Sierra <https://github.com/iskandersierra>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference path='../react/react.d.ts' />
|
||||
|
||||
declare module 'recompose' {
|
||||
|
||||
import * as React from 'react';
|
||||
import { ComponentClass, StatelessComponent, ValidationMap } from 'react';
|
||||
|
||||
type Component<P> = ComponentClass<P> | StatelessComponent<P>;
|
||||
type mapper<TInner, TOutter> = (input: TInner) => TOutter;
|
||||
type predicate<T> = mapper<T, boolean>;
|
||||
type predicateDiff<T> = (current: T, next: T) => boolean
|
||||
interface Subscribable<T> {
|
||||
subscribe: Function;
|
||||
}
|
||||
|
||||
interface ComponentEnhancer<TInner, TOutter> {
|
||||
(component: Component<TInner>): ComponentClass<TOutter>;
|
||||
}
|
||||
interface InferableComponentEnhancer {
|
||||
<P, TComp extends (Component<P>)>(component: TComp): TComp;
|
||||
}
|
||||
|
||||
|
||||
// Higher-order components: https://github.com/acdlite/recompose/blob/master/docs/API.md#higher-order-components
|
||||
|
||||
// mapProps: https://github.com/acdlite/recompose/blob/master/docs/API.md#mapprops
|
||||
export function mapProps<TInner, TOutter>(
|
||||
propsMapper: mapper<TOutter, TInner>
|
||||
): ComponentEnhancer<TInner, TOutter>;
|
||||
|
||||
// withProps: https://github.com/acdlite/recompose/blob/master/docs/API.md#withprops
|
||||
export function withProps<TInner, TOutter>(
|
||||
createProps: TInner | mapper<TOutter, TInner>
|
||||
): ComponentEnhancer<TInner & TOutter, TOutter>;
|
||||
|
||||
// withPropsOnChange: https://github.com/acdlite/recompose/blob/master/docs/API.md#withpropsonchange
|
||||
export function withPropsOnChange<TInner, TOutter>(
|
||||
shouldMapOrKeys: string[] | predicateDiff<TOutter>,
|
||||
createProps: mapper<TOutter, TInner>
|
||||
): ComponentEnhancer<TInner & TOutter, TOutter>;
|
||||
|
||||
// withHandlers: https://github.com/acdlite/recompose/blob/master/docs/API.md#withhandlers
|
||||
type EventHandler = Function;
|
||||
type HandleCreators<TOutter> = {
|
||||
[handlerName: string]: mapper<TOutter, EventHandler>;
|
||||
};
|
||||
export function withHandlers<TInner, TOutter>(
|
||||
handlerCreators: HandleCreators<TOutter>
|
||||
): ComponentEnhancer<TInner, TOutter>;
|
||||
|
||||
// defaultProps: https://github.com/acdlite/recompose/blob/master/docs/API.md#defaultprops
|
||||
export function defaultProps(
|
||||
props: Object
|
||||
): InferableComponentEnhancer;
|
||||
|
||||
// renameProp: https://github.com/acdlite/recompose/blob/master/docs/API.md#renameProp
|
||||
export function renameProp(
|
||||
outterName: string, innerName: string
|
||||
): ComponentEnhancer<any, any>;
|
||||
|
||||
// renameProps: https://github.com/acdlite/recompose/blob/master/docs/API.md#renameProps
|
||||
type NameMap = {
|
||||
[outterName: string]: string;
|
||||
};
|
||||
export function renameProps(
|
||||
nameMap: NameMap
|
||||
): ComponentEnhancer<any, any>;
|
||||
|
||||
// flattenProp: https://github.com/acdlite/recompose/blob/master/docs/API.md#flattenProp
|
||||
export function flattenProp(
|
||||
propName: string
|
||||
): ComponentEnhancer<any, any>;
|
||||
|
||||
// withState: https://github.com/acdlite/recompose/blob/master/docs/API.md#withState
|
||||
export function withState<TOutter>(
|
||||
stateName: string,
|
||||
stateUpdaterName: string,
|
||||
initialState: any | mapper<TOutter, any>
|
||||
): ComponentEnhancer<TOutter /*& { [stateName]: any; [stateUpdaterName]: (s: any) => void }*/, TOutter>;
|
||||
|
||||
// withReducer: https://github.com/acdlite/recompose/blob/master/docs/API.md#withReducer
|
||||
type reducer<TState, TAction> = (s: TState, a: TAction) => TState;
|
||||
export function withReducer<TState, TAction>(
|
||||
stateName: string,
|
||||
dispatchName: string,
|
||||
reducer: reducer<TState, TAction>,
|
||||
initialState: TState
|
||||
): ComponentEnhancer<any, any>;
|
||||
export function withReducer<TOutter, TState, TAction>(
|
||||
stateName: string,
|
||||
dispatchName: string,
|
||||
reducer: reducer<TState, TAction>,
|
||||
initialState: (props: TOutter) => TState
|
||||
): ComponentEnhancer<any, TOutter>;
|
||||
|
||||
// branch: https://github.com/acdlite/recompose/blob/master/docs/API.md#branch
|
||||
export function branch<TOutter>(
|
||||
test: predicate<TOutter>,
|
||||
trueEnhancer: InferableComponentEnhancer,
|
||||
falseEnhancer: InferableComponentEnhancer
|
||||
): ComponentEnhancer<any, TOutter>;
|
||||
|
||||
// renderComponent: https://github.com/acdlite/recompose/blob/master/docs/API.md#renderComponent
|
||||
export function renderComponent(
|
||||
component: string | Component<any>
|
||||
): ComponentEnhancer<any, any>;
|
||||
|
||||
// renderNothing: https://github.com/acdlite/recompose/blob/master/docs/API.md#renderNothing
|
||||
export const renderNothing: InferableComponentEnhancer;
|
||||
|
||||
// shouldUpdate: https://github.com/acdlite/recompose/blob/master/docs/API.md#shouldUpdate
|
||||
export function shouldUpdate<TProps>(
|
||||
test: predicateDiff<TProps>
|
||||
): InferableComponentEnhancer;
|
||||
|
||||
// pure: https://github.com/acdlite/recompose/blob/master/docs/API.md#pure
|
||||
export function pure<TProps, TComp extends (Component<TProps>)>
|
||||
(component: TComp): TComp;
|
||||
|
||||
// onlyUpdateForKeys: https://github.com/acdlite/recompose/blob/master/docs/API.md#onlyUpdateForKeys
|
||||
export function onlyUpdateForKeys(
|
||||
propKeys: Array<string>
|
||||
) : InferableComponentEnhancer;
|
||||
|
||||
// onlyUpdateForPropTypes: https://github.com/acdlite/recompose/blob/master/docs/API.md#onlyUpdateForPropTypes
|
||||
export const onlyUpdateForPropTypes: InferableComponentEnhancer;
|
||||
|
||||
// withContext: https://github.com/acdlite/recompose/blob/master/docs/API.md#withContext
|
||||
export function withContext<TContext, TProps>(
|
||||
childContextTypes: ValidationMap<TContext>,
|
||||
getChildContext: mapper<TProps, any>
|
||||
) : InferableComponentEnhancer;
|
||||
|
||||
// getContext: https://github.com/acdlite/recompose/blob/master/docs/API.md#getContext
|
||||
export function getContext<TContext, TProps>(
|
||||
contextTypes: ValidationMap<TContext>
|
||||
) : InferableComponentEnhancer;
|
||||
|
||||
// lifecycle: https://github.com/acdlite/recompose/blob/master/docs/API.md#lifecycle
|
||||
interface ReactLifeCycleFunctions {
|
||||
componentWillMount?: Function;
|
||||
componentDidMount?: Function;
|
||||
componentWillReceiveProps?: Function;
|
||||
shouldComponentUpdate?: Function;
|
||||
componentWillUpdate?: Function;
|
||||
componentDidUpdate?: Function;
|
||||
componentWillUnmount?: Function;
|
||||
}
|
||||
export function lifecycle(
|
||||
spec: ReactLifeCycleFunctions
|
||||
): InferableComponentEnhancer;
|
||||
|
||||
// toClass: https://github.com/acdlite/recompose/blob/master/docs/API.md#toClass
|
||||
export const toClass: InferableComponentEnhancer;
|
||||
|
||||
|
||||
// Static property helpers: https://github.com/acdlite/recompose/blob/master/docs/API.md#static-property-helpers
|
||||
|
||||
// setStatic: https://github.com/acdlite/recompose/blob/master/docs/API.md#setStatic
|
||||
export function setStatic<TOutter>(
|
||||
key: string, value: any
|
||||
): ComponentEnhancer<TOutter, TOutter>;
|
||||
|
||||
// setPropTypes: https://github.com/acdlite/recompose/blob/master/docs/API.md#setPropTypes
|
||||
export function setPropTypes<TOutter>(
|
||||
propTypes: ValidationMap<TOutter>
|
||||
): ComponentEnhancer<any, TOutter>;
|
||||
|
||||
// setDisplayName: https://github.com/acdlite/recompose/blob/master/docs/API.md#setDisplayName
|
||||
export function setDisplayName<TOutter>(
|
||||
displayName: string
|
||||
): ComponentEnhancer<TOutter, TOutter>;
|
||||
|
||||
|
||||
// Utilities: https://github.com/acdlite/recompose/blob/master/docs/API.md#utilities
|
||||
|
||||
// compose: https://github.com/acdlite/recompose/blob/master/docs/API.md#compose
|
||||
export function compose<TInner, TOutter>(
|
||||
...functions: Function[]
|
||||
): ComponentEnhancer<TInner, TOutter>;
|
||||
// export function compose<TOutter>(
|
||||
// ...functions: Array<Function>
|
||||
// ): ComponentEnhancer<any, TOutter>;
|
||||
// export function compose(
|
||||
// ...functions: Array<Function>
|
||||
// ): ComponentEnhancer<any, any>;
|
||||
|
||||
// getDisplayName: https://github.com/acdlite/recompose/blob/master/docs/API.md#getDisplayName
|
||||
export function getDisplayName(
|
||||
component: Component<any>
|
||||
): string;
|
||||
|
||||
// wrapDisplayName: https://github.com/acdlite/recompose/blob/master/docs/API.md#wrapDisplayName
|
||||
export function wrapDisplayName(
|
||||
component: Component<any>,
|
||||
wrapperName: string
|
||||
): string;
|
||||
|
||||
// shallowEqual: https://github.com/acdlite/recompose/blob/master/docs/API.md#shallowEqual
|
||||
export function shallowEqual(
|
||||
a: Object, b: Object
|
||||
): boolean;
|
||||
|
||||
// isClassComponent: https://github.com/acdlite/recompose/blob/master/docs/API.md#isClassComponent
|
||||
export function isClassComponent(
|
||||
value: any
|
||||
): boolean;
|
||||
|
||||
// createEagerElement: https://github.com/acdlite/recompose/blob/master/docs/API.md#createEagerElement
|
||||
export function createEagerElement(
|
||||
type: Component<any> | string,
|
||||
props?: Object,
|
||||
children?: React.ReactNode
|
||||
): React.ReactElement<any>;
|
||||
|
||||
// createEagerFactory: https://github.com/acdlite/recompose/blob/master/docs/API.md#createEagerFactory
|
||||
type componentFactory = (props?: Object, children?: React.ReactNode) => React.ReactElement<any>;
|
||||
export function createEagerFactory(
|
||||
type: Component<any> | string
|
||||
): componentFactory;
|
||||
|
||||
// createSink: https://github.com/acdlite/recompose/blob/master/docs/API.md#createSink
|
||||
export function createSink(
|
||||
callback: (props: Object) => void
|
||||
): React.ComponentClass<any>; // ???
|
||||
|
||||
// componentFromProp: https://github.com/acdlite/recompose/blob/master/docs/API.md#componentFromProp
|
||||
export function componentFromProp(
|
||||
propName: string
|
||||
): StatelessComponent<any>;
|
||||
|
||||
// nest: https://github.com/acdlite/recompose/blob/master/docs/API.md#nest
|
||||
export function nest(
|
||||
...Components: (string | Component<any>)[]
|
||||
): React.ComponentClass<any>; // ???
|
||||
|
||||
// hoistStatics: https://github.com/acdlite/recompose/blob/master/docs/API.md#hoistStatics
|
||||
export function hoistStatics(
|
||||
hoc: InferableComponentEnhancer
|
||||
): InferableComponentEnhancer;
|
||||
|
||||
|
||||
|
||||
// Observable utilities: https://github.com/acdlite/recompose/blob/master/docs/API.md#observable-utilities
|
||||
|
||||
// componentFromStream: https://github.com/acdlite/recompose/blob/master/docs/API.md#componentFromStream
|
||||
export function componentFromStream<TProps>(
|
||||
propsToReactNode: mapper<Subscribable<TProps>, Subscribable<React.ReactNode>>
|
||||
): Component<TProps>; // ???
|
||||
|
||||
// mapPropsStream: https://github.com/acdlite/recompose/blob/master/docs/API.md#mapPropsStream
|
||||
export function mapPropsStream<TInner, TOutter>(
|
||||
transform: mapper<Subscribable<TOutter>, Subscribable<TInner>>
|
||||
): ComponentEnhancer<TInner, TOutter>;
|
||||
|
||||
// createEventHandler: https://github.com/acdlite/recompose/blob/master/docs/API.md#createEventHandler
|
||||
type EventHandlerOf<T, TSubs extends Subscribable<T>> = {
|
||||
handler: (value: T) => void;
|
||||
stream: TSubs;
|
||||
};
|
||||
export function createEventHandler<T, TSubs extends Subscribable<T>>(): EventHandlerOf<T, TSubs>;
|
||||
|
||||
// setObservableConfig: https://github.com/acdlite/recompose/blob/master/docs/API.md#setObservableConfig
|
||||
type ObservableConfig = {
|
||||
fromESObservable?: <T>(observable: Subscribable<T>) => any;
|
||||
toESObservable?: <T>(stream: any) => Subscribable<T>;
|
||||
};
|
||||
export function setObservableConfig(config: ObservableConfig): void;
|
||||
}
|
||||
|
||||
// https://github.com/acdlite/recompose/blob/master/docs/API.md#rxjs
|
||||
declare module 'recompose/rxjsObservableConfig' {
|
||||
|
||||
import { ObservableConfig } from 'recompose';
|
||||
|
||||
const rxjsconfig: ObservableConfig;
|
||||
|
||||
export default rxjsconfig;
|
||||
}
|
||||
|
||||
// https://github.com/acdlite/recompose/blob/master/docs/API.md#rxjs-4-legacy
|
||||
declare module 'recompose/rxjs4ObservableConfig' {
|
||||
|
||||
import { ObservableConfig } from 'recompose';
|
||||
|
||||
const rxjs4config: ObservableConfig;
|
||||
|
||||
export default rxjs4config;
|
||||
}
|
||||
|
||||
// https://github.com/acdlite/recompose/blob/master/docs/API.md#most
|
||||
declare module 'recompose/mostObservableConfig' {
|
||||
|
||||
import { ObservableConfig } from 'recompose';
|
||||
|
||||
const mostConfig: ObservableConfig;
|
||||
|
||||
export default mostConfig;
|
||||
}
|
||||
|
||||
// https://github.com/acdlite/recompose/blob/master/docs/API.md#xstream
|
||||
declare module 'recompose/xstreamObservableConfig' {
|
||||
|
||||
import { ObservableConfig } from 'recompose';
|
||||
|
||||
const xstreamConfig: ObservableConfig;
|
||||
|
||||
export default xstreamConfig;
|
||||
}
|
||||
|
||||
// https://github.com/acdlite/recompose/blob/master/docs/API.md#bacon
|
||||
declare module 'recompose/baconObservableConfig' {
|
||||
|
||||
import { ObservableConfig } from 'recompose';
|
||||
|
||||
const baconConfig: ObservableConfig;
|
||||
|
||||
export default baconConfig;
|
||||
}
|
||||
|
||||
// https://github.com/acdlite/recompose/blob/master/docs/API.md#kefir
|
||||
declare module 'recompose/kefirObservableConfig' {
|
||||
|
||||
import { ObservableConfig } from 'recompose';
|
||||
|
||||
const kefirConfig: ObservableConfig;
|
||||
|
||||
export default kefirConfig;
|
||||
}
|
||||
Vendored
-425
@@ -1,425 +0,0 @@
|
||||
// Type definitions for riot v2.6.0
|
||||
// Project: https://github.com/riot/riot
|
||||
// Definitions by: Boriss Nazarovs <https://github.com/Stubb0rn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace riot {
|
||||
/**
|
||||
* Current version number as string
|
||||
*/
|
||||
const version: string;
|
||||
|
||||
/**
|
||||
* Riot settings
|
||||
*/
|
||||
interface Settings {
|
||||
/**
|
||||
* Setting used to customize the start and end tokens of the expression
|
||||
*/
|
||||
brackets: string;
|
||||
}
|
||||
|
||||
const settings: Settings;
|
||||
|
||||
interface TemplateError extends Error {
|
||||
riotData: {
|
||||
tagName: string;
|
||||
}
|
||||
}
|
||||
|
||||
interface Util {
|
||||
tmpl: {
|
||||
errorHandler(error: TemplateError): void;
|
||||
}
|
||||
}
|
||||
|
||||
const util: Util;
|
||||
|
||||
/**
|
||||
* Internal riot tags cache
|
||||
*/
|
||||
const vdom: Tag[];
|
||||
|
||||
interface Observable {
|
||||
/**
|
||||
* Register callback for specified events.
|
||||
* Callback is executed each time event is triggered
|
||||
* @param events Space separated list of events or wildcard '*' that matches all events
|
||||
* @param callback Callback function
|
||||
*/
|
||||
on?(events: string, callback: Function): Observable;
|
||||
|
||||
/**
|
||||
* Register callback for specified events.
|
||||
* Callback is executed at most once.
|
||||
* @param events Space separated list of events.
|
||||
* @param callback Callback function
|
||||
*/
|
||||
one?(events: string, callback: Function): Observable;
|
||||
|
||||
/**
|
||||
* Remove all registered callbacks for specified events
|
||||
* @param events Space separated list of events or wildcard '*' that matches all events
|
||||
*/
|
||||
off?(events: string): Observable;
|
||||
|
||||
/**
|
||||
* Remove specified callback for specified events
|
||||
* @param events Space separated list of events or wildcard '*' that matches all events
|
||||
* @param callback Callback function to remove
|
||||
*/
|
||||
off?(events: string, callback: Function): Observable;
|
||||
|
||||
/**
|
||||
* Execute all callback functions registered for specified list of events
|
||||
* @param events Space separated list of events
|
||||
* @param args Arguments provided to callbacks
|
||||
*/
|
||||
trigger?(events: string, ...args: any[]): Observable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Riot Router
|
||||
*/
|
||||
interface Route {
|
||||
/**
|
||||
* Register callback that is executed when the URL changes
|
||||
* @param callback Callback function
|
||||
*/
|
||||
(callback: (...args: any[]) => void): void;
|
||||
|
||||
/**
|
||||
* Register callback that is executed when the URL changes and new URL matches specified filter
|
||||
* @param filter URL filter
|
||||
* @param callback Callback function
|
||||
*/
|
||||
(filter: string, callback: (...any: string[]) => void): void;
|
||||
|
||||
/**
|
||||
* Change the browser URL and notify all the listeners registered with `Route(callback)`
|
||||
* @param to New URL
|
||||
* @param title Document title for new URL
|
||||
* @param shouldReplace Should new url replace the current history
|
||||
*/
|
||||
(to: string, title?: string, shouldReplace?: boolean): void;
|
||||
|
||||
/**
|
||||
* Return a new routing context
|
||||
*/
|
||||
create(): Route;
|
||||
|
||||
/**
|
||||
* Start listening for url changes
|
||||
* @param autoExec Should router exec routing on the current url
|
||||
*/
|
||||
start(autoExec?: boolean): void;
|
||||
|
||||
/**
|
||||
* Stop all the routings.
|
||||
* Removes the listeners and clears the callbacks.
|
||||
*/
|
||||
stop(): void;
|
||||
|
||||
/**
|
||||
* Study the current browser path “in place” and emit routing without waiting for it to change.
|
||||
*/
|
||||
exec(): void;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
exec(callback: Function): void;
|
||||
|
||||
/**
|
||||
* Extract query from the url
|
||||
*/
|
||||
query(): { [key: string]: string };
|
||||
|
||||
/**
|
||||
* Change the base path
|
||||
* @param base Base path
|
||||
*/
|
||||
base(base: string): void;
|
||||
|
||||
/**
|
||||
* Change the default parsers to the custom ones.
|
||||
* @param parser Replacement parser for default parser
|
||||
* @param secondParser Replacement parser for handling url filters
|
||||
*/
|
||||
parser(parser: (path: string) => any[], secondParser?: (path: string, filter: string) => any[]): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds Observer support for the given object or
|
||||
* if the argument is empty a new observable instance is created and returned.
|
||||
* @param el Object to become observable
|
||||
*/
|
||||
function observable(el?: any): Observable;
|
||||
|
||||
const route: Route;
|
||||
|
||||
/**
|
||||
* Mount custom tags with specified tag name. Returns an array of mounted tag instances.
|
||||
* @param selector Tag selector.
|
||||
* It can be tag name, css selector or special '*' selector that matches all tags on the page.
|
||||
* @param opts Optional object passed for the tags to consume.
|
||||
*/
|
||||
function mount(selector: string, opts?: any): Tag[];
|
||||
|
||||
/**
|
||||
* Mount a custom tag on DOM nodes matching provided selector. Returns an array of mounted tag instances.
|
||||
* @param selector CSS selector
|
||||
* @param tagName Custom tag name
|
||||
* @param opts Optional object passed for the tag to consume.
|
||||
*/
|
||||
function mount(selector: string, tagName: string, opts?: any): Tag[];
|
||||
|
||||
/**
|
||||
* Mount a custom tag on a given DOM node. Returns an array of mounted tag instances.
|
||||
* @param domNode DOM node
|
||||
* @param tagName Tag name
|
||||
* @param opts Optional object passed for the tag to consume.
|
||||
*/
|
||||
function mount(domNode: Node, tagName: string, opts?: any): Tag[];
|
||||
|
||||
/**
|
||||
* Render a tag to html. This method is only available on server-side.
|
||||
* @param tagName Custom tag name
|
||||
* @param opts Optional object passed for the tag to consume.
|
||||
*/
|
||||
function render(tagName: string, opts?: any): string;
|
||||
|
||||
/**
|
||||
* Update all the mounted tags and their expressions on the page.
|
||||
* Returns an array of tag instances that are mounted on the page.
|
||||
*/
|
||||
function update(): Tag[];
|
||||
|
||||
/**
|
||||
* Register a global mixin and automatically add it to all tag instances.
|
||||
* @param mixinObject Mixin object
|
||||
*/
|
||||
function mixin(mixinObject: TagMixin): void;
|
||||
|
||||
/**
|
||||
* Register a shared mixin, globally available to be used in any tag using `TagInstance.mixin(mixinName)`
|
||||
* @param mixinName Name of the mixin
|
||||
* @param mixinObject Mixin object
|
||||
*/
|
||||
function mixin(mixinName: string, mixinObject: TagMixin): void;
|
||||
|
||||
/**
|
||||
* Create a new custom tag “manually” without the compiler. Returns name of the tag.
|
||||
* @param tagName The tag name
|
||||
* @param html The layout with expressions
|
||||
* @param css The style of the tag
|
||||
* @param attrs String of attributes for the tag
|
||||
* @param constructor The initialization function being called before
|
||||
* the tag expressions are calculated and before the tag is mounted
|
||||
*/
|
||||
function tag(tagName: string, html: string, css?: string, attrs?: string, constructor?: (opts: any) => void): string;
|
||||
|
||||
|
||||
interface TagImplementation {
|
||||
/**
|
||||
* Tag template
|
||||
*/
|
||||
tmpl: string;
|
||||
/**
|
||||
* The callback function called on the mount event
|
||||
* @param opts Tag options object
|
||||
*/
|
||||
fn?(opts: any): void;
|
||||
/**
|
||||
* Root tag html attributes as object (key => value)
|
||||
*/
|
||||
attrs?: {
|
||||
[key: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
interface TagConfiguration {
|
||||
/**
|
||||
* DOM node where you will mount the tag template
|
||||
*/
|
||||
root: Node;
|
||||
/**
|
||||
* Tag options
|
||||
*/
|
||||
opts?: any;
|
||||
/**
|
||||
* Is it used in as loop tag
|
||||
*/
|
||||
isLoop?: boolean;
|
||||
/**
|
||||
* Is already registered using `riot.tag`
|
||||
*/
|
||||
hasImpl?: boolean;
|
||||
/**
|
||||
* Loop item in the loop assigned to this instance
|
||||
*/
|
||||
item?: any;
|
||||
}
|
||||
|
||||
interface TagInterface extends Observable {
|
||||
/**
|
||||
* options object
|
||||
*/
|
||||
opts?: any;
|
||||
/**
|
||||
* the parent tag if any
|
||||
*/
|
||||
parent?: Tag;
|
||||
/**
|
||||
* root DOM node
|
||||
*/
|
||||
root?: Node;
|
||||
/**
|
||||
* nested custom tags
|
||||
*/
|
||||
tags?: {
|
||||
[key: string]: Tag | Tag[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates all the expressions on the current tag instance as well as on all the children.
|
||||
* @param data Context data
|
||||
*/
|
||||
update?(data?: any): void;
|
||||
|
||||
/**
|
||||
* Extend tag with functionality available on shared mixin registered with `riot.mixin(mixinName, mixinObject)`
|
||||
* @param mixinName Name of shared mixin
|
||||
*/
|
||||
mixin?(mixinName: string): void;
|
||||
|
||||
/**
|
||||
* Extend tag functionality with functionality available on provided mixin object.
|
||||
* @param mixinObject Mixin object
|
||||
*/
|
||||
mixin?(mixinObject: TagMixin): void;
|
||||
|
||||
/**
|
||||
* Mount the tag
|
||||
*/
|
||||
mount?(): void;
|
||||
|
||||
/**
|
||||
* Detach the tag and its children from the page.
|
||||
* @param keepTheParent If `true` unmounting tag doesn't remove the parent tag
|
||||
*/
|
||||
unmount?(keepTheParent?: boolean): void;
|
||||
}
|
||||
|
||||
|
||||
class Tag implements TagInterface {
|
||||
/**
|
||||
* Tag constructor
|
||||
* @param impl Tag implementation
|
||||
* @param conf Tag configuration
|
||||
* @param innerHTML HTML that can be used replacing a nested `yield` tag in its template
|
||||
*/
|
||||
constructor(impl: TagImplementation, conf: TagConfiguration, innerHTML?: string);
|
||||
|
||||
/**
|
||||
* options object
|
||||
*/
|
||||
opts: any;
|
||||
/**
|
||||
* the parent tag if any
|
||||
*/
|
||||
parent: Tag;
|
||||
/**
|
||||
* root DOM node
|
||||
*/
|
||||
root: Node;
|
||||
/**
|
||||
* nested custom tags
|
||||
*/
|
||||
tags: {
|
||||
[key: string]: Tag | Tag[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates all the expressions on the current tag instance as well as on all the children.
|
||||
* @param data Context data
|
||||
*/
|
||||
update(data?: any): void;
|
||||
|
||||
/**
|
||||
* Extend tag with functionality available on shared mixin registered with `riot.mixin(mixinName, mixinObject)`
|
||||
* @param mixinName Name of shared mixin
|
||||
*/
|
||||
mixin(mixinName: string): void;
|
||||
|
||||
/**
|
||||
* Extend tag functionality with functionality available on provided mixin object.
|
||||
* @param mixinObject Mixin object
|
||||
*/
|
||||
mixin(mixinObject: TagMixin): void;
|
||||
|
||||
/**
|
||||
* Mount the tag
|
||||
*/
|
||||
mount(): void;
|
||||
|
||||
/**
|
||||
* Detach the tag and its children from the page.
|
||||
* @param keepTheParent If `true` unmounting tag doesn't remove the parent tag
|
||||
*/
|
||||
unmount(keepTheParent?: boolean): void;
|
||||
|
||||
// Observable methods
|
||||
on(events: string, callback: Function): this;
|
||||
one(events: string, callback: Function): this;
|
||||
off(events: string): this;
|
||||
off(events: string, callback: Function): this;
|
||||
trigger(events: string, ...args: any[]): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mixin object for extending tag functionality.
|
||||
* When it gets mixed in it has access to all tag properties.
|
||||
* It should not override any built in tag properties
|
||||
*/
|
||||
interface TagMixin extends TagInterface {
|
||||
/**
|
||||
* Special method which can initialize
|
||||
* the mixin when it's loaded to the tag and is not
|
||||
* accessible from the tag its mixed in
|
||||
*/
|
||||
init?(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile all tags defined with <script type="riot/tag"> to JavaScript.
|
||||
* @param callback Function that is called after all scripts are compiled
|
||||
*/
|
||||
function compile(callback: Function): void;
|
||||
|
||||
/**
|
||||
* Compiles and executes the given tag.
|
||||
* @param tag Tag definition
|
||||
* @return {string} Compiled JavaScript as string
|
||||
*/
|
||||
function compile(tag: string): string;
|
||||
|
||||
/**
|
||||
* Compiles the given tag but doesn't execute it, if `skipExecution` parameter is `true`
|
||||
* @param tag Tag definition
|
||||
* @param skipExecution If `true` tag is not executed after compilation
|
||||
* @return {string} Compiled JavaScript as string
|
||||
*/
|
||||
function compile(tag: string, skipExecution: boolean): string;
|
||||
|
||||
/**
|
||||
* Loads the given URL and compiles all tags after which the callback is called
|
||||
* @param url URL to load
|
||||
* @param callback Function that is called after all tags are compiled
|
||||
*/
|
||||
function compile(url: string, callback: Function): void;
|
||||
}
|
||||
|
||||
declare module 'riot' {
|
||||
export = riot;
|
||||
}
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
// Type definitions for shallowequal v0.2.2
|
||||
// Project: https://github.com/dashed/shallowequal
|
||||
// Definitions by: Sean Kelley <https://github.com/seansfkelley>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'shallowequal' {
|
||||
function shallowEqual(objA: any, objB: any, compare?: (objA: any, objB: any, indexOrKey?: number | string) => boolean, compareContext?: any): boolean;
|
||||
export = shallowEqual;
|
||||
}
|
||||
-95
@@ -1,95 +0,0 @@
|
||||
// Type definitions for simple-url-cache
|
||||
// Project: https://github.com/a-lucas/simple-url-cache
|
||||
// Definitions by: Antoine LUCAS <https://github.com/a-lucas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../redis/redis.d.ts" />
|
||||
|
||||
declare module 'simple-url-cache' {
|
||||
import redis = require("redis");
|
||||
|
||||
export class CacheEngine {
|
||||
constructor(storageConfig: FileStorageConfig, cacheRules: CacheRules);
|
||||
constructor(storageConfig: RedisStorageConfig, cacheRules: CacheRules);
|
||||
url(url: string): FileStorage;
|
||||
url(url: string): RedisStorage;
|
||||
}
|
||||
|
||||
export interface RegexRule {
|
||||
regex:RegExp
|
||||
}
|
||||
|
||||
export interface MaxAgeRegexRule extends RegexRule {
|
||||
maxAge:number
|
||||
}
|
||||
|
||||
export interface CacheRules {
|
||||
cacheMaxAge:MaxAgeRegexRule[],
|
||||
cacheAlways:RegexRule[],
|
||||
cacheNever:RegexRule[],
|
||||
default:string
|
||||
}
|
||||
|
||||
export interface FileStorageConfig extends privateN.StorageConfig {
|
||||
dir:string;
|
||||
}
|
||||
|
||||
export interface RedisStorageConfig extends privateN.StorageConfig {
|
||||
host:string;
|
||||
port:number;
|
||||
path?:string;
|
||||
url?:string;
|
||||
socket_keepalive?:boolean;
|
||||
password?:string;
|
||||
db?:string;
|
||||
}
|
||||
|
||||
namespace privateN {
|
||||
interface StorageConfig {
|
||||
type:string
|
||||
}
|
||||
|
||||
interface CacheStorage {
|
||||
isCached():Promise<boolean>;
|
||||
removeUrl():Promise<boolean>;
|
||||
getUrl():Promise<string>;
|
||||
cache(html:string):Promise<boolean>;
|
||||
cache(html:string, force:boolean):Promise<boolean>;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
abstract class CacheCategory {
|
||||
constructor(currentUrl:string, _config:CacheRules) ;
|
||||
private getRegexTest(u:RegexRule):boolean;
|
||||
private getCacheCategory():string;
|
||||
public getCategory():string;
|
||||
public getCurrentUrl():string;
|
||||
}
|
||||
|
||||
module RedisPool {
|
||||
export function connect(config:RedisStorageConfig): redis.RedisClient;
|
||||
export function isOnline():boolean;
|
||||
export function kill():void;
|
||||
}
|
||||
}
|
||||
|
||||
export class FileStorage extends privateN.CacheCategory implements privateN.CacheStorage {
|
||||
constructor(_url:string, _storageConfig: FileStorageConfig, _regexRules: CacheRules);
|
||||
isCached():Promise<boolean>;
|
||||
removeUrl():Promise<boolean>;
|
||||
getUrl():Promise<string>;
|
||||
cache(html:string):Promise<boolean>
|
||||
cache(html:string, force:boolean):Promise<boolean>;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export class RedisStorage extends privateN.CacheCategory implements privateN.CacheStorage {
|
||||
constructor(_url:string, _storageConfig: RedisStorageConfig, _regexRules: CacheRules);
|
||||
isCached():Promise<boolean>;
|
||||
removeUrl():Promise<boolean>;
|
||||
getUrl():Promise<string>;
|
||||
cache(html:string):Promise<boolean>;
|
||||
cache(html:string, force:boolean):Promise<boolean>;
|
||||
destroy(): void;
|
||||
}
|
||||
}
|
||||
Vendored
-412
@@ -1,412 +0,0 @@
|
||||
// Type definitions for node-spdy v3.4.3
|
||||
// Project: https://github.com/indutny/node-spdy
|
||||
// Definitions by: Anthony Trinh <https://github.com/tony19>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "spdy" {
|
||||
// lib/spdy/agent.js
|
||||
namespace agent {
|
||||
export class Agent extends node.https.Agent {}
|
||||
export class PlainAgent extends node.http.Agent {}
|
||||
export function create(base: any, options: AgentOptions): Agent | PlainAgent;
|
||||
|
||||
export interface AgentOptions extends node.https.AgentOptions {
|
||||
port?: number,
|
||||
spdy?: {
|
||||
plain?: boolean,
|
||||
ssl?: boolean,
|
||||
'x-forwarded-for'?: string,
|
||||
protocol?: string,
|
||||
protocols?: string[]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// lib/spdy/handle.js
|
||||
export interface Handle {
|
||||
create(options: Object, stream: any, socket: Socket): Handle;
|
||||
getStream(callback?: Function): any;
|
||||
assignSocket(socket: Socket, options: Object): void;
|
||||
assignClientRequest(req: any): void;
|
||||
assignRequest(req: any): void;
|
||||
assignResponse(res: any): void;
|
||||
emitRequest(): void;
|
||||
emitResponse(status: any, headers: any): void;
|
||||
}
|
||||
|
||||
// lib/spdy/request.js
|
||||
namespace request {
|
||||
export function onNewListener(type: string): void;
|
||||
}
|
||||
|
||||
// lib/spdy/response.js
|
||||
namespace response {
|
||||
export function writeHead(statusCode: number, reason: string, obj: Object): void;
|
||||
export function writeHead(statusCode: number, obj: Object): void;
|
||||
export function end(data: any, encoding: string, callback: Function): void;
|
||||
}
|
||||
|
||||
// lib/spdy/server.js
|
||||
namespace server {
|
||||
export interface Server extends node.https.Server {}
|
||||
export interface PlainServer extends node.http.Server {}
|
||||
export interface IncomingMessage extends node.http.IncomingMessage {}
|
||||
export interface ServerResponse extends node.http.ServerResponse {
|
||||
push(filename: string, options: PushOptions): any;
|
||||
}
|
||||
export function create(base: any,
|
||||
options: node.https.ServerOptions,
|
||||
handler: (request: IncomingMessage, response: ServerResponse) => void): Server;
|
||||
export function create(options: node.https.ServerOptions,
|
||||
handler: (request: IncomingMessage, response: ServerResponse) => void): Server;
|
||||
export function create(handler: (request: IncomingMessage, response: ServerResponse) => void): Server;
|
||||
|
||||
export type Protocol =
|
||||
'h2'
|
||||
| 'spdy/3.1'
|
||||
| 'spdy/3'
|
||||
| 'spdy/2'
|
||||
| 'http/1.1'
|
||||
| 'http/1.0';
|
||||
|
||||
export interface PushOptions {
|
||||
status?: number,
|
||||
method?: string,
|
||||
request?: any,
|
||||
response?: any
|
||||
}
|
||||
|
||||
export interface ServerOptions extends node.https.ServerOptions {
|
||||
spdy?: {
|
||||
protocols?: Protocol[],
|
||||
plain?: boolean,
|
||||
'x-forwarded-for'?: boolean,
|
||||
connection?: {
|
||||
windowSize?: number,
|
||||
autoSpdy31?: boolean,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// copied from definitions of Node 6.7.0
|
||||
namespace node {
|
||||
namespace http {
|
||||
interface Server extends net.Server {
|
||||
setTimeout(msecs: number, callback: Function): any;
|
||||
|
||||
maxHeadersCount: number;
|
||||
timeout: number;
|
||||
listening: boolean;
|
||||
}
|
||||
|
||||
interface AgentOptions {
|
||||
/**
|
||||
* Keep sockets around in a pool to be used by other requests in the future. Default = false
|
||||
*/
|
||||
keepAlive?: boolean;
|
||||
/**
|
||||
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
|
||||
* Only relevant if keepAlive is set to true.
|
||||
*/
|
||||
keepAliveMsecs?: number;
|
||||
/**
|
||||
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
|
||||
*/
|
||||
maxSockets?: number;
|
||||
/**
|
||||
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
|
||||
*/
|
||||
maxFreeSockets?: number;
|
||||
}
|
||||
|
||||
class Agent {
|
||||
maxSockets: number;
|
||||
sockets: any;
|
||||
requests: any;
|
||||
|
||||
constructor(opts?: AgentOptions);
|
||||
|
||||
/**
|
||||
* Destroy any sockets that are currently in use by the agent.
|
||||
* It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
|
||||
* then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
|
||||
* sockets may hang open for quite a long time before the server terminates them.
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export interface IncomingMessage {
|
||||
path: string;
|
||||
httpVersion: string;
|
||||
httpVersionMajor: number;
|
||||
httpVersionMinor: number;
|
||||
connection: any;
|
||||
headers: any;
|
||||
rawHeaders: string[];
|
||||
trailers: any;
|
||||
rawTrailers: any;
|
||||
setTimeout(msecs: number, callback: Function): any;
|
||||
/**
|
||||
* Only valid for request obtained from http.Server.
|
||||
*/
|
||||
method?: string;
|
||||
/**
|
||||
* Only valid for request obtained from http.Server.
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* Only valid for response obtained from http.ClientRequest.
|
||||
*/
|
||||
statusCode?: number;
|
||||
/**
|
||||
* Only valid for response obtained from http.ClientRequest.
|
||||
*/
|
||||
statusMessage?: string;
|
||||
socket: any;
|
||||
destroy(error?: Error): void;
|
||||
get(name: string): string;
|
||||
}
|
||||
|
||||
export interface ServerResponse {
|
||||
// Extended base methods
|
||||
write(buffer: any): boolean;
|
||||
write(buffer: any, cb?: Function): boolean;
|
||||
write(str: string, cb?: Function): boolean;
|
||||
write(str: string, encoding?: string, cb?: Function): boolean;
|
||||
write(str: string, encoding?: string, fd?: string): boolean;
|
||||
|
||||
writeContinue(): void;
|
||||
writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void;
|
||||
writeHead(statusCode: number, headers?: any): void;
|
||||
statusCode: number;
|
||||
statusMessage: string;
|
||||
headersSent: boolean;
|
||||
setHeader(name: string, value: string | string[]): void;
|
||||
setTimeout(msecs: number, callback: Function): ServerResponse;
|
||||
sendDate: boolean;
|
||||
getHeader(name: string): string;
|
||||
removeHeader(name: string): void;
|
||||
write(chunk: any, encoding?: string): any;
|
||||
addTrailers(headers: any): void;
|
||||
finished: boolean;
|
||||
|
||||
// Extended base methods
|
||||
end(): void;
|
||||
end(buffer: any, cb?: Function): void;
|
||||
end(str: string, cb?: Function): void;
|
||||
end(str: string, encoding?: string, cb?: Function): void;
|
||||
end(data?: any, encoding?: string): void;
|
||||
}
|
||||
}
|
||||
|
||||
namespace https {
|
||||
interface Server extends tls.Server {
|
||||
close(callback?: Function): Server;
|
||||
}
|
||||
|
||||
interface ServerOptions {
|
||||
pfx?: any;
|
||||
key?: any;
|
||||
passphrase?: string;
|
||||
cert?: any;
|
||||
ca?: any;
|
||||
crl?: any;
|
||||
ciphers?: string;
|
||||
honorCipherOrder?: boolean;
|
||||
requestCert?: boolean;
|
||||
rejectUnauthorized?: boolean;
|
||||
NPNProtocols?: any;
|
||||
SNICallback?: (servername: string, cb: (err: Error, ctx: tls.SecureContext) => any) => any;
|
||||
}
|
||||
|
||||
class Agent extends http.Agent {}
|
||||
|
||||
interface AgentOptions extends http.AgentOptions {
|
||||
pfx?: any;
|
||||
key?: any;
|
||||
passphrase?: string;
|
||||
cert?: any;
|
||||
ca?: any;
|
||||
ciphers?: string;
|
||||
rejectUnauthorized?: boolean;
|
||||
secureProtocol?: string;
|
||||
maxCachedSessions?: number;
|
||||
}
|
||||
}
|
||||
|
||||
namespace tls {
|
||||
interface Server extends net.Server {
|
||||
close(): Server;
|
||||
address(): { port: number; family: string; address: string; };
|
||||
addContext(hostName: string, credentials: {
|
||||
key: string;
|
||||
cert: string;
|
||||
ca: string;
|
||||
}): void;
|
||||
maxConnections: number;
|
||||
connections: number;
|
||||
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. tlsClientError
|
||||
* 2. newSession
|
||||
* 3. OCSPRequest
|
||||
* 4. resumeSession
|
||||
* 5. secureConnection
|
||||
**/
|
||||
addListener(event: string, listener: Function): this;
|
||||
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: any) => void): this;
|
||||
addListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: any) => void) => void): this;
|
||||
addListener(event: "OCSPRequest", listener: (certificate: any, issuer: any, callback: Function) => void): this;
|
||||
addListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
|
||||
addListener(event: "secureConnection", listener: (tlsSocket: any) => void): this;
|
||||
|
||||
emit(event: string, ...args: any[]): boolean;
|
||||
emit(event: "tlsClientError", err: Error, tlsSocket: any): boolean;
|
||||
emit(event: "newSession", sessionId: any, sessionData: any, callback: (err: Error, resp: any) => void): boolean;
|
||||
emit(event: "OCSPRequest", certificate: any, issuer: any, callback: Function): boolean;
|
||||
emit(event: "resumeSession", sessionId: any, callback: (err: Error, sessionData: any) => void): boolean;
|
||||
emit(event: "secureConnection", tlsSocket: any): boolean;
|
||||
|
||||
on(event: string, listener: Function): this;
|
||||
on(event: "tlsClientError", listener: (err: Error, tlsSocket: any) => void): this;
|
||||
on(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: any) => void) => void): this;
|
||||
on(event: "OCSPRequest", listener: (certificate: any, issuer: any, callback: Function) => void): this;
|
||||
on(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
|
||||
on(event: "secureConnection", listener: (tlsSocket: any) => void): this;
|
||||
|
||||
once(event: string, listener: Function): this;
|
||||
once(event: "tlsClientError", listener: (err: Error, tlsSocket: any) => void): this;
|
||||
once(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: any) => void) => void): this;
|
||||
once(event: "OCSPRequest", listener: (certificate: any, issuer: any, callback: Function) => void): this;
|
||||
once(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
|
||||
once(event: "secureConnection", listener: (tlsSocket: any) => void): this;
|
||||
|
||||
prependListener(event: string, listener: Function): this;
|
||||
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: any) => void): this;
|
||||
prependListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: any) => void) => void): this;
|
||||
prependListener(event: "OCSPRequest", listener: (certificate: any, issuer: any, callback: Function) => void): this;
|
||||
prependListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
|
||||
prependListener(event: "secureConnection", listener: (tlsSocket: any) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: Function): this;
|
||||
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: any) => void): this;
|
||||
prependOnceListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: any) => void) => void): this;
|
||||
prependOnceListener(event: "OCSPRequest", listener: (certificate: any, issuer: any, callback: Function) => void): this;
|
||||
prependOnceListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
|
||||
prependOnceListener(event: "secureConnection", listener: (tlsSocket: any) => void): this;
|
||||
}
|
||||
|
||||
interface SecureContext {
|
||||
context: any;
|
||||
}
|
||||
}
|
||||
|
||||
namespace net {
|
||||
interface Server {
|
||||
// net.Server
|
||||
listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server;
|
||||
listen(port: number, hostname?: string, listeningListener?: Function): Server;
|
||||
listen(port: number, backlog?: number, listeningListener?: Function): Server;
|
||||
listen(port: number, listeningListener?: Function): Server;
|
||||
listen(path: string, backlog?: number, listeningListener?: Function): Server;
|
||||
listen(path: string, listeningListener?: Function): Server;
|
||||
listen(handle: any, backlog?: number, listeningListener?: Function): Server;
|
||||
listen(handle: any, listeningListener?: Function): Server;
|
||||
listen(options: ListenOptions, listeningListener?: Function): Server;
|
||||
|
||||
close(callback?: Function): Server;
|
||||
|
||||
address(): { port: number; family: string; address: string; };
|
||||
|
||||
getConnections(cb: (error: Error, count: number) => void): void;
|
||||
|
||||
ref(): Server;
|
||||
|
||||
unref(): Server;
|
||||
|
||||
maxConnections: number;
|
||||
connections: number;
|
||||
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. close
|
||||
* 2. connection
|
||||
* 3. error
|
||||
* 4. listening
|
||||
*/
|
||||
addListener(event: string, listener: Function): this;
|
||||
addListener(event: "close", listener: () => void): this;
|
||||
addListener(event: "connection", listener: (socket: Socket) => void): this;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
addListener(event: "listening", listener: () => void): this;
|
||||
|
||||
emit(event: string, ...args: any[]): boolean;
|
||||
emit(event: "close"): boolean;
|
||||
emit(event: "connection", socket: Socket): boolean;
|
||||
emit(event: "error", err: Error): boolean;
|
||||
emit(event: "listening"): boolean;
|
||||
|
||||
on(event: string, listener: Function): this;
|
||||
on(event: "close", listener: () => void): this;
|
||||
on(event: "connection", listener: (socket: Socket) => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
on(event: "listening", listener: () => void): this;
|
||||
|
||||
once(event: string, listener: Function): this;
|
||||
once(event: "close", listener: () => void): this;
|
||||
once(event: "connection", listener: (socket: Socket) => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
once(event: "listening", listener: () => void): this;
|
||||
|
||||
prependListener(event: string, listener: Function): this;
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
prependListener(event: "connection", listener: (socket: Socket) => void): this;
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependListener(event: "listening", listener: () => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: Function): this;
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependOnceListener(event: "listening", listener: () => void): this;
|
||||
}
|
||||
|
||||
interface ListenOptions {
|
||||
port?: number;
|
||||
host?: string;
|
||||
backlog?: number;
|
||||
path?: string;
|
||||
exclusive?: boolean;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// lib/spdy/socket.js
|
||||
namespace socket {
|
||||
export interface Socket {
|
||||
// net.Socket
|
||||
}
|
||||
}
|
||||
|
||||
// lib/spdy.js
|
||||
export type Agent = agent.Agent;
|
||||
export type PlainAgent = agent.PlainAgent;
|
||||
export type AgentOptions = agent.AgentOptions;
|
||||
export type Socket = socket.Socket;
|
||||
export type Server = server.Server;
|
||||
export type IncomingMessage = server.IncomingMessage;
|
||||
export type ServerRequest = server.IncomingMessage;
|
||||
export type ServerResponse = server.ServerResponse;
|
||||
export type PlainServer = server.PlainServer;
|
||||
export type ServerOptions = server.ServerOptions;
|
||||
export function createAgent(base: any, options: AgentOptions): Agent | PlainAgent;
|
||||
export function createAgent(options: AgentOptions): Agent | PlainAgent;
|
||||
export function createServer(base: any,
|
||||
options: ServerOptions,
|
||||
handler: (request: IncomingMessage, response: ServerResponse) => void): Server;
|
||||
export function createServer(options: ServerOptions,
|
||||
handler: (request: IncomingMessage, response: ServerResponse) => void): Server;
|
||||
export function createServer(handler: (request: IncomingMessage, response: ServerResponse) => void): Server;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
-m commonjs
|
||||
Vendored
-41
@@ -1,41 +0,0 @@
|
||||
// Type definitions for Swagger-JSDoc
|
||||
// Project: https://github.com/surnet/swagger-jsdoc
|
||||
// Definitions by: Daniel Grove <https://github.com/drGrove>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/* =================== USAGE ===================
|
||||
|
||||
import * as express from "express"
|
||||
import swaggerJSDoc = require('swagger-jsdoc');
|
||||
const app = express()
|
||||
|
||||
let options = {
|
||||
swaggerDefinition: {
|
||||
info: {
|
||||
title: 'Hello World',
|
||||
version: '1.0.0',
|
||||
description: 'A sample API'
|
||||
},
|
||||
host: 'localhost:3000',
|
||||
basePath: '/'
|
||||
},
|
||||
apis: [
|
||||
'./example/routes*.js',
|
||||
'./example/parameters.yaml'
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
var spec = swaggerJSDoc(options);
|
||||
|
||||
app.get('/api-docs.json', function(req, res) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.send(spec);
|
||||
});
|
||||
|
||||
=============================================== */
|
||||
|
||||
declare module "swagger-jsdoc" {
|
||||
function swaggerJSDoc(options?: any): any;
|
||||
export = swaggerJSDoc;
|
||||
}
|
||||
Vendored
-159
@@ -1,159 +0,0 @@
|
||||
// Type definitions for terminal-menu v2.1.1
|
||||
// Project: https://github.com/substack/terminal-menu
|
||||
// Definitions by: Arun Aravind <https://github.com/aravindarun>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "terminal-menu" {
|
||||
import * as stream from "stream";
|
||||
|
||||
/**
|
||||
* Creates a TerminalMenu with default settings.
|
||||
*/
|
||||
function MenuContainerFactory(): MenuContainerFactory.TerminalMenu;
|
||||
|
||||
/**
|
||||
* Creates a TerminalMenu using options to override default settings.
|
||||
* @param options Override values for available settings.
|
||||
*/
|
||||
function MenuContainerFactory(options: MenuContainerFactory.TerminalMenuOptions): MenuContainerFactory.TerminalMenu;
|
||||
|
||||
namespace MenuContainerFactory {
|
||||
|
||||
/**
|
||||
* A Thickness structure specifying the amount of padding to apply.
|
||||
*/
|
||||
export interface Thickness {
|
||||
/**
|
||||
* Represents width of the left side of the bounding rectangle.
|
||||
*/
|
||||
left: number,
|
||||
|
||||
/**
|
||||
* Represents width of the right side of the bounding rectangle.
|
||||
*/
|
||||
right: number,
|
||||
|
||||
/**
|
||||
* Represents width of the upper side of the bounding rectangle.
|
||||
*/
|
||||
top: number,
|
||||
|
||||
/**
|
||||
* Represents width of the lower side of the bounding rectangle.
|
||||
*/
|
||||
bottom: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Options to configure the menu.
|
||||
*/
|
||||
export interface TerminalMenuOptions {
|
||||
/**
|
||||
* Menu width in columns.
|
||||
* Default = 50.
|
||||
*/
|
||||
width?: number;
|
||||
|
||||
/**
|
||||
* Horizontal offset for top-left corner.
|
||||
* Default = 1
|
||||
*/
|
||||
x?: number;
|
||||
|
||||
/**
|
||||
* Vertical offset for top-left corner.
|
||||
* Default = 1
|
||||
*/
|
||||
y?: number;
|
||||
|
||||
/**
|
||||
* Foreground color for the menu.
|
||||
* Default = 'white'
|
||||
*/
|
||||
fg?: string;
|
||||
|
||||
/**
|
||||
* Background color for the menu.
|
||||
* Default = 'blue'
|
||||
*/
|
||||
bg?: string;
|
||||
|
||||
/**
|
||||
* Padding for the bounding rectangle.
|
||||
* If a number is passed, all elements of the Thickness structure will be set to
|
||||
* that value.
|
||||
* Default = {
|
||||
* left: 2,
|
||||
* right: 2,
|
||||
* top: 1,
|
||||
* bottom: 1
|
||||
* }
|
||||
*/
|
||||
padding?: number | Thickness;
|
||||
|
||||
/**
|
||||
* Index of the menu item to be selected.
|
||||
* Default = 0
|
||||
*/
|
||||
selected?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Retro ansi terminal menus.
|
||||
*/
|
||||
export interface TerminalMenu extends NodeJS.EventEmitter {
|
||||
/**
|
||||
* Create a new selectable menu item with label as the anchor.
|
||||
* @param label Label to use as the menu item anchor.
|
||||
*/
|
||||
add(label: string): void;
|
||||
|
||||
/**
|
||||
* Create a new selectable menu item with label as the anchor.
|
||||
* @param label Label to use as the menu item anchor.
|
||||
* @param callback Callback to invoke when the menu item is selected.
|
||||
*/
|
||||
add(label: string, callback: (label: string, index: number) => void): void;
|
||||
|
||||
/**
|
||||
* Writes a message to the terminal.
|
||||
* @param msg Message to be written.
|
||||
*/
|
||||
write(msg: string): void;
|
||||
|
||||
/**
|
||||
* Return a duplex stream to wire up input and output.
|
||||
*/
|
||||
createStream(): stream.Duplex;
|
||||
|
||||
/**
|
||||
* Reset the terminal, clearing all content.
|
||||
*/
|
||||
reset(): void;
|
||||
|
||||
/**
|
||||
* Unregister all listeners and puts the terminal back to its original state.
|
||||
*/
|
||||
close(): void;
|
||||
|
||||
/**
|
||||
* When a menu item is selected, this event is fired.
|
||||
* @param eventName Name of the event. Only value available for eventName is "select"
|
||||
* @param callback Handler for the event specified by eventName
|
||||
*/
|
||||
on(eventName: string | symbol, callback: (label: string, index: number) => void): this;
|
||||
|
||||
/**
|
||||
* When a menu item is selected, this event is fired.
|
||||
* This overload ensures backward compatibility with older versions of NodeJS (< 6.0)
|
||||
* @param eventName Name of the event. Only value available for eventName is "select"
|
||||
* @param callback Handler for the event specified by eventName
|
||||
*/
|
||||
on(eventName: string, callback: (label: string, index: number) => void): this;
|
||||
}
|
||||
}
|
||||
|
||||
export = MenuContainerFactory;
|
||||
}
|
||||
Vendored
-189
@@ -1,189 +0,0 @@
|
||||
// Type definitions for tilebelt 1.0.1
|
||||
// Project: https://github.com/mapbox/tilebelt
|
||||
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../geojson/geojson.d.ts" />
|
||||
|
||||
declare const tilebelt: tilebelt.TilebeltStatic;
|
||||
declare namespace tilebelt {
|
||||
interface TilebeltStatic {
|
||||
/**
|
||||
* Get a geojson representation of a tile
|
||||
*
|
||||
* @name tileToGeoJSON
|
||||
* @param {Array<number>} tile
|
||||
* @returns {Feature<Polygon>}
|
||||
* @example
|
||||
* var poly = tileToGeoJSON([5, 10, 10])
|
||||
* //=poly
|
||||
*/
|
||||
tileToGeoJSON(tile: Array<number>): GeoJSON.Feature<GeoJSON.Polygon>
|
||||
|
||||
/**
|
||||
* Get the bbox of a tile
|
||||
*
|
||||
* @name tileToBBOX
|
||||
* @param {Array<number>} tile
|
||||
* @returns {Array<number>} bbox
|
||||
* @example
|
||||
* var bbox = tileToBBOX([5, 10, 10])
|
||||
* //=bbox
|
||||
*/
|
||||
tileToBBOX(tile: Array<number>): Array<number>
|
||||
|
||||
/**
|
||||
* Get the tile for a point at a specified zoom level
|
||||
*
|
||||
* @name pointToTile
|
||||
* @param {number} lon
|
||||
* @param {number} lat
|
||||
* @param {number} z
|
||||
* @returns {Array<number>} tile
|
||||
* @example
|
||||
* var tile = pointToTile(1, 1, 20)
|
||||
* //=tile
|
||||
*/
|
||||
pointToTile(lon: number, lat: number, z: number): Array<number>
|
||||
|
||||
/**
|
||||
* Get the 4 tiles one zoom level higher
|
||||
*
|
||||
* @name getChildren
|
||||
* @param {Array<number>} tile
|
||||
* @returns {Array<Array<number>>} tiles
|
||||
* @example
|
||||
* var tiles = getChildren([5, 10, 10])
|
||||
* //=tiles
|
||||
*/
|
||||
getChildren(tile: Array<number>): Array<Array<number>>
|
||||
|
||||
/**
|
||||
* Get the tile one zoom level lower
|
||||
*
|
||||
* @name getParent
|
||||
* @param {Array<number>} tile
|
||||
* @returns {Array<number>} tile
|
||||
* @example
|
||||
* var tile = getParent([5, 10, 10])
|
||||
* //=tile
|
||||
*/
|
||||
getParent(tile: Array<number>): Array<number>
|
||||
|
||||
/**
|
||||
* Get the 3 sibling tiles for a tile
|
||||
*
|
||||
* @name getSiblings
|
||||
* @param {Array<number>} tile
|
||||
* @returns {Array<Array<number>>} tiles
|
||||
* @example
|
||||
* var tiles = getSiblings([5, 10, 10])
|
||||
* //=tiles
|
||||
*/
|
||||
getSiblings(tile: Array<number>): Array<Array<number>>
|
||||
|
||||
/**
|
||||
* Check to see if an array of tiles contains a tiles siblings
|
||||
*
|
||||
* @name hasSiblings
|
||||
* @param {Array<number>} tile
|
||||
* @param {Array<Array<number>>} tiles
|
||||
* @returns {boolean}
|
||||
* @example
|
||||
* var tiles = [
|
||||
* [0, 0, 5],
|
||||
* [0, 1, 5],
|
||||
* [1, 1, 5],
|
||||
* [1, 0, 5]
|
||||
* ]
|
||||
* hasSiblings([0, 0, 5], tiles)
|
||||
* //=boolean
|
||||
*/
|
||||
hasSiblings(tile: Array<number>, tiles: Array<Array<number>>): boolean
|
||||
|
||||
/**
|
||||
* Check to see if an array of tiles contains a particular tile
|
||||
*
|
||||
* @name hasTile
|
||||
* @param {Array<Array<number>>} tiles
|
||||
* @param {Array<number>} tile
|
||||
* @returns {boolean}
|
||||
* @example
|
||||
* var tiles = [
|
||||
* [0, 0, 5],
|
||||
* [0, 1, 5],
|
||||
* [1, 1, 5],
|
||||
* [1, 0, 5]
|
||||
* ]
|
||||
* hasTile(tiles, [0, 0, 5])
|
||||
* //=boolean
|
||||
*/
|
||||
hasTile(tiles: Array<Array<number>>, tile: Array<number>): boolean
|
||||
|
||||
/**
|
||||
* Check to see if two tiles are the same
|
||||
*
|
||||
* @name tilesEqual
|
||||
* @param {Array<number>} tile1
|
||||
* @param {Array<number>} tile2
|
||||
* @returns {boolean}
|
||||
* @example
|
||||
* tilesEqual([0, 1, 5], [0, 0, 5])
|
||||
* //=boolean
|
||||
*/
|
||||
tilesEqual(tile1: Array<number>, tile2: Array<number>): boolean
|
||||
|
||||
/**
|
||||
* Get the quadkey for a tile
|
||||
*
|
||||
* @name tileToQuadkey
|
||||
* @param {Array<number>} tile
|
||||
* @returns {string} quadkey
|
||||
* @example
|
||||
* var quadkey = tileToQuadkey([0, 1, 5])
|
||||
* //=quadkey
|
||||
*/
|
||||
tileToQuadkey(tile: Array<number>): string
|
||||
|
||||
/**
|
||||
* Get the tile for a quadkey
|
||||
*
|
||||
* @name quadkeyToTile
|
||||
* @param {string} quadkey
|
||||
* @returns {Array<number>} tile
|
||||
* @example
|
||||
* var tile = quadkeyToTile('00001033')
|
||||
* //=tile
|
||||
*/
|
||||
quadkeyToTile(quadkey: string): Array<number>
|
||||
|
||||
/**
|
||||
* Get the smallest tile to cover a bbox
|
||||
*
|
||||
* @name bboxToTile
|
||||
* @param {Array<number>} bbox
|
||||
* @returns {Array<number>} tile
|
||||
* @example
|
||||
* var tile = bboxToTile([ -178, 84, -177, 85 ])
|
||||
* //=tile
|
||||
*/
|
||||
bboxToTile(bbox: Array<number>): Array<number>
|
||||
|
||||
/**
|
||||
* Get the precise fractional tile location for a point at a zoom level
|
||||
*
|
||||
* @name pointToTileFraction
|
||||
* @param {number} lon
|
||||
* @param {number} lat
|
||||
* @param {number} z
|
||||
* @returns {Array<number>} tile fraction
|
||||
* var tile = pointToTileFraction(30.5, 50.5, 15)
|
||||
* //=tile
|
||||
*/
|
||||
pointToTileFraction(lon: number, lat: number, z: number): Array<number>
|
||||
}
|
||||
}
|
||||
|
||||
declare module "tilebelt" {
|
||||
export = tilebelt
|
||||
}
|
||||
Vendored
-304
@@ -1,304 +0,0 @@
|
||||
// Type definitions for transducers-js
|
||||
// Project: https://github.com/cognitect-labs/transducers-js
|
||||
// Definitions by: Colin Kahn <https://github.com/colinkahn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'transducers-js' {
|
||||
export interface IteratorResult<T> {
|
||||
done: boolean;
|
||||
value?: T
|
||||
}
|
||||
|
||||
export interface Iterator<T> {
|
||||
next (value?: any): IteratorResult<T>;
|
||||
return? (value?: any): IteratorResult<T>;
|
||||
throw? (e?: any): IteratorResult<T>;
|
||||
}
|
||||
|
||||
export interface Reduced<TResult> {
|
||||
['@@transducer/reduced']: boolean;
|
||||
['@@transducer/value']: TResult;
|
||||
}
|
||||
|
||||
export interface Reducer<TResult, TInput> {
|
||||
(result: TResult, input: TInput): TResult;
|
||||
}
|
||||
|
||||
export interface Transducer<TResult, TInput, TOutput> {
|
||||
(xf: Transformer<TResult, TOutput>): Transformer<TResult, TInput>;
|
||||
}
|
||||
|
||||
export interface CompletingTransformer <TResult, TCompleteResult, TInput> {
|
||||
['@@transducer/init'] (): TResult | void;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult | Reduced<TResult>;
|
||||
['@@transducer/result'] (result: TResult): TCompleteResult;
|
||||
}
|
||||
|
||||
export interface Transformer<TResult, TInput> extends CompletingTransformer<TResult, TResult, TInput> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a reduced value. Reduced values short circuit transduce.
|
||||
*/
|
||||
export function reduced<TResult> (x: TResult): Reduced<TResult>;
|
||||
|
||||
/**
|
||||
* Check if a value is reduced.
|
||||
*/
|
||||
export function isReduced (x : any) : Boolean;
|
||||
|
||||
/**
|
||||
* Function composition. Take N function and return their composition.
|
||||
*/
|
||||
export function comp<T> (...args: T[]): T;
|
||||
|
||||
/**
|
||||
* Take a predicate function and return its complement.
|
||||
*/
|
||||
export function complement (f: Function): Function;
|
||||
|
||||
/**
|
||||
* Identity function.
|
||||
*/
|
||||
export function identity<T> (arg: T): T;
|
||||
|
||||
export class Map<TResult, TInput, TOutput> implements Transformer<TResult, TInput> {
|
||||
constructor (f: (x: TInput) => TOutput, xf: Transformer<TResult, TOutput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult;
|
||||
['@@transducer/result'] (result: TResult): TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mapping transducer constructor
|
||||
*/
|
||||
export function map<TResult, TInput, TOutput> (f: (x: TInput) => TOutput): Transducer<TResult, TInput, TOutput>;
|
||||
|
||||
export class Filter<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (pred: (x: TInput) => boolean, xf: Transformer<TResult, TInput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult;
|
||||
['@@transducer/result'] (result: TResult): TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filtering transducer constructor
|
||||
*/
|
||||
export function filter<TResult, TInput> (pred: (x: TInput) => boolean): Transducer<TResult, TInput, TInput>;
|
||||
|
||||
/**
|
||||
* Similar to filter except the predicate is used to
|
||||
* eliminate values.
|
||||
*/
|
||||
export function remove<TResult, TInput> (pred: (x: TInput) => boolean): Transducer<TResult, TInput, TInput>;
|
||||
|
||||
export class Keep<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (f: (x: TInput) => any, xf: Transformer<TResult, TInput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult;
|
||||
['@@transducer/result'] (result: TResult): TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* A keeping transducer. Keep inputs as long as the provided
|
||||
* function does not return null or undefined.
|
||||
*/
|
||||
export function keep<TResult, TInput> (f: (x: TInput) => any): Transducer<TResult, TInput, TInput>;
|
||||
|
||||
export class KeepIndexed<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (f: (i: number, x:TInput) => any, xf: Transformer<TResult, TInput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult;
|
||||
['@@transducer/result'] (result: TResult): TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Like keep but the provided function will be passed the
|
||||
* index as the fist argument.
|
||||
*/
|
||||
export function keepIndexed<TResult, TInput> (f: (i: number, x: TInput) => any): Transducer<TResult, TInput, TInput>;
|
||||
|
||||
export class Take<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (n: number, xf: Transformer<TResult, TInput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult | Reduced<TResult>;
|
||||
['@@transducer/result'] (result: TResult): TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* A take transducer constructor. Will take n values before
|
||||
* returning a reduced result.
|
||||
*/
|
||||
export function take<TResult, TInput> (n: number): Transducer<TResult, TInput, TInput>;
|
||||
|
||||
export class TakeWhile<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (pred: (n: TInput) => boolean, xf: Transformer<TResult, TInput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult | Reduced<TResult>;
|
||||
['@@transducer/result'] (result: TResult): TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Like the take transducer except takes as long as the pred
|
||||
* return true for inputs.
|
||||
*/
|
||||
export function takeWhile<TResult, TInput> (pred: (n: TInput) => boolean): Transducer<TResult, TInput, TInput>;
|
||||
|
||||
export class TakeNth<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (n: number, xf: Transformer<TResult, TInput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult;
|
||||
['@@transducer/result'] (result: TResult): TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* A transducer that takes every Nth input
|
||||
*/
|
||||
export function takeNth<TResult, TInput> (n: number): Transducer<TResult, TInput, TInput>;
|
||||
|
||||
export class Drop<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (n: number, xf: Transformer<TResult, TInput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult;
|
||||
['@@transducer/result'] (result: TResult): TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* A dropping transducer constructor
|
||||
*/
|
||||
export function drop<TResult, TInput> (n: number): Transducer<TResult, TInput, TInput>;
|
||||
|
||||
export class DropWhile<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (pred: (input: TInput) => boolean, xf: Transformer<TResult, TInput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult;
|
||||
['@@transducer/result'] (result: TResult): TResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* A dropping transducer that drop inputs as long as
|
||||
* pred is true.
|
||||
*/
|
||||
export function dropWhile<TResult, TInput> (pred: (input: TInput) => boolean): Transducer<TResult, TInput, TInput>;
|
||||
|
||||
export class PartitionBy<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (f: (input: TInput) => any, xf: Transformer<TResult, TInput[]>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult
|
||||
['@@transducer/result'] (result: TResult): TResult
|
||||
}
|
||||
|
||||
/**
|
||||
* A partitioning transducer. Collects inputs into
|
||||
* arrays as long as predicate remains true for contiguous
|
||||
* inputs.
|
||||
*/
|
||||
export function partitionBy<TResult, TInput> (f: (input: TInput) => any): Transducer<TResult, TInput, TInput[]>;
|
||||
|
||||
export class PartitionAll<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (n: number, xf: Transformer<TResult, TInput[]>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult
|
||||
['@@transducer/result'] (result: TResult): TResult
|
||||
}
|
||||
|
||||
/**
|
||||
* A partitioning transducer. Collects inputs into
|
||||
* arrays of size N.
|
||||
*/
|
||||
export function partitionAll<TResult, TInput> (n: number): Transducer<TResult, TInput, TInput[]>;
|
||||
|
||||
export class Completing<TResult, TCompleteResult, TInput> implements CompletingTransformer<TResult, TCompleteResult, TInput> {
|
||||
constructor (cf: (result: TResult) => TCompleteResult, xf: Transformer<TResult, TInput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult
|
||||
['@@transducer/result'] (result: TResult): TCompleteResult
|
||||
}
|
||||
|
||||
/**
|
||||
* A completing transducer constructor. Useful to provide cleanup
|
||||
* logic at the end of a reduction/transduction.
|
||||
*/
|
||||
export function completing<TResult, TCompleteResult, TInput> (cf: (result: TResult) => TCompleteResult): CompletingTransformer<TResult, TCompleteResult, TInput>;
|
||||
|
||||
export class Wrap<TResult, TInput> implements Transformer<TResult, TInput> {
|
||||
constructor (stepFn: Reducer<TResult, TInput>, xf: Transformer<TResult, TInput>);
|
||||
['@@transducer/init'] (): TResult;
|
||||
['@@transducer/step'] (result: TResult, input: TInput): TResult
|
||||
['@@transducer/result'] (result: TResult): TResult
|
||||
}
|
||||
|
||||
/**
|
||||
* Take a two-arity reducing function where the first argument is the
|
||||
* accumluation and the second argument is the next input and convert
|
||||
* it into a transducer transformer object.
|
||||
*/
|
||||
export function wrap<TResult, TInput> (stepFn: Reducer<TResult, TInput>): Transducer<TResult, TInput, TInput>;
|
||||
|
||||
/**
|
||||
* Given a transformer return a concatenating transformer
|
||||
*/
|
||||
export function cat<TResult, TInput> (xf: Transformer<TResult, TInput>): Transformer<TResult, TInput> ;
|
||||
|
||||
/**
|
||||
* A mapping concatenating transformer
|
||||
*/
|
||||
export function mapcat<TResult, TInput, TOutput> (f: (arr: TInput[]) => TOutput[]): Transducer<TResult, TInput[], TOutput>;
|
||||
|
||||
/**
|
||||
* Given a transducer, a builder function, an initial value
|
||||
* and a iterable collection - returns the reduction.
|
||||
*/
|
||||
export function transduce<TResult, TInput, TOutput> (
|
||||
xf: Transducer<TResult, TInput, TOutput>,
|
||||
f: Transformer<TResult, TInput> | Reducer<TResult, TInput>,
|
||||
init: TResult,
|
||||
coll: TInput[] | Iterator<TInput> | string | Object): TResult;
|
||||
|
||||
/**
|
||||
* Given a transducer, an intial value and a
|
||||
* collection - returns the reduction.
|
||||
*/
|
||||
export function reduce<TResult, TInput, TOutput> (
|
||||
xf: Transducer<TResult, TInput, TOutput>,
|
||||
init: TResult,
|
||||
coll: TInput[] | Iterator<TInput> | string | Object): TResult
|
||||
|
||||
/**
|
||||
* Reduce a value into the given empty value using a transducer.
|
||||
*/
|
||||
export function into<TResult, TInput, TOutput>(
|
||||
empty: TResult,
|
||||
xf: Transducer<TResult, TInput, TOutput>,
|
||||
coll: TInput[] | Iterator<TInput> | string | Object): TResult;
|
||||
|
||||
/**
|
||||
* Convert a transducer transformer object into a function so
|
||||
* that it can be used with existing reduce implementation i.e. native,
|
||||
* Underscore, lodash
|
||||
*/
|
||||
export function toFn<TResult, TInput, TOutput> (
|
||||
xf: Transducer<TResult, TInput, TOutput>,
|
||||
builder: Reducer<TResult, TInput> | Transformer<TResult, TInput>
|
||||
): Reducer<TResult, TInput>;
|
||||
|
||||
/**
|
||||
* A transformer which simply returns the first input.
|
||||
*/
|
||||
export function first<TResult, TInput> (): Wrap<TResult, TInput>;
|
||||
|
||||
/**
|
||||
* Ensure that a value is reduced. If already reduced will not re-wrap.
|
||||
*/
|
||||
export function ensureReduced<TResult> (x: TResult | Reduced<TResult>): Reduced<TResult>;
|
||||
|
||||
/**
|
||||
* Ensure a value is not reduced. Unwraps if reduced.
|
||||
*/
|
||||
export function unreduced<TResult> (x: TResult | Reduced<TResult>): TResult;
|
||||
|
||||
/**
|
||||
* Returns the value of a reduced result.
|
||||
*/
|
||||
export function deref<TResult> (x: Reduced<TResult>): TResult;
|
||||
}
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
// Type definitions for tz-format
|
||||
// Project: https://github.com/SamVerschueren/tz-format
|
||||
// Definitions by: Sam Verschueren <https://github.com/samverschueren>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "tz-format" {
|
||||
function format(date?: Date | number, offset?: number): string;
|
||||
namespace format { }
|
||||
export = format;
|
||||
}
|
||||
Vendored
-202
@@ -1,202 +0,0 @@
|
||||
// Type definitions for vitalsigns 0.4.3
|
||||
// Project: https://github.com/TomFrost/node-vitalsigns
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference path="../express/express.d.ts"/>
|
||||
|
||||
declare module "vitalsigns" {
|
||||
import { RequestHandler } from "express";
|
||||
|
||||
namespace vitalsigns {
|
||||
/**
|
||||
* Contraint.
|
||||
* @interface
|
||||
*/
|
||||
export interface Constraint {
|
||||
/**
|
||||
* The comparator to use when comparing the field's value with the constraint value.
|
||||
* Valid comparators are: 'equal', 'greater', and 'less'.
|
||||
* @type {string}
|
||||
*/
|
||||
comparator: string;
|
||||
|
||||
/**
|
||||
* The name of the field to be constrained.
|
||||
* @type {string}
|
||||
*/
|
||||
field: string;
|
||||
|
||||
/**
|
||||
* The name of the monitor containing the field to be constrained.
|
||||
* @type {string}
|
||||
*/
|
||||
monitor: string;
|
||||
|
||||
/**
|
||||
* true to negate the outcome of the comparison; false or omitted to use the comparison result.
|
||||
* @type {boolean}
|
||||
*/
|
||||
negate?: boolean;
|
||||
|
||||
/**
|
||||
* The value against which the field should be compared.
|
||||
* @type {any}
|
||||
*/
|
||||
value: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constraint wrapper.
|
||||
* @interface
|
||||
*/
|
||||
export interface ConstraintWrapper {
|
||||
equals?: (num: number) => ConstraintWrapper;
|
||||
|
||||
greaterThan?: (num: number) => ConstraintWrapper;
|
||||
|
||||
lessThan?: (num: number) => ConstraintWrapper;
|
||||
|
||||
not?: ConstraintWrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options.
|
||||
* @interface
|
||||
*/
|
||||
export interface Options {
|
||||
/**
|
||||
* Number of milliseconds to wait between automatic health checks.
|
||||
* @type {number|boolean}
|
||||
*/
|
||||
autoCheck?: number | boolean;
|
||||
|
||||
/**
|
||||
* HTTP response code to send back in the VitalSigns.
|
||||
* @type {number}
|
||||
*/
|
||||
httpHealthy?: number;
|
||||
|
||||
/**
|
||||
* HTTP response code to send back in the VitalSigns.
|
||||
* @type {number}
|
||||
*/
|
||||
httpUnhealthy?: number;
|
||||
}
|
||||
|
||||
export interface Monitor {
|
||||
/**
|
||||
* Connections.
|
||||
* @type {any}
|
||||
*/
|
||||
connections: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor field.
|
||||
* @interface
|
||||
*/
|
||||
export interface MonitorField {
|
||||
/**
|
||||
* Name.
|
||||
* @type {string}
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* Units.
|
||||
* @type {string}
|
||||
*/
|
||||
units?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Report options.
|
||||
* @interface
|
||||
*/
|
||||
interface ReportOptions {
|
||||
/**
|
||||
* true to flatten the report object down to a single level by concatenating nested key names; false to keep the default hierarchical format.
|
||||
* @type {boolean}
|
||||
*/
|
||||
flatten?: boolean;
|
||||
|
||||
/**
|
||||
* If flatten is true, this string will be used to separate key names when they are concatenated together.
|
||||
* @type {boolean}
|
||||
*/
|
||||
separator?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* VitalSigns instance.
|
||||
*/
|
||||
class VitalSigns {
|
||||
/**
|
||||
* Constructor.
|
||||
* @constructors
|
||||
* @param {Options} [options] Options.
|
||||
*/
|
||||
constructor (options?: vitalsigns.Options);
|
||||
|
||||
/**
|
||||
* Pushes a health constraint onto this instance's constraint array.
|
||||
* Health constraints define scenarios in which VitalSigns will consider the application to be in an unhealthy state.
|
||||
* @param {} constraint A constraint.
|
||||
*/
|
||||
addConstraint(): void;
|
||||
|
||||
/**
|
||||
* Destroys this VitalSigns instance.
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/**
|
||||
* Gets a request handler.
|
||||
* @type {RequestHandler}
|
||||
*/
|
||||
express: RequestHandler;
|
||||
|
||||
/**
|
||||
* Retrieves an array of human-readable messages that define the specific health constraints that failed when running the last health check.
|
||||
* @returns {Array<string>} An array of failure messages.
|
||||
*/
|
||||
getFailed(): Array<string>;
|
||||
|
||||
/**
|
||||
* Gets a report of all monitors, their fields, and the values of those fields, compiled into Javascript object form. Additionally, a 'healthy' field is
|
||||
* attached. This field will be boolean true if all health constraints passed; false otherwise.
|
||||
* @param {ReportOptions} [options] A mapping of options to customize this report.
|
||||
* @return {Object} The full health report.
|
||||
*/
|
||||
getReport(options?: vitalsigns.ReportOptions): {};
|
||||
|
||||
/**
|
||||
* Generates a health report and checks each health constraint against it. Any constraints that fail will be added to the 'failed' array in the form of
|
||||
* a human-readable failure message, which can be retrieved with {@link #getFailed}.
|
||||
* @param {Object} [report] A report object on which to run the health constraints. If omitted, this function will generate a health report automatically.
|
||||
* @return {boolean} true if all health constraints passed; false otherwise.
|
||||
*/
|
||||
isHealthy(report?: {}): boolean;
|
||||
|
||||
/**
|
||||
* Registers monitor.
|
||||
* @param {string} monitorName A monitor name.
|
||||
* @param {MonitorField} [field] Options.
|
||||
*/
|
||||
monitor(monitor: string | vitalsigns.Monitor | {}, field?: vitalsigns.MonitorField): void;
|
||||
|
||||
/**
|
||||
* Defines a new health constraint in a chainable, more easily readable format.
|
||||
* When called with the monitor name and field name of concern, a wrapper is
|
||||
* returned that allows the constraint to be built out with function calls.
|
||||
* @param {string} monitorName A monitor name.
|
||||
* @param {string} fieldName A field name.
|
||||
* @return {ConstraintWrapper} The constraint wrapper.
|
||||
*/
|
||||
unhealthyWhen: (monitorName: string, fieldName: string) => vitalsigns.ConstraintWrapper;
|
||||
}
|
||||
|
||||
export = VitalSigns;
|
||||
}
|
||||
Vendored
-1135
File diff suppressed because it is too large
Load Diff
Vendored
-64
@@ -1,64 +0,0 @@
|
||||
// Type definitions for yayson v2.0.1
|
||||
// Project: https://github.com/confetti/yayson
|
||||
// Definitions by: David Wood <https://github.com/Codesleuth>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'yayson' {
|
||||
class Store {
|
||||
sync(obj: {}): any;
|
||||
find(type: string, id: string): any;
|
||||
findAll(type: string): any[];
|
||||
remove(type: string, id?: string): void;
|
||||
reset(): void;
|
||||
|
||||
records: y.Record[];
|
||||
relations: { [key: string]: any };
|
||||
}
|
||||
|
||||
interface Adapter {
|
||||
get(model: {}, key?: string): any;
|
||||
id(model: {}): string;
|
||||
}
|
||||
|
||||
class Presenter {
|
||||
static adapter: string;
|
||||
|
||||
static render<T>(instanceOrCollection: PromiseLike<T>, options?: y.JsonOptions): PromiseLike<T>;
|
||||
static render(instanceOrCollection: {}, options?: y.JsonOptions): any;
|
||||
static toJSON(instanceOrCollection: {}, options?: y.JsonOptions): any;
|
||||
|
||||
render<T>(instanceOrCollection: PromiseLike<T>, options?: y.JsonOptions): PromiseLike<T>;
|
||||
render(instanceOrCollection: {}, options?: y.JsonOptions): any;
|
||||
toJSON(instanceOrCollection: {}, options?: y.JsonOptions): any;
|
||||
id(instance: {}): string;
|
||||
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface Yayson {
|
||||
Store: typeof Store;
|
||||
Presenter: typeof Presenter;
|
||||
Adapter: Adapter;
|
||||
}
|
||||
|
||||
interface YaysonOptions {
|
||||
adapter?: 'default' | 'sequelize';
|
||||
}
|
||||
|
||||
function y(arg?: YaysonOptions): Yayson;
|
||||
|
||||
namespace y {
|
||||
interface JsonOptions {
|
||||
[key: string]: any;
|
||||
meta?: {};
|
||||
}
|
||||
interface Record {
|
||||
id: any;
|
||||
type: string;
|
||||
attributes: any;
|
||||
relationships: any;
|
||||
}
|
||||
}
|
||||
|
||||
export = y;
|
||||
}
|
||||
Reference in New Issue
Block a user