mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Merge remote-tracking branch 'upstream/master' into angular-component-router
Conflicts: angularjs/angular.d.ts
This commit is contained in:
@@ -5,6 +5,11 @@
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module "angular-dynamic-locale" {
|
||||
import ng = angular.dynamicLocale;
|
||||
export = ng;
|
||||
}
|
||||
|
||||
declare module angular.dynamicLocale {
|
||||
|
||||
interface tmhDynamicLocaleService {
|
||||
|
||||
5
angularjs/angular.d.ts
vendored
5
angularjs/angular.d.ts
vendored
@@ -1632,7 +1632,6 @@ declare module angular {
|
||||
// see http://angularjs.blogspot.com.br/2015/11/angularjs-15-beta2-and-14-releases.html
|
||||
// and http://toddmotto.com/exploring-the-angular-1-5-component-method/
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Runtime representation a type that a Component or other object is instances of.
|
||||
*
|
||||
@@ -1728,6 +1727,10 @@ declare module angular {
|
||||
$routeConfig?: RouteDefinition[];
|
||||
}
|
||||
|
||||
interface IComponentTemplateFn {
|
||||
( $element?: IAugmentedJQuery, $attrs?: IAttributes ): string;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Directive
|
||||
// see http://docs.angularjs.org/api/ng.$compileProvider#directive
|
||||
|
||||
1
backbone/backbone-global.d.ts
vendored
1
backbone/backbone-global.d.ts
vendored
@@ -43,6 +43,7 @@ declare module Backbone {
|
||||
|
||||
interface PersistenceOptions {
|
||||
url?: string;
|
||||
data?: any;
|
||||
beforeSend?: (jqxhr: JQueryXHR) => void;
|
||||
success?: (modelOrCollection?: any, response?: any, options?: any) => void;
|
||||
error?: (modelOrCollection?: any, jqxhr?: JQueryXHR, options?: any) => void;
|
||||
|
||||
30
bcrypt-nodejs/bcrypt-nodejs-tests.ts
Normal file
30
bcrypt-nodejs/bcrypt-nodejs-tests.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference path="bcrypt-nodejs.d.ts" />
|
||||
|
||||
import bCrypt = require("bcrypt-nodejs");
|
||||
|
||||
function test_sync() {
|
||||
var salt1 = bCrypt.genSaltSync();
|
||||
var salt2 = bCrypt.genSaltSync(8);
|
||||
|
||||
var hash1 = bCrypt.hashSync('super secret');
|
||||
var hash2 = bCrypt.hashSync('super secret', salt1);
|
||||
|
||||
var compare1 = bCrypt.compareSync('super secret', hash1);
|
||||
|
||||
var rounds1 = bCrypt.getRounds(hash2);
|
||||
}
|
||||
|
||||
function test_async() {
|
||||
var cbString = (error: Error, result: string) => {};
|
||||
var cbVoid = () => {};
|
||||
var cbBoolean = (error: Error, result: boolean) => {};
|
||||
|
||||
bCrypt.genSalt(8, cbString);
|
||||
|
||||
var salt = bCrypt.genSaltSync();
|
||||
bCrypt.hash('super secret', salt, cbString);
|
||||
bCrypt.hash('super secret', salt, cbVoid, cbString);
|
||||
|
||||
var hash = bCrypt.hashSync('super secret');
|
||||
bCrypt.compare('super secret', hash, cbBoolean);
|
||||
}
|
||||
68
bcrypt-nodejs/bcrypt-nodejs.d.ts
vendored
Normal file
68
bcrypt-nodejs/bcrypt-nodejs.d.ts
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
// Type definitions for bcrypt-nodejs
|
||||
// Project: https://github.com/shaneGirish/bcrypt-nodejs
|
||||
// Definitions by: David Broder-Rodgers <https://github.com/DavidBR-SW/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "bcrypt-nodejs" {
|
||||
/**
|
||||
* Generate a salt synchronously
|
||||
* @param rounds Number of rounds to process the data for (default - 10)
|
||||
* @return Generated salt
|
||||
*/
|
||||
export function genSaltSync(rounds?: number): string;
|
||||
|
||||
/**
|
||||
* Generate a salt asynchronously
|
||||
* @param rounds Number of rounds to process the data for (default - 10)
|
||||
* @param callback Callback with error and resulting salt, to be fired once the salt has been generated
|
||||
*/
|
||||
export function genSalt(rounds: number, callback: (error: Error, result: string) => void): void;
|
||||
|
||||
/**
|
||||
* Generate a hash synchronously
|
||||
* @param data Data to be encrypted
|
||||
* @param salt Salt to be used in encryption (default - new salt generated with 10 rounds)
|
||||
* @return Generated hash
|
||||
*/
|
||||
export function hashSync(data: string, salt?: string): string;
|
||||
|
||||
/**
|
||||
* Generate a hash asynchronously
|
||||
* @param data Data to be encrypted
|
||||
* @param salt Salt to be used in encryption
|
||||
* @param callback Callback with error and hashed result, to be fired once the data has been encrypted
|
||||
*/
|
||||
export function hash(data: string, salt: string, callback: (error: Error, result: string) => void): void;
|
||||
|
||||
/**
|
||||
* Generate a hash asynchronously
|
||||
* @param data Data to be encrypted
|
||||
* @param salt Salt to be used in encryption
|
||||
* @param progressCallback Callback to be fired multiple times during the hash calculation to signify progress
|
||||
* @param callback Callback with error and hashed result, to be fired once the data has been encrypted
|
||||
*/
|
||||
export function hash(data: string, salt: string, progressCallback: () => void, callback: (error: Error, result: string) => void): void;
|
||||
|
||||
/**
|
||||
* Compares data with a hash synchronously
|
||||
* @param data Data to be compared
|
||||
* @param hash Hash to be compared to
|
||||
* @return true if matching, false otherwise
|
||||
*/
|
||||
export function compareSync(data: string, hash: string): boolean;
|
||||
|
||||
/**
|
||||
* Compares data with a hash asynchronously
|
||||
* @param data Data to be compared
|
||||
* @param hash Hash to be compared to
|
||||
* @param callback Callback with error and match result, to be fired once the data has been compared
|
||||
*/
|
||||
export function compare(data: string, hash: string, callback: (error: Error, result: boolean) => void): void;
|
||||
|
||||
/**
|
||||
* Get number of rounds used for hash
|
||||
* @param hash Hash from which the number of rounds used should be extracted
|
||||
* @return number of rounds used to encrypt a given hash
|
||||
*/
|
||||
export function getRounds(hash: string): number;
|
||||
}
|
||||
21
bezier-easing/bezier-easing-tests.ts
Normal file
21
bezier-easing/bezier-easing-tests.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference path="bezier-easing.d.ts" />
|
||||
|
||||
function test_create_from_array() {
|
||||
let easing: BezierEasing = BezierEasing([0, 0, 1, 0.5]);
|
||||
}
|
||||
|
||||
function test_create_from_params() {
|
||||
let easing: BezierEasing = BezierEasing(0, 0, 1, 0.5);
|
||||
}
|
||||
|
||||
function test_create_from_builtins() {
|
||||
let easing: BezierEasing = BezierEasing.css['ease-in'];
|
||||
}
|
||||
|
||||
function test_methods() {
|
||||
let easing: BezierEasing = BezierEasing.css['ease-in'];
|
||||
let easedRatio: number = easing.get(0.5);
|
||||
let points: Array<number> = easing.getPoints();
|
||||
let stringified: string = easing.toString();
|
||||
let asCSS: string = easing.toCSS();
|
||||
}
|
||||
24
bezier-easing/bezier-easing.d.ts
vendored
Normal file
24
bezier-easing/bezier-easing.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// Type definitions for bezier-easing
|
||||
// Project: https://github.com/gre/bezier-easing
|
||||
// Definitions by: brian ridley <https://github.com/ptlis/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare interface BezierEasing {
|
||||
get(ratio: number): number;
|
||||
getPoints(): Array<number>;
|
||||
toString(): string;
|
||||
toCSS(): string;
|
||||
}
|
||||
|
||||
declare function BezierEasing(points: Array<number>): BezierEasing;
|
||||
declare function BezierEasing(a: number, b: number, c: number, d: number): BezierEasing;
|
||||
|
||||
declare namespace BezierEasing {
|
||||
let css: {
|
||||
'ease': BezierEasing,
|
||||
'linear': BezierEasing,
|
||||
'ease-in': BezierEasing,
|
||||
'ease-out': BezierEasing,
|
||||
'ease-in-out': BezierEasing
|
||||
};
|
||||
}
|
||||
@@ -85,15 +85,15 @@ var bazProm: Promise<Baz>;
|
||||
|
||||
// - - - - - - - - - - - - - - - - -
|
||||
|
||||
var numThen: Promise.Thenable<number>;
|
||||
var strThen: Promise.Thenable<string>;
|
||||
var anyThen: Promise.Thenable<any>;
|
||||
var boolThen: Promise.Thenable<boolean>;
|
||||
var objThen: Promise.Thenable<Object>;
|
||||
var voidThen: Promise.Thenable<void>;
|
||||
var numThen: PromiseLike<number>;
|
||||
var strThen: PromiseLike<string>;
|
||||
var anyThen: PromiseLike<any>;
|
||||
var boolThen: PromiseLike<boolean>;
|
||||
var objThen: PromiseLike<Object>;
|
||||
var voidThen: PromiseLike<void>;
|
||||
|
||||
var fooThen: Promise.Thenable<Foo>;
|
||||
var barThen: Promise.Thenable<Bar>;
|
||||
var fooThen: PromiseLike<Foo>;
|
||||
var barThen: PromiseLike<Bar>;
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
@@ -106,12 +106,12 @@ var barArrProm: Promise<Bar[]>;
|
||||
|
||||
// - - - - - - - - - - - - - - - - -
|
||||
|
||||
var numArrThen: Promise.Thenable<number[]>;
|
||||
var strArrThen: Promise.Thenable<string[]>;
|
||||
var anyArrThen: Promise.Thenable<any[]>;
|
||||
var numArrThen: PromiseLike<number[]>;
|
||||
var strArrThen: PromiseLike<string[]>;
|
||||
var anyArrThen: PromiseLike<any[]>;
|
||||
|
||||
var fooArrThen: Promise.Thenable<Foo[]>;
|
||||
var barArrThen: Promise.Thenable<Bar[]>;
|
||||
var fooArrThen: PromiseLike<Foo[]>;
|
||||
var barArrThen: PromiseLike<Bar[]>;
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
@@ -124,18 +124,18 @@ var barPromArr: Promise<Bar>[];
|
||||
|
||||
// - - - - - - - - - - - - - - - - -
|
||||
|
||||
var numThenArr: Promise.Thenable<number>[];
|
||||
var strThenArr: Promise.Thenable<string>[];
|
||||
var anyThenArr: Promise.Thenable<any>[];
|
||||
var numThenArr: PromiseLike<number>[];
|
||||
var strThenArr: PromiseLike<string>[];
|
||||
var anyThenArr: PromiseLike<any>[];
|
||||
|
||||
var fooThenArr: Promise.Thenable<Foo>[];
|
||||
var barThenArr: Promise.Thenable<Bar>[];
|
||||
var fooThenArr: PromiseLike<Foo>[];
|
||||
var barThenArr: PromiseLike<Bar>[];
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
// booya!
|
||||
var fooThenArrThen: Promise.Thenable<Promise.Thenable<Foo>[]>;
|
||||
var barThenArrThen: Promise.Thenable<Promise.Thenable<Bar>[]>;
|
||||
var fooThenArrThen: PromiseLike<PromiseLike<Foo>[]>;
|
||||
var barThenArrThen: PromiseLike<PromiseLike<Bar>[]>;
|
||||
|
||||
var fooResolver: Promise.Resolver<Foo>;
|
||||
var barResolver: Promise.Resolver<Bar>;
|
||||
|
||||
1438
bluebird/bluebird.d.ts
vendored
1438
bluebird/bluebird.d.ts
vendored
File diff suppressed because it is too large
Load Diff
1
breeze/breeze.d.ts
vendored
1
breeze/breeze.d.ts
vendored
@@ -392,6 +392,7 @@ declare module breeze {
|
||||
constructor(config?: EntityManagerOptions);
|
||||
constructor(config?: string);
|
||||
|
||||
acceptChanges(): void;
|
||||
addEntity(entity: Entity): Entity;
|
||||
attachEntity(entity: Entity, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity;
|
||||
clear(): void;
|
||||
|
||||
162
cookies/cookies.d.ts
vendored
162
cookies/cookies.d.ts
vendored
@@ -8,91 +8,93 @@
|
||||
declare module "cookies" {
|
||||
import * as http from "http"
|
||||
|
||||
interface ICookies {
|
||||
/**
|
||||
* This extracts the cookie with the given name from the
|
||||
* Cookie header in the request. If such a cookie exists,
|
||||
* its value is returned. Otherwise, nothing is returned.
|
||||
*/
|
||||
get(name: string): string;
|
||||
/**
|
||||
* This extracts the cookie with the given name from the
|
||||
* Cookie header in the request. If such a cookie exists,
|
||||
* its value is returned. Otherwise, nothing is returned.
|
||||
*/
|
||||
get(name: string, opts: IOptions): string;
|
||||
|
||||
/**
|
||||
* This sets the given cookie in the response and returns
|
||||
* the current context to allow chaining.If the value is omitted,
|
||||
* an outbound header with an expired date is used to delete the cookie.
|
||||
*/
|
||||
set(name: string, value: string): ICookies;
|
||||
/**
|
||||
* This sets the given cookie in the response and returns
|
||||
* the current context to allow chaining.If the value is omitted,
|
||||
* an outbound header with an expired date is used to delete the cookie.
|
||||
*/
|
||||
set(name: string, value: string, opts: IOptions): ICookies;
|
||||
}
|
||||
module cookies {
|
||||
interface ICookies {
|
||||
/**
|
||||
* This extracts the cookie with the given name from the
|
||||
* Cookie header in the request. If such a cookie exists,
|
||||
* its value is returned. Otherwise, nothing is returned.
|
||||
*/
|
||||
get(name: string): string;
|
||||
/**
|
||||
* This extracts the cookie with the given name from the
|
||||
* Cookie header in the request. If such a cookie exists,
|
||||
* its value is returned. Otherwise, nothing is returned.
|
||||
*/
|
||||
get(name: string, opts: IOptions): string;
|
||||
|
||||
/**
|
||||
* This sets the given cookie in the response and returns
|
||||
* the current context to allow chaining.If the value is omitted,
|
||||
* an outbound header with an expired date is used to delete the cookie.
|
||||
*/
|
||||
set(name: string, value: string): ICookies;
|
||||
/**
|
||||
* This sets the given cookie in the response and returns
|
||||
* the current context to allow chaining.If the value is omitted,
|
||||
* an outbound header with an expired date is used to delete the cookie.
|
||||
*/
|
||||
set(name: string, value: string, opts: IOptions): ICookies;
|
||||
}
|
||||
|
||||
interface IOptions {
|
||||
/**
|
||||
* a number representing the milliseconds from Date.now() for expiry
|
||||
*/
|
||||
maxAge?: number;
|
||||
/**
|
||||
* a Date object indicating the cookie's expiration
|
||||
* date (expires at the end of session by default).
|
||||
*/
|
||||
expires?: Date;
|
||||
/**
|
||||
* a string indicating the path of the cookie (/ by default).
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* a string indicating the domain of the cookie (no default).
|
||||
*/
|
||||
domain?: string;
|
||||
/**
|
||||
* a boolean indicating whether the cookie is only to be sent
|
||||
* over HTTPS (false by default for HTTP, true by default for HTTPS).
|
||||
*/
|
||||
secure?: boolean;
|
||||
/**
|
||||
* a boolean indicating whether the cookie is only to be sent
|
||||
* over HTTPS (use this if you handle SSL not in your node process).
|
||||
*/
|
||||
secureProxy?: boolean;
|
||||
/**
|
||||
* a boolean indicating whether the cookie is only to be sent over HTTP(S),
|
||||
* and not made available to client JavaScript (true by default).
|
||||
*/
|
||||
httpOnly?: boolean;
|
||||
/**
|
||||
* a boolean indicating whether the cookie is to be signed (false by default).
|
||||
* If this is true, another cookie of the same name with the .sig suffix
|
||||
* appended will also be sent, with a 27-byte url-safe base64 SHA1 value
|
||||
* representing the hash of cookie-name=cookie-value against the first Keygrip key.
|
||||
* This signature key is used to detect tampering the next time a cookie is received.
|
||||
*/
|
||||
signed?: boolean;
|
||||
/**
|
||||
* a boolean indicating whether to overwrite previously set
|
||||
* cookies of the same name (false by default). If this is true,
|
||||
* all cookies set during the same request with the same
|
||||
* name (regardless of path or domain) are filtered out of
|
||||
* the Set-Cookie header when setting this cookie.
|
||||
*/
|
||||
overwrite?: boolean;
|
||||
interface IOptions {
|
||||
/**
|
||||
* a number representing the milliseconds from Date.now() for expiry
|
||||
*/
|
||||
maxAge?: number;
|
||||
/**
|
||||
* a Date object indicating the cookie's expiration
|
||||
* date (expires at the end of session by default).
|
||||
*/
|
||||
expires?: Date;
|
||||
/**
|
||||
* a string indicating the path of the cookie (/ by default).
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* a string indicating the domain of the cookie (no default).
|
||||
*/
|
||||
domain?: string;
|
||||
/**
|
||||
* a boolean indicating whether the cookie is only to be sent
|
||||
* over HTTPS (false by default for HTTP, true by default for HTTPS).
|
||||
*/
|
||||
secure?: boolean;
|
||||
/**
|
||||
* a boolean indicating whether the cookie is only to be sent
|
||||
* over HTTPS (use this if you handle SSL not in your node process).
|
||||
*/
|
||||
secureProxy?: boolean;
|
||||
/**
|
||||
* a boolean indicating whether the cookie is only to be sent over HTTP(S),
|
||||
* and not made available to client JavaScript (true by default).
|
||||
*/
|
||||
httpOnly?: boolean;
|
||||
/**
|
||||
* a boolean indicating whether the cookie is to be signed (false by default).
|
||||
* If this is true, another cookie of the same name with the .sig suffix
|
||||
* appended will also be sent, with a 27-byte url-safe base64 SHA1 value
|
||||
* representing the hash of cookie-name=cookie-value against the first Keygrip key.
|
||||
* This signature key is used to detect tampering the next time a cookie is received.
|
||||
*/
|
||||
signed?: boolean;
|
||||
/**
|
||||
* a boolean indicating whether to overwrite previously set
|
||||
* cookies of the same name (false by default). If this is true,
|
||||
* all cookies set during the same request with the same
|
||||
* name (regardless of path or domain) are filtered out of
|
||||
* the Set-Cookie header when setting this cookie.
|
||||
*/
|
||||
overwrite?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
interface CookiesStatic {
|
||||
new (request: http.IncomingMessage, response: http.ServerResponse): ICookies;
|
||||
new (request: http.IncomingMessage, response: http.ServerResponse, keys?: Array<string>): ICookies;
|
||||
new (request: http.IncomingMessage, response: http.ServerResponse): cookies.ICookies;
|
||||
new (request: http.IncomingMessage, response: http.ServerResponse, keys?: Array<string>): cookies.ICookies;
|
||||
}
|
||||
|
||||
const _tmp: CookiesStatic;
|
||||
const cookies: CookiesStatic;
|
||||
|
||||
export = _tmp
|
||||
export = cookies
|
||||
}
|
||||
40
d3/d3.d.ts
vendored
40
d3/d3.d.ts
vendored
@@ -3032,6 +3032,46 @@ declare module d3 {
|
||||
padding(padding: number): Pack<T>;
|
||||
}
|
||||
|
||||
export function partition(): Partition<partition.Node>;
|
||||
export function partition<T extends partition.Node>(): Partition<T>;
|
||||
|
||||
module partition {
|
||||
interface Link<T extends Node> {
|
||||
source: T;
|
||||
target: T;
|
||||
}
|
||||
|
||||
interface Node {
|
||||
parent?: Node;
|
||||
children?: number;
|
||||
value?: number;
|
||||
depth?: number;
|
||||
x?: number;
|
||||
y?: number;
|
||||
dx?: number;
|
||||
dy?: number;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export interface Partition<T extends partition.Node> {
|
||||
nodes(root: T): T[];
|
||||
|
||||
links(nodes: T[]): partition.Link<T>[];
|
||||
|
||||
children(): (node: T, depth: number) => T[];
|
||||
children(children: (node: T, depth: number) => T[]): Partition<T>;
|
||||
|
||||
sort(): (a: T, b: T) => number;
|
||||
sort(comparator: (a: T, b: T) => number): Partition<T>;
|
||||
|
||||
value(): (node: T) => number;
|
||||
value(value: (node: T) => number): Partition<T>;
|
||||
|
||||
size(): [number, number];
|
||||
size(size: [number, number]): Partition<T>;
|
||||
}
|
||||
|
||||
export function pie(): Pie<number>;
|
||||
export function pie<T>(): Pie<T>;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="debug.d.ts" />
|
||||
|
||||
import debug = require("debug");
|
||||
@@ -6,7 +5,7 @@ import debug = require("debug");
|
||||
debug.disable();
|
||||
debug.enable("DefinitelyTyped:*");
|
||||
|
||||
var log: debug.Debugger = debug("DefinitelyTyped:log");
|
||||
var log:debug.IDebugger = debug("DefinitelyTyped:log");
|
||||
|
||||
log("Just text");
|
||||
log("Formatted test (%d arg)", 1);
|
||||
@@ -15,6 +14,6 @@ log("Formatted %s (%d args)", "test", 2);
|
||||
log("Enabled?: %s", debug.enabled("DefinitelyTyped:log"));
|
||||
log("Namespace: %s", log.namespace);
|
||||
|
||||
var error: debug.Debugger = debug("DefinitelyTyped:error");
|
||||
var error:debug.IDebugger = debug("DefinitelyTyped:error");
|
||||
error.log = console.error.bind(console);
|
||||
error("This should be printed to stderr");
|
||||
|
||||
54
debug/debug.d.ts
vendored
54
debug/debug.d.ts
vendored
@@ -1,30 +1,38 @@
|
||||
// Type definitions for debug
|
||||
// Project: https://github.com/visionmedia/debug
|
||||
// Definitions by: Seon-Wook Park <https://github.com/swook>
|
||||
// Definitions by: Seon-Wook Park <https://github.com/swook>, Gal Talmor <https://github.com/galtalmor>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "debug" {
|
||||
|
||||
function d(namespace: string): d.Debugger;
|
||||
|
||||
module d {
|
||||
export var log: Function;
|
||||
|
||||
function enable(namespaces: string): void;
|
||||
function disable(): void;
|
||||
|
||||
function enabled(namespace: string): boolean;
|
||||
|
||||
export interface Debugger {
|
||||
(formatter: any, ...args: any[]): void;
|
||||
|
||||
enabled: boolean;
|
||||
log: Function;
|
||||
namespace: string;
|
||||
}
|
||||
}
|
||||
|
||||
export = d;
|
||||
declare var debug: debug.IDebug;
|
||||
|
||||
// Support AMD require
|
||||
declare module 'debug' {
|
||||
export = debug;
|
||||
}
|
||||
|
||||
declare module debug {
|
||||
export interface IDebug {
|
||||
(namespace: string): debug.IDebugger,
|
||||
coerce: (val: any) => any,
|
||||
disable: () => void,
|
||||
enable: (namespaces: string) => void,
|
||||
enabled: (namespaces: string) => boolean,
|
||||
|
||||
names: string[],
|
||||
skips: string[],
|
||||
|
||||
formatters: IFormatters
|
||||
}
|
||||
|
||||
export interface IFormatters {
|
||||
[formatter: string]: Function
|
||||
}
|
||||
|
||||
export interface IDebugger {
|
||||
(formatter: any, ...args: any[]): void;
|
||||
|
||||
enabled: boolean;
|
||||
log: Function;
|
||||
namespace: string;
|
||||
}
|
||||
}
|
||||
|
||||
18
dhtmlxscheduler/dhtmlxscheduler.d.ts
vendored
18
dhtmlxscheduler/dhtmlxscheduler.d.ts
vendored
@@ -1165,11 +1165,22 @@ interface SchedulerStatic{
|
||||
*/
|
||||
deleteEvent(id: any);
|
||||
|
||||
/**
|
||||
* removes all blocking sets from the scheduler
|
||||
*/
|
||||
deleteMarkedTimespan();
|
||||
|
||||
/**
|
||||
* removes marking/blocking set by the addMarkedTimespan() and blockTime() methods
|
||||
* @param id the timespan id
|
||||
*/
|
||||
deleteMarkedTimespan(id: string);
|
||||
|
||||
/**
|
||||
* removes marking/blocking set by the addMarkedTimespan() and blockTime() methods
|
||||
* @param configuration for deleting
|
||||
*/
|
||||
deleteMarkedTimespan(config: any);
|
||||
|
||||
/**
|
||||
* deletes a section from the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored)
|
||||
@@ -1212,6 +1223,13 @@ interface SchedulerStatic{
|
||||
* expands the scheduler to the full screen view
|
||||
*/
|
||||
expand();
|
||||
|
||||
/**
|
||||
* filter events that will be displayed on the week view
|
||||
* @param id event-id
|
||||
* @param event event-object
|
||||
*/
|
||||
filter_week(id: any, event: any);
|
||||
|
||||
/**
|
||||
* gives access to the objects of lightbox's sections
|
||||
|
||||
349
fbemitter/fbemitter-tests.ts
Normal file
349
fbemitter/fbemitter-tests.ts
Normal file
@@ -0,0 +1,349 @@
|
||||
///<reference path="fbemitter.d.ts" />
|
||||
///<reference path="../node/node.d.ts" />
|
||||
///<reference path="../mocha/mocha.d.ts" />
|
||||
///<reference path="../assert/assert.d.ts" />
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* The tests are adapted from ../eventemitter3/eventemitter3-tests.ts
|
||||
*/
|
||||
|
||||
import { EventEmitter, EventSubscription } from 'fbemitter';
|
||||
import * as util from 'util';
|
||||
import * as assert from 'assert';
|
||||
|
||||
describe('EventEmitter', function tests() {
|
||||
'use strict';
|
||||
|
||||
it('inherits when used with require(util).inherits', function () {
|
||||
class Beast extends EventEmitter {
|
||||
/* rawr, i'm a beast */
|
||||
}
|
||||
|
||||
util.inherits(Beast, EventEmitter);
|
||||
|
||||
var moop = new Beast()
|
||||
, meap = new Beast();
|
||||
|
||||
assert.strictEqual(moop instanceof Beast, true);
|
||||
assert.strictEqual(moop instanceof EventEmitter, true);
|
||||
|
||||
moop.listeners('click');
|
||||
meap.listeners('click');
|
||||
|
||||
moop.addListener('data', function () {
|
||||
throw new Error('I should not emit');
|
||||
});
|
||||
|
||||
meap.emit('data', 'rawr');
|
||||
meap.removeAllListeners();
|
||||
});
|
||||
|
||||
describe('EventEmitter#emit', function () {
|
||||
it('emits with context', function (done) {
|
||||
var context = { bar: 'baz' }
|
||||
, e = new EventEmitter();
|
||||
|
||||
e.addListener('foo', function (bar: string) {
|
||||
assert.strictEqual(bar, 'bar');
|
||||
assert.strictEqual(this, context);
|
||||
|
||||
done();
|
||||
}, context);
|
||||
|
||||
e.emit('foo', 'bar');
|
||||
});
|
||||
|
||||
it('can emit the function with multiple arguments', function () {
|
||||
var e = new EventEmitter();
|
||||
|
||||
for(var i = 0; i < 100; i++) {
|
||||
(function (j: number) {
|
||||
for (var i = 0, args: number[] = []; i < j; i++) {
|
||||
args.push(j);
|
||||
}
|
||||
|
||||
e.once('args', function () {
|
||||
assert.strictEqual(arguments.length, args.length);
|
||||
assert.deepStrictEqual(Array.prototype.slice.call(arguments), args);
|
||||
});
|
||||
|
||||
e.emit.apply(e, (['args'] as any[]).concat(args));
|
||||
})(i);
|
||||
}
|
||||
});
|
||||
|
||||
it('can emit the function with multiple arguments, multiple listeners', function () {
|
||||
var e = new EventEmitter();
|
||||
|
||||
for(var i = 0; i < 100; i++) {
|
||||
(function (j: number) {
|
||||
for (var i = 0, args: number[] = []; i < j; i++) {
|
||||
args.push(j);
|
||||
}
|
||||
|
||||
e.once('args', function () {
|
||||
assert.strictEqual(arguments.length, args.length);
|
||||
assert.deepStrictEqual(Array.prototype.slice.call(arguments), args);
|
||||
});
|
||||
|
||||
e.once('args', function () {
|
||||
assert.strictEqual(arguments.length, args.length);
|
||||
assert.deepStrictEqual(Array.prototype.slice.call(arguments), args);
|
||||
});
|
||||
|
||||
e.once('args', function () {
|
||||
assert.strictEqual(arguments.length, args.length);
|
||||
assert.deepStrictEqual(Array.prototype.slice.call(arguments), args);
|
||||
});
|
||||
|
||||
e.once('args', function () {
|
||||
assert.strictEqual(arguments.length, args.length);
|
||||
assert.deepStrictEqual(Array.prototype.slice.call(arguments), args);
|
||||
});
|
||||
|
||||
e.emit.apply(e, (['args'] as any[]).concat(args));
|
||||
})(i);
|
||||
}
|
||||
});
|
||||
|
||||
it('emits with context, multiple listeners (force loop)', function () {
|
||||
var e = new EventEmitter();
|
||||
|
||||
e.addListener('foo', function (bar: string) {
|
||||
assert.deepStrictEqual(this, { foo: 'bar' });
|
||||
assert.strictEqual(bar, 'bar');
|
||||
}, { foo: 'bar' });
|
||||
|
||||
e.addListener('foo', function (bar: string) {
|
||||
assert.deepStrictEqual(this, { bar: 'baz' });
|
||||
assert.strictEqual(bar, 'bar');
|
||||
}, { bar: 'baz' });
|
||||
|
||||
e.emit('foo', 'bar');
|
||||
});
|
||||
|
||||
it('emits with different contexts', function () {
|
||||
var e = new EventEmitter()
|
||||
, pattern = '';
|
||||
|
||||
function writer() {
|
||||
pattern += this;
|
||||
}
|
||||
|
||||
e.addListener('write', writer, 'foo');
|
||||
e.addListener('write', writer, 'baz');
|
||||
e.once('write', writer, 'bar');
|
||||
e.once('write', writer, 'banana');
|
||||
|
||||
e.emit('write');
|
||||
assert.strictEqual(pattern, 'foobazbarbanana');
|
||||
});
|
||||
|
||||
it('receives the emitted events', function (done) {
|
||||
var e = new EventEmitter();
|
||||
|
||||
e.addListener('data', function (a: string, b: EventEmitter, c: Date, d: void, undef: void) {
|
||||
assert.strictEqual(a, 'foo');
|
||||
assert.strictEqual(b, e);
|
||||
assert.strictEqual(c instanceof Date, true);
|
||||
assert.strictEqual(undef, undefined);
|
||||
assert.strictEqual(arguments.length, 3);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
e.emit('data', 'foo', e, new Date());
|
||||
});
|
||||
|
||||
it('emits to all event listeners', function () {
|
||||
var e = new EventEmitter()
|
||||
, pattern: string[] = [];
|
||||
|
||||
e.addListener('foo', function () {
|
||||
pattern.push('foo1');
|
||||
});
|
||||
|
||||
e.addListener('foo', function () {
|
||||
pattern.push('foo2');
|
||||
});
|
||||
|
||||
e.emit('foo');
|
||||
|
||||
assert.strictEqual(pattern.join(';'), 'foo1;foo2');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('EventEmitter#listeners', function () {
|
||||
it('returns an empty array if no listeners are specified', function () {
|
||||
var e = new EventEmitter();
|
||||
|
||||
assert.strictEqual(e.listeners('foo') instanceof Array, true);
|
||||
assert.strictEqual(e.listeners('foo').length, 0);
|
||||
});
|
||||
|
||||
it('returns an array of function', function () {
|
||||
var e = new EventEmitter();
|
||||
|
||||
function foo() {}
|
||||
|
||||
e.addListener('foo', foo);
|
||||
assert.strictEqual(e.listeners('foo') instanceof Array, true);
|
||||
assert.strictEqual(e.listeners('foo').length, 1);
|
||||
console.log(e.listeners('foo')[0]);
|
||||
assert.strictEqual(e.listeners('foo')[0], foo);
|
||||
});
|
||||
|
||||
it('is not vulnerable to modifications', function () {
|
||||
var e = new EventEmitter();
|
||||
|
||||
function foo() {}
|
||||
|
||||
e.addListener('foo', foo);
|
||||
|
||||
assert.strictEqual(e.listeners('foo')[0], foo);
|
||||
|
||||
e.listeners('foo').length = 0;
|
||||
assert.strictEqual(e.listeners('foo')[0], foo);
|
||||
});
|
||||
});
|
||||
|
||||
describe('EventEmitter#once', function () {
|
||||
it('only emits it once', function () {
|
||||
var e = new EventEmitter()
|
||||
, calls = 0;
|
||||
|
||||
e.once('foo', function () {
|
||||
calls++;
|
||||
});
|
||||
|
||||
e.emit('foo');
|
||||
e.emit('foo');
|
||||
e.emit('foo');
|
||||
e.emit('foo');
|
||||
e.emit('foo');
|
||||
|
||||
assert.strictEqual(e.listeners('foo').length, 0);
|
||||
assert.strictEqual(calls, 1);
|
||||
});
|
||||
|
||||
it('only emits once if emits are nested inside the listener', function () {
|
||||
var e = new EventEmitter()
|
||||
, calls = 0;
|
||||
|
||||
e.once('foo', function () {
|
||||
calls++;
|
||||
e.emit('foo');
|
||||
});
|
||||
|
||||
e.emit('foo');
|
||||
assert.strictEqual(e.listeners('foo').length, 0);
|
||||
assert.strictEqual(calls, 1);
|
||||
});
|
||||
|
||||
it('only emits once for multiple events', function () {
|
||||
var e = new EventEmitter()
|
||||
, multi = 0
|
||||
, foo = 0
|
||||
, bar = 0;
|
||||
|
||||
e.once('foo', function () {
|
||||
foo++;
|
||||
});
|
||||
|
||||
e.once('foo', function () {
|
||||
bar++;
|
||||
});
|
||||
|
||||
e.addListener('foo', function () {
|
||||
multi++;
|
||||
});
|
||||
|
||||
e.emit('foo');
|
||||
e.emit('foo');
|
||||
e.emit('foo');
|
||||
e.emit('foo');
|
||||
e.emit('foo');
|
||||
|
||||
assert.strictEqual(e.listeners('foo').length, 1);
|
||||
assert.strictEqual(multi, 5);
|
||||
assert.strictEqual(foo, 1);
|
||||
assert.strictEqual(bar, 1);
|
||||
});
|
||||
|
||||
it('only emits once with context', function (done) {
|
||||
var context = { foo: 'bar' }
|
||||
, e = new EventEmitter();
|
||||
|
||||
e.once('foo', function (bar: string) {
|
||||
assert.strictEqual(this, context);
|
||||
assert.strictEqual(bar, 'bar');
|
||||
done();
|
||||
}, context);
|
||||
|
||||
e.emit('foo', 'bar');
|
||||
});
|
||||
});
|
||||
|
||||
describe('EventSubscription#remove', function () {
|
||||
it('should only remove the event with the specified function', function () {
|
||||
var e = new EventEmitter();
|
||||
|
||||
function bar() {}
|
||||
var foo = e.addListener('foo', function () {});
|
||||
var bar1 = e.addListener('bar', function () {});
|
||||
var bar2 = e.addListener('bar', bar);
|
||||
|
||||
assert.strictEqual(e.listeners('foo').length, 1);
|
||||
assert.strictEqual(e.listeners('bar').length, 2);
|
||||
|
||||
foo.remove();
|
||||
assert.strictEqual(e.listeners('foo').length, 0);
|
||||
assert.strictEqual(e.listeners('bar').length, 2);
|
||||
|
||||
bar2.remove();
|
||||
assert.strictEqual(e.listeners('bar').length, 1);
|
||||
|
||||
bar1.remove();
|
||||
assert.strictEqual(e.listeners('bar').length, 0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('EventEmitter#removeAllListeners', function () {
|
||||
it('removes all events for the specified events', function () {
|
||||
var e = new EventEmitter();
|
||||
|
||||
e.addListener('foo', function () { throw new Error('oops'); });
|
||||
e.addListener('foo', function () { throw new Error('oops'); });
|
||||
e.addListener('bar', function () { throw new Error('oops'); });
|
||||
e.addListener('aaa', function () { throw new Error('oops'); });
|
||||
|
||||
e.removeAllListeners('foo');
|
||||
assert.strictEqual(e.listeners('foo').length, 0);
|
||||
assert.strictEqual(e.listeners('bar').length, 1);
|
||||
assert.strictEqual(e.listeners('aaa').length, 1);
|
||||
|
||||
e.removeAllListeners('bar');
|
||||
e.removeAllListeners('aaa');
|
||||
assert.strictEqual(e.listeners('foo').length, 0);
|
||||
assert.strictEqual(e.listeners('bar').length, 0);
|
||||
assert.strictEqual(e.listeners('aaa').length, 0);
|
||||
});
|
||||
|
||||
it('just nukes the fuck out of everything', function () {
|
||||
var e = new EventEmitter();
|
||||
|
||||
e.addListener('foo', function () { throw new Error('oops'); });
|
||||
e.addListener('foo', function () { throw new Error('oops'); });
|
||||
e.addListener('bar', function () { throw new Error('oops'); });
|
||||
e.addListener('aaa', function () { throw new Error('oops'); });
|
||||
|
||||
e.removeAllListeners();
|
||||
assert.strictEqual(e.listeners('foo').length, 0);
|
||||
assert.strictEqual(e.listeners('bar').length, 0);
|
||||
assert.strictEqual(e.listeners('aaa').length, 0);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
67
fbemitter/fbemitter.d.ts
vendored
Normal file
67
fbemitter/fbemitter.d.ts
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
// Type definitions for Facebook's EventEmitter 2.0.0
|
||||
// Project: https://github.com/facebook/emitter
|
||||
// Definitions by: kmxz <https://github.com/kmxz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'fbemitter' {
|
||||
|
||||
export class EventSubscription {
|
||||
|
||||
listener: Function;
|
||||
context: any;
|
||||
|
||||
/**
|
||||
* Removes this subscription from the subscriber that controls it.
|
||||
*/
|
||||
remove(): void;
|
||||
|
||||
}
|
||||
|
||||
export class EventEmitter {
|
||||
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* Adds a listener to be invoked when events of the specified type are
|
||||
* emitted. An optional calling context may be provided. The data arguments
|
||||
* emitted will be passed to the listener function.
|
||||
*/
|
||||
addListener(eventType: string, listener: Function, context?: any): EventSubscription;
|
||||
|
||||
/**
|
||||
* Similar to addListener, except that the listener is removed after it is
|
||||
* invoked once.
|
||||
*/
|
||||
once(eventType: string, listener: Function, context?: any): EventSubscription;
|
||||
|
||||
/**
|
||||
* Removes all of the registered listeners, including those registered as
|
||||
* listener maps.
|
||||
*/
|
||||
removeAllListeners(eventType?: string): void;
|
||||
|
||||
/**
|
||||
* Provides an API that can be called during an eventing cycle to remove the
|
||||
* last listener that was invoked. This allows a developer to provide an event
|
||||
* object that can remove the listener (or listener map) during the
|
||||
* invocation.
|
||||
*
|
||||
* If it is called when not inside of an emitting cycle it will throw.
|
||||
*/
|
||||
removeCurrentListener(): void;
|
||||
|
||||
/**
|
||||
* Returns an array of listeners that are currently registered for the given
|
||||
* event.
|
||||
*/
|
||||
listeners(eventType: string): Function[];
|
||||
|
||||
/**
|
||||
* Emits an event of the given type with the given data. All handlers of that
|
||||
* particular type will be notified.
|
||||
*/
|
||||
emit(eventType: string, ...data: any[]): void;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
90
github-electron/github-electron.d.ts
vendored
90
github-electron/github-electron.d.ts
vendored
@@ -1121,7 +1121,7 @@ declare module GitHubElectron {
|
||||
* Note: This API is only available on Mac.
|
||||
*/
|
||||
setMenu(menu: Menu): void;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
class AutoUpdater implements NodeJS.EventEmitter {
|
||||
@@ -1353,7 +1353,7 @@ declare module GitHubElectron {
|
||||
* Only string properties are send correctly.
|
||||
* Nested objects are not supported.
|
||||
*/
|
||||
extra?: {}
|
||||
extra?: {};
|
||||
}
|
||||
|
||||
interface CrashReporterPayload extends Object {
|
||||
@@ -1406,7 +1406,7 @@ declare module GitHubElectron {
|
||||
getLastCrashReport(): CrashReporterPayload;
|
||||
}
|
||||
|
||||
interface Shell{
|
||||
interface Shell {
|
||||
/**
|
||||
* Show the given file in a file manager. If possible, select the file.
|
||||
*/
|
||||
@@ -1464,7 +1464,7 @@ declare module GitHubElectron {
|
||||
sendToHost(channel: string, ...args: any[]): void;
|
||||
}
|
||||
|
||||
interface Remote {
|
||||
interface Remote extends CommonElectron {
|
||||
/**
|
||||
* @returns The object returned by require(module) in the main process.
|
||||
*/
|
||||
@@ -1472,7 +1472,7 @@ declare module GitHubElectron {
|
||||
/**
|
||||
* @returns The BrowserWindow object which this web page belongs to.
|
||||
*/
|
||||
getCurrentWindow(): BrowserWindow
|
||||
getCurrentWindow(): BrowserWindow;
|
||||
/**
|
||||
* @returns The global variable of name (e.g. global[name]) in the main process.
|
||||
*/
|
||||
@@ -1481,7 +1481,7 @@ declare module GitHubElectron {
|
||||
* Returns the process object in the main process. This is the same as
|
||||
* remote.getGlobal('process'), but gets cached.
|
||||
*/
|
||||
process: any;
|
||||
process: NodeJS.Process;
|
||||
}
|
||||
|
||||
interface WebFrame {
|
||||
@@ -1523,7 +1523,7 @@ declare module GitHubElectron {
|
||||
|
||||
// Type definitions for main process
|
||||
|
||||
interface ContentTracing {
|
||||
interface ContentTracing {
|
||||
/**
|
||||
* Get a set of category groups. The category groups can change as new code paths are reached.
|
||||
* @param callback Called once all child processes have acked to the getCategories request.
|
||||
@@ -1710,30 +1710,94 @@ declare module GitHubElectron {
|
||||
RequestBufferJob: typeof RequestBufferJob;
|
||||
}
|
||||
|
||||
interface PowerSaveBlocker {
|
||||
start(type: string): number;
|
||||
stop(id: number): void;
|
||||
isStarted(id: number): boolean;
|
||||
}
|
||||
|
||||
interface Electron {
|
||||
interface ClearStorageDataOptions {
|
||||
origin?: string;
|
||||
storages?: string[];
|
||||
quotas?: string[];
|
||||
}
|
||||
|
||||
interface NetworkEmulationOptions {
|
||||
offline?: boolean;
|
||||
latency?: number;
|
||||
downloadThroughput?: number;
|
||||
uploadThroughput?: number;
|
||||
}
|
||||
|
||||
interface CertificateVerifyProc {
|
||||
(hostname: string, cert: any, callback: (accepted: boolean) => any): any;
|
||||
}
|
||||
|
||||
class Session {
|
||||
static fromPartition(partition: string): Session;
|
||||
static defaultSession: Session;
|
||||
|
||||
cookies: any;
|
||||
clearCache(callback: Function): void;
|
||||
clearStorageData(callback: Function): void;
|
||||
clearStorageData(options: ClearStorageDataOptions, callback: Function): void;
|
||||
setProxy(config: string, callback: Function): void;
|
||||
resolveProxy(url: URL, callback: (proxy: any) => any): void;
|
||||
setDownloadPath(path: string): void;
|
||||
enableNetworkEmulation(options: NetworkEmulationOptions): void;
|
||||
disableNetworkEmulation(): void;
|
||||
setCertificateVerifyProc(proc: CertificateVerifyProc): void;
|
||||
webRequest: any;
|
||||
}
|
||||
|
||||
interface CommonElectron {
|
||||
clipboard: GitHubElectron.Clipboard;
|
||||
crashReporter: GitHubElectron.CrashReporter;
|
||||
nativeImage: typeof GitHubElectron.NativeImage;
|
||||
screen: GitHubElectron.Screen;
|
||||
shell: GitHubElectron.Shell;
|
||||
remote: GitHubElectron.Remote;
|
||||
ipcRenderer: GitHubElectron.IpcRenderer;
|
||||
webFrame: GitHubElectron.WebFrame;
|
||||
|
||||
app: GitHubElectron.App;
|
||||
autoUpdater: GitHubElectron.AutoUpdater;
|
||||
BrowserWindow: typeof GitHubElectron.BrowserWindow;
|
||||
contentTracing: GitHubElectron.ContentTracing;
|
||||
dialog: GitHubElectron.Dialog;
|
||||
globalShortcut: GitHubElectron.GlobalShortcut;
|
||||
ipcMain: NodeJS.EventEmitter;
|
||||
globalShortcut: GitHubElectron.GlobalShortcut;
|
||||
Menu: typeof GitHubElectron.Menu;
|
||||
MenuItem: typeof GitHubElectron.MenuItem;
|
||||
powerMonitor: NodeJS.EventEmitter;
|
||||
powerSaveBlocker: GitHubElectron.PowerSaveBlocker;
|
||||
protocol: GitHubElectron.Protocol;
|
||||
screen: GitHubElectron.Screen;
|
||||
session: GitHubElectron.Session;
|
||||
Tray: typeof GitHubElectron.Tray;
|
||||
hideInternalModules(): void;
|
||||
}
|
||||
|
||||
interface DesktopCapturerOptions {
|
||||
types?: string[];
|
||||
thumbnailSize?: {
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface DesktopCapturerSource {
|
||||
id: string;
|
||||
name: string;
|
||||
thumbnail: NativeImage;
|
||||
}
|
||||
|
||||
interface DesktopCapturer {
|
||||
getSources(options: any, callback: (error: Error, sources: DesktopCapturerSource[]) => any): void;
|
||||
}
|
||||
|
||||
interface Electron extends CommonElectron {
|
||||
desktopCapturer: GitHubElectron.DesktopCapturer;
|
||||
ipcRenderer: GitHubElectron.IpcRenderer;
|
||||
remote: GitHubElectron.Remote;
|
||||
webFrame: GitHubElectron.WebFrame;
|
||||
}
|
||||
}
|
||||
|
||||
interface Window {
|
||||
|
||||
61
hopscotch/hopscotch.d.ts
vendored
61
hopscotch/hopscotch.d.ts
vendored
@@ -77,23 +77,84 @@ interface StepDefinition {
|
||||
}
|
||||
|
||||
interface HopscotchStatic {
|
||||
/**
|
||||
* Actually starts the tour. Optional stepNum argument specifies what step to start at.
|
||||
*/
|
||||
startTour(tour: TourDefinition, stepNum?: number): void;
|
||||
|
||||
/**
|
||||
* Skips to a given step in the tour
|
||||
*/
|
||||
showStep(id: number): void;
|
||||
|
||||
/**
|
||||
* Goes back one step in the tour
|
||||
*/
|
||||
prevStep(): void;
|
||||
|
||||
/**
|
||||
* Goes forward one step in the tour
|
||||
*/
|
||||
nextStep(): void;
|
||||
|
||||
/**
|
||||
* Ends the current tour. If clearCookie is set to false, the tour state is preserved.
|
||||
* Otherwise, if clearCookie is set to true or is not provided, the tour state is cleared.
|
||||
*/
|
||||
endTour(clearCookie: boolean): void;
|
||||
|
||||
/**
|
||||
* Sets options for running the tour.
|
||||
*/
|
||||
configure(options: HopscotchConfiguration): void;
|
||||
|
||||
/**
|
||||
* Returns the currently running tour.
|
||||
*/
|
||||
getCurrTour(): TourDefinition;
|
||||
|
||||
/**
|
||||
* Returns the currently running tour.
|
||||
*/
|
||||
getCurrStepNum(): number;
|
||||
|
||||
/**
|
||||
* Checks for tour state saved in sessionStorage/cookies and returns the state if
|
||||
* it exists. Use this method to determine whether or not you should resume a tour.
|
||||
*/
|
||||
getState(): string;
|
||||
|
||||
/**
|
||||
* Adds a callback for one of the event types. Valid event types are:
|
||||
* *start*, *end*, *next*, *prev*, *show*, *close*, *error*
|
||||
*/
|
||||
listen(eventName: string, callback: () => void): void;
|
||||
|
||||
/**
|
||||
* Removes a callback for one of the event types.
|
||||
*/
|
||||
unlisten(eventName: string, callback: () => void): void;
|
||||
|
||||
/**
|
||||
* Remove callbacks for hopscotch events. If tourOnly is set to true, only removes
|
||||
* callbacks specified by a tour (callbacks set by hopscotch.configure or hopscotch.listen
|
||||
* will remain). If eventName is null or undefined, callbacks for all events will be removed.
|
||||
*/
|
||||
removeCallbacks(eventName?: string, tourOnly?: boolean): void;
|
||||
|
||||
/**
|
||||
* Registers a callback helper. See the section about Helpers below.
|
||||
*/
|
||||
registerHelper(id: string, helper: (...args: any[]) => void): void;
|
||||
|
||||
/**
|
||||
* Resets i18n strings to original default values.
|
||||
*/
|
||||
resetDefaultI18N(): void;
|
||||
|
||||
/**
|
||||
* Resets all config options to original values.
|
||||
*/
|
||||
resetDefaultOptions(): void;
|
||||
}
|
||||
|
||||
|
||||
@@ -200,8 +200,9 @@ class IonicTestController {
|
||||
};
|
||||
var ionicPopoverController: ionic.popover.IonicPopoverController = this.$ionicPopover.fromTemplate("template", popoverOptions);
|
||||
ionicPopoverController.initialize(popoverOptions);
|
||||
ionicPopoverController.show(angular.element("body")).then(() => console.log("shown popover"))
|
||||
ionicPopoverController.hide().then(() => console.log("hid popover"))
|
||||
ionicPopoverController.show(angular.element("body")).then(() => console.log("shown popover"));
|
||||
ionicPopoverController.hide().then(() => console.log("hid popover"));
|
||||
ionicPopoverController.remove().then(() => console.log("removed popover"));
|
||||
var isShown: boolean = ionicPopoverController.isShown();
|
||||
|
||||
this.$ionicPopover.fromTemplateUrl("templateUrl", popoverOptions)
|
||||
|
||||
1
ionic/ionic.d.ts
vendored
1
ionic/ionic.d.ts
vendored
@@ -238,6 +238,7 @@ declare module ionic {
|
||||
show($event?: any): ng.IPromise<any>;
|
||||
hide(): ng.IPromise<any>;
|
||||
isShown(): boolean;
|
||||
remove(): ng.IPromise<any>;
|
||||
}
|
||||
interface IonicPopoverOptions {
|
||||
scope?: any;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/// <reference path="jade.d.ts"/>
|
||||
|
||||
import jade from 'jade';
|
||||
import * as jade from 'jade';
|
||||
|
||||
jade.compile("b")();
|
||||
jade.compileFile("foo.jade", {})();
|
||||
jade.compileClient("a")({ a: 1 });
|
||||
jade.compileClientWithDependenciesTracked("test").body();
|
||||
jade.render("h1",{});
|
||||
jade.renderFile("foo.jade");
|
||||
jade.renderFile("foo.jade");
|
||||
|
||||
21
jade/jade.d.ts
vendored
21
jade/jade.d.ts
vendored
@@ -4,16 +4,13 @@
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module 'jade' {
|
||||
module jade {
|
||||
function compile(template: string, options?: any): (locals?: any) => string;
|
||||
function compileFile(path: string, options?: any): (locals?: any) => string;
|
||||
function compileClient(template: string, options?: any): (locals?: any) => string;
|
||||
function compileClientWithDependenciesTracked(template: string, options?: any): {
|
||||
body: (locals?: any) => string;
|
||||
dependencies: string[];
|
||||
};
|
||||
function render(template: string, options?: any): string;
|
||||
function renderFile(path: string, options?: any): string;
|
||||
}
|
||||
export default jade;
|
||||
export function compile(template: string, options?: any): (locals?: any) => string;
|
||||
export function compileFile(path: string, options?: any): (locals?: any) => string;
|
||||
export function compileClient(template: string, options?: any): (locals?: any) => string;
|
||||
export function compileClientWithDependenciesTracked(template: string, options?: any): {
|
||||
body: (locals?: any) => string;
|
||||
dependencies: string[];
|
||||
};
|
||||
export function render(template: string, options?: any): string;
|
||||
export function renderFile(path: string, options?: any): string;
|
||||
}
|
||||
|
||||
@@ -579,7 +579,9 @@ objSchema = objSchema.without(str, strArr);
|
||||
objSchema = objSchema.rename(str, str);
|
||||
objSchema = objSchema.rename(str, str, renOpts);
|
||||
|
||||
objSchema = objSchema.assert(str, schema);
|
||||
objSchema = objSchema.assert(str, schema, str);
|
||||
objSchema = objSchema.assert(ref, schema);
|
||||
objSchema = objSchema.assert(ref, schema, str);
|
||||
|
||||
objSchema = objSchema.unknown();
|
||||
|
||||
6
joi/joi.d.ts
vendored
6
joi/joi.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for joi v4.6.0
|
||||
// Project: https://github.com/spumko/joi
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Laurence Dougal Myers <https://github.com/laurence-myers>, Christopher Glantschnig <https://github.com/cglantschnig>
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Laurence Dougal Myers <https://github.com/laurence-myers>, Christopher Glantschnig <https://github.com/cglantschnig>, David Broder-Rodgers <https://github.com/DavidBR-SW>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// TODO express type of Schema in a type-parameter (.default, .valid, .example etc)
|
||||
@@ -584,8 +584,8 @@ declare module 'joi' {
|
||||
/**
|
||||
* Verifies an assertion where.
|
||||
*/
|
||||
assert(ref: string, schema: Schema, message: string): ObjectSchema;
|
||||
assert(ref: Reference, schema: Schema, message: string): ObjectSchema;
|
||||
assert(ref: string, schema: Schema, message?: string): ObjectSchema;
|
||||
assert(ref: Reference, schema: Schema, message?: string): ObjectSchema;
|
||||
|
||||
/**
|
||||
* Overrides the handling of unknown keys for the scope of the current object only (does not apply to children).
|
||||
|
||||
@@ -5920,10 +5920,24 @@ result = <boolean>_({}).isError();
|
||||
}
|
||||
|
||||
// _.isFinite
|
||||
result = <boolean>_.isFinite(any);
|
||||
result = <boolean>_(1).isFinite();
|
||||
result = <boolean>_<any>([]).isFinite();
|
||||
result = <boolean>_({}).isFinite();
|
||||
module TestIsFinite {
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.isFinite(any);
|
||||
result = _(1).isFinite();
|
||||
result = _<any>([]).isFinite();
|
||||
result = _({}).isFinite();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(1).chain().isFinite();
|
||||
result = _<any>([]).chain().isFinite();
|
||||
result = _({}).chain().isFinite();
|
||||
}
|
||||
}
|
||||
|
||||
// _.isFunction
|
||||
module TestIsFunction {
|
||||
@@ -5987,7 +6001,7 @@ module TestIsNaN {
|
||||
}
|
||||
|
||||
// _.isNative
|
||||
module TestIsNull {
|
||||
module TestIsNative {
|
||||
{
|
||||
let value: number|Function;
|
||||
|
||||
@@ -6040,17 +6054,35 @@ module TestIsNull {
|
||||
}
|
||||
|
||||
// _.isNumber
|
||||
result = <boolean>_.isNumber(any);
|
||||
result = <boolean>_(1).isNumber();
|
||||
result = <boolean>_<any>([]).isNumber();
|
||||
result = <boolean>_({}).isNumber();
|
||||
{
|
||||
let value: number|string = "foo";
|
||||
if (_.isNumber(value)) {
|
||||
let result: number = value * 42;
|
||||
} else {
|
||||
let result: string = value;
|
||||
}
|
||||
module TestIsNumber {
|
||||
{
|
||||
let value: string|number;
|
||||
|
||||
if (_.isNumber(value)) {
|
||||
let result: number = value;
|
||||
}
|
||||
else {
|
||||
let result: string = value;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.isNumber(any);
|
||||
|
||||
result = _(1).isNumber();
|
||||
result = _<any>([]).isNumber();
|
||||
result = _({}).isNumber();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(1).chain().isNumber();
|
||||
result = _<any>([]).chain().isNumber();
|
||||
result = _({}).chain().isNumber();
|
||||
}
|
||||
}
|
||||
|
||||
// _.isObject
|
||||
@@ -6111,17 +6143,34 @@ module TestIsRegExp {
|
||||
}
|
||||
|
||||
// _.isString
|
||||
result = <boolean>_.isString(any);
|
||||
result = <boolean>_(1).isString();
|
||||
result = <boolean>_<any>([]).isString();
|
||||
result = <boolean>_({}).isString();
|
||||
{
|
||||
let value: string|number = "foo";
|
||||
if (_.isString(value)) {
|
||||
let result: string = value;
|
||||
} else {
|
||||
let result: number = value * 42;
|
||||
}
|
||||
module TestIsString {
|
||||
{
|
||||
let value: number|string;
|
||||
|
||||
if (_.isString(value)) {
|
||||
let result: string = value;
|
||||
}
|
||||
else {
|
||||
let result: number = value;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.isString(any);
|
||||
result = _(1).isString();
|
||||
result = _<any>([]).isString();
|
||||
result = _({}).isString();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(1).chain().isString();
|
||||
result = _<any>([]).chain().isString();
|
||||
result = _({}).chain().isString();
|
||||
}
|
||||
}
|
||||
|
||||
// _.isTypedArray
|
||||
|
||||
32
lodash/lodash.d.ts
vendored
32
lodash/lodash.d.ts
vendored
@@ -9928,11 +9928,13 @@ declare module _ {
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if value is a finite primitive number.
|
||||
*
|
||||
* Note: This method is based on Number.isFinite.
|
||||
*
|
||||
* @param value The value to check.
|
||||
* @return Returns true if value is a finite number, else false.
|
||||
**/
|
||||
isFinite(value?: any): value is number;
|
||||
*/
|
||||
isFinite(value?: any): boolean;
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
||||
@@ -9942,6 +9944,13 @@ declare module _ {
|
||||
isFinite(): boolean;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* @see _.isFinite
|
||||
*/
|
||||
isFinite(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isFunction
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
@@ -10075,7 +10084,9 @@ declare module _ {
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if value is classified as a Number primitive or object.
|
||||
*
|
||||
* Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method.
|
||||
*
|
||||
* @param value The value to check.
|
||||
* @return Returns true if value is correctly classified, else false.
|
||||
*/
|
||||
@@ -10089,6 +10100,13 @@ declare module _ {
|
||||
isNumber(): boolean;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* see _.isNumber
|
||||
*/
|
||||
isNumber(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isObject
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
@@ -10165,9 +10183,10 @@ declare module _ {
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if value is classified as a String primitive or object.
|
||||
*
|
||||
* @param value The value to check.
|
||||
* @return Returns true if value is correctly classified, else false.
|
||||
**/
|
||||
*/
|
||||
isString(value?: any): value is string;
|
||||
}
|
||||
|
||||
@@ -10178,6 +10197,13 @@ declare module _ {
|
||||
isString(): boolean;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* see _.isString
|
||||
*/
|
||||
isString(): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
//_.isTypedArray
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
120
moment/moment-node.d.ts
vendored
120
moment/moment-node.d.ts
vendored
@@ -1,10 +1,22 @@
|
||||
// Type definitions for Moment.js 2.8.0
|
||||
// Type definitions for Moment.js 2.10.5
|
||||
// Project: https://github.com/timrwood/moment
|
||||
// Definitions by: Michael Lakerveld <https://github.com/Lakerfield>, Aaron King <https://github.com/kingdango>, Hiroki Horiuchi <https://github.com/horiuchi>, Dick van den Brink <https://github.com/DickvdBrink>, Adi Dahiya <https://github.com/adidahiya>, Matt Brooks <https://github.com/EnableSoftware>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module moment {
|
||||
|
||||
interface MomentDateObject {
|
||||
years?: number;
|
||||
/* One digit */
|
||||
months?: number;
|
||||
/* Day of the month */
|
||||
date?: number;
|
||||
hours?: number;
|
||||
minutes?: number;
|
||||
seconds?: number;
|
||||
milliseconds?: number;
|
||||
}
|
||||
|
||||
interface MomentInput {
|
||||
/** Year */
|
||||
years?: number;
|
||||
@@ -247,8 +259,8 @@ declare module moment {
|
||||
dayOfYear(): number;
|
||||
dayOfYear(d: number): Moment;
|
||||
|
||||
from(f: Moment|string|number|Date|number[], suffix?: boolean): string;
|
||||
to(f: Moment|string|number|Date|number[], suffix?: boolean): string;
|
||||
from(f: Moment | string | number | Date | number[], suffix?: boolean): string;
|
||||
to(f: Moment | string | number | Date | number[], suffix?: boolean): string;
|
||||
toNow(withoutPrefix?: boolean): string;
|
||||
|
||||
diff(b: Moment): number;
|
||||
@@ -272,13 +284,13 @@ declare module moment {
|
||||
isDST(): boolean;
|
||||
|
||||
isBefore(): boolean;
|
||||
isBefore(b: Moment|string|number|Date|number[], granularity?: string): boolean;
|
||||
isBefore(b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
||||
|
||||
isAfter(): boolean;
|
||||
isAfter(b: Moment|string|number|Date|number[], granularity?: string): boolean;
|
||||
isAfter(b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
||||
|
||||
isSame(b: Moment|string|number|Date|number[], granularity?: string): boolean;
|
||||
isBetween(a: Moment|string|number|Date|number[], b: Moment|string|number|Date|number[], granularity?: string): boolean;
|
||||
isSame(b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
||||
isBetween(a: Moment | string | number | Date | number[], b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
||||
|
||||
// Deprecated as of 2.8.0.
|
||||
lang(language: string): Moment;
|
||||
@@ -294,43 +306,47 @@ declare module moment {
|
||||
localeData(): MomentLanguage;
|
||||
|
||||
// Deprecated as of 2.7.0.
|
||||
max(date: Moment|string|number|Date|any[]): Moment;
|
||||
max(date: Moment | string | number | Date | any[]): Moment;
|
||||
max(date: string, format: string): Moment;
|
||||
|
||||
// Deprecated as of 2.7.0.
|
||||
min(date: Moment|string|number|Date|any[]): Moment;
|
||||
min(date: Moment | string | number | Date | any[]): Moment;
|
||||
min(date: string, format: string): Moment;
|
||||
|
||||
get(unit: string): number;
|
||||
set(unit: string, value: number): Moment;
|
||||
set(objectLiteral: MomentInput): Moment;
|
||||
|
||||
/*This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds.*/
|
||||
//Works with version 2.10.5+
|
||||
toObject(): MomentDateObject;
|
||||
}
|
||||
|
||||
type formatFunction = () => string;
|
||||
|
||||
interface MomentCalendar {
|
||||
lastDay?: string | formatFunction;
|
||||
sameDay?: string | formatFunction;
|
||||
nextDay?: string | formatFunction;
|
||||
lastWeek?: string | formatFunction;
|
||||
nextWeek?: string | formatFunction;
|
||||
sameElse?: string | formatFunction;
|
||||
lastDay?: string | formatFunction;
|
||||
sameDay?: string | formatFunction;
|
||||
nextDay?: string | formatFunction;
|
||||
lastWeek?: string | formatFunction;
|
||||
nextWeek?: string | formatFunction;
|
||||
sameElse?: string | formatFunction;
|
||||
}
|
||||
|
||||
interface BaseMomentLanguage {
|
||||
months ?: any;
|
||||
monthsShort ?: any;
|
||||
weekdays ?: any;
|
||||
weekdaysShort ?: any;
|
||||
weekdaysMin ?: any;
|
||||
relativeTime ?: MomentRelativeTime;
|
||||
meridiem ?: (hour: number, minute: number, isLowercase: boolean) => string;
|
||||
calendar ?: MomentCalendar;
|
||||
ordinal ?: (num: number) => string;
|
||||
months?: any;
|
||||
monthsShort?: any;
|
||||
weekdays?: any;
|
||||
weekdaysShort?: any;
|
||||
weekdaysMin?: any;
|
||||
relativeTime?: MomentRelativeTime;
|
||||
meridiem?: (hour: number, minute: number, isLowercase: boolean) => string;
|
||||
calendar?: MomentCalendar;
|
||||
ordinal?: (num: number) => string;
|
||||
}
|
||||
|
||||
interface MomentLanguage extends BaseMomentLanguage {
|
||||
longDateFormat?: MomentLongDateFormat;
|
||||
longDateFormat?: MomentLongDateFormat;
|
||||
}
|
||||
|
||||
interface MomentLanguageData extends BaseMomentLanguage {
|
||||
@@ -341,34 +357,34 @@ declare module moment {
|
||||
}
|
||||
|
||||
interface MomentLongDateFormat {
|
||||
L: string;
|
||||
LL: string;
|
||||
LLL: string;
|
||||
LLLL: string;
|
||||
LT: string;
|
||||
LTS: string;
|
||||
l?: string;
|
||||
ll?: string;
|
||||
lll?: string;
|
||||
llll?: string;
|
||||
lt?: string;
|
||||
lts?: string;
|
||||
L: string;
|
||||
LL: string;
|
||||
LLL: string;
|
||||
LLLL: string;
|
||||
LT: string;
|
||||
LTS: string;
|
||||
l?: string;
|
||||
ll?: string;
|
||||
lll?: string;
|
||||
llll?: string;
|
||||
lt?: string;
|
||||
lts?: string;
|
||||
}
|
||||
|
||||
interface MomentRelativeTime {
|
||||
future: any;
|
||||
past: any;
|
||||
s: any;
|
||||
m: any;
|
||||
mm: any;
|
||||
h: any;
|
||||
hh: any;
|
||||
d: any;
|
||||
dd: any;
|
||||
M: any;
|
||||
MM: any;
|
||||
y: any;
|
||||
yy: any;
|
||||
future: any;
|
||||
past: any;
|
||||
s: any;
|
||||
m: any;
|
||||
mm: any;
|
||||
h: any;
|
||||
hh: any;
|
||||
d: any;
|
||||
dd: any;
|
||||
M: any;
|
||||
MM: any;
|
||||
y: any;
|
||||
yy: any;
|
||||
}
|
||||
|
||||
interface MomentStatic {
|
||||
@@ -460,8 +476,8 @@ declare module moment {
|
||||
max(...moments: Moment[]): Moment;
|
||||
|
||||
normalizeUnits(unit: string): string;
|
||||
relativeTimeThreshold(threshold: string): number|boolean;
|
||||
relativeTimeThreshold(threshold: string, limit:number): boolean;
|
||||
relativeTimeThreshold(threshold: string): number | boolean;
|
||||
relativeTimeThreshold(threshold: string, limit: number): boolean;
|
||||
|
||||
/**
|
||||
* Constant used to enable explicit ISO_8601 format parsing.
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
import sql = require('mssql');
|
||||
|
||||
interface Entity{
|
||||
value: number;
|
||||
}
|
||||
|
||||
var config: sql.config = {
|
||||
user: 'user',
|
||||
password: 'password',
|
||||
@@ -33,6 +37,18 @@ var connection: sql.Connection = new sql.Connection(config, function (err: any)
|
||||
}
|
||||
});
|
||||
|
||||
getArticlesQuery = "SELECT 1 as value FROM TABLE";
|
||||
|
||||
requestQuery.query<Entity>(getArticlesQuery, function (err, recordSet) {
|
||||
if (err) {
|
||||
console.error('Error happened calling Query: ' + err.name + " " + err.message);
|
||||
|
||||
}
|
||||
// checking to see if the articles returned as at least one.
|
||||
else if (recordSet.length > 0 && recordSet[0].value) {
|
||||
}
|
||||
});
|
||||
|
||||
var requestStoredProcedure = new sql.Request(connection);
|
||||
var testId: number = 0;
|
||||
var testString: string = 'test';
|
||||
@@ -50,6 +66,15 @@ var connection: sql.Connection = new sql.Connection(config, function (err: any)
|
||||
}
|
||||
});
|
||||
|
||||
requestStoredProcedure.execute<Entity>('StoredProcedureName', function (err, recordsets, returnValue) {
|
||||
if (err != null) {
|
||||
console.error('Error happened calling Query: ' + err.name + " " + err.message);
|
||||
}
|
||||
else {
|
||||
console.info(returnValue);
|
||||
}
|
||||
});
|
||||
|
||||
var requestStoredProcedureWithOutput = new sql.Request(connection);
|
||||
var testId: number = 0;
|
||||
var testString: string = 'test';
|
||||
@@ -74,6 +99,15 @@ var connection: sql.Connection = new sql.Connection(config, function (err: any)
|
||||
console.info(requestStoredProcedureWithOutput.parameters['output'].value);
|
||||
}
|
||||
});
|
||||
|
||||
requestStoredProcedure.execute<Entity>('StoredProcedureName', function (err, recordsets, returnValue) {
|
||||
if (err != null) {
|
||||
console.error('Error happened calling Query: ' + err.name + " " + err.message);
|
||||
}
|
||||
else {
|
||||
console.info(requestStoredProcedureWithOutput.parameters['output'].value);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -109,8 +143,10 @@ function test_promise_returns() {
|
||||
|
||||
var request = new sql.Request();
|
||||
request.batch('create procedure #temporary as select * from table').then((recordset) => { });
|
||||
request.batch<Entity>('create procedure #temporary as select * from table;select 1 as value').then((recordset) => { });
|
||||
request.bulk(new sql.Table("table_name")).then(() => { });
|
||||
request.query('SELECT 1').then((recordset) => { });
|
||||
request.query<Entity>('SELECT 1 as value').then(res => { });
|
||||
request.execute('procedure_name').then((recordset) => { });
|
||||
}
|
||||
|
||||
@@ -120,7 +156,7 @@ function test_request_constructor() {
|
||||
var connection: sql.Connection = new sql.Connection(config);
|
||||
var preparedStatment = new sql.PreparedStatement(connection);
|
||||
var transaction = new sql.Transaction(connection);
|
||||
|
||||
|
||||
var request1 = new sql.Request(connection);
|
||||
var request2 = new sql.Request(preparedStatment);
|
||||
var request3 = new sql.Request(transaction);
|
||||
@@ -141,4 +177,4 @@ function test_classes_extend_eventemitter() {
|
||||
request.on('error', () => { });
|
||||
|
||||
preparedStatment.on('error', () => { })
|
||||
}
|
||||
}
|
||||
|
||||
10
mssql/mssql.d.ts
vendored
10
mssql/mssql.d.ts
vendored
@@ -7,7 +7,7 @@
|
||||
/// <reference path="../es6-promise/es6-promise.d.ts" />
|
||||
|
||||
declare module "mssql" {
|
||||
import events = require('events');
|
||||
import events = require('events');
|
||||
|
||||
type sqlTypeWithNoParams = { type: sqlTypeFactoryWithNoParams }
|
||||
type sqlTypeWithLength = { type: sqlTypeFactoryWithLength, length: number }
|
||||
@@ -200,15 +200,19 @@ declare module "mssql" {
|
||||
public constructor(transaction: Transaction);
|
||||
public constructor(preparedStatement: PreparedStatement);
|
||||
public execute(procedure: string): Promise<recordSet>;
|
||||
public execute(procedure: string, callback: (err?: any, recordsets?: any, returnValue?: any) => void): void;
|
||||
public execute<Entity>(procedure: string, callback: (err?: any, recordsets?: Entity[], returnValue?: any) => void): void;
|
||||
public input(name: string, value: any): void;
|
||||
public input(name: string, type: any, value: any): void;
|
||||
public output(name: string, type: any, value?: any): void;
|
||||
public pipe(stream: NodeJS.WritableStream): void;
|
||||
public query(command: string): Promise<void>;
|
||||
public query<Entity>(command: string): Promise<Entity[]>;
|
||||
public query(command: string, callback: (err?: any, recordset?: any) => void): void;
|
||||
public query<Entity>(command: string, callback: (err?: any, recordset?: Entity[]) => void): void;
|
||||
public batch(batch: string): Promise<recordSet>;
|
||||
public batch<Entity>(batch: string): Promise<Entity[]>;
|
||||
public batch(batch: string, callback: (err?: any, recordset?: any) => void): void;
|
||||
public batch<Entity>(batch: string, callback: (err?: any, recordset?: Entity[]) => void): void;
|
||||
public bulk(table: Table): Promise<void>;
|
||||
public bulk(table: Table, callback: (err: any, rowCount: any) => void): void;
|
||||
public cancel(): void;
|
||||
@@ -254,7 +258,9 @@ declare module "mssql" {
|
||||
public prepare(statement?: string): Promise<void>;
|
||||
public prepare(statement?: string, callback?: (err?: any) => void): void;
|
||||
public execute(values: Object): Promise<recordSet>;
|
||||
public execute<Entity>(values: Object): Promise<Entity[]>;
|
||||
public execute(values: Object, callback: (err: any, recordSet: recordSet) => void): void;
|
||||
public execute<Entity>(values: Object, callback: (err: any, recordSet: Entity[]) => void): void;
|
||||
public unprepare(): Promise<void>;
|
||||
public unprepare(callback: (err?: any) => void): void;
|
||||
}
|
||||
|
||||
@@ -4,5 +4,30 @@
|
||||
import express = require('express');
|
||||
import multer = require('multer');
|
||||
|
||||
var app: express.Express = express();
|
||||
app.use(multer());
|
||||
var upload = multer({ dest: 'uploads/' });
|
||||
|
||||
var app = express();
|
||||
|
||||
app.post('/profile', upload.single('avatar'), (req, res, next) => {
|
||||
});
|
||||
|
||||
app.post('/photos/upload', upload.array('photos', 12), (req, res, next) => {
|
||||
});
|
||||
|
||||
var cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }])
|
||||
app.post('/cool-profile', cpUpload, (req, res, next) => {
|
||||
});
|
||||
|
||||
var diskStorage = multer.diskStorage({
|
||||
destination(req, file, cb) {
|
||||
cb(null, '/tmp/my-uploads');
|
||||
},
|
||||
filename(req, file, cb) {
|
||||
cb(null, file.fieldname + '-' + Date.now());
|
||||
}
|
||||
})
|
||||
|
||||
var diskUpload = multer({ storage: diskStorage });
|
||||
|
||||
var memoryStorage = multer.memoryStorage();
|
||||
var memoryUpload = multer({ storage: memoryStorage });
|
||||
|
||||
85
multer/multer.d.ts
vendored
85
multer/multer.d.ts
vendored
@@ -1,16 +1,16 @@
|
||||
// Type definitions for multer
|
||||
// Project: https://github.com/expressjs/multer
|
||||
// Definitions by: jt000 <https://github.com/jt000>, vilicvane <https://vilic.github.io/>
|
||||
// Definitions by: jt000 <https://github.com/jt000>, vilicvane <https://vilic.github.io/>, David Broder-Rodgers <https://github.com/DavidBR-SW>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
|
||||
declare module Express {
|
||||
export interface Request {
|
||||
file: Multer.File;
|
||||
files: {
|
||||
[fieldname: string]: Multer.File
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module Multer {
|
||||
@@ -40,13 +40,19 @@ declare module Express {
|
||||
declare module "multer" {
|
||||
import express = require('express');
|
||||
|
||||
function multer(options?: multer.Options): express.RequestHandler;
|
||||
|
||||
module multer {
|
||||
interface Field {
|
||||
/** The field name. */
|
||||
name: string;
|
||||
/** Optional maximum number of files per field to accept. */
|
||||
maxCount?: number;
|
||||
}
|
||||
|
||||
type Options = {
|
||||
interface Options {
|
||||
/** The destination directory for the uploaded files. */
|
||||
dest?: string;
|
||||
/** The storage engine to use for uploaded files. */
|
||||
storage?: StorageEngine;
|
||||
/** An object specifying the size limits of the following optional properties. This object is passed to busboy directly, and the details of properties can be found on https://github.com/mscdex/busboy#busboy-methods */
|
||||
limits?: {
|
||||
/** Max field name size (Default: 100 bytes) */
|
||||
@@ -64,36 +70,45 @@ declare module "multer" {
|
||||
/** For multipart forms, the max number of header key=> value pairs to parse Default: 2000(same as node's http). */
|
||||
headerPairs?: number;
|
||||
};
|
||||
/** A Boolean value to specify whether empty submitted values should be processed and applied to req.body; defaults to false; */
|
||||
includeEmptyFields?: boolean;
|
||||
/** If this Boolean value is true, the file.buffer property holds the data in-memory that Multer would have written to disk. The dest option is still populated and the path property contains the proposed path to save the file. Defaults to false. */
|
||||
inMemory?: boolean;
|
||||
/** Function to rename the uploaded files. Whatever the function returns will become the new name of the uploaded file (extension is not included). The fieldname and filename of the file will be available in this function, use them if you need to. */
|
||||
rename?: (fieldname: string, filename: string, req: Express.Request, res: Express.Response) => string;
|
||||
/** Function to rename the directory in which to place uploaded files. The dest parameter is the default value originally assigned or passed into multer. The req and res parameters are also passed into the function because they may contain information (eg session data) needed to create the path (eg get userid from the session). */
|
||||
changeDest?: (dest: string, req: Express.Request, res: Express.Response) => string;
|
||||
/** Event handler triggered when a file starts to be uploaded. A file object, with the following properties, is available to this function: fieldname, originalname, name, encoding, mimetype, path, and extension. */
|
||||
onFileUploadStart?: (file: Express.Multer.File, req: Express.Request, res: Express.Response) => void;
|
||||
/** Event handler triggered when a chunk of buffer is received. A buffer object along with a file object is available to the function. */
|
||||
onFileUploadData?: (file: Express.Multer.File, data: Buffer, req: Express.Request, res: Express.Response) => void;
|
||||
/** Event handler trigger when a file is completely uploaded. A file object is available to the function. */
|
||||
onFileUploadComplete?: (file: Express.Multer.File, req: Express.Request, res: Express.Response) => void;
|
||||
/** Event handler triggered when the form parsing starts. */
|
||||
onParseStart?: () => void;
|
||||
/** Event handler triggered when the form parsing completes. The request object and the next objects are are passed to the function. */
|
||||
onParseEnd?: (req: Express.Request, next: () => void) => void;
|
||||
/** Event handler for any errors encountering while processing the form. The error object and the next object is available to the function. If you are handling errors yourself, make sure to terminate the request or call the next() function, else the request will be left hanging. */
|
||||
onError?: () => void;
|
||||
/** Event handler triggered when a file size exceeds the specification in the limit object. No more files will be parsed after the limit is reached. */
|
||||
onFileSizeLimit?: (file: Express.Multer.File) => void;
|
||||
/** Event handler triggered when the number of files exceed the specification in the limit object. No more files will be parsed after the limit is reached. */
|
||||
onFilesLimit?: () => void;
|
||||
/** Event handler triggered when the number of fields exceed the specification in the limit object. No more fields will be parsed after the limit is reached. */
|
||||
onFieldsLimit?: () => void;
|
||||
/** Event handler triggered when the number of parts exceed the specification in the limit object. No more files or fields will be parsed after the limit is reached. */
|
||||
onPartsLimit?: () => void;
|
||||
};
|
||||
/** A function to control which files to upload and which to skip. */
|
||||
fileFilter?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error, acceptFile: boolean) => void) => void;
|
||||
}
|
||||
|
||||
interface StorageEngine {
|
||||
_handleFile(req: express.Request, file: Express.Multer.File, callback: (error?: any, info?: Express.Multer.File) => void): void;
|
||||
_removeFile(req: express.Request, file: Express.Multer.File, callback: (error: Error) => void): void;
|
||||
}
|
||||
|
||||
interface DiskStorageOptions {
|
||||
/** A function used to determine within which folder the uploaded files should be stored. Defaults to the system's default temporary directory. */
|
||||
destination?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error, destination: string) => void) => void;
|
||||
/** A function used to determine what the file should be named inside the folder. Defaults to a random name with no file extension. */
|
||||
filename?: (req: Express.Request, file: Express.Multer.File, callback: (error: Error, filename: string) => void) => void;
|
||||
}
|
||||
|
||||
interface Instance {
|
||||
/** Accept a single file with the name fieldname. The single file will be stored in req.file. */
|
||||
single(fieldame: string): express.RequestHandler;
|
||||
/** Accept an array of files, all with the name fieldname. Optionally error out if more than maxCount files are uploaded. The array of files will be stored in req.files. */
|
||||
array(fieldame: string, maxCount?: number): express.RequestHandler;
|
||||
/** Accept a mix of files, specified by fields. An object with arrays of files will be stored in req.files. */
|
||||
fields(fields: Field[]): express.RequestHandler;
|
||||
/** Accepts all files that comes over the wire. An array of files will be stored in req.files. */
|
||||
any(): express.RequestHandler;
|
||||
}
|
||||
}
|
||||
|
||||
interface Multer {
|
||||
|
||||
(options?: multer.Options): multer.Instance;
|
||||
|
||||
/* The disk storage engine gives you full control on storing files to disk. */
|
||||
diskStorage(options: multer.DiskStorageOptions): multer.StorageEngine;
|
||||
/* The memory storage engine stores the files in memory as Buffer objects. */
|
||||
memoryStorage(): multer.StorageEngine;
|
||||
}
|
||||
|
||||
var multer: Multer;
|
||||
|
||||
export = multer;
|
||||
}
|
||||
|
||||
1
node/node.d.ts
vendored
1
node/node.d.ts
vendored
@@ -490,6 +490,7 @@ declare module "http" {
|
||||
writeHead(statusCode: number, headers?: any): void;
|
||||
statusCode: number;
|
||||
statusMessage: string;
|
||||
headersSent: boolean;
|
||||
setHeader(name: string, value: string): void;
|
||||
sendDate: boolean;
|
||||
getHeader(name: string): string;
|
||||
|
||||
54
raty/raty-tests.ts
Normal file
54
raty/raty-tests.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="raty.d.ts" />
|
||||
|
||||
|
||||
var $element: JQuery = $('<div></div>');
|
||||
|
||||
$element.raty();
|
||||
|
||||
$element.raty({
|
||||
cancel: false,
|
||||
cancelClass: 'raty-cancel',
|
||||
cancelHint: 'Cancel this rating!',
|
||||
cancelOff: 'cancel-off.png',
|
||||
cancelOn: 'cancel-on.png',
|
||||
cancelPlace: 'left',
|
||||
click: undefined,
|
||||
half: false,
|
||||
halfShow: true,
|
||||
hints: ['bad', 'poor', 'regular', 'good', 'gorgeous'],
|
||||
iconRange: undefined,
|
||||
mouseout: undefined,
|
||||
mouseover: undefined,
|
||||
noRatedMsg: 'Not rated yet!',
|
||||
number: 5,
|
||||
numberMax: 20,
|
||||
path: undefined,
|
||||
precision: false,
|
||||
readOnly: false,
|
||||
round: { down: .25, full: .6, up: .76 },
|
||||
score: undefined,
|
||||
scoreName: 'score',
|
||||
single: false,
|
||||
space: true,
|
||||
starHalf: 'star-half.png',
|
||||
starOff: 'star-off.png',
|
||||
starOn: 'star-on.png',
|
||||
target: undefined,
|
||||
targetFormat: '{score}',
|
||||
targetKeep: false,
|
||||
targetScore: undefined,
|
||||
targetText: '',
|
||||
targetType: 'hint',
|
||||
starType: 'img',
|
||||
});
|
||||
|
||||
var score: number = $element.raty('score');
|
||||
$element.raty('score', 4);
|
||||
$element.raty('click', 2);
|
||||
$element.raty('readOnly', true);
|
||||
$element.raty('cancel', true);
|
||||
$element.raty('reload');
|
||||
$element.raty('set', { space: false });
|
||||
$element.raty('destroy');
|
||||
$element.raty('move', 3);
|
||||
64
raty/raty.d.ts
vendored
Normal file
64
raty/raty.d.ts
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
// Type definitions for jQuery.raty 2.7.0
|
||||
// Project: https://github.com/wbotelhos/raty
|
||||
// Definitions by: Matt Wheatley <http://github.com/terrawheat>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
interface JQuery {
|
||||
raty(): JQuery;
|
||||
raty(options: JQueryRatyOptions): JQuery;
|
||||
raty(method: string, parameter: any): any;
|
||||
raty(method: 'score'): number;
|
||||
raty(method: 'score', score: number): void;
|
||||
raty(method: 'click', star: number): void;
|
||||
raty(method: 'readonly', on: boolean): void;
|
||||
raty(method: 'cancel', on: boolean): void;
|
||||
raty(method: 'reload'): void;
|
||||
raty(method: 'set', options: JQueryRatyOptions): void;
|
||||
raty(method: 'destroy'): JQuery;
|
||||
raty(method: 'move', number: number): void;
|
||||
}
|
||||
|
||||
interface JQueryRatyOptions {
|
||||
cancel?: boolean,
|
||||
cancelClass?: string,
|
||||
cancelHint?: string,
|
||||
cancelOff?: string,
|
||||
cancelOn?: string,
|
||||
cancelPlace?: string,
|
||||
click?: (score: number, event: JQueryEventObject) => void,
|
||||
half?: boolean,
|
||||
halfShow?: boolean,
|
||||
hints?: string[],
|
||||
iconRange?: any[][],
|
||||
mouseout?: (score: number, event: JQueryEventObject) => void,
|
||||
mouseover?: (score: number, event: JQueryEventObject) => void,
|
||||
noRatedMsg?: string,
|
||||
number?: number,
|
||||
numberMax?: number,
|
||||
path?: string,
|
||||
precision?: boolean,
|
||||
readOnly?: boolean,
|
||||
round?: JQueryRatyRoundingOptions,
|
||||
score?: number,
|
||||
scoreName?: string,
|
||||
single?: boolean,
|
||||
space?: boolean,
|
||||
starHalf?: string,
|
||||
starOff?: string,
|
||||
starOn?: string,
|
||||
target?: string,
|
||||
targetFormat?: string,
|
||||
targetKeep?: boolean,
|
||||
targetScore?: string,
|
||||
targetText?: string,
|
||||
targetType?: string,
|
||||
starType?: string,
|
||||
}
|
||||
|
||||
interface JQueryRatyRoundingOptions {
|
||||
down: number,
|
||||
full: number,
|
||||
up: number,
|
||||
}
|
||||
11
rcloader/rcloader-tests.ts
Normal file
11
rcloader/rcloader-tests.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/// <reference path="./rcloader.d.ts" />
|
||||
|
||||
import RcLoader = require("rcloader");
|
||||
|
||||
const rcLoader = new RcLoader(".configfilename", {
|
||||
lookup: true
|
||||
});
|
||||
|
||||
rcLoader.for("foo.json", (err, fileOpts) => {
|
||||
// send the file along
|
||||
});
|
||||
18
rcloader/rcloader.d.ts
vendored
Normal file
18
rcloader/rcloader.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// Type definitions for rcloader
|
||||
// Project: https://github.com/spalger/rcloader
|
||||
// Definitions by: Panu Horsmalahti <https://github.com/panuhorsmalahti>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "rcloader" {
|
||||
interface Options {
|
||||
[property: string]: any;
|
||||
lookup?: boolean;
|
||||
}
|
||||
|
||||
class RcLoader {
|
||||
constructor(configfilename: string, options: string | Options);
|
||||
for(path: string, callback?: (error: any, fileOpts: any) => void): void;
|
||||
}
|
||||
|
||||
export = RcLoader;
|
||||
}
|
||||
7
react/react.d.ts
vendored
7
react/react.d.ts
vendored
@@ -1145,6 +1145,11 @@ declare namespace __React {
|
||||
*/
|
||||
maxWidth?: any;
|
||||
|
||||
/**
|
||||
* Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. The value of min-height overrides both max-height and height.
|
||||
*/
|
||||
minHeight?: any;
|
||||
|
||||
/**
|
||||
* Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width.
|
||||
*/
|
||||
@@ -1817,7 +1822,7 @@ declare namespace __React {
|
||||
vocab?: string;
|
||||
|
||||
// Non-standard Attributes
|
||||
autoCapitalize?: boolean;
|
||||
autoCapitalize?: string;
|
||||
autoCorrect?: string;
|
||||
autoSave?: string;
|
||||
color?: string;
|
||||
|
||||
71
rss/rss-tests.ts
Normal file
71
rss/rss-tests.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
/// <reference path="rss.d.ts" />
|
||||
|
||||
// this test is copied from https://github.com/dylang/node-rss
|
||||
// it basically:
|
||||
//
|
||||
// * creates an RSS feed with some attributes,
|
||||
// * add an item to it
|
||||
// * then generates XML string
|
||||
|
||||
import * as RSS from 'rss';
|
||||
|
||||
var feed = new RSS({
|
||||
title: 'title',
|
||||
description: 'description',
|
||||
feed_url: 'http://example.com/rss.xml',
|
||||
site_url: 'http://example.com',
|
||||
image_url: 'http://example.com/icon.png',
|
||||
docs: 'http://example.com/rss/docs.html',
|
||||
managingEditor: 'Dylan Greene',
|
||||
webMaster: 'Dylan Greene',
|
||||
copyright: '2013 Dylan Greene',
|
||||
language: 'en',
|
||||
categories: ['Category 1','Category 2','Category 3'],
|
||||
pubDate: 'May 20, 2012 04:00:00 GMT',
|
||||
ttl: 60,
|
||||
custom_namespaces: {
|
||||
'itunes': 'http://www.itunes.com/dtds/podcast-1.0.dtd'
|
||||
},
|
||||
custom_elements: [
|
||||
{ 'itunes:subtitle': 'A show about everything' },
|
||||
{ 'itunes:author': 'John Doe' },
|
||||
{ 'itunes:summary': 'All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our podcast in the Podcasts app or in the iTunes Store'},
|
||||
{ 'itunes:owner': [
|
||||
{ 'itunes:name': 'John Doe' },
|
||||
{ 'itunes:email': 'john.doe@example.com' }
|
||||
]
|
||||
},
|
||||
{ 'itunes:image': {
|
||||
_attr: {
|
||||
href: 'http://example.com/podcasts/everything/AllAboutEverything.jpg'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
feed.item({
|
||||
title: 'item title',
|
||||
description: 'use this for the content. It can include html.',
|
||||
url: 'http://example.com/article4?this&that',
|
||||
guid: '1123',
|
||||
categories: ['Category 1','Category 2','Category 3','Category 4'],
|
||||
author: 'Guest Author',
|
||||
date: 'May 27, 2012',
|
||||
lat: 33.417974,
|
||||
long: -111.933231,
|
||||
enclosure: { url:'...', file:'path-to-file' },
|
||||
custom_elements: [
|
||||
{ 'itunes:author': 'John Doe' },
|
||||
{ 'itunes:subtitle': 'A short primer on table spices' },
|
||||
{ 'itunes:image': {
|
||||
_attr: {
|
||||
href: 'http://example.com/podcasts/everything/AllAboutEverything/Episode1.jpg'
|
||||
}
|
||||
}
|
||||
},
|
||||
{ 'itunes:duration': '7:04' }
|
||||
]
|
||||
});
|
||||
|
||||
var xml = feed.xml();
|
||||
209
rss/rss.d.ts
vendored
Normal file
209
rss/rss.d.ts
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
// Type definitions for rss
|
||||
// Project: https://github.com/dylang/node-rss
|
||||
// Definitions by: Second Datke <https://github.com/secondwtq>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module NodeRSS {
|
||||
interface FeedOptions {
|
||||
/**
|
||||
* Title of your site or feed.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* A short description of the feed.
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* Feed generator.
|
||||
*/
|
||||
generator?: string;
|
||||
/**
|
||||
* URL to the rss feed.
|
||||
*/
|
||||
feed_url: string;
|
||||
/**
|
||||
* URL to the site that the feed is for.
|
||||
*/
|
||||
site_url: string;
|
||||
/**
|
||||
* Small image for feed readers to use.
|
||||
*/
|
||||
image_url?: string;
|
||||
/**
|
||||
* URL to documentation on this feed.
|
||||
*/
|
||||
docs?: string;
|
||||
/**
|
||||
* Who manages content in this feed.
|
||||
*/
|
||||
managingEditor?: string;
|
||||
/**
|
||||
* Who manages feed availability and technical support.
|
||||
*/
|
||||
webMaster?: string;
|
||||
/**
|
||||
* Copyright information for this feed.
|
||||
*/
|
||||
copyright?: string;
|
||||
/**
|
||||
* The language of the content of this feed.
|
||||
*/
|
||||
language?: string;
|
||||
/**
|
||||
* One or more categories this feed belongs to.
|
||||
*/
|
||||
categories?: string[];
|
||||
/**
|
||||
* The publication date for content in the feed.
|
||||
* Accepts Date object or string with any format
|
||||
* JS Date can parse.
|
||||
*/
|
||||
pubDate?: Date | string;
|
||||
/**
|
||||
* Number of minutes feed can be cached before refreshing
|
||||
* from source.
|
||||
*/
|
||||
ttl?: number;
|
||||
/**
|
||||
* Where is the PubSubHub hub located.
|
||||
*/
|
||||
hub?: string;
|
||||
/**
|
||||
* Put additional namespaces in element
|
||||
* (without 'xmlns:' prefix).
|
||||
*/
|
||||
custom_namespaces?: Object;
|
||||
/**
|
||||
* Put additional elements in the feed (node-xml syntax).
|
||||
*/
|
||||
custom_elements?: any[];
|
||||
}
|
||||
|
||||
interface EnclosureObject {
|
||||
/**
|
||||
* URL to file object (or file).
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* Path to binary file (or URL).
|
||||
*/
|
||||
file: string;
|
||||
/**
|
||||
* Size of the file.
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
* If not provided, the MIME Type will be guessed based
|
||||
* on the extension of the file or URL, passing type to
|
||||
* the enclosure will override the guessed type.
|
||||
*/
|
||||
type?: string;
|
||||
}
|
||||
|
||||
interface ItemOptions {
|
||||
/**
|
||||
* Title of this particular item.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Content for the item. Can contain HTML but link and image
|
||||
* URLs must be absolute path including hostname.
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* URL to the item. This could be a blog entry.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* A unique string feed readers use to know if an item is
|
||||
* new or has already been seen. If you use a guid never
|
||||
* change it. If you don't provide a guid then your item
|
||||
* urls must be unique.
|
||||
* Defaults to url.
|
||||
*/
|
||||
guid?: string;
|
||||
/**
|
||||
* If provided, each array item will be added as a category
|
||||
* element.
|
||||
*/
|
||||
categories?: string[];
|
||||
/**
|
||||
* If included it is the name of the item's creator. If not
|
||||
* provided the item author will be the same as the feed author.
|
||||
* This is typical except on multi-author blogs.
|
||||
*/
|
||||
author?: string;
|
||||
/**
|
||||
* The date and time of when the item was created. Feed
|
||||
* readers use this to determine the sort order. Some readers
|
||||
* will also use it to determine if the content should be
|
||||
* presented as unread.
|
||||
* Accepts Date object or string with any format
|
||||
* JS Date can parse.
|
||||
*/
|
||||
date: Date | string;
|
||||
/**
|
||||
* The latitude coordinate of the item for GeoRSS.
|
||||
*/
|
||||
lat?: number;
|
||||
/**
|
||||
* The longitude coordinate of the item for GeoRSS.
|
||||
*/
|
||||
long?: number;
|
||||
/**
|
||||
* Put additional elements in the item (node-xml syntax).
|
||||
*/
|
||||
custom_elements?: any[];
|
||||
/**
|
||||
* An enclosure object.
|
||||
*/
|
||||
enclosure?: EnclosureObject;
|
||||
}
|
||||
|
||||
interface XmlOptions {
|
||||
/**
|
||||
* What to use as a tab. Defaults to no tabs (compressed).
|
||||
* For example you can use '\t' for tab character, or ' '
|
||||
* for two-space tabs. If you set it to true it will use
|
||||
* four spaces.
|
||||
*/
|
||||
indent?: boolean | string;
|
||||
}
|
||||
|
||||
interface RSS {
|
||||
/**
|
||||
* Add an item to a feed. An item can be used for a blog
|
||||
* entry, project update, log entry, etc.
|
||||
* @param {ItemOptions} itemOptions
|
||||
* @returns {RSS}
|
||||
*/
|
||||
item(itemOptions: ItemOptions): RSS;
|
||||
/**
|
||||
* Generate XML and return as a string for this feed.
|
||||
* @returns {string}
|
||||
*/
|
||||
xml(): string;
|
||||
/**
|
||||
* Generate XML and return as a string for this feed.
|
||||
*
|
||||
* @param {XmlOptions} xmlOptions - You can use indent
|
||||
* option to specify the tab character to use.
|
||||
* @returns {string}
|
||||
*/
|
||||
xml(xmlOptions: XmlOptions): string;
|
||||
}
|
||||
|
||||
interface RSSFactory {
|
||||
/**
|
||||
* Create an RSS feed with options.
|
||||
* @param {FeedOptions} feedOptions - Options for the RSS feed.
|
||||
* @returns {RSS}
|
||||
*/
|
||||
new(feedOptions: FeedOptions): RSS;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'rss' {
|
||||
var factory: NodeRSS.RSSFactory;
|
||||
export = factory;
|
||||
}
|
||||
14
s3rver/s3rver-tests.ts
Normal file
14
s3rver/s3rver-tests.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/// <reference path="s3rver.d.ts" />
|
||||
|
||||
import S3rver = require('s3rver');
|
||||
|
||||
var s3rver = new S3rver({
|
||||
port: 5694,
|
||||
hostname: 'localhost',
|
||||
silent: true,
|
||||
indexDocument: 'index.html',
|
||||
errorDocument: '',
|
||||
directory: '/tmp/s3rver_test_directory'
|
||||
}).run((err, hostname, port, directory) => {});
|
||||
|
||||
s3rver.close();
|
||||
32
s3rver/s3rver.d.ts
vendored
Normal file
32
s3rver/s3rver.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// Type definitions for S3rver
|
||||
// Project: https://github.com/jamhall/s3rver
|
||||
// Definitions by: David Broder-Rodgers <https://github.com/DavidBR-SW/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "s3rver" {
|
||||
import * as http from "http";
|
||||
|
||||
class S3rver {
|
||||
constructor(options: S3rverOptions)
|
||||
setPort(port: number): S3rver;
|
||||
setHostname(hostname: string): S3rver;
|
||||
setDirectory(directory: string): S3rver;
|
||||
setSilent(silent: boolean): S3rver;
|
||||
setIndexDocument(indexDocument: string): S3rver;
|
||||
setErrorDocument(errorDocument: string): S3rver;
|
||||
run(callback: (error: Error, hostname: string, port: number, directory: string) => void): http.Server;
|
||||
}
|
||||
|
||||
interface S3rverOptions {
|
||||
port?: number;
|
||||
hostname?: string;
|
||||
silent?: boolean;
|
||||
indexDocument?: string;
|
||||
errorDocument?: string;
|
||||
directory: string;
|
||||
}
|
||||
|
||||
export = S3rver;
|
||||
}
|
||||
6273
spotify-api/spotify-api-tests.ts
Normal file
6273
spotify-api/spotify-api-tests.ts
Normal file
File diff suppressed because it is too large
Load Diff
686
spotify-api/spotify-api.d.ts
vendored
Normal file
686
spotify-api/spotify-api.d.ts
vendored
Normal file
@@ -0,0 +1,686 @@
|
||||
// Type definitions for The Spotify Web API v1.0
|
||||
// Project: https://developer.spotify.com/web-api/
|
||||
// Definitions by: Niels Kristian Hansen Skovmand <https://github.com/skovmand>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Release comments:
|
||||
// -----------------
|
||||
// TrackObjects and AlbumObjects is specified in the docs as always having the available_markets property,
|
||||
// but when it is sent in https://developer.spotify.com/web-api/console/get-current-user-saved-tracks
|
||||
// the available_markets are missing. Therefore it is marked as optional in this source code.
|
||||
|
||||
|
||||
declare module SpotifyApi {
|
||||
|
||||
//
|
||||
// Parameter Objects for searching
|
||||
//
|
||||
|
||||
/**
|
||||
* Object for search parameters for searching for tracks, playlists, artists or albums.
|
||||
* See: [Search for an item](https://developer.spotify.com/web-api/search-item/)
|
||||
*
|
||||
* q and type are not optional in the API, however they are marked as optional here, since various libraries
|
||||
* implement them as function call parameters instead. This could be changed.
|
||||
*
|
||||
* @param q Required. The search query's keywords (and optional field filters and operators).
|
||||
* @param type Required. A comma-separated list of item types to search across. Valid types are: album, artist, playlist, and track.
|
||||
* @param market Optional. An ISO 3166-1 alpha-2 country code or the string from_token
|
||||
* @param limit Optional. The maximum number of results to return. Default: 20. Minimum: 1. Maximum: 50.
|
||||
* @param offset Optional. The index of the first result to return. Default: 0 (i.e., the first result). Maximum offset: 100.000. Use with limit to get the next page of search results.
|
||||
*/
|
||||
interface SearchForItemParameterObject {
|
||||
q?: string;
|
||||
type?: string;
|
||||
market?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Responses from the Spotify Web API in the same order as in the API endpoint docs seen here:
|
||||
// [API Endpoint Reference](https://developer.spotify.com/web-api/endpoint-reference/)
|
||||
//
|
||||
|
||||
// Generic interfaces for re-use:
|
||||
|
||||
/**
|
||||
* Void Response
|
||||
*/
|
||||
interface VoidResponse {}
|
||||
|
||||
/**
|
||||
* Response with Playlist Snapshot
|
||||
*/
|
||||
interface PlaylistSnapshotResponse {
|
||||
snapshot_id: string
|
||||
}
|
||||
|
||||
|
||||
// Spotify API Endpoints:
|
||||
|
||||
/**
|
||||
* Get an Album
|
||||
* GET /v1/albums/{id}
|
||||
*/
|
||||
interface SingleAlbumResponse extends AlbumObjectFull {}
|
||||
|
||||
/**
|
||||
* Get Several Albums
|
||||
* GET /v1/albums
|
||||
*/
|
||||
interface MultipleAlbumsResponse {
|
||||
albums: AlbumObjectFull[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an Album’s Tracks
|
||||
* GET /v1/albums/{id}/tracks
|
||||
*/
|
||||
interface AlbumTracksResponse extends PagingObject<TrackObjectSimplified> {}
|
||||
|
||||
/**
|
||||
* Get an Artist
|
||||
* GET /v1/artists/{id}
|
||||
*/
|
||||
interface SingleArtistResponse extends ArtistObjectFull {}
|
||||
|
||||
/**
|
||||
* Get Several Artists
|
||||
* GET /v1/artists
|
||||
*/
|
||||
interface MultipleArtistsResponse {
|
||||
artists: ArtistObjectFull[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an Artist’s Albums
|
||||
* GET /v1/artists/{id}/albums
|
||||
*/
|
||||
interface ArtistsAlbumsResponse extends PagingObject<AlbumObjectSimplified> {}
|
||||
|
||||
/**
|
||||
* Get an Artist’s Top Tracks
|
||||
* GET /v1/artists/{id}/top-tracks
|
||||
*/
|
||||
interface ArtistsTopTracksResponse {
|
||||
tracks: TrackObjectFull[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an Artist’s Related Artists
|
||||
* GET /v1/artists/{id}/related-artists
|
||||
*/
|
||||
interface ArtistsRelatedArtistsResponse {
|
||||
artists: ArtistObjectFull[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of featured playlists
|
||||
* GET /v1/browse/featured-playlists
|
||||
*/
|
||||
interface ListOfFeaturedPlaylistsResponse {
|
||||
message?: string,
|
||||
playlists: PagingObject<PlaylistObjectSimplified>
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of new releases
|
||||
* GET /v1/browse/new-releases
|
||||
*/
|
||||
interface ListOfNewReleasesResponse {
|
||||
message?: string,
|
||||
albums: PagingObject<AlbumObjectSimplified>
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of categories
|
||||
* GET /v1/browse/categories
|
||||
*/
|
||||
interface MultipleCategoriesResponse {
|
||||
categories: PagingObject<CategoryObject>
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a category
|
||||
* GET /v1/browse/categories/{category_id}
|
||||
*/
|
||||
interface SingleCategoryResponse extends CategoryObject {}
|
||||
|
||||
/**
|
||||
* Get a categorys playlists
|
||||
* GET /v1/browse/categories/{id}/playlists
|
||||
*/
|
||||
interface CategoryPlaylistsReponse {
|
||||
playlists: PagingObject<PlaylistObjectSimplified>
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Current User’s Profile
|
||||
* GET /v1/me
|
||||
*/
|
||||
interface CurrentUsersProfileResponse extends UserObjectPrivate {}
|
||||
|
||||
/**
|
||||
* Get User’s Followed Artists
|
||||
* GET /v1/me/following?type=artist
|
||||
*/
|
||||
interface UsersFollowedArtistsResponse {
|
||||
artists: CursorBasedPagingObject<ArtistObjectFull>
|
||||
}
|
||||
|
||||
/**
|
||||
* Follow artists or users
|
||||
* PUT /v1/me/following
|
||||
*/
|
||||
interface FollowArtistsOrUsersResponse extends VoidResponse {}
|
||||
|
||||
/**
|
||||
* Unfollow artists or users
|
||||
* DELETE /v1/me/following
|
||||
*/
|
||||
interface UnfollowArtistsOrUsersResponse extends VoidResponse {}
|
||||
|
||||
/**
|
||||
* Check if User Follows Users or Artists
|
||||
* GET /v1/me/following/contains
|
||||
*/
|
||||
interface UserFollowsUsersOrArtistsResponse extends Array<boolean> {}
|
||||
|
||||
/**
|
||||
* Follow a Playlist
|
||||
* PUT /v1/users/{owner_id}/playlists/{playlist_id}/followers
|
||||
*/
|
||||
interface FollowPlaylistReponse extends VoidResponse {}
|
||||
|
||||
/**
|
||||
* Unfollow a Playlist
|
||||
* DELETE /v1/users/{owner_id}/playlists/{playlist_id}/followers
|
||||
*/
|
||||
interface UnfollowPlaylistReponse extends VoidResponse {}
|
||||
|
||||
/**
|
||||
* Save tracks for user
|
||||
* PUT /v1/me/tracks?ids={ids}
|
||||
*/
|
||||
interface SaveTracksForUserResponse extends VoidResponse {}
|
||||
|
||||
/**
|
||||
* Get user's saved tracks
|
||||
* GET /v1/me/tracks
|
||||
*/
|
||||
interface UsersSavedTracksResponse extends PagingObject<SavedTrackObject> {}
|
||||
|
||||
/**
|
||||
* Remove User’s Saved Tracks
|
||||
* DELETE /v1/me/tracks?ids={ids}
|
||||
*/
|
||||
interface RemoveUsersSavedTracksResponse extends VoidResponse {}
|
||||
|
||||
/**
|
||||
* Check User’s Saved Tracks
|
||||
* GET /v1/me/tracks/contains
|
||||
*/
|
||||
interface CheckUsersSavedTracksResponse extends Array<boolean> {}
|
||||
|
||||
/**
|
||||
* Save albums for user
|
||||
* PUT /v1/me/albums?ids={ids}
|
||||
*/
|
||||
interface SaveAlbumsForUserResponse extends VoidResponse {}
|
||||
|
||||
/**
|
||||
* Get user's saved albums
|
||||
* GET /v1/me/albums
|
||||
*/
|
||||
interface UsersSavedAlbumsResponse extends PagingObject<AlbumObjectFull> {}
|
||||
|
||||
/**
|
||||
* Remove Albums for Current User
|
||||
* DELETE /v1/me/albums?ids={ids}
|
||||
*/
|
||||
interface RemoveAlbumsForUserResponse extends VoidResponse {}
|
||||
|
||||
/**
|
||||
* Check user's saved albums
|
||||
* DELETE /v1/me/albums/contains?ids={ids}
|
||||
*/
|
||||
interface CheckUserSavedAlbumsResponse extends Array<boolean> {}
|
||||
|
||||
/**
|
||||
* Search for an album
|
||||
* GET /v1/search?type=album
|
||||
*/
|
||||
interface AlbumSearchResponse {
|
||||
albums: PagingObject<AlbumObjectSimplified>
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for an artist
|
||||
* GET /v1/search?type=artist
|
||||
*/
|
||||
interface ArtistSearchResponse {
|
||||
artists: PagingObject<ArtistObjectFull>
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for a playlist
|
||||
* GET /v1/search?type=playlist
|
||||
*/
|
||||
interface PlaylistSearchResponse {
|
||||
playlists: PagingObject<PlaylistObjectSimplified>
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for a track
|
||||
* GET /v1/search?type=track
|
||||
*/
|
||||
interface TrackSearchResponse {
|
||||
tracks: PagingObject<TrackObjectFull>
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a track
|
||||
* GET /v1/tracks/{id}
|
||||
*/
|
||||
interface SingleTrackResponse extends TrackObjectFull {}
|
||||
|
||||
/**
|
||||
* Get multiple tracks
|
||||
* GET /v1/tracks?ids={ids}
|
||||
*/
|
||||
interface MultipleTracksResponse {
|
||||
tracks: TrackObjectFull[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user profile
|
||||
* GET /v1/users/{user_id}
|
||||
*/
|
||||
interface UserProfileResponse extends UserObjectPublic {}
|
||||
|
||||
/**
|
||||
* Get a list of a user's playlists
|
||||
* GET /v1/users/{user_id}/playlists
|
||||
*/
|
||||
interface ListOfUsersPlaylistsResponse extends PagingObject<PlaylistObjectSimplified> {}
|
||||
|
||||
/**
|
||||
* Get a list of the current user's playlists
|
||||
* GET /v1/me/playlists
|
||||
*/
|
||||
interface ListOfCurrentUsersPlaylistsResponse extends PagingObject<PlaylistObjectSimplified> {}
|
||||
|
||||
/**
|
||||
* Get a playlist
|
||||
* GET /v1/users/{user_id}/playlists/{playlist_id}
|
||||
*/
|
||||
interface SinglePlaylistResponse extends PlaylistObjectFull {}
|
||||
|
||||
/**
|
||||
* Get a playlist's tracks
|
||||
* GET /v1/users/{user_id}/playlists/{playlist_id}/tracks
|
||||
*/
|
||||
interface PlaylistTrackResponse extends PagingObject<PlaylistTrackObject> {}
|
||||
|
||||
/**
|
||||
* Create a Playlist
|
||||
* POST /v1/users/{user_id}/playlists
|
||||
*/
|
||||
interface CreatePlaylistResponse extends PlaylistObjectFull {}
|
||||
|
||||
/**
|
||||
* Change a Playlist’s Details
|
||||
* PUT /v1/users/{user_id}/playlists/{playlist_id}
|
||||
*/
|
||||
interface ChangePlaylistDetailsReponse extends VoidResponse {}
|
||||
|
||||
/**
|
||||
* Add Tracks to a Playlist
|
||||
* POST /v1/users/{user_id}/playlists/{playlist_id}/tracks
|
||||
*/
|
||||
interface AddTracksToPlaylistResponse extends PlaylistSnapshotResponse {}
|
||||
|
||||
/**
|
||||
* Remove Tracks from a Playlist
|
||||
* DELETE /v1/users/{user_id}/playlists/{playlist_id}/tracks
|
||||
*/
|
||||
interface RemoveTracksFromPlaylistResponse extends PlaylistSnapshotResponse {}
|
||||
|
||||
/**
|
||||
* Reorder a Playlist’s Tracks
|
||||
* PUT /v1/users/{user_id}/playlists/{playlist_id}/tracks
|
||||
*/
|
||||
interface ReorderPlaylistTracksResponse extends PlaylistSnapshotResponse {}
|
||||
|
||||
/**
|
||||
* Replace a Playlist’s Tracks
|
||||
* PUT /v1/users/{user_id}/playlists/{playlist_id}/tracks
|
||||
*/
|
||||
interface ReplacePlaylistTracksResponse extends VoidResponse {}
|
||||
|
||||
/**
|
||||
* Check if Users Follow a Playlist
|
||||
* GET /v1/users/{user_id}/playlists/{playlist_id}/followers/contains
|
||||
*/
|
||||
interface UsersFollowPlaylistReponse extends Array<boolean> {}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Objects from the Object Models of the Spotify Web Api
|
||||
// [Object Model](https://developer.spotify.com/web-api/object-model)
|
||||
//
|
||||
|
||||
//
|
||||
// The Paging Object wrappers used for retrieving collections from the Spotify API.
|
||||
//
|
||||
|
||||
/**
|
||||
* BasePagingObject which the IPagingObject and ICursorBasedPagingObject extend from.
|
||||
* Doesn't exist in itself in the spotify API.
|
||||
*/
|
||||
interface BasePagingObject <T>{
|
||||
href: string,
|
||||
items: T[],
|
||||
limit: number,
|
||||
next: string,
|
||||
total: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Paging Object wrapper used for retrieving collections from the Spotify API.
|
||||
* [](https://developer.spotify.com/web-api/object-model/#paging-object)
|
||||
*/
|
||||
interface PagingObject<T> extends BasePagingObject<T> {
|
||||
previous: string,
|
||||
offset: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Cursor Based Paging Object wrappers used for retrieving collections from the Spotify API.
|
||||
* [](https://developer.spotify.com/web-api/object-model/#cursor-based-paging-object)
|
||||
*/
|
||||
interface CursorBasedPagingObject<T> extends BasePagingObject<T> {
|
||||
cursors: CursorObject
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// All other objects of the Object Models from the Spotify Web Api, ordered alphabetically.
|
||||
//
|
||||
|
||||
/**
|
||||
* Full Album Object
|
||||
* [album object (full)](https://developer.spotify.com/web-api/object-model/#album-object-simplified)
|
||||
*/
|
||||
interface AlbumObjectFull extends AlbumObjectSimplified {
|
||||
artists: ArtistObjectSimplified[],
|
||||
copyrights: CopyrightObject[],
|
||||
external_ids: ExternalIdObject,
|
||||
genres: string[],
|
||||
popularity: number,
|
||||
release_date: string,
|
||||
release_date_precision: string,
|
||||
tracks: PagingObject<TrackObjectSimplified>,
|
||||
}
|
||||
|
||||
/**
|
||||
* Simplified Album Object
|
||||
* [album object (simplified)](https://developer.spotify.com/web-api/object-model/#album-object-simplified)
|
||||
*/
|
||||
interface AlbumObjectSimplified {
|
||||
album_type: string,
|
||||
available_markets?: string[],
|
||||
external_urls: ExternalUrlObject,
|
||||
href: string,
|
||||
id: string,
|
||||
images: ImageObject[],
|
||||
name: string,
|
||||
type: string,
|
||||
uri: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Full Artist Object
|
||||
* [artist object (full)](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface ArtistObjectFull extends ArtistObjectSimplified {
|
||||
followers: FollowersObject,
|
||||
genres: string[],
|
||||
images: ImageObject[],
|
||||
popularity: number,
|
||||
}
|
||||
|
||||
/**
|
||||
* Simplified Artist Object
|
||||
* [artist object (simplified)](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface ArtistObjectSimplified {
|
||||
external_urls: ExternalUrlObject,
|
||||
href: string,
|
||||
id: string,
|
||||
name: string,
|
||||
type: string,
|
||||
uri: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Category Object
|
||||
* [category object](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface CategoryObject {
|
||||
href: string,
|
||||
icons: ImageObject[],
|
||||
id: string,
|
||||
name: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright object
|
||||
* [copyright object](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface CopyrightObject {
|
||||
text: string,
|
||||
type: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Cursor object
|
||||
* [cursor object](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface CursorObject {
|
||||
after: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Error object
|
||||
* [error object](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface ErrorObject {
|
||||
status: number,
|
||||
message: string
|
||||
}
|
||||
|
||||
/**
|
||||
* External Id object
|
||||
* [](https://developer.spotify.com/web-api/object-model/)
|
||||
*
|
||||
* Note that there might be other types available, it couldn't be found in the docs.
|
||||
*/
|
||||
interface ExternalIdObject {
|
||||
isrc?: string,
|
||||
ean?: string,
|
||||
upc?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* External Url Object
|
||||
* [](https://developer.spotify.com/web-api/object-model/)
|
||||
*
|
||||
* Note that there might be other types available, it couldn't be found in the docs.
|
||||
*/
|
||||
interface ExternalUrlObject {
|
||||
spotify: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Followers Object
|
||||
* [](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface FollowersObject {
|
||||
href: string,
|
||||
total: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Image Object
|
||||
* [](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface ImageObject {
|
||||
height?: number,
|
||||
url: string,
|
||||
width?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Base Playlist Object. Does not in itself exist in Spotify Web Api,
|
||||
* but needs to be made since the tracks types vary in the Full and Simplified versions.
|
||||
*/
|
||||
interface PlaylistBaseObject {
|
||||
collaborative: boolean,
|
||||
external_urls: ExternalUrlObject,
|
||||
href: string,
|
||||
id: string,
|
||||
images: ImageObject[],
|
||||
name: string,
|
||||
owner: UserObjectPublic,
|
||||
public: boolean,
|
||||
snapshot_id: string,
|
||||
type: string,
|
||||
uri: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Playlist Object Full
|
||||
* [](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface PlaylistObjectFull extends PlaylistBaseObject {
|
||||
description: string,
|
||||
followers: FollowersObject,
|
||||
tracks: PagingObject<PlaylistTrackObject>
|
||||
}
|
||||
|
||||
/**
|
||||
* Playlist Object Simplified
|
||||
* [](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface PlaylistObjectSimplified extends PlaylistBaseObject {
|
||||
tracks: {
|
||||
href: string,
|
||||
total: number
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The Track Object in Playlists
|
||||
* [](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface PlaylistTrackObject {
|
||||
added_at: string,
|
||||
added_by: UserObjectPublic,
|
||||
is_local: boolean,
|
||||
track: TrackObjectFull
|
||||
}
|
||||
|
||||
/**
|
||||
* Saved Track Object in Playlists
|
||||
* [](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface SavedTrackObject {
|
||||
added_at: string,
|
||||
track: TrackObjectFull
|
||||
}
|
||||
|
||||
/**
|
||||
* Saved Track Object in Playlists
|
||||
* [](https://developer.spotify.com/web-api/object-model/)
|
||||
*/
|
||||
interface SavedAlbumObject {
|
||||
added_at: string,
|
||||
album: AlbumObjectFull
|
||||
}
|
||||
|
||||
/**
|
||||
* Full Track Object
|
||||
* [track object (full)](https://developer.spotify.com/web-api/object-model/#track-object-full)
|
||||
*/
|
||||
interface TrackObjectFull extends TrackObjectSimplified {
|
||||
album: AlbumObjectSimplified,
|
||||
external_ids: ExternalIdObject,
|
||||
popularity: number
|
||||
}
|
||||
|
||||
/**
|
||||
* Simplified Track Object
|
||||
* [track object (simplified)](https://developer.spotify.com/web-api/object-model/#track-object-simplified)
|
||||
*/
|
||||
interface TrackObjectSimplified {
|
||||
artists: ArtistObjectSimplified[],
|
||||
available_markets?: string[],
|
||||
disc_number: number,
|
||||
duration_ms: number,
|
||||
explicit: boolean,
|
||||
external_urls: ExternalUrlObject,
|
||||
href: string,
|
||||
id: string,
|
||||
is_playable?: boolean,
|
||||
linked_from?: TrackLinkObject,
|
||||
name: string,
|
||||
preview_url: string,
|
||||
track_number: number,
|
||||
type: string,
|
||||
uri: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Track Link Object
|
||||
* [](https://developer.spotify.com/web-api/object-model/#track-object-simplified)
|
||||
*/
|
||||
interface TrackLinkObject {
|
||||
external_urls: ExternalUrlObject,
|
||||
href: string,
|
||||
id: string,
|
||||
type: string,
|
||||
uri: string
|
||||
}
|
||||
|
||||
/**
|
||||
* User Object (Private)
|
||||
* [](https://developer.spotify.com/web-api/object-model/#track-object-simplified)
|
||||
*/
|
||||
interface UserObjectPrivate extends UserObjectPublic {
|
||||
birthdate: string,
|
||||
country: string,
|
||||
email: string,
|
||||
product: string
|
||||
}
|
||||
|
||||
/**
|
||||
* User Object (Public)
|
||||
* [](https://developer.spotify.com/web-api/object-model/#track-object-simplified)
|
||||
*/
|
||||
interface UserObjectPublic {
|
||||
display_name?: string,
|
||||
external_urls: ExternalUrlObject,
|
||||
followers?: FollowersObject,
|
||||
href: string,
|
||||
id: string,
|
||||
images?: ImageObject[],
|
||||
type: string,
|
||||
uri: string
|
||||
}
|
||||
|
||||
}
|
||||
44
stripe/stripe.d.ts
vendored
44
stripe/stripe.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for stripe
|
||||
// Project: https://stripe.com/
|
||||
// Definitions by: Andy Hawkins <https://github.com/a904guy/,http://a904guy.com>, Eric J. Smith <https://github.com/ejsmith/>
|
||||
// Definitions by: Andy Hawkins <https://github.com/a904guy/,http://a904guy.com>, Eric J. Smith <https://github.com/ejsmith/>, Amrit Kahlon <https://github.com/amritk/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface StripeStatic {
|
||||
@@ -11,7 +11,8 @@ interface StripeStatic {
|
||||
cardType(cardNumber: string): string;
|
||||
getToken(token: string, responseHandler: (status: number, response: StripeTokenResponse) => void): void;
|
||||
card: StripeCardData;
|
||||
createToken(data: StripeTokenData, responseHandler: (status: number, response: StripeTokenResponse) => void): void;
|
||||
createToken(data: StripeTokenData, responseHandler: (status: number, response: StripeTokenResponse) => void): void;
|
||||
bankAccount: StripeBankAccount;
|
||||
}
|
||||
|
||||
interface StripeTokenData {
|
||||
@@ -40,7 +41,10 @@ interface StripeTokenResponse {
|
||||
}
|
||||
|
||||
interface StripeError {
|
||||
type: string;
|
||||
code: string;
|
||||
message: string;
|
||||
param?: string;
|
||||
}
|
||||
|
||||
interface StripeCardData {
|
||||
@@ -60,7 +64,41 @@ interface StripeCardData {
|
||||
address_country?: string;
|
||||
}
|
||||
|
||||
interface StripeBankAccount
|
||||
{
|
||||
createToken(params: StripeBankTokenParams, stripeResponseHandler: (status:number, response: StripeBankTokenResponse) => void): void;
|
||||
validateRoutingNumber(routingNumber: number | string, countryCode: string): boolean;
|
||||
validateAccountNumber(accountNumber: number | string, countryCode: string): boolean;
|
||||
}
|
||||
|
||||
interface StripeBankTokenParams
|
||||
{
|
||||
country: string;
|
||||
currency: string;
|
||||
account_number: number | string;
|
||||
routing_number?: number | string;
|
||||
}
|
||||
|
||||
interface StripeBankTokenResponse
|
||||
{
|
||||
id: string;
|
||||
bank_account: {
|
||||
id: string;
|
||||
country: string;
|
||||
bank_name: string;
|
||||
last4: number;
|
||||
validated: boolean;
|
||||
object: string;
|
||||
};
|
||||
created: number;
|
||||
livemode: boolean;
|
||||
type: string;
|
||||
object: string;
|
||||
used: boolean;
|
||||
error: StripeError;
|
||||
}
|
||||
|
||||
declare var Stripe: StripeStatic;
|
||||
declare module "Stripe" {
|
||||
export = StripeStatic;
|
||||
export = StripeStatic;
|
||||
}
|
||||
|
||||
24
through/through.d.ts
vendored
24
through/through.d.ts
vendored
@@ -6,19 +6,19 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "through" {
|
||||
import stream = require("stream");
|
||||
import stream = require("stream");
|
||||
|
||||
function through(write?: (data: any) => void,
|
||||
end?: () => void,
|
||||
opts?: {
|
||||
autoDestroy: boolean;
|
||||
}): through.ThroughStream;
|
||||
function through(write?: (data: any) => void,
|
||||
end?: () => void,
|
||||
opts?: {
|
||||
autoDestroy: boolean;
|
||||
}): through.ThroughStream;
|
||||
|
||||
module through {
|
||||
export interface ThroughStream extends stream.Transform {
|
||||
autoDestroy: boolean;
|
||||
}
|
||||
}
|
||||
module through {
|
||||
export interface ThroughStream extends stream.Transform {
|
||||
autoDestroy: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = through;
|
||||
export = through;
|
||||
}
|
||||
|
||||
55
tracking/tracking-tests.ts
Normal file
55
tracking/tracking-tests.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
/// <reference path="tracking.d.ts" />
|
||||
|
||||
// All tracking tests below are code taken verbatim (or, as close as possible) from the tracking docs: https://trackingjs.com/docs.html
|
||||
|
||||
var colors = new tracking.ColorTracker(['magenta', 'cyan', 'yellow']);
|
||||
|
||||
colors.on('track', function(event) {
|
||||
if (event.data.length === 0) {
|
||||
// No colors were detected in this frame.
|
||||
} else {
|
||||
event.data.forEach(function(rect) {
|
||||
console.log(rect.x, rect.y, rect.height, rect.width, rect.color);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
tracking.track('#myVideo', colors);
|
||||
|
||||
var myTracker = new tracking.Tracker('target');
|
||||
|
||||
myTracker.on('track', function(event) {
|
||||
if (event.data.length === 0) {
|
||||
// No targets were detected in this frame.
|
||||
} else {
|
||||
event.data.forEach(function(data) {
|
||||
// Plots the detected targets here.
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var trackerTask = tracking.track('#myVideo', myTracker);
|
||||
|
||||
trackerTask.stop(); // Stops the tracking
|
||||
trackerTask.run(); // Runs it again anytime
|
||||
|
||||
tracking.ColorTracker.registerColor('green', function(r, g, b) {
|
||||
if (r < 50 && g > 200 && b < 50) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
var objects = new tracking.ObjectTracker(['face', 'eye', 'mouth']);
|
||||
|
||||
objects.on('track', function(event) {
|
||||
if (event.data.length === 0) {
|
||||
// No objects were detected in this frame.
|
||||
} else {
|
||||
event.data.forEach(function(rect) {
|
||||
// rect.x, rect.y, rect.height, rect.width
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
tracking.track('#myVideo', objects);
|
||||
40
tracking/tracking.d.ts
vendored
Normal file
40
tracking/tracking.d.ts
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
// Type definitions for Tracking.js v1.1.2
|
||||
// Project: https://github.com/eduardolundgren/tracking.js
|
||||
// Definitions by: Tim Perry <https://github.com/pimterry>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module tracking {
|
||||
export class ColorTracker extends Tracker {
|
||||
constructor(colours: string[]);
|
||||
|
||||
static registerColor(name: string, predicate: (r: number, g: number, b: number) => boolean): void;
|
||||
}
|
||||
|
||||
export class ObjectTracker extends Tracker {
|
||||
constructor(objects: string[]);
|
||||
}
|
||||
|
||||
class Tracker {
|
||||
constructor(target: string);
|
||||
on(eventName: string, callback: (event: TrackEvent) => void): void;
|
||||
}
|
||||
|
||||
interface TrackEvent {
|
||||
data: TrackRect[];
|
||||
}
|
||||
|
||||
interface TrackRect {
|
||||
x: number;
|
||||
y: number;
|
||||
height: number;
|
||||
width: number;
|
||||
color: string;
|
||||
}
|
||||
|
||||
interface TrackerTask {
|
||||
stop(): void;
|
||||
run(): void;
|
||||
}
|
||||
|
||||
export function track(selector: string, tracker: tracking.Tracker): TrackerTask;
|
||||
}
|
||||
117
vue-router/vue-router-tests.ts
Normal file
117
vue-router/vue-router-tests.ts
Normal file
@@ -0,0 +1,117 @@
|
||||
/// <reference path="./vue-router.d.ts" />
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
namespace TestBasic {
|
||||
"use strict";
|
||||
|
||||
var Foo = Vue.extend({
|
||||
template: "<p>This is foo!</p>",
|
||||
route: {
|
||||
canActivate(transition: vuerouter.Transition<any, any, any, any, any>) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var Bar = Vue.extend({
|
||||
template: "<p>This is bar!</p>"
|
||||
});
|
||||
|
||||
var App = Vue.extend({});
|
||||
var app = new App();
|
||||
app.$on("some event", function() {
|
||||
var name: string = app.$route.name;
|
||||
});
|
||||
|
||||
var router = new VueRouter<typeof App.prototype>();
|
||||
|
||||
router.map({
|
||||
"/foo": {
|
||||
component: Foo
|
||||
},
|
||||
"/bar": {
|
||||
component: Bar
|
||||
}
|
||||
});
|
||||
|
||||
router.start(App, "#app");
|
||||
}
|
||||
|
||||
namespace TestAdvanced {
|
||||
"use strict";
|
||||
|
||||
namespace App {
|
||||
|
||||
export class App {
|
||||
authenticating: boolean;
|
||||
|
||||
data() {
|
||||
return {
|
||||
authenticating: false
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Inbox {
|
||||
export class Index {
|
||||
static route: vuerouter.TransitionHook<App.App, any, any, { id: number }, any> = {
|
||||
canActivate: function(transition) {
|
||||
var n: number = transition.to.params.id;
|
||||
transition.next();
|
||||
},
|
||||
activate: function() {
|
||||
return new Promise((resolve) => {
|
||||
resolve();
|
||||
});
|
||||
},
|
||||
deactivate: function({next}) {
|
||||
next();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace RouteConfig {
|
||||
export function configRouter(router: vuerouter.Router<App.App>) {
|
||||
router.map({
|
||||
"/about": {
|
||||
component: {},
|
||||
auth: false
|
||||
},
|
||||
"*": {
|
||||
component: {}
|
||||
}
|
||||
});
|
||||
|
||||
router.redirect({
|
||||
"/info": "/about",
|
||||
"/hello/:userId": "/user/:userId"
|
||||
});
|
||||
|
||||
router.beforeEach((transition) => {
|
||||
if (transition.to.path === "/forbidden") {
|
||||
router.app.authenticating = true;
|
||||
setTimeout(() => {
|
||||
router.app.authenticating = false;
|
||||
alert("");
|
||||
transition.abort();
|
||||
}, 3000);
|
||||
} else {
|
||||
transition.next();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
import configRouter = RouteConfig.configRouter;
|
||||
|
||||
const router = new VueRouter<App.App>({
|
||||
history: true,
|
||||
saveScrollPosition: true
|
||||
});
|
||||
|
||||
configRouter(router);
|
||||
router.start(App, "#app");
|
||||
}
|
||||
91
vue-router/vue-router.d.ts
vendored
Normal file
91
vue-router/vue-router.d.ts
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
// Type definitions for vue-router 0.7.7
|
||||
// Project: https://github.com/vuejs/vue-router
|
||||
// Definitions by: kaorun343 <https://github.com/kaorun343>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../vue/vue.d.ts" />
|
||||
/// <reference path="../es6-promise/es6-promise.d.ts" />
|
||||
|
||||
declare namespace vuerouter {
|
||||
|
||||
interface Transition<RootVueApp, FromParams, FromQuery, ToParams, ToQuery> {
|
||||
from: $route<RootVueApp, FromParams, FromQuery>;
|
||||
to: $route<RootVueApp, ToParams, ToQuery>;
|
||||
next(data?: any): void;
|
||||
abort(reason?: any): void;
|
||||
redirect(path: string): void;
|
||||
}
|
||||
|
||||
interface RouterOption {
|
||||
hashbang?: boolean;
|
||||
history?: boolean;
|
||||
abstract?: boolean;
|
||||
root?: string;
|
||||
linkActiveClass?: string;
|
||||
saveScrollPosition?: boolean;
|
||||
transitionOnLoad?: boolean;
|
||||
suppressTransitionError?: boolean;
|
||||
}
|
||||
|
||||
interface RouterStatic {
|
||||
new <RootVueApp>(option?: RouterOption): Router<RootVueApp>;
|
||||
}
|
||||
|
||||
interface RouteMapObject {
|
||||
component: any;
|
||||
subRoutes?: { [key: string]: RouteMapObject };
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface Router<RootVueApp> {
|
||||
|
||||
app: RootVueApp;
|
||||
mode: string;
|
||||
|
||||
start(App: any, el: string | Element): void;
|
||||
stop(): void;
|
||||
map(routeMap: { [path: string]: RouteMapObject }): void;
|
||||
on(path: string, config: Object): void;
|
||||
go(path: string | Object): void;
|
||||
replace(path: string): void;
|
||||
redirect(redirectMap: Object): void;
|
||||
alias(aliasMap: Object): void;
|
||||
beforeEach<FP, FQ, TP, TQ>(hook: (transition: Transition<RootVueApp, FP, FQ, TP, TQ>) => any): void;
|
||||
afterEach<FP, FQ, TP, TQ>(hook: (transition: Transition<RootVueApp, FP, FQ, TP, TQ>) => any): void;
|
||||
}
|
||||
|
||||
interface $route<RootVueApp, Params, Query> {
|
||||
path: string;
|
||||
params: Params;
|
||||
query: Query;
|
||||
router: Router<RootVueApp>;
|
||||
matched: string[];
|
||||
name: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface TransitionHook<Root, FP, FQ, TP, TQ> {
|
||||
data?(transition?: Transition<Root, FP, FQ, TP, TQ>): Thenable<any> | void;
|
||||
activate?(transition?: Transition<Root, FP, FQ, TP, TQ>): Thenable<any> | void;
|
||||
deactivate?(transition?: Transition<Root, FP, FQ, TP, TQ>): Thenable<any> | void;
|
||||
canActivate?(transition?: Transition<Root, FP, FQ, TP, TQ>): Thenable<any> | boolean | void;
|
||||
canDeactivate?(transition?: Transition<Root, FP, FQ, TP, TQ>): Thenable<any> | boolean | void;
|
||||
canReuse?: boolean | ((transition: Transition<Root, FP, FQ, TP, TQ>) => boolean);
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace vuejs {
|
||||
interface Vue {
|
||||
$route: vuerouter.$route<any, any, any>;
|
||||
}
|
||||
|
||||
interface ComponentOption {
|
||||
route?: vuerouter.TransitionHook<any, any, any, any, any>;
|
||||
}
|
||||
}
|
||||
|
||||
declare var VueRouter: vuerouter.RouterStatic;
|
||||
|
||||
declare module "vue-router" {
|
||||
export = VueRouter;
|
||||
}
|
||||
Reference in New Issue
Block a user