mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Merge remote-tracking branch 'remotes/upstream/types-2.0' into types-2.0
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 6.9.1
|
||||
- 6.9.2
|
||||
|
||||
sudo: false
|
||||
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
import codeFrame from "babel-code-frame";
|
||||
import codeFrame = require("babel-code-frame");
|
||||
|
||||
describe('babel-code-frame', () => {
|
||||
it('frames given code', () => {
|
||||
const code = `
|
||||
const number = 1;
|
||||
var string = 'foo';
|
||||
const code = `
|
||||
const number = 1;
|
||||
var string = 'foo';
|
||||
|
||||
function print(name: string) {
|
||||
console.log(string + name);
|
||||
}
|
||||
`;
|
||||
function print(name: string) {
|
||||
console.log(string + name);
|
||||
}
|
||||
`;
|
||||
|
||||
codeFrame(code, 5, 22);
|
||||
codeFrame(code, 5, 22, { forceColor: true });
|
||||
codeFrame(code, 2, 2, { highlightCode: true });
|
||||
});
|
||||
});
|
||||
codeFrame(code, 5, 22);
|
||||
codeFrame(code, 5, 22, { forceColor: true });
|
||||
codeFrame(code, 2, 2, { highlightCode: true });
|
||||
|
||||
Vendored
+4
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for babel-code-frame 6.16
|
||||
// Type definitions for babel-code-frame 6.20
|
||||
// Project: https://github.com/babel/babel/tree/master/packages
|
||||
// Definitions by: Mohsen Azimi <https://github.com/mohsen1>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -28,9 +28,11 @@ interface BabelCodeFrameOptions {
|
||||
*
|
||||
* @returns Framed code
|
||||
*/
|
||||
export default function babelCodeFrame(
|
||||
declare function codeFrame(
|
||||
rawLines: string,
|
||||
lineNumber: number,
|
||||
colNumber: number,
|
||||
options?: BabelCodeFrameOptions
|
||||
): string;
|
||||
|
||||
export = codeFrame;
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
"mocha"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import contentDisposition = require("content-disposition");
|
||||
|
||||
const noParams = contentDisposition();
|
||||
const withFilenameNoOptions = contentDisposition("EURO rates.txt");
|
||||
const withFilenameAndOptions = contentDisposition("€ rates.txt", { type: "attachment", fallback: "EURO rates.txt" });
|
||||
const noFilename = contentDisposition(undefined, { type: "attachment", fallback: true });
|
||||
|
||||
const res = contentDisposition.parse('attachment; filename="EURO rates.txt"');
|
||||
const type = res.type;
|
||||
const parameters = res.parameters;
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// Type definitions for content-disposition 0.5
|
||||
// Project: https://github.com/jshttp/content-disposition
|
||||
// Definitions by: Stefan Reichel <https://github.com/bomret>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace contentDisposition {
|
||||
export interface ContentDisposition {
|
||||
type: string;
|
||||
parameters: any;
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
type?: string;
|
||||
fallback?: string | boolean;
|
||||
}
|
||||
|
||||
export function parse(contentDispositionHeader: string): ContentDisposition;
|
||||
}
|
||||
|
||||
declare function contentDisposition(): string;
|
||||
declare function contentDisposition(filename: undefined, options: contentDisposition.Options): string;
|
||||
declare function contentDisposition(filename: string, options?: contentDisposition.Options): string;
|
||||
|
||||
export = contentDisposition;
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"content-disposition-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Vendored
+3
-3
@@ -253,9 +253,9 @@ declare module "enzyme" {
|
||||
*
|
||||
* Returns itself.
|
||||
* @param fn A callback to be run for every node in the collection. Should expect a ShallowWrapper as the first
|
||||
* argument, and will be run with a context of the original instance.
|
||||
* argument, index as a second, and will be run with a context of the original instance.
|
||||
*/
|
||||
forEach(fn: (wrapper: this) => any): this;
|
||||
forEach(fn: (wrapper: this, index?: number) => any): this;
|
||||
|
||||
/**
|
||||
* Maps the current array of nodes to another array. Each node is passed in as a ShallowWrapper to the map
|
||||
@@ -470,4 +470,4 @@ declare module "enzyme" {
|
||||
export function describeWithDOM(description: String, fn: Function): void;
|
||||
|
||||
export function spyLifecycle(component: typeof Component): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
import * as fs from "fs-promise";
|
||||
|
||||
var src: string;
|
||||
var dst: string;
|
||||
var dir: string;
|
||||
var path: string;
|
||||
var data: any;
|
||||
var writeOptions: fs.WriteOptions;
|
||||
var writeJsonOptions: fs.WriteJsonOptions;
|
||||
var readJsonOptions: fs.ReadJsonOptions;
|
||||
|
||||
async function test() {
|
||||
await fs.copy(src, dst);
|
||||
await fs.emptyDir(dir);
|
||||
await fs.emptydir(dir);
|
||||
await fs.ensureFile(path);
|
||||
await fs.createFile(path);
|
||||
await fs.ensureDir(dir);
|
||||
await fs.ensureLink(src, dst);
|
||||
await fs.createLink(src, dst);
|
||||
await fs.ensureSymlink(src, dst);
|
||||
await fs.ensureSymlink(src, dst, "dir");
|
||||
await fs.ensureSymlink(src, dst, "file");
|
||||
await fs.ensureSymlink(src, dst, "junction");
|
||||
await fs.createSymlink(src, dst, "dir");
|
||||
await fs.mkdirs(dir);
|
||||
await fs.mkdirp(dir);
|
||||
await fs.move(src, dst);
|
||||
await fs.outputFile(path, "test");
|
||||
await fs.outputFile(path, "test", writeOptions);
|
||||
await fs.outputFile(path, new Buffer([1,2]));
|
||||
await fs.outputFile(path, new Buffer([1,2]), writeOptions);
|
||||
await fs.outputJson(path, data);
|
||||
await fs.outputJson(path, data, writeJsonOptions);
|
||||
await fs.outputJSON(path, data, writeJsonOptions);
|
||||
let json = await fs.readJson(path);
|
||||
json = await fs.readJson(path, readJsonOptions);
|
||||
json = await fs.readJSON(path, readJsonOptions);
|
||||
await fs.remove(path);
|
||||
let dirs: string[] = await fs.walk(dir);
|
||||
await fs.writeJson(path, data);
|
||||
await fs.writeJson(path, data, writeJsonOptions);
|
||||
await fs.writeJSON(path, data, writeJsonOptions);
|
||||
return dirs;
|
||||
}
|
||||
|
||||
test().then((dirs: string[]) => {
|
||||
console.log(dirs);
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
// Type definitions for fs-promise 1.0
|
||||
// Project: https://github.com/kevinbeaty/fs-promise#readme
|
||||
// Definitions by: Thiago de Arruda <https://github.com/tarruda>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export * from "mz/fs";
|
||||
|
||||
export interface WriteOptions {
|
||||
encoding?: string;
|
||||
mode?: number;
|
||||
flag?: string;
|
||||
}
|
||||
|
||||
type JsonReplacerArray = Array<number | string>;
|
||||
|
||||
type JsonReplacerFunction = (key: any, value: any) => any;
|
||||
|
||||
type JsonReplacer = JsonReplacerArray | JsonReplacerFunction;
|
||||
|
||||
export interface WriteJsonOptions extends WriteOptions {
|
||||
spaces?: number;
|
||||
replacer?: JsonReplacer;
|
||||
}
|
||||
|
||||
export interface ReadJsonOptions {
|
||||
encoding: string;
|
||||
flag?: string;
|
||||
reviver: (key: any, value: any) => any;
|
||||
}
|
||||
|
||||
export function copy(src: string, dst: string): Promise<void>;
|
||||
export function emptyDir(dir: string): Promise<void>;
|
||||
export function ensureFile(file: string): Promise<void>;
|
||||
export function ensureDir(dir: string): Promise<void>;
|
||||
export function ensureLink(srcpath: string, dstpath: string): Promise<void>;
|
||||
export function ensureSymlink(srcpath: string, dstpath: string, type?: "dir" | "file" | "junction"): Promise<void>;
|
||||
export function mkdirs(dir: string): Promise<void>;
|
||||
export function move(src: string, dst: string): Promise<void>;
|
||||
export function outputFile(file: string, data: string | Buffer, options?: WriteOptions): Promise<void>;
|
||||
export function outputJson(file: string, data: any, options?: WriteJsonOptions): Promise<void>;
|
||||
export function readJson(file: string, options?: ReadJsonOptions): Promise<any>;
|
||||
export function remove(path: string): Promise<void>;
|
||||
export function walk(dir: string): Promise<string[]>;
|
||||
export function writeJson(file: string, data: any, options?: WriteJsonOptions): Promise<void>;
|
||||
|
||||
// aliases
|
||||
export {
|
||||
emptyDir as emptydir,
|
||||
ensureFile as createFile,
|
||||
ensureLink as createLink,
|
||||
ensureSymlink as createSymlink,
|
||||
mkdirs as mkdirp,
|
||||
outputJson as outputJSON,
|
||||
readJson as readJSON,
|
||||
writeJson as writeJSON
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"fs-promise-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
@@ -8,9 +8,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
"graphql"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/// <reference types="mocha" />
|
||||
declare var expect: any;
|
||||
|
||||
import id = require('incremental-dom');
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
"mocha"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// Type definitions for is-binary-path 2.0
|
||||
// Project: https://github.com/sindresorhus/is-binary-path
|
||||
// Definitions by: Daniel Rosenwasser <https://github.com/DanielRosenwasser>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = is_binary_path;
|
||||
declare function is_binary_path(filepath: string): boolean;
|
||||
@@ -0,0 +1,5 @@
|
||||
import isBinaryPath = require("is-binary-path");
|
||||
|
||||
let a: boolean = isBinaryPath("src/unicorn.png");
|
||||
|
||||
let b: boolean = isBinaryPath("src/unicorn.txt");
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"is-binary-path-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
@@ -8,9 +8,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
// Type definitions for koa-pug 3.0
|
||||
// Project: https://github.com/chrisyip/koa-pug
|
||||
// Definitions by: Xavier Stouder <https://github.com/Xstoudi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as koa from "koa";
|
||||
|
||||
export namespace Koa {
|
||||
interface Context {
|
||||
render(viewPath: string, locals?: Pug.PugLocals, overrideOpts?: Pug.PugCtxOptions, noCache?: boolean): void;
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
render(pugStr: string, locals?: Pug.PugLocals, overrideOpts?: Pug.PugCtxOptions): void;
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
render(pugStr: string, locals?: Pug.PugLocals, noCache?: boolean): void;
|
||||
}
|
||||
}
|
||||
export class Pug {
|
||||
constructor(options?: Pug.PugOptions);
|
||||
use(app: koa): void;
|
||||
}
|
||||
export namespace Pug {
|
||||
export interface PugOptions {
|
||||
viewPath?: string;
|
||||
pretty?: boolean;
|
||||
compileDebug?: boolean;
|
||||
debug?: boolean;
|
||||
locals?: PugLocals;
|
||||
noCache?: boolean;
|
||||
helperPath?: string | Array<string | { [str: string]: any }>;
|
||||
basedir?: string;
|
||||
app?: koa;
|
||||
}
|
||||
export interface PugCtxOptions extends PugOptions {
|
||||
fromString: boolean;
|
||||
}
|
||||
export interface PugLocals { [str: string]: any; }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"koa-pug-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// Type definitions for meow 3.6
|
||||
// Project: https://github.com/sindresorhus/meow
|
||||
// Definitions by: KnisterPeter <https://github.com/KnisterPeter>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as minimist from 'minimist';
|
||||
|
||||
declare function meow(options: string | string[] | meow.Options, minimistOptions?: minimist.Opts): meow.Result;
|
||||
declare namespace meow {
|
||||
|
||||
export interface Options {
|
||||
description?: string | boolean;
|
||||
help?: string | boolean;
|
||||
version?: string | boolean;
|
||||
pkg?: any;
|
||||
argv?: string[];
|
||||
inferType?: boolean;
|
||||
}
|
||||
|
||||
export interface Result {
|
||||
input: string[];
|
||||
flags: { [name: string]: any };
|
||||
pkg: any;
|
||||
help: string;
|
||||
showHelp(code: number): void;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export = meow;
|
||||
@@ -0,0 +1,19 @@
|
||||
import meow = require('meow');
|
||||
import Options = meow.Options;
|
||||
|
||||
var options: Options = {};
|
||||
options.description = true;
|
||||
options.description = 'string';
|
||||
options.help = true;
|
||||
options.help = 'string';
|
||||
options.version = true;
|
||||
options.version = 'string';
|
||||
options.argv = ['string', 'string'];
|
||||
options.inferType = true;
|
||||
|
||||
meow(options);
|
||||
meow('Usage text', {
|
||||
alias: {
|
||||
opt: 'opt'
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"meow-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "../tslint.json"
|
||||
}
|
||||
Vendored
+1
-1
@@ -717,7 +717,7 @@ declare module "mongoose" {
|
||||
/** defaults to true */
|
||||
validateBeforeSave?: boolean;
|
||||
/** defaults to "__v" */
|
||||
versionKey?: string;
|
||||
versionKey?: string|boolean;
|
||||
/**
|
||||
* skipVersioning allows excluding paths from
|
||||
* versioning (the internal revision will not be
|
||||
|
||||
+1
-3
@@ -8,9 +8,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
Vendored
+1070
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,22 @@
|
||||
/// <reference path="index.d.ts" />
|
||||
|
||||
import hue = require('node-hue-api');
|
||||
|
||||
hue.nupnpSearch().then(function (bridges) {
|
||||
if (!bridges || !bridges[0]) {
|
||||
throw "No bridge found";
|
||||
}
|
||||
let ip = bridges[0].ipaddress;
|
||||
//First load username from file. Register if there's no file.
|
||||
let api = new hue.HueApi();
|
||||
api.registerUser(ip).then(newUser => {
|
||||
console.log("Created Hue user: " + JSON.stringify(newUser));
|
||||
}).then(listScenes.bind(this, api));
|
||||
})
|
||||
|
||||
|
||||
function listScenes(api: hue.HueApi) {
|
||||
return api.getScenes().then(function (scenes) {
|
||||
return console.log(scenes.map(s => s.name).join(", "));
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"node-hue-api-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+5
-2
@@ -1,5 +1,5 @@
|
||||
// Type definitions for passport-facebook 1.0.3
|
||||
// Project: https://github.com/jaredhanson/passport-facebook
|
||||
// Type definitions for passport-twitter 1.0.4
|
||||
// Project: https://github.com/jaredhanson/passport-twitter
|
||||
// Definitions by: James Roland Cabresos <https://github.com/staticfunction>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -24,6 +24,9 @@ interface IStrategyOption {
|
||||
consumerSecret: string;
|
||||
callbackURL: string;
|
||||
|
||||
passReqToCallback?: true;
|
||||
includeEmail?: true;
|
||||
|
||||
reguestTokenURL?: string;
|
||||
accessTokenURL?: string;
|
||||
userAuthorizationURL?: string;
|
||||
|
||||
@@ -15,7 +15,9 @@ var User = {
|
||||
passport.use(new twitter.Strategy({
|
||||
consumerKey: process.env.PASSPORT_TWITTER_CONSUMER_KEY,
|
||||
consumerSecret: process.env.PASSPORT_TWITTER_CONSUMER_SECRET,
|
||||
callbackURL: process.env.PASSPORT_TWITTER_CALLBACK_URL
|
||||
callbackURL: process.env.PASSPORT_TWITTER_CALLBACK_URL,
|
||||
passReqToCallback : true,
|
||||
includeEmail: true
|
||||
},
|
||||
function(accessToken:string, refreshToken:string, profile:twitter.Profile, done:(error:any, user?:any) => void) {
|
||||
User.findOrCreate(profile.id, profile.provider, function(err, user) {
|
||||
|
||||
Vendored
-2
@@ -3,8 +3,6 @@
|
||||
// Definitions by: John Cant <https://github.com/johncant/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
/// <reference types="jasmine" />
|
||||
/// <reference types="selenium-webdriver" />
|
||||
|
||||
// ElementArrayFinder
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
/// <reference types="jasmine" />
|
||||
|
||||
import helpers = require('protractor-helpers');
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"types": ["jasmine", "selenium-webdriver"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"types": ["selenium-webdriver"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"paths": {
|
||||
"*": ["*", "react-daterange-picker/node_modules/*"]
|
||||
},
|
||||
"types": ["moment-range", "react"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": ["react"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
Vendored
+25
-2
@@ -103,8 +103,31 @@ declare module "react-relay" {
|
||||
renderFailure?(error: Error, retry: Function): JSX.Element
|
||||
}
|
||||
|
||||
type ReadyStateEvent =
|
||||
'ABORT' |
|
||||
'CACHE_RESTORED_REQUIRED' |
|
||||
'CACHE_RESTORE_FAILED' |
|
||||
'CACHE_RESTORE_START' |
|
||||
'NETWORK_QUERY_ERROR' |
|
||||
'NETWORK_QUERY_RECEIVED_ALL' |
|
||||
'NETWORK_QUERY_RECEIVED_REQUIRED' |
|
||||
'NETWORK_QUERY_START' |
|
||||
'STORE_FOUND_ALL' |
|
||||
'STORE_FOUND_REQUIRED';
|
||||
|
||||
interface OnReadyStateChange {
|
||||
(readyState: {
|
||||
ready: boolean,
|
||||
done: boolean,
|
||||
stale: boolean,
|
||||
error?: Error,
|
||||
events: Array<ReadyStateEvent>,
|
||||
aborted: boolean
|
||||
}): void
|
||||
}
|
||||
|
||||
interface RelayProp {
|
||||
variables: any
|
||||
setVariables(variables: Object): void
|
||||
variables: any
|
||||
setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
"react"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
Vendored
+2
-1
@@ -2179,7 +2179,8 @@ declare namespace React {
|
||||
stopColor?: string;
|
||||
stopOpacity?: number | string;
|
||||
stroke?: string;
|
||||
strokeDasharray?: string;
|
||||
strokeDasharray?: string | number;
|
||||
strokeDashoffset?: string | number;
|
||||
strokeLinecap?: "butt" | "round" | "square" | "inherit";
|
||||
strokeLinejoin?: "miter" | "round" | "bevel" | "inherit";
|
||||
strokeMiterlimit?: string;
|
||||
|
||||
@@ -341,13 +341,17 @@ React.DOM.svg({
|
||||
x: 22,
|
||||
y: 10,
|
||||
width: 4,
|
||||
height: 28
|
||||
height: 28,
|
||||
strokeDasharray: '30%',
|
||||
strokeDashoffset: '20%'
|
||||
}),
|
||||
React.DOM.rect({
|
||||
x: 10,
|
||||
y: 22,
|
||||
width: 28,
|
||||
height: 4
|
||||
height: 4,
|
||||
strokeDasharray: 30,
|
||||
strokeDashoffset: 20
|
||||
}),
|
||||
React.DOM.path({
|
||||
d: "M0,0V3H3V0ZM1,1V2H2V1Z",
|
||||
|
||||
Vendored
+2
@@ -3,6 +3,8 @@
|
||||
// Definitions by: Alexandro Libertino <https://github.com/arvitaly>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import BluebirdPromise = require("bluebird");
|
||||
declare namespace Waterline {
|
||||
type Adapter = Object;
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
"node",
|
||||
"bluebird"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
// Type definitions for xml 1.0
|
||||
// Project: http://github.com/dylang/node-xml
|
||||
// Definitions by: Jianrong Yu <https://github.com/YuJianrong>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
interface Option {
|
||||
/**
|
||||
* String used for tab, defaults to no tabs (compressed)
|
||||
*/
|
||||
indent?: string;
|
||||
/**
|
||||
* Return the result as a `stream` (default false)
|
||||
*/
|
||||
stream?: boolean;
|
||||
/**
|
||||
* Add default xml declaration (default false)
|
||||
*/
|
||||
declaration?: boolean | {
|
||||
encoding?: string;
|
||||
standalone?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface XmlAttrs {
|
||||
[attr: string]: string;
|
||||
}
|
||||
interface XmlDescArray {
|
||||
[index: number]: { _attr: XmlAttrs } | XmlObject;
|
||||
}
|
||||
interface ElementObject {
|
||||
push(xmlObject: XmlObject): void;
|
||||
close(xmlObject?: XmlObject): void;
|
||||
}
|
||||
|
||||
type XmlAtom = string | number | boolean;
|
||||
type XmlDesc = { _attr: XmlAttrs } | { _cdata: string } | { _attr: XmlAttrs, _cdata: string } | XmlAtom | XmlAtom[] | XmlDescArray;
|
||||
type XmlObject = { [tag: string]: ElementObject | XmlDesc } | XmlDesc;
|
||||
|
||||
declare namespace xml {
|
||||
function element(...xmlObjects: XmlObject[]): ElementObject;
|
||||
function Element(...xmlObjects: XmlObject[]): ElementObject;
|
||||
}
|
||||
|
||||
declare function xml(xmlObject: XmlObject | XmlObject[], options: { stream: true, indent?: string }): NodeJS.ReadableStream;
|
||||
declare function xml(xmlObject?: XmlObject | XmlObject[], options?: boolean | string | Option): string;
|
||||
|
||||
export = xml;
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"xml-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
@@ -0,0 +1,163 @@
|
||||
// Code get from the test file of http://github.com/dylang/node-xml
|
||||
|
||||
import * as xml from "xml";
|
||||
|
||||
interface Tester {
|
||||
is(a: any, b: any): void;
|
||||
same(a: any, b: any): void;
|
||||
plan(id: number): void;
|
||||
ok(a: any): void;
|
||||
};
|
||||
|
||||
function test(c: string, f: (t: Tester) => void) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
test('no elements', t => {
|
||||
t.is(xml(), '');
|
||||
t.is(xml([]), '');
|
||||
t.is(xml('test'), 'test');
|
||||
t.is(xml('scotch & whisky'), 'scotch & whisky');
|
||||
t.is(xml('bob\'s escape character'), 'bob's escape character');
|
||||
});
|
||||
|
||||
test('simple options', t => {
|
||||
t.is(xml([{a: {}}]), '<a/>');
|
||||
t.is(xml([{a: null}]), '<a/>');
|
||||
t.is(xml([{a: []}]), '<a></a>');
|
||||
t.is(xml([{a: -1}]), '<a>-1</a>');
|
||||
t.is(xml([{a: false}]), '<a>false</a>');
|
||||
t.is(xml([{a: 'test'}]), '<a>test</a>');
|
||||
t.is(xml({a: {}}), '<a/>');
|
||||
t.is(xml({a: null}), '<a/>');
|
||||
t.is(xml({a: []}), '<a></a>');
|
||||
t.is(xml({a: -1}), '<a>-1</a>');
|
||||
t.is(xml({a: false}), '<a>false</a>');
|
||||
t.is(xml({a: 'test'}), '<a>test</a>');
|
||||
t.is(xml([{a: 'test'}, {b: 123}, {c: -0.5}]), '<a>test</a><b>123</b><c>-0.5</c>');
|
||||
});
|
||||
|
||||
test('deeply nested objects', t => {
|
||||
t.is(xml([{a: [{b: [{c: 1}, {c: 2}, {c: 3}]}]}]), '<a><b><c>1</c><c>2</c><c>3</c></b></a>');
|
||||
});
|
||||
|
||||
test('indents property', t => {
|
||||
t.is(xml([{a: [{b: [{c: 1}, {c: 2}, {c: 3}]}]}], true), '<a>\n <b>\n <c>1</c>\n <c>2</c>\n <c>3</c>\n </b>\n</a>');
|
||||
t.is(xml([{a: [{b: [{c: 1}, {c: 2}, {c: 3}]}]}], ' '), '<a>\n <b>\n <c>1</c>\n <c>2</c>\n <c>3</c>\n </b>\n</a>');
|
||||
t.is(xml([{a: [{b: [{c: 1}, {c: 2}, {c: 3}]}]}], '\t'), '<a>\n\t<b>\n\t\t<c>1</c>\n\t\t<c>2</c>\n\t\t<c>3</c>\n\t</b>\n</a>');
|
||||
t.is(xml({guid: [{_attr: {premalink: true}}, 'content']}, true), '<guid premalink="true">content</guid>');
|
||||
});
|
||||
|
||||
test('supports xml attributes', t => {
|
||||
t.is(xml([{b: {_attr: {}}}]), '<b/>');
|
||||
t.is(xml([{
|
||||
a: {
|
||||
_attr: {
|
||||
attribute1: 'some value',
|
||||
attribute2: 12345
|
||||
}
|
||||
}
|
||||
}]), '<a attribute1="some value" attribute2="12345"/>');
|
||||
t.is(xml([{
|
||||
a: [{
|
||||
_attr: {
|
||||
attribute1: 'some value',
|
||||
attribute2: 12345
|
||||
}
|
||||
}]
|
||||
}]), '<a attribute1="some value" attribute2="12345"></a>');
|
||||
t.is(xml([{
|
||||
a: [{
|
||||
_attr: {
|
||||
attribute1: 'some value',
|
||||
attribute2: 12345
|
||||
}
|
||||
}, 'content']
|
||||
}]), '<a attribute1="some value" attribute2="12345">content</a>');
|
||||
});
|
||||
|
||||
test('supports cdata', t => {
|
||||
t.is(xml([{a: {_cdata: 'This is some <strong>CDATA</strong>'}}]), '<a><![CDATA[This is some <strong>CDATA</strong>]]></a>');
|
||||
t.is(xml([{
|
||||
a: {
|
||||
_attr: {attribute1: 'some value', attribute2: 12345},
|
||||
_cdata: 'This is some <strong>CDATA</strong>'
|
||||
}
|
||||
}]), '<a attribute1="some value" attribute2="12345"><![CDATA[This is some <strong>CDATA</strong>]]></a>');
|
||||
t.is(xml([{a: {_cdata: 'This is some <strong>CDATA</strong> with ]]> and then again ]]>'}}]), '<a><![CDATA[This is some <strong>CDATA</strong> with ]]]]><![CDATA[> and then again ]]]]><![CDATA[>]]></a>');
|
||||
});
|
||||
|
||||
test('supports encoding', t => {
|
||||
t.is(xml([{
|
||||
a: [{
|
||||
_attr: {
|
||||
anglebrackets: 'this is <strong>strong</strong>',
|
||||
url: 'http://google.com?s=opower&y=fun'
|
||||
}
|
||||
}, 'text']
|
||||
}]), '<a anglebrackets="this is <strong>strong</strong>" url="http://google.com?s=opower&y=fun">text</a>');
|
||||
});
|
||||
|
||||
test('supports stream interface', t => {
|
||||
const elem = xml.element({_attr: {decade: '80s', locale: 'US'}});
|
||||
const xmlStream = xml({toys: elem}, {stream: true});
|
||||
const results = ['<toys decade="80s" locale="US">', '<toy>Transformers</toy>', '<toy><name>He-man</name></toy>', '<toy>GI Joe</toy>', '</toys>'];
|
||||
|
||||
elem.push({toy: 'Transformers'});
|
||||
elem.push({toy: [{name: 'He-man'}]});
|
||||
elem.push({toy: 'GI Joe'});
|
||||
elem.close();
|
||||
|
||||
xmlStream.on('data', (stanza: any[]) => {
|
||||
t.is(stanza, results.shift());
|
||||
});
|
||||
|
||||
return new Promise( (resolve, reject) => {
|
||||
xmlStream.on('close', () => {
|
||||
t.same(results, []);
|
||||
resolve();
|
||||
});
|
||||
xmlStream.on('error', reject);
|
||||
});
|
||||
});
|
||||
|
||||
test('streams end properly', t => {
|
||||
const elem = xml.element({ _attr: { decade: '80s', locale: 'US'} });
|
||||
const xmlStream = xml({ toys: elem }, { stream: true });
|
||||
|
||||
let gotData = false;
|
||||
|
||||
t.plan(7);
|
||||
|
||||
elem.push({ toy: 'Transformers' });
|
||||
elem.push({ toy: 'GI Joe' });
|
||||
elem.push({ toy: [{name:'He-man'}] });
|
||||
elem.close();
|
||||
|
||||
xmlStream.on('data', (data: any) => {
|
||||
t.ok(data);
|
||||
gotData = true;
|
||||
});
|
||||
|
||||
xmlStream.on('end', () => {
|
||||
t.ok(gotData);
|
||||
});
|
||||
|
||||
return new Promise( (resolve, reject) => {
|
||||
xmlStream.on('close', () => {
|
||||
t.ok(gotData);
|
||||
resolve();
|
||||
});
|
||||
xmlStream.on('error', reject);
|
||||
});
|
||||
});
|
||||
|
||||
test('xml declaration options', t => {
|
||||
t.is(xml([{a: 'test'}], {declaration: true}), '<?xml version="1.0" encoding="UTF-8"?><a>test</a>');
|
||||
t.is(xml([{a: 'test'}], {declaration: {encoding: 'foo'}}), '<?xml version="1.0" encoding="foo"?><a>test</a>');
|
||||
t.is(xml([{a: 'test'}], {declaration: {standalone: 'yes'}}), '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><a>test</a>');
|
||||
t.is(xml([{a: 'test'}], {declaration: false}), '<a>test</a>');
|
||||
t.is(xml([{a: 'test'}], {declaration: true, indent: '\n'}), '<?xml version="1.0" encoding="UTF-8"?>\n<a>test</a>');
|
||||
t.is(xml([{a: 'test'}], {}), '<a>test</a>');
|
||||
});
|
||||
Reference in New Issue
Block a user