Resolve conflicts and improve ToggleButton and ToggleButtonGroup

This commit is contained in:
Karol Janyst
2017-09-07 09:58:15 +09:00
395 changed files with 10004 additions and 1596 deletions
-3
View File
@@ -23,8 +23,5 @@
"devDependencies": {
"dtslint": "github:Microsoft/dtslint#production",
"types-publisher": "Microsoft/types-publisher#production"
},
"dependencies": {
"@egjs/axes": "^2.0.0"
}
}
+10 -1
View File
@@ -39,7 +39,16 @@ function fix(config: any): any {
const out: any = {};
for (const key in config) {
let value = config[key];
out[key] = value;
out[key] = key === "rules" ? fixRules(value) : value;
}
return out;
}
function fixRules(rules: any): any {
const out: any = {};
for (const key in rules) {
out[key] = rules[key];
}
return out;
}
-147
View File
@@ -1,147 +0,0 @@
const {get} = require('https')
const {readdir, readFile, writeFile} = require('fs')
const {join, extname, basename, dirname, relative} = require('path')
const token = process.env.GITHUB_ACCESS_TOKEN || ''
const toMixedCase = (name) => {
let dist = name[0].toUpperCase()
for (let i = 1; i < name.length; i++) {
const c = name[i]
if (c !== '-') {
dist += c
continue
}
i++
dist += name[i].toUpperCase()
}
return dist
}
const github = (path) => new Promise((resolve, reject) => {
get({
headers: {'user-agent': 'DefinitelyTyped/material-ui/generate'},
host: 'api.github.com',
path,
}, (res) => {
if ((res.statusCode / 100 >> 0) != 2) {
reject(`GitHub response: ${res.statusCode} ${res.statusMessage}`)
return
}
let data = '';
res
.on('data', (chunk) => data += chunk)
.on('end', () => resolve(JSON.parse(data)))
}).on('error', reject)
})
const categories = () => github(`/repos/callemall/material-ui/contents/src/svg-icons?ref=master&access_token=${token}`)
const contents = (path) => github(`/repos/callemall/material-ui/contents/${path}?ref=master&access_token=${token}`)
const collator = new Intl.Collator()
const resolvePath = (filename) => join(__dirname, '../../types/material-ui', filename)
const readText = (filename) => new Promise((resolve, reject) => {
readFile(resolvePath(filename), 'utf8', (err, data) => {
if (err != null) {
reject(err)
return
}
resolve(data)
})
})
const writeText = (filename, text) => new Promise((resolve, reject) => {
writeFile(resolvePath(filename), text, 'utf8', (err) => {
if (err != null) {
reject(err)
return
}
resolve()
})
})
const inject = (content) => {
content.category = this.name
return content
}
const rMark = /(\/{2} \{{3})[\s\S]*?(\/{2} \}{3})/g
categories()
.then((cats) => Promise.all(Array.prototype.map.call(cats, (cat) => contents(cat.path)
.then((cons) => Array.prototype.map.call(cons, (con) => {
con.category = cat.name
return con
}))
)))
.then((contentsList) => Array.prototype.concat.apply([], contentsList)
.map((content) => {
const {path} = content
const name = basename(path, extname(path))
content.id = join(relative('src', dirname(path)), name)
content.className = toMixedCase(content.category) + toMixedCase(name)
return content
})
.sort((a, b) => collator.compare(a.id, b.id))
.reduce((prev, content) => {
const {dts, test} = prev
dts.individuals.push(`declare module 'material-ui/${content.id}' {
export import ${content.className} = __MaterialUI.SvgIcon;
export default ${content.className};
}`)
dts.summarizeds.push(` export import ${content.className} = __MaterialUI.SvgIcon; // require('material-ui/${content.id}');`)
test.individuals.push(`import _${content.className} from 'material-ui/${content.id}';`)
test.summarizeds.push(` ${content.className},`)
return prev
}, {
dts: {individuals: [], summarizeds: []},
test: {individuals: [], summarizeds: []},
})
)
.then(({dts, test}) => {
return Promise.all([
(() => {
const {individuals, summarizeds} = dts
const file = 'index.d.ts'
let index = 0
return readText(file)
.then((script) => writeText(file, script.replace(rMark, (_, p1, p2) => {
let text = ''
switch (index) {
case 0:
text = individuals.join('\n\n')
break
case 1:
text = summarizeds.join('\n')
break
}
index++
return p1 + '\n' + text + '\n' + p2
})))
})(),
(() => {
const {individuals, summarizeds} = test
const file = join('material-ui-tests.tsx')
let index = 0
return readText(file)
.then((script) => writeText(file, script.replace(rMark, (_, p1, p2) => {
let text = ''
switch (index) {
case 0:
text = individuals.join('\n')
break
case 1:
text = summarizeds.join('\n')
break
}
index++
return p1 + '\n' + text + '\n' + p2
})))
})(),
])
})
.catch((err) => console.error(err))
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-any-union": false
}
}
+2
View File
@@ -5,9 +5,11 @@
"align": false,
"no-namespace": false,
"strict-export-declare-modifiers": false,
"no-any-union": false,
"no-boolean-literal-compare": false,
"no-mergeable-namespace": false,
"no-single-declare-module": false,
"no-unnecessary-generics": false,
"no-unnecessary-qualifier": false,
"unified-signatures": false,
"space-before-function-paren": false
+4 -1
View File
@@ -1,3 +1,6 @@
{
"extends": "dtslint/dt.json"
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -8,6 +8,7 @@
"no-object-literal-type-assertion": false,
"ban-types": false,
"space-before-function-paren": false,
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
+124 -158
View File
@@ -1,25 +1,24 @@
// near copy of each of the tests from https://github.com/nodeca/argparse/tree/master/examples
import { ArgumentParser, RawDescriptionHelpFormatter } from 'argparse';
var args: any;
let args: any;
var simpleExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse example',
const simpleExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse example',
});
simpleExample.addArgument(
['-f', '--foo'],
{
help: 'foo bar',
}
['-f', '--foo'],
{
help: 'foo bar',
}
);
simpleExample.addArgument(
['-b', '--bar'],
{
help: 'bar foo',
}
['-b', '--bar'],
{
help: 'bar foo',
}
);
simpleExample.printHelp();
@@ -35,13 +34,10 @@ args = simpleExample.parseArgs('--foo 5 --bar 6'.split(' '));
console.dir(args);
console.log('-----------');
var choicesExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse examples: choice'
const choicesExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse examples: choice'
});
choicesExample.addArgument(['foo'], { choices: 'abc' });
@@ -55,56 +51,53 @@ console.log('-----------');
// choicesExample.parseArgs(['X']);
// console.dir(args);
var constantExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse examples: constant'
const constantExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse examples: constant'
});
constantExample.addArgument(
['-a'],
{
action: 'storeConst',
dest: 'answer',
help: 'store constant',
constant: 42
}
['-a'],
{
action: 'storeConst',
dest: 'answer',
help: 'store constant',
constant: 42
}
);
constantExample.addArgument(
['--str'],
{
action: 'appendConst',
dest: 'types',
help: 'append constant "str" to types',
constant: 'str'
}
['--str'],
{
action: 'appendConst',
dest: 'types',
help: 'append constant "str" to types',
constant: 'str'
}
);
constantExample.addArgument(
['--int'],
{
action: 'appendConst',
dest: 'types',
help: 'append constant "int" to types',
constant: 'int'
}
['--int'],
{
action: 'appendConst',
dest: 'types',
help: 'append constant "int" to types',
constant: 'int'
}
);
constantExample.addArgument(
['--true'],
{
action: 'storeTrue',
help: 'store true constant'
}
['--true'],
{
action: 'storeTrue',
help: 'store true constant'
}
);
constantExample.addArgument(
['--false'],
{
action: 'storeFalse',
help: 'store false constant'
}
['--false'],
{
action: 'storeFalse',
help: 'store false constant'
}
);
constantExample.printHelp();
@@ -113,27 +106,24 @@ console.log('-----------');
args = constantExample.parseArgs('-a --str --int --true'.split(' '));
console.dir(args);
var nargsExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse examples: nargs'
const nargsExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse examples: nargs'
});
nargsExample.addArgument(
['-f', '--foo'],
{
help: 'foo bar',
nargs: 1
}
['-f', '--foo'],
{
help: 'foo bar',
nargs: 1
}
);
nargsExample.addArgument(
['-b', '--bar'],
{
help: 'bar foo',
nargs: '*'
}
['-b', '--bar'],
{
help: 'bar foo',
nargs: '*'
}
);
nargsExample.printHelp();
@@ -145,40 +135,34 @@ console.log('-----------');
args = nargsExample.parseArgs('--bar b c f --foo a'.split(' '));
console.dir(args);
var parent_parser = new ArgumentParser({ addHelp: false });
const parent_parser = new ArgumentParser({ addHelp: false });
// note addHelp:false to prevent duplication of the -h option
parent_parser.addArgument(
['--parent'],
{ type: 'int', help: 'parent' }
['--parent'],
{ type: 'int', help: 'parent' }
);
var foo_parser = new ArgumentParser({
parents: [parent_parser],
description: 'child1'
const foo_parser = new ArgumentParser({
parents: [parent_parser],
description: 'child1'
});
foo_parser.addArgument(['foo']);
args = foo_parser.parseArgs(['--parent', '2', 'XXX']);
console.log(args);
var bar_parser = new ArgumentParser({
parents: [parent_parser],
description: 'child2'
const bar_parser = new ArgumentParser({
parents: [parent_parser],
description: 'child2'
});
bar_parser.addArgument(['--bar']);
args = bar_parser.parseArgs(['--bar', 'YYY']);
console.log(args);
var prefixCharsExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse examples: prefix_chars',
prefixChars: '-+'
const prefixCharsExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse examples: prefix_chars',
prefixChars: '-+'
});
prefixCharsExample.addArgument(['+f', '++foo']);
prefixCharsExample.addArgument(['++bar'], { action: 'storeTrue' });
@@ -193,39 +177,36 @@ console.dir(args);
args = prefixCharsExample.parseArgs(['++foo', '2', '++bar']);
console.dir(args);
var subparserExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse examples: sub-commands'
const subparserExample = new ArgumentParser({
version: '0.0.1',
addHelp: true,
description: 'Argparse examples: sub-commands'
});
var subparsers = subparserExample.addSubparsers({
title: 'subcommands',
dest: "subcommand_name"
const subparsers = subparserExample.addSubparsers({
title: 'subcommands',
dest: "subcommand_name"
});
var bar = subparsers.addParser('c1', { addHelp: true, help: 'c1 help' });
let bar = subparsers.addParser('c1', { addHelp: true, help: 'c1 help' });
bar.addArgument(
['-f', '--foo'],
{
action: 'store',
help: 'foo3 bar3'
}
['-f', '--foo'],
{
action: 'store',
help: 'foo3 bar3'
}
);
var bar = subparsers.addParser(
'c2',
{ aliases: ['co'], addHelp: true, help: 'c2 help' }
bar = subparsers.addParser(
'c2',
{ aliases: ['co'], addHelp: true, help: 'c2 help' }
);
bar.addArgument(
['-b', '--bar'],
{
action: 'store',
type: 'int',
help: 'foo3 bar3'
}
['-b', '--bar'],
{
action: 'store',
type: 'int',
help: 'foo3 bar3'
}
);
subparserExample.printHelp();
console.log('-----------');
@@ -241,66 +222,51 @@ console.dir(args);
console.log('-----------');
subparserExample.parseArgs(['c1', '-h']);
var functionExample = new ArgumentParser({ description: 'Process some integers.' });
const functionExample = new ArgumentParser({ description: 'Process some integers.' });
function sum(arr: number[]) {
return arr.reduce(function(a, b) {
return a + b;
}, 0);
return arr.reduce((a, b) => a + b, 0);
}
function max(arr: number[]) {
return Math.max.apply(Math, arr);
return Math.max.apply(Math, arr);
}
functionExample.addArgument(['integers'], {
metavar: 'N',
type: 'int',
nargs: '+',
help: 'an integer for the accumulator'
metavar: 'N',
type: 'int',
nargs: '+',
help: 'an integer for the accumulator'
});
functionExample.addArgument(['--sum'], {
dest: 'accumulate',
action: 'storeConst',
constant: sum,
defaultValue: max,
help: 'sum the integers (default: find the max)'
dest: 'accumulate',
action: 'storeConst',
constant: sum,
defaultValue: max,
help: 'sum the integers (default: find the max)'
});
args = functionExample.parseArgs('--sum 1 2 -1'.split(' '));
console.log(args.accumulate(args.integers));
var formatterExample = new ArgumentParser({
prog: 'PROG',
formatterClass: RawDescriptionHelpFormatter,
description: 'Keep the formatting\n' +
' exactly as it is written\n' +
'\n' +
'here\n'
const formatterExample = new ArgumentParser({
prog: 'PROG',
formatterClass: RawDescriptionHelpFormatter,
description: `Keep the formatting\nexactly as it is written\n\nhere\n`,
});
formatterExample.addArgument(['--foo'], {
help: ' foo help should not\n' +
' retain this odd formatting'
help: `foo help should not\nretain this odd formatting`,
});
formatterExample.addArgument(['spam'], {
'help': 'spam help'
help: 'spam help',
});
var group = formatterExample.addArgumentGroup({
title: 'title',
description: ' This text\n' +
' should be indented\n' +
' exactly like it is here\n'
const group = formatterExample.addArgumentGroup({
title: 'title',
description: `This text\nshould be indented\nexactly like it is here\n`,
});
group.addArgument(['--bar'], {
help: 'bar help'
help: 'bar help'
});
formatterExample.printHelp();
+28 -19
View File
@@ -1,31 +1,39 @@
// Type definitions for argparse v1.0.3
// Type definitions for argparse 1.0
// Project: https://github.com/nodeca/argparse
// Definitions by: Andrew Schurman <https://github.com/arcticwaters>
// Tomasz Łaziuk <https://github.com/tlaziuk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
export declare class ArgumentParser extends ArgumentGroup {
export class ArgumentParser extends ArgumentGroup {
constructor(options?: ArgumentParserOptions);
addSubparsers(options?: SubparserOptions): SubParser;
parseArgs(args?: string[], ns?: Namespace | Object): any;
parseArgs(args?: string[], ns?: Namespace | object): any;
printUsage(): void;
printHelp(): void;
formatUsage(): string;
formatHelp(): string;
parseKnownArgs(args?: string[], ns?: Namespace | Object): any[];
parseKnownArgs(args?: string[], ns?: Namespace | object): any[];
convertArgLineToArg(argLine: string): string[];
exit(status: number, message: string): void;
error(err: string | Error): void;
}
interface Namespace { }
export class Namespace {
constructor(options: object);
get<K extends keyof this, D extends any>(key: K, defaultValue?: D): this[K] | D;
isset<K extends keyof this>(key: K): boolean;
set<K extends keyof this, V extends this[K]>(key: K, value: V): this;
set<K extends string, V extends any>(key: K, value: V): this & Record<K, V>;
set<K extends object>(obj: K): this & K;
unset<K extends keyof this, D extends any>(key: K, defaultValue?: D): this[K] | D;
}
declare class SubParser {
export class SubParser {
addParser(name: string, options?: SubArgumentParserOptions): ArgumentParser;
}
declare class ArgumentGroup {
export class ArgumentGroup {
addArgument(args: string[], options?: ArgumentOptions): void;
addArgumentGroup(options?: ArgumentGroupOptions): ArgumentGroup;
addMutuallyExclusiveGroup(options?: { required: boolean }): ArgumentGroup;
@@ -33,7 +41,7 @@ declare class ArgumentGroup {
getDefault(dest: string): any;
}
interface SubparserOptions {
export interface SubparserOptions {
title?: string;
description?: string;
prog?: string;
@@ -44,12 +52,12 @@ interface SubparserOptions {
metavar?: string;
}
interface SubArgumentParserOptions extends ArgumentParserOptions {
export interface SubArgumentParserOptions extends ArgumentParserOptions {
aliases?: string[];
help?: string;
}
interface ArgumentParserOptions {
export interface ArgumentParserOptions {
description?: string;
epilog?: string;
addHelp?: boolean;
@@ -62,26 +70,27 @@ interface ArgumentParserOptions {
version?: string;
}
interface ArgumentGroupOptions {
export interface ArgumentGroupOptions {
prefixChars?: string;
argumentDefault?: any;
title?: string;
description?: string;
}
export declare class HelpFormatter { }
export declare class ArgumentDefaultsHelpFormatter { }
export declare class RawDescriptionHelpFormatter { }
export declare class RawTextHelpFormatter { }
export class HelpFormatter { }
export class ArgumentDefaultsHelpFormatter { }
export class RawDescriptionHelpFormatter { }
export class RawTextHelpFormatter { }
interface ArgumentOptions {
export interface ArgumentOptions {
action?: string;
optionStrings?: string[];
dest?: string;
nargs?: string | number;
constant?: any;
defaultValue?: any;
type?: string | Function;
// type may be a string (primitive) or a Function (constructor)
type?: string | Function; // tslint:disable-line:ban-types
choices?: string | string[];
required?: boolean;
help?: string;
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}
+1 -1
View File
@@ -205,7 +205,7 @@ declare namespace autobahn {
type DeferFactory = () => When.Promise<any>;
type OnChallengeHandler = (session: Session, method: string, extra: any) => When.Promise<string>;
type OnChallengeHandler = (session: Session, method: string, extra: any) => string;
interface IConnectionOptions {
use_es6_promises?: boolean;
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-any-union": false
}
}
+3 -1
View File
@@ -1,6 +1,8 @@
{
"extends": "dtslint/dt.json",
"rules": {
"no-misused-new": false
// TODOs
"no-misused-new": false,
"no-any-union": false
}
}
+2 -1
View File
@@ -5,6 +5,7 @@
"no-empty-interface": false,
"array-type": false,
"unified-signatures": false,
"ban-types": false
"ban-types": false,
"no-unnecessary-generics": false
}
}
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
+4 -1
View File
@@ -1,3 +1,6 @@
{
"extends": "dtslint/dt.json"
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
@@ -26,6 +26,7 @@ thenableNum = chai.expect(thenableNum).to.notify(() => console.log('done'));
// BDD API (should)
thenableNum = thenableNum.should.be.fulfilled;
thenableNum = thenableNum.should.eventually.deep.equal(3);
thenableNum = thenableNum.should.eventually.become(3);
thenableNum = thenableNum.should.become(3);
thenableNum = thenableNum.should.be.rejected;
thenableNum = thenableNum.should.be.rejectedWith(Error);
+132 -11
View File
@@ -1,6 +1,10 @@
// Type definitions for chai-as-promised
// Type definitions for chai-as-promised 7.1.0
// Project: https://github.com/domenic/chai-as-promised/
// Definitions by: jt000 <https://github.com/jt000>, Yuki Kokubun <https://github.com/Kuniwak>, Leonard Thieu <https://github.com/leonard-thieu>
// Definitions by: jt000 <https://github.com/jt000>,
// Yuki Kokubun <https://github.com/Kuniwak>,
// Leonard Thieu <https://github.com/leonard-thieu>,
// Mike Lazer-Walker <https://github.com/lazerwalker>,
// Matt Bishop <https://github.com/mattbishop>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="chai" />
@@ -25,22 +29,25 @@ declare namespace Chai {
become(expected: any): PromisedAssertion;
fulfilled: PromisedAssertion;
rejected: PromisedAssertion;
rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion;
rejectedWith: PromisedThrow;
notify(fn: Function): PromisedAssertion;
}
// Eventually does not have .then(), but PromisedAssertion have.
interface Eventually extends PromisedLanguageChains, PromisedNumericComparison, PromisedTypeComparison {
// From chai-as-promised
become(expected: PromiseLike<any>): PromisedAssertion;
become(expected: any): PromisedAssertion;
fulfilled: PromisedAssertion;
rejected: PromisedAssertion;
rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion;
rejectedWith: PromisedThrow;
notify(fn: Function): PromisedAssertion;
// From chai
not: PromisedAssertion;
deep: PromisedDeep;
ordered: PromisedOrdered;
nested: PromisedNested;
any: PromisedKeyFilter;
all: PromisedKeyFilter;
a: PromisedTypeComparison;
an: PromisedTypeComparison;
@@ -51,6 +58,7 @@ declare namespace Chai {
false: PromisedAssertion;
null: PromisedAssertion;
undefined: PromisedAssertion;
NaN: PromisedAssertion;
exist: PromisedAssertion;
empty: PromisedAssertion;
arguments: PromisedAssertion;
@@ -63,20 +71,36 @@ declare namespace Chai {
property: PromisedProperty;
ownProperty: PromisedOwnProperty;
haveOwnProperty: PromisedOwnProperty;
ownPropertyDescriptor: PromisedOwnPropertyDescriptor;
haveOwnPropertyDescriptor: PromisedOwnPropertyDescriptor;
length: PromisedLength;
lengthOf: PromisedLength;
match(regexp: RegExp | string, message?: string): PromisedAssertion;
match: PromisedMatch;
matches: PromisedMatch;
string(string: string, message?: string): PromisedAssertion;
keys: PromisedKeys;
key(string: string): PromisedAssertion;
throw: PromisedThrow;
throws: PromisedThrow;
Throw: PromisedThrow;
respondTo(method: string, message?: string): PromisedAssertion;
respondTo: PromisedRespondTo;
respondsTo: PromisedRespondTo;
itself: PromisedAssertion;
satisfy(matcher: Function, message?: string): PromisedAssertion;
closeTo(expected: number, delta: number, message?: string): PromisedAssertion;
satisfy: PromisedSatisfy;
satisfies: PromisedSatisfy;
closeTo: PromisedCloseTo;
approximately: PromisedCloseTo;
members: PromisedMembers;
increase: PromisedPropertyChange;
increases: PromisedPropertyChange;
decrease: PromisedPropertyChange;
decreases: PromisedPropertyChange;
change: PromisedPropertyChange;
changes: PromisedPropertyChange;
extensible: PromisedAssertion;
sealed: PromisedAssertion;
frozen: PromisedAssertion;
oneOf(list: any[], message?: string): PromisedAssertion;
}
interface PromisedAssertion extends Eventually, PromiseLike<any> {
@@ -99,6 +123,8 @@ declare namespace Chai {
at: PromisedAssertion;
of: PromisedAssertion;
same: PromisedAssertion;
but: PromisedAssertion;
does: PromisedAssertion;
}
interface PromisedNumericComparison {
@@ -129,10 +155,28 @@ declare namespace Chai {
(constructor: Object, message?: string): PromisedAssertion;
}
interface PromisedDeep {
equal: PromisedEqual;
interface PromisedCloseTo {
(expected: number, delta: number, message?: string): PromisedAssertion;
}
interface PromisedNested {
include: PromisedInclude;
property: PromisedProperty;
members: PromisedMembers;
}
interface PromisedDeep {
equal: PromisedEqual;
equals: PromisedEqual;
eq: PromisedEqual;
include: PromisedInclude;
property: PromisedProperty;
members: PromisedMembers;
ordered: PromisedOrdered
}
interface PromisedOrdered {
members: PromisedMembers;
}
interface PromisedKeyFilter {
@@ -151,6 +195,11 @@ declare namespace Chai {
(name: string, message?: string): PromisedAssertion;
}
interface PromisedOwnPropertyDescriptor {
(name: string, descriptor: PropertyDescriptor, message?: string): PromisedAssertion;
(name: string, message?: string): PromisedAssertion;
}
interface PromisedLength extends PromisedLanguageChains, PromisedNumericComparison {
(length: number, message?: string): PromisedAssertion;
}
@@ -160,13 +209,21 @@ declare namespace Chai {
(value: string, message?: string): PromisedAssertion;
(value: number, message?: string): PromisedAssertion;
keys: PromisedKeys;
deep: PromisedDeep;
ordered: PromisedOrdered;
members: PromisedMembers;
any: PromisedKeyFilter;
all: PromisedKeyFilter;
}
interface PromisedMatch {
(regexp: RegExp | string, message?: string): PromisedAssertion;
}
interface PromisedKeys {
(...keys: string[]): PromisedAssertion;
(keys: any[]): PromisedAssertion;
(keys: Object): PromisedAssertion;
}
interface PromisedThrow {
@@ -179,10 +236,22 @@ declare namespace Chai {
(constructor: Function, expected?: RegExp, message?: string): PromisedAssertion;
}
interface PromisedRespondTo {
(method: string, message?: string): PromisedAssertion;
}
interface PromisedSatisfy {
(matcher: Function, message?: string): PromisedAssertion;
}
interface PromisedMembers {
(set: any[], message?: string): PromisedAssertion;
}
interface PromisedPropertyChange {
(object: Object, property: string, message?: string): PromisedAssertion;
}
// For Assert API
interface Assert {
eventually: PromisedAssert;
@@ -198,7 +267,9 @@ declare namespace Chai {
export interface PromisedAssert {
fail(actual?: any, expected?: any, msg?: string, operator?: string): PromiseLike<void>;
isOk(val: any, msg?: string): PromiseLike<void>;
ok(val: any, msg?: string): PromiseLike<void>;
isNotOk(val: any, msg?: string): PromiseLike<void>;
notOk(val: any, msg?: string): PromiseLike<void>;
equal(act: any, exp: any, msg?: string): PromiseLike<void>;
@@ -210,12 +281,26 @@ declare namespace Chai {
deepEqual(act: any, exp: any, msg?: string): PromiseLike<void>;
notDeepEqual(act: any, exp: any, msg?: string): PromiseLike<void>;
isAbove(val: number, above: number, msg?: string): PromiseLike<void>;
isAtLeast(val: number, atLeast: number, msg?: string): PromiseLike<void>;
isAtBelow(val: number, below: number, msg?: string): PromiseLike<void>;
isAtMost(val: number, atMost: number, msg?: string): PromiseLike<void>;
isTrue(val: any, msg?: string): PromiseLike<void>;
isFalse(val: any, msg?: string): PromiseLike<void>;
isNotTrue(val: any, msg?: string): PromiseLike<void>;
isNotFalse(val: any, msg?: string): PromiseLike<void>;
isNull(val: any, msg?: string): PromiseLike<void>;
isNotNull(val: any, msg?: string): PromiseLike<void>;
isNaN(val: any, msg?: string): PromiseLike<void>;
isNotNaN(val: any, msg?: string): PromiseLike<void>;
exists(val: any, msg?: string): PromiseLike<void>;
notExists(val: any, msg?: string): PromiseLike<void>;
isUndefined(val: any, msg?: string): PromiseLike<void>;
isDefined(val: any, msg?: string): PromiseLike<void>;
@@ -287,10 +372,46 @@ declare namespace Chai {
operator(val: any, operator: string, val2: any, msg?: string): PromiseLike<void>;
closeTo(act: number, exp: number, delta: number, msg?: string): PromiseLike<void>;
approximately(act: number, exp: number, delta: number, msg?: string): PromiseLike<void>;
sameMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
sameDeepMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
sameOrderedMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
notSameOrderedMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
sameDeepOrderedMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
notSameDeepOrderedMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
includeOrderedMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
notIncludeOrderedMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
includeDeepOrderedMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
notIncludeDeepOrderedMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
includeMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
includeDeepMembers(set1: any[], set2: any[], msg?: string): PromiseLike<void>;
oneOf(val: any, list: any[], msg?: string): PromiseLike<void>;
changes(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike<void>;
doesNotChange(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike<void>;
increases(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike<void>;
doesNotIncrease(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike<void>;
decreases(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike<void>;
doesNotDecrease(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike<void>;
ifError(val: any, msg?: string): PromiseLike<void>;
isExtensible(obj: Object, msg?: string): PromiseLike<void>;
isNotExtensible(obj: Object, msg?: string): PromiseLike<void>;
isSealed(obj: Object, msg?: string): PromiseLike<void>;
sealed(obj: Object, msg?: string): PromiseLike<void>;
isNotSealed(obj: Object, msg?: string): PromiseLike<void>;
notSealed(obj: Object, msg?: string): PromiseLike<void>;
isFrozen(obj: Object, msg?: string): PromiseLike<void>;
frozen(obj: Object, msg?: string): PromiseLike<void>;
isNotFrozen(obj: Object, msg?: string): PromiseLike<void>;
notFrozen(obj: Object, msg?: string): PromiseLike<void>;
isEmpty(val: any, msg?: string): PromiseLike<void>;
isNotEmpty(val: any, msg?: string): PromiseLike<void>;
}
}
+10
View File
@@ -41,6 +41,16 @@ chai.request(app)
.get('/search')
.query({ name: 'foo', limit: 10 });
chai.request(app)
.get('/download')
.buffer()
.parse((res, cb) => {
let data = '';
res.setEncoding('binary');
res.on('data', (chunk: any) => { data += chunk; });
res.on('end', () => { cb(undefined, new Buffer(data, 'binary')); });
});
chai.request(app)
.put('/user/me')
.send({ passsword: '123', confirmPassword: '123' })
+3
View File
@@ -49,6 +49,8 @@ declare global {
type: string;
status: number;
text: string;
setEncoding(encoding: string): void;
on(event: string, fn: (...args: any[]) => void): void;
}
interface Request extends FinishedRequest {
@@ -59,6 +61,7 @@ declare global {
auth(user: string, name: string): Request;
field(name: string, val: string): Request;
buffer(): Request;
parse(fn: (res: Response, cb: (e?: Error, r?: any) => void) => void): Request;
end(callback?: (err: any, res: Response) => void): FinishedRequest;
}
+21 -11
View File
@@ -4,15 +4,14 @@
// Fabien Lavocat <https://github.com/FabienLavocat>
// KentarouTakeda <https://github.com/KentarouTakeda>
// Larry Bahr <https://github.com/larrybahr>
// Daniel Luz <https://github.com/mernen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="jquery" />
declare class Chart {
static readonly Chart: typeof Chart;
constructor(
context: string | JQuery | CanvasRenderingContext2D | HTMLCanvasElement | string[] | CanvasRenderingContext2D[] | HTMLCanvasElement[],
context: string | CanvasRenderingContext2D | HTMLCanvasElement | ArrayLike<CanvasRenderingContext2D | HTMLCanvasElement>,
options: Chart.ChartConfiguration
);
config: Chart.ChartConfiguration;
@@ -83,6 +82,8 @@ declare namespace Chart {
type ScaleType = 'category' | 'linear' | 'logarithmic' | 'time' | 'radialLinear';
type PointStyle = 'circle' | 'cross' | 'crossRot' | 'dash' | 'line' | 'rect' | 'rectRounded' | 'rectRot' | 'star' | 'triangle';
type PositionType = 'left' | 'right' | 'top' | 'bottom';
interface ChartArea {
@@ -175,7 +176,7 @@ declare namespace Chart {
interface ChartTitleOptions {
display?: boolean;
position?: string;
position?: PositionType;
fullWdith?: boolean;
fontSize?: number;
fontFamily?: string;
@@ -187,10 +188,12 @@ declare namespace Chart {
interface ChartLegendOptions {
display?: boolean;
position?: string;
position?: PositionType;
fullWidth?: boolean;
onClick?(event: any, legendItem: any): void;
onClick?(event: MouseEvent, legendItem: ChartLegendItem): void;
onHover?(event: MouseEvent, legendItem: ChartLegendItem): void;
labels?: ChartLegendLabelOptions;
reverse?: boolean;
}
interface ChartLegendLabelOptions {
@@ -293,7 +296,7 @@ declare namespace Chart {
interface ChartPointOptions {
radius?: number;
pointStyle?: string;
pointStyle?: PointStyle;
backgroundColor?: ChartColor;
borderWidth?: number;
borderColor?: ChartColor;
@@ -332,6 +335,7 @@ declare namespace Chart {
interface TickOptions {
autoSkip?: boolean;
autoSkipPadding?: boolean;
callback?(value: any, index: any, values: any): string|number;
display?: boolean;
fontColor?: ChartColor;
@@ -386,7 +390,7 @@ declare namespace Chart {
type ChartColor = string | CanvasGradient | CanvasPattern | string[];
interface ChartDataSets {
cubicInterpolationMode?: string;
cubicInterpolationMode?: 'default' | 'monotone';
backgroundColor?: ChartColor | ChartColor[];
borderWidth?: number;
borderColor?: ChartColor;
@@ -394,10 +398,15 @@ declare namespace Chart {
borderDash?: number[];
borderDashOffset?: number;
borderJoinStyle?: string;
borderSkipped?: PositionType;
data?: number[] | ChartPoint[];
fill?: boolean;
fill?: boolean | number | string;
hoverBackgroundColor?: string | string[];
hoverBorderColor?: string | string[];
hoverBorderWidth?: number | number[];
label?: string;
lineTension?: number;
steppedLine?: 'before' | 'after' | boolean;
pointBorderColor?: ChartColor | ChartColor[];
pointBackgroundColor?: ChartColor | ChartColor[];
pointBorderWidth?: number | number[];
@@ -407,14 +416,15 @@ declare namespace Chart {
pointHoverBackgroundColor?: ChartColor | ChartColor[];
pointHoverBorderColor?: ChartColor | ChartColor[];
pointHoverBorderWidth?: number | number[];
pointStyle?: string | string[] | HTMLImageElement | HTMLImageElement[];
pointStyle?: PointStyle | HTMLImageElement | Array<PointStyle | HTMLImageElement>;
xAxisID?: string;
yAxisID?: string;
type?: string;
hidden?: boolean;
hideInLegendAndTooltip?: boolean;
showLine?: boolean;
stack?: string;
spanGaps?: string;
spanGaps?: boolean;
}
interface ChartScales {
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-any-union": false
}
}
+3 -1
View File
@@ -5,6 +5,8 @@
"adjacent-overload-signatures": false,
"ban-types": false,
"dt-header": false,
"unified-signatures": false
"no-any-union": false,
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -7,6 +7,7 @@
"one-variable-per-declaration": false,
"space-before-function-paren": false,
"no-var": false,
"interface-over-type-literal": false
"interface-over-type-literal": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"ban-types": false
"ban-types": false,
"no-unnecessary-generics": false
}
}
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
+1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"no-any-union": false,
"prefer-method-signature": false
}
}
+8 -1
View File
@@ -1 +1,8 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"no-any-union": false,
"rules": {
"no-any-union": false,
"no-unnecessary-generics": false
}
}
+7 -1
View File
@@ -1 +1,7 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-any-union": false,
"no-unnecessary-generics": false
}
}
+5 -2
View File
@@ -1,3 +1,6 @@
{
"extends": "dtslint/dt.json"
}
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
+4 -1
View File
@@ -1,3 +1,6 @@
{
"extends": "dtslint/dt.json"
"extends": "dtslint/dt.json",
"rules": {
"no-any-union": false
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+5 -4
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false
}
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
"rules": {
// TODO
"no-this-assignment": false,
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
"rules": {
// TODO
"no-this-assignment": false,
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+5 -1
View File
@@ -4,6 +4,10 @@
// TODO
"no-this-assignment": false,
"unified-signatures": false,
"max-line-length": [false, 200]
"max-line-length": [
false,
200
],
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -2,6 +2,7 @@
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false,
"no-empty-interface": false
"no-empty-interface": false,
"no-unnecessary-generics": false
}
}
+1
View File
@@ -2,6 +2,7 @@
"extends": "dtslint/dt.json",
"rules": {
// TODO
"no-any-union": false,
"no-this-assignment": false,
"unified-signatures": false
}
+3 -1
View File
@@ -1,8 +1,10 @@
{
"extends": "dtslint/dt.json",
"rules": {
// TODO
// TODOs
"no-any-union": false,
"no-this-assignment": false,
"no-unnecessary-generics": false,
"unified-signatures": false,
"max-line-length": [false, 145]
}
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -2,6 +2,7 @@
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false,
"callable-types": false
"callable-types": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
"rules": {
// TODO
"no-this-assignment": false,
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -4,6 +4,7 @@
// TODO
"no-this-assignment": false,
"unified-signatures": false,
"callable-types": false
"callable-types": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
"rules": {
// TODO
"no-this-assignment": false,
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
"rules": {
// TODO
"no-this-assignment": false,
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
@@ -8,10 +8,20 @@ $(document).ready(function () {
extend: 'excel',
text: 'Excel',
className: 'class',
filename: "exported_file.csv",
exportOptions: {
columns: ':visible'
}
},
{
extend: 'excel',
text: 'Excel',
className: 'class',
filename: "exported_file.csv",
exportOptions: {
columns: [1, 6, 2, 3, 4]
}
},
{
action: function (e, dt, node, config) { },
available: function (dt, config) { return true; },
+6 -1
View File
@@ -86,6 +86,11 @@ declare namespace DataTables {
*/
title?: string;
/**
* Define what the exported filename should be
*/
filename?: string;
exportOptions?: ButtonExportOptions;
autoPrint?: boolean;
customize?: FunctionButtonCustomize;
@@ -95,7 +100,7 @@ declare namespace DataTables {
(dt: DataTables.Api, config: any): boolean
}
export interface ButtonExportOptions {
columns?: string;
columns?: string | number | string[] | number[];
}
export interface ButtonKey {
+19 -9
View File
@@ -1,19 +1,29 @@
import * as deepmerge from "deepmerge";
const x = {
foo: { bar: 3 },
array: [{ does: 'work', too: [1, 2, 3] }]
foo: { bar: 3 },
array: [{ does: 'work', too: [1, 2, 3] }]
};
const y = {
foo: { baz: 4 },
quux: 5,
array: [{ does: 'work', too: [4, 5, 6] }, { really: 'yes' }]
foo: { baz: 4 },
quux: 5,
array: [{ does: 'work', too: [4, 5, 6] }, { really: 'yes' }]
};
const expected = {
foo: { bar: 3, baz: 4 },
array: [{ does: 'work', too: [1, 2, 3, 4, 5, 6] }, { really: 'yes' }],
quux: 5
foo: { bar: 3, baz: 4 },
array: [{ does: 'work', too: [1, 2, 3, 4, 5, 6] }, { really: 'yes' }],
quux: 5
};
const result = deepmerge<any>(x, y);
const result = deepmerge(x, y);
const anyResult = deepmerge<any>(x, y);
function reverseConcat(dest: number[], src: number[]) {
return src.concat(dest);
}
const withOptions = deepmerge(x, y, {
clone: false,
arrayMerge: reverseConcat
});
+7 -4
View File
@@ -1,17 +1,20 @@
// Type definitions for deepmerge 1.3
// Project: https://github.com/KyleAMathews/deepmerge
// Definitions by: marvinscharle <https://github.com/marvinscharle>
// syy1125 <https://github.com/syy1125>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
export = deepmerge;
declare function deepmerge<T>(x: T, y: T, options?: deepmerge.Options<T>): T;
declare function deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
declare function deepmerge<T1, T2>(x: T1, y: T2, options?: deepmerge.Options): T1 & T2;
declare namespace deepmerge {
interface Options<T> {
interface Options {
clone?: boolean;
arrayMerge?(destination: T, source: T, options?: Options<T>): T;
arrayMerge?(destination: any[], source: any[], options?: Options): any[];
}
function all<T>(objects: T[], options?: Options<T>): T;
function all<T>(objects: Array<Partial<T>>, options?: Options): T;
}
+6 -5
View File
@@ -1,7 +1,8 @@
{
"extends": "dtslint/dt.json",
"rules": {
// TODO
"await-promise": false
}
"extends": "dtslint/dt.json",
"rules": {
// TODO
"await-promise": false,
"no-unnecessary-generics": false
}
}
+1
View File
@@ -488,6 +488,7 @@ declare namespace Dockerode {
CpusetCpus: string;
CpusetMems: string;
Devices?: any;
DiskQuota: number;
KernelMemory: number;
Memory: number;
MemoryReservation: number;
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -14,7 +14,8 @@
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true
},
"files": [
"index.d.ts",
+3 -2
View File
@@ -14,10 +14,11 @@
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true
},
"files": [
"index.d.ts",
"ember-tests.ts"
]
}
}
+2
View File
@@ -4,9 +4,11 @@
// Heavy use of Function type in this older package.
"ban-types": false,
"jsdoc-format": false,
"no-any-union": false,
"no-misused-new": false,
// not sure what this means
"no-single-declare-module": false,
"no-unnecessary-generics": false,
"no-unnecessary-qualifier": false
}
}
-1
View File
@@ -8,7 +8,6 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strict": true,
"baseUrl": "../",
"typeRoots": [
"../"
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
+1 -1
View File
@@ -56,7 +56,7 @@ export interface CommonWrapper<P = {}, S = {}> {
* Returns whether or not the current wrapper has a node anywhere in it's render tree that looks like the one passed in.
* @param node
*/
contains(node: ReactElement<any>): boolean;
contains(node: ReactElement<any> | string): boolean;
/**
* Returns whether or not a given react element exists in the shallow render tree.
+7 -6
View File
@@ -1,8 +1,9 @@
{
"extends": "dtslint/dt.json",
"rules": {
// TODOs
"dt-header": false,
"no-duplicate-imports": false
}
"extends": "dtslint/dt.json",
"rules": {
// TODOs
"dt-header": false,
"no-duplicate-imports": false,
"no-unnecessary-generics": false
}
}
+2
View File
@@ -1,6 +1,8 @@
{
"extends": "dtslint/dt.json",
"rules": {
// TODOs
"no-any-union": false,
"no-object-literal-type-assertion": false
}
}
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-any-union": false
}
}
+7 -6
View File
@@ -1,8 +1,9 @@
{
"extends": "dtslint/dt.json",
"rules": {
// TODO
"no-void-expression": false,
"no-duplicate-imports": false
}
"extends": "dtslint/dt.json",
"rules": {
// TODO
"no-void-expression": false,
"no-duplicate-imports": false,
"no-unnecessary-generics": false
}
}
+18 -8
View File
@@ -1,6 +1,6 @@
import * as express from "express";
import * as express from 'express';
import 'express-session';
import * as graphqlHTTP from "express-graphql";
import * as graphqlHTTP from 'express-graphql';
const app = express();
const schema = {};
@@ -8,19 +8,29 @@ const schema = {};
const graphqlOption: graphqlHTTP.OptionsObj = {
graphiql: true,
schema: schema,
formatError: (error:Error) => ({
message: error.message,
formatError: (error: Error) => ({
message: error.message
})
};
const graphqlOptionRequest = (request: express.Request): graphqlHTTP.OptionsObj => ({
graphiql: true,
schema: schema,
context: request.session,
context: request.session
});
app.use("/graphql1", graphqlHTTP(graphqlOption));
const graphqlOptionRequestAsync = async (request: express.Request): Promise<graphqlHTTP.OptionsObj> => {
return {
graphiql: true,
schema: await Promise.resolve(schema),
context: request.session
};
};
app.use("/graphql2", graphqlHTTP(graphqlOptionRequest));
app.use('/graphql1', graphqlHTTP(graphqlOption));
app.listen(8080);
app.use('/graphql2', graphqlHTTP(graphqlOptionRequest));
app.use('/graphqlasync', graphqlHTTP(graphqlOptionRequestAsync));
app.listen(8080, () => console.log('GraphQL Server running on localhost:8080'));
+4 -2
View File
@@ -1,6 +1,8 @@
// Type definitions for express-graphql
// Project: https://www.npmjs.org/package/express-graphql
// Definitions by: Isman Usoh <https://github.com/isman-usoh>, Nitin Tutlani <https://github.com/nitintutlani>
// Definitions by: Isman Usoh <https://github.com/isman-usoh>
// Nitin Tutlani <https://github.com/nitintutlani>
// Daniel Fader <https://github.com/hubel>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Request, Response } from "express";
@@ -12,7 +14,7 @@ declare namespace graphqlHTTP {
* Used to configure the graphQLHTTP middleware by providing a schema
* and other configuration options.
*/
export type Options = ((req: Request) => OptionsObj) | OptionsObj
export type Options = ((req: Request) => OptionsObj) | ((req: Request) => Promise<OptionsObj>) | OptionsObj
export type OptionsObj = {
/**
* A GraphQL schema from graphql-js.
+2 -1
View File
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"lib": [
"es6"
],
@@ -19,4 +20,4 @@
"index.d.ts",
"express-graphql-tests.ts"
]
}
}
+1
View File
@@ -5,6 +5,7 @@
"adjacent-overload-signatures": false,
"ban-types": false,
"interface-name": false,
"no-any-union": false,
"no-empty-interface": false,
"space-within-parens": false,
"strict-export-declare-modifiers": false,
+8 -1
View File
@@ -1 +1,8 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
// TODOs
"no-any-union": false,
"no-unnecessary-generics": false
}
}
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -2,6 +2,7 @@
"extends": "dtslint/dt.json",
"rules": {
// TODO
"no-boolean-literal-compare": false
"no-boolean-literal-compare": false,
"no-unnecessary-generics": false
}
}
+13 -8
View File
@@ -105,6 +105,11 @@ declare namespace Ffmpeg {
size?: string;
}
interface AudioVideoFilter {
filter: string;
options: string | string[] | {};
}
class FfmpegCommand extends events.EventEmitter {
constructor(options?: FfmpegCommandOptions);
constructor(input?: string | stream.Readable, options?: FfmpegCommandOptions);
@@ -144,10 +149,10 @@ declare namespace Ffmpeg {
audioFrequency(freq: number): FfmpegCommand;
withAudioQuality(quality: number): FfmpegCommand;
audioQuality(quality: number): FfmpegCommand;
withAudioFilter(filters: { filter: string, options: any }): FfmpegCommand;
withAudioFilters(filters: { filter: string, options: any }): FfmpegCommand;
audioFilter(filters: { filter: string, options: any }): FfmpegCommand;
audioFilters(filters: { filter: string, options: any }): FfmpegCommand;
withAudioFilter(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand;
withAudioFilters(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand;
audioFilter(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand;
audioFilters(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand;
// options/video;
withNoVideo(): FfmpegCommand;
@@ -156,10 +161,10 @@ declare namespace Ffmpeg {
videoCodec(codec: string): FfmpegCommand;
withVideoBitrate(bitrate: string | number): FfmpegCommand;
videoBitrate(bitrate: string | number): FfmpegCommand;
withVideoFilter(filters: { filter: string, options: any }): FfmpegCommand;
withVideoFilters(filters: { filter: string, options: any }): FfmpegCommand;
videoFilter(filters: { filter: string, options: any }): FfmpegCommand;
videoFilters(filters: { filter: string, options: any }): FfmpegCommand;
withVideoFilter(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand;
withVideoFilters(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand;
videoFilter(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand;
videoFilters(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand;
withOutputFps(fps: number): FfmpegCommand;
withOutputFPS(fps: number): FfmpegCommand;
withFpsOutput(fps: number): FfmpegCommand;
+5 -1
View File
@@ -1,3 +1,7 @@
{
"extends": "dtslint/dt.json"
"extends": "dtslint/dt.json",
"rules": {
// TODO
"no-any-union": false
}
}
+3 -2
View File
@@ -1,6 +1,7 @@
// Type definitions for flux-standard-action 0.5.0
// Project: https://github.com/acdlite/flux-standard-action
// Definitions by: Qubo <https://github.com/tkqubo>
// Simon Fridlund <https://github.com/zimme>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -16,12 +17,12 @@ export interface Action<T> {
/** Usage: `var action: Action<string> & AnyMeta;` */
export interface AnyMeta {
meta: any
meta?: any;
}
/** Usage: `var action: Action<string> & TypedMeta<string>;` */
export interface TypedMeta<T> {
meta: T
meta?: T;
}
export declare function isFSA(action: any): action is Action<any>;
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-any-union": false
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ const fd = 0;
const modeNum = 0;
const modeStr = "";
const object = {};
const errorCallback = (err: Error) => { };
const errorCallback = (err: Error | null) => { };
const readOptions: fs.ReadOptions = {
reviver: {}
};
+74 -72
View File
@@ -14,140 +14,141 @@ import { Stats } from "fs";
export * from "fs";
export function copy(src: string, dest: string, options?: CopyOptions): Promise<void>;
export function copy(src: string, dest: string, callback: (err: Error) => void): void;
export function copy(src: string, dest: string, options: CopyOptions, callback: (err: Error) => void): void;
export function copy(src: string, dest: string, callback: (err: Error | null) => void): void;
export function copy(src: string, dest: string, options: CopyOptions, callback: (err: Error | null) => void): void;
export function copySync(src: string, dest: string, options?: CopyOptions): void;
export function move(src: string, dest: string, options?: MoveOptions): Promise<void>;
export function move(src: string, dest: string, callback: (err: Error) => void): void;
export function move(src: string, dest: string, options: MoveOptions, callback: (err: Error) => void): void;
export function move(src: string, dest: string, callback: (err: Error | null) => void): void;
export function move(src: string, dest: string, options: MoveOptions, callback: (err: Error | null) => void): void;
export function moveSync(src: string, dest: string, options?: MoveOptions): void;
export function createFile(file: string): Promise<void>;
export function createFile(file: string, callback: (err: Error) => void): void;
export function createFile(file: string, callback: (err: Error | null) => void): void;
export function createFileSync(file: string): void;
export function ensureDir(path: string): Promise<void>;
export function ensureDir(path: string, callback: (err: Error) => void): void;
export function ensureDir(path: string, callback: (err: Error | null) => void): void;
export function ensureDirSync(path: string): void;
export function mkdirs(dir: string): Promise<void>;
export function mkdirs(dir: string, callback: (err: Error) => void): void;
export function mkdirs(dir: string, callback: (err: Error | null) => void): void;
export function mkdirp(dir: string): Promise<void>;
export function mkdirp(dir: string, callback: (err: Error) => void): void;
export function mkdirp(dir: string, callback: (err: Error | null) => void): void;
export function mkdirsSync(dir: string): void;
export function mkdirpSync(dir: string): void;
export function outputFile(file: string, data: any): Promise<void>;
export function outputFile(file: string, data: any, callback: (err: Error) => void): void;
export function outputFile(file: string, data: any, callback: (err: Error | null) => void): void;
export function outputFileSync(file: string, data: any): void;
export function readJson(file: string, options?: ReadOptions): Promise<any>;
export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void;
export function readJson(file: string, options: ReadOptions, callback: (err: Error, jsonObject: any) => void): void;
export function readJson(file: string, callback: (err: Error | null, jsonObject: any) => void): void;
export function readJson(file: string, options: ReadOptions, callback: (err: Error | null, jsonObject: any) => void): void;
export function readJSON(file: string, options?: ReadOptions): Promise<any>;
export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void;
export function readJSON(file: string, options: ReadOptions, callback: (err: Error, jsonObject: any) => void): void;
export function readJSON(file: string, callback: (err: Error | null, jsonObject: any) => void): void;
export function readJSON(file: string, options: ReadOptions, callback: (err: Error | null, jsonObject: any) => void): void;
export function readJsonSync(file: string, options?: ReadOptions): any;
export function readJSONSync(file: string, options?: ReadOptions): any;
export function remove(dir: string): Promise<void>;
export function remove(dir: string, callback: (err: Error) => void): void;
export function remove(dir: string, callback: (err: Error | null) => void): void;
export function removeSync(dir: string): void;
export function outputJSON(file: string, data: any, options?: WriteOptions): Promise<void>;
export function outputJSON(file: string, data: any, options: WriteOptions, callback: (err: Error) => void): void;
export function outputJSON(file: string, data: any, callback: (err: Error) => void): void;
export function outputJSON(file: string, data: any, options: WriteOptions, callback: (err: Error | null) => void): void;
export function outputJSON(file: string, data: any, callback: (err: Error | null) => void): void;
export function outputJson(file: string, data: any, options?: WriteOptions): Promise<void>;
export function outputJson(file: string, data: any, options: WriteOptions, callback: (err: Error) => void): void;
export function outputJson(file: string, data: any, callback: (err: Error) => void): void;
export function outputJson(file: string, data: any, options: WriteOptions, callback: (err: Error | null) => void): void;
export function outputJson(file: string, data: any, callback: (err: Error | null) => void): void;
export function outputJsonSync(file: string, data: any, options?: WriteOptions): void;
export function outputJSONSync(file: string, data: any, options?: WriteOptions): void;
export function writeJSON(file: string, object: any, options?: WriteOptions): Promise<void>;
export function writeJSON(file: string, object: any, callback: (err: Error) => void): void;
export function writeJSON(file: string, object: any, options: WriteOptions, callback: (err: Error) => void): void;
export function writeJSON(file: string, object: any, callback: (err: Error | null) => void): void;
export function writeJSON(file: string, object: any, options: WriteOptions, callback: (err: Error | null) => void): void;
export function writeJson(file: string, object: any, options?: WriteOptions): Promise<void>;
export function writeJson(file: string, object: any, callback: (err: Error) => void): void;
export function writeJson(file: string, object: any, options: WriteOptions, callback: (err: Error) => void): void;
export function writeJson(file: string, object: any, callback: (err: Error | null) => void): void;
export function writeJson(file: string, object: any, options: WriteOptions, callback: (err: Error | null) => void): void;
export function writeJsonSync(file: string, object: any, options?: WriteOptions): void;
export function writeJSONSync(file: string, object: any, options?: WriteOptions): void;
export function ensureFile(path: string): Promise<void>;
export function ensureFile(path: string, callback: (err: Error) => void): void;
export function ensureFile(path: string, callback: (err: Error | null) => void): void;
export function ensureFileSync(path: string): void;
export function ensureLink(src: string, dest: string): Promise<void>;
export function ensureLink(src: string, dest: string, callback: (err: Error) => void): void;
export function ensureLink(src: string, dest: string, callback: (err: Error | null) => void): void;
export function ensureLinkSync(src: string, dest: string): void;
export function ensureSymlink(src: string, dest: string, type?: SymlinkType): Promise<void>;
export function ensureSymlink(src: string, dest: string, type: SymlinkType, callback: (err: Error) => void): void;
export function ensureSymlink(src: string, dest: string, callback: (err: Error) => void): void;
export function ensureSymlink(src: string, dest: string, type: SymlinkType, callback: (err: Error | null) => void): void;
export function ensureSymlink(src: string, dest: string, callback: (err: Error | null) => void): void;
export function ensureSymlinkSync(src: string, dest: string, type?: SymlinkType): void;
export function emptyDir(path: string): Promise<void>;
export function emptyDir(path: string, callback: (err: Error) => void): void;
export function emptyDir(path: string, callback: (err: Error | null) => void): void;
export function emptyDirSync(path: string): void;
export function pathExists(path: string): Promise<boolean>;
export function pathExists(path: string, callback: (err: Error, exists: boolean) => void): void;
export function pathExists(path: string, callback: (err: Error | null, exists: boolean) => void): void;
export function pathExistsSync(path: string): boolean;
// fs async methods
// copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v6/index.d.ts
/** Tests a user's permissions for the file specified by path. */
export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void;
export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null) => void): void;
export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
export function access(path: string | Buffer, mode?: number): Promise<void>;
export function appendFile(file: string | Buffer | number, data: any, options: { encoding?: string; mode?: number | string; flag?: string; }, callback: (err: NodeJS.ErrnoException) => void): void;
export function appendFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
export function appendFile(file: string | Buffer | number, data: any, options: { encoding?: string; mode?: number | string; flag?: string; },
callback: (err: NodeJS.ErrnoException | null) => void): void;
export function appendFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void;
export function appendFile(file: string | Buffer | number, data: any, options?: { encoding?: string; mode?: number | string; flag?: string; }): Promise<void>;
export function chmod(path: string | Buffer, mode: string | number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function chmod(path: string | Buffer, mode: string | number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function chmod(path: string | Buffer, mode: string | number): Promise<void>;
export function chown(path: string | Buffer, uid: number, gid: number): Promise<void>;
export function chown(path: string | Buffer, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function chown(path: string | Buffer, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function close(fd: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function close(fd: number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function close(fd: number): Promise<void>;
export function fchmod(fd: number, mode: string | number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function fchmod(fd: number, mode: string | number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function fchmod(fd: number, mode: string | number): Promise<void>;
export function fchown(fd: number, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function fchown(fd: number, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function fchown(fd: number, uid: number, gid: number): Promise<void>;
export function fdatasync(fd: number, callback: () => void): void;
export function fdatasync(fd: number): Promise<void>;
export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any): void;
export function fstat(fd: number): Promise<Stats>;
export function fsync(fd: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function fsync(fd: number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function fsync(fd: number): Promise<void>;
export function ftruncate(fd: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function ftruncate(fd: number, len: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function ftruncate(fd: number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function ftruncate(fd: number, len: number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function ftruncate(fd: number, len?: number): Promise<void>;
export function futimes(fd: number, atime: number, mtime: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function futimes(fd: number, atime: Date, mtime: Date, callback: (err?: NodeJS.ErrnoException) => void): void;
export function futimes(fd: number, atime: number, mtime: number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function futimes(fd: number, atime: Date, mtime: Date, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function futimes(fd: number, atime: number, mtime: number): Promise<void>;
export function futimes(fd: number, atime: Date, mtime: Date): Promise<void>;
export function lchown(path: string | Buffer, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function lchown(path: string | Buffer, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function lchown(path: string | Buffer, uid: number, gid: number): Promise<void>;
export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function link(srcpath: string | Buffer, dstpath: string | Buffer): Promise<void>;
export function lstat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
export function lstat(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any): void;
export function lstat(path: string | Buffer): Promise<Stats>;
/**
@@ -156,7 +157,7 @@ export function lstat(path: string | Buffer): Promise<Stats>;
* @param path
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function mkdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function mkdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoException | null) => void): void;
/**
* Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
*
@@ -164,35 +165,36 @@ export function mkdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoExcept
* @param mode
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function mkdir(path: string | Buffer, mode: number | string, callback: (err?: NodeJS.ErrnoException) => void): void;
export function mkdir(path: string | Buffer, mode: number | string, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function mkdir(path: string | Buffer): Promise<void>;
export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
export function open(path: string | Buffer, flags: string | number, mode: number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
export function open(path: string | Buffer, flags: string | number, mode: number, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
export function open(path: string | Buffer, flags: string | number, mode?: number): Promise<number>;
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null,
callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: Buffer) => void): void;
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null): Promise<ReadResult>;
export function readFile(file: string | Buffer | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
export function readFile(file: string | Buffer | number, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
export function readFile(file: string | Buffer | number, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void;
export function readFile(file: string | Buffer | number, encoding: string, callback: (err: NodeJS.ErrnoException | null, data: string) => void): void;
export function readFile(file: string | Buffer | number, options: { flag?: string; } | { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
export function readFile(file: string | Buffer | number, options: { flag?: string; } | { encoding: string; flag?: string; }): Promise<string>;
// tslint:disable-next-line:unified-signatures
export function readFile(file: string | Buffer | number, encoding: string): Promise<string>;
export function readFile(file: string | Buffer | number): Promise<Buffer>;
export function readdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void;
export function readdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void;
export function readdir(path: string | Buffer): Promise<string[]>;
export function readlink(path: string | Buffer, callback: (err: NodeJS.ErrnoException, linkString: string) => any): void;
export function readlink(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null, linkString: string) => any): void;
export function readlink(path: string | Buffer): Promise<string>;
export function realpath(path: string | Buffer, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
export function realpath(path: string | Buffer, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
export function realpath(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => any): void;
export function realpath(path: string | Buffer, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => any): void;
export function realpath(path: string | Buffer, cache?: { [path: string]: string }): Promise<string>;
export function rename(oldPath: string, newPath: string, callback: (err?: NodeJS.ErrnoException) => void): void;
export function rename(oldPath: string, newPath: string, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function rename(oldPath: string, newPath: string): Promise<void>;
/**
@@ -201,17 +203,17 @@ export function rename(oldPath: string, newPath: string): Promise<void>;
* @param path
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function rmdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function rmdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function rmdir(path: string | Buffer): Promise<void>;
export function stat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
export function stat(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any): void;
export function stat(path: string | Buffer): Promise<Stats>;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: string, callback: (err?: NodeJS.ErrnoException) => void): void;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: string, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): Promise<void>;
export function truncate(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function truncate(path: string | Buffer, len: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function truncate(path: string | Buffer, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function truncate(path: string | Buffer, len: number, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function truncate(path: string | Buffer, len?: number): Promise<void>;
/**
@@ -220,25 +222,25 @@ export function truncate(path: string | Buffer, len?: number): Promise<void>;
* @param path
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function unlink(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function unlink(path: string | Buffer, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function unlink(path: string | Buffer): Promise<void>;
export function utimes(path: string | Buffer, atime: number, mtime: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback: (err?: NodeJS.ErrnoException) => void): void;
export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback: (err?: NodeJS.ErrnoException | null) => void): void;
export function utimes(path: string | Buffer, atime: number, mtime: number): Promise<void>;
export function utimes(path: string | Buffer, atime: Date, mtime: Date): Promise<void>;
export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
export function write(fd: number, buffer: Buffer, offset: number, length: number, callback: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
export function write(fd: number, data: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
export function write(fd: number, data: any, offset: number, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
export function write(fd: number, data: any, offset: number, encoding: string, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
export function write(fd: number, buffer: Buffer, offset: number, length: number, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: Buffer) => void): void;
export function write(fd: number, data: any, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
export function write(fd: number, data: any, offset: number, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
export function write(fd: number, data: any, offset: number, encoding: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
export function write(fd: number, buffer: Buffer, offset: number, length: number, position?: number | null): Promise<WriteResult>;
export function write(fd: number, data: any, offset: number, encoding?: string): Promise<WriteResult>;
export function writeFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
export function writeFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void;
export function writeFile(file: string | Buffer | number, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): Promise<void>;
export function writeFile(file: string | Buffer | number, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback: (err: NodeJS.ErrnoException) => void): void;
export function writeFile(file: string | Buffer | number, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback: (err: NodeJS.ErrnoException | null) => void): void;
/**
* Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
@@ -247,7 +249,7 @@ export function writeFile(file: string | Buffer | number, data: any, options: {
* @param callback The created folder path is passed as a string to the callback's second parameter.
*/
export function mkdtemp(prefix: string): Promise<string>;
export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void;
export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void;
export interface PathEntry {
path: string;
+12 -5
View File
@@ -42,11 +42,7 @@ declare namespace gapi.auth2 {
/**
* Get permission from the user to access the specified scopes offline.
*/
grantOfflineAccess(options?: {
scope?: string;
prompt?: "select_account" | "consent";
app_package_name?: string;
}): any;
grantOfflineAccess(options?: OfflineAccessOptions): Promise<{code: string}>;
/**
* Attaches the sign-in flow to the specified container's click handler.
@@ -107,6 +103,17 @@ declare namespace gapi.auth2 {
scope?: string;
}
/**
* Definitions by: John <https://github.com/jhcao23>
* Interface that represents the different configuration parameters for the GoogleAuth.grantOfflineAccess(options) method.
* Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2offlineaccessoptions
*/
interface OfflineAccessOptions {
scope?: string;
prompt?: "select_account" | "consent";
app_package_name?: string;
}
/**
* Interface that represents the different configuration parameters for the gapi.auth2.init method.
* Reference: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauth2clientconfig
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}
+6 -4
View File
@@ -294,8 +294,9 @@ outMat4 = mat4.fromXRotation(outMat4, Math.PI);
outMat4 = mat4.fromYRotation(outMat4, Math.PI);
outMat4 = mat4.fromZRotation(outMat4, Math.PI);
outMat4 = mat4.fromRotationTranslation(outMat4, quatA, vec3A);
outVec3 = mat4.getTranslation(outVec3, mat4A)
outQuat = mat4.getRotation(outQuat, mat4A)
outVec3 = mat4.getTranslation(outVec3, mat4A);
outVec3 = mat4.getScaling(outVec3, mat4A);
outQuat = mat4.getRotation(outQuat, mat4A);
outMat4 = mat4.fromRotationTranslationScale(outMat4, quatA, vec3A, vec3B);
outMat4 = mat4.fromRotationTranslationScaleOrigin(outMat4, quatA, vec3A, vec3B, vec3A);
outMat4 = mat4.fromQuat(outMat4, quatB);
@@ -643,8 +644,9 @@ outMat4 = _mat4.fromXRotation(outMat4, Math.PI);
outMat4 = _mat4.fromYRotation(outMat4, Math.PI);
outMat4 = _mat4.fromZRotation(outMat4, Math.PI);
outMat4 = _mat4.fromRotationTranslation(outMat4, quatA, vec3A);
outVec3 = _mat4.getTranslation(outVec3, mat4A)
outQuat = _mat4.getRotation(outQuat, mat4A)
outVec3 = _mat4.getTranslation(outVec3, mat4A);
outVec3 = _mat4.getScaling(outVec3, mat4A);
outQuat = _mat4.getRotation(outQuat, mat4A);
outMat4 = _mat4.fromRotationTranslationScale(outMat4, quatA, vec3A, vec3B);
outMat4 = _mat4.fromRotationTranslationScaleOrigin(outMat4, quatA, vec3A, vec3B, vec3A);
outMat4 = _mat4.fromQuat(outMat4, quatB);
+12
View File
@@ -1,6 +1,7 @@
// Type definitions for gl-matrix 2.2.2
// Project: https://github.com/toji/gl-matrix
// Definitions by: Mattijs Kneppers <https://github.com/mattijskneppers>, based on definitions by Tat <https://github.com/tatchx>
// Austin Martin <https://github.com/auzmartist>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'gl-matrix' {
@@ -2450,6 +2451,17 @@ declare module 'gl-matrix' {
*/
public static getTranslation(out: vec3, mat: mat4): vec3;
/**
* Returns the scaling factor component of a transformation matrix.
* If a matrix is built with fromRotationTranslationScale with a
* normalized Quaternion parameter, the returned vector will be
* the same as the scaling vector originally supplied.
* @param {vec3} out Vector to receive scaling factor component
* @param {mat4} mat Matrix to be decomposed (input)
* @return {vec3} out
*/
public static getScaling(out: vec3, mat: mat4): vec3;
/**
* Returns a quaternion representing the rotational component
* of a transformation matrix. If a matrix is built with
+15 -14
View File
@@ -1,16 +1,17 @@
{
"extends": "dtslint/dt.json",
"rules": {
"align": false,
"array-type": false,
"new-parens": false,
"no-consecutive-blank-lines": false,
"interface-over-type-literal": false,
"no-relative-import-in-test": false,
"no-var": false,
"prefer-declare-function": false,
"semicolon": false,
"strict-export-declare-modifiers": false,
"trim-file": false
}
"extends": "dtslint/dt.json",
"rules": {
"align": false,
"array-type": false,
"new-parens": false,
"no-consecutive-blank-lines": false,
"interface-over-type-literal": false,
"no-relative-import-in-test": false,
"no-var": false,
"prefer-declare-function": false,
"semicolon": false,
"strict-export-declare-modifiers": false,
"trim-file": false,
"no-unnecessary-generics": false
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
"rules": {
"dt-header": false,
"ban-types": false,
"unified-signatures": false
"unified-signatures": false,
"no-unnecessary-generics": false
}
}
+6 -1
View File
@@ -1 +1,6 @@
{ "extends": "dtslint/dt.json" }
{
"extends": "dtslint/dt.json",
"rules": {
"no-any-union": false
}
}
-1
View File
@@ -1 +0,0 @@
execution/values.d.ts
+2
View File
@@ -4,3 +4,5 @@ export {
responsePathAsArray,
ExecutionResult
} from './execute';
export { getDirectiveValues } from './values';
+13
View File
@@ -23,3 +23,16 @@ export function getArgumentValues(
node: FieldNode | DirectiveNode,
variableValues?: { [key: string]: any }
): { [key: string]: any };
/**
* Prepares an object map of argument values given a directive definition
* and a AST node which may contain directives. Optionally also accepts a map
* of variable values.
*
* If the directive does not exist on the node, returns undefined.
*/
export function getDirectiveValues(
directiveDef: GraphQLDirective,
node: { directives?: Array<DirectiveNode> },
variableValues?: { [key: string]: any }
): void | { [key: string]: any };
+34 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for graphql 0.10
// Type definitions for graphql 0.11
// Project: https://www.npmjs.com/package/graphql
// Definitions by: TonyYang <https://github.com/TonyPythoneer>
// Caleb Meredith <https://github.com/calebmer>
@@ -6,6 +6,8 @@
// Firede <https://github.com/firede>
// Kepennar <https://github.com/kepennar>
// Mikhail Novikov <https://github.com/freiksenet>
// Ivan Goncharov <https://github.com/IvanGoncharov>
// Hagai Cohen <https://github.com/DxCx>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -27,6 +29,7 @@ export {
execute,
defaultFieldResolver,
responsePathAsArray,
getDirectiveValues,
ExecutionResult,
} from './execution';
@@ -34,7 +37,37 @@ export {
export {
validate,
ValidationContext,
// All validation rules in the GraphQL Specification.
specifiedRules,
// Individual validation rules.
ArgumentsOfCorrectTypeRule,
DefaultValuesOfCorrectTypeRule,
FieldsOnCorrectTypeRule,
FragmentsOnCompositeTypesRule,
KnownArgumentNamesRule,
KnownDirectivesRule,
KnownFragmentNamesRule,
KnownTypeNamesRule,
LoneAnonymousOperationRule,
NoFragmentCyclesRule,
NoUndefinedVariablesRule,
NoUnusedFragmentsRule,
NoUnusedVariablesRule,
OverlappingFieldsCanBeMergedRule,
PossibleFragmentSpreadsRule,
ProvidedNonNullArgumentsRule,
ScalarLeafsRule,
SingleFieldSubscriptionsRule,
UniqueArgumentNamesRule,
UniqueDirectivesPerLocationRule,
UniqueFragmentNamesRule,
UniqueInputFieldNamesRule,
UniqueOperationNamesRule,
UniqueVariableNamesRule,
VariablesAreInputTypesRule,
VariablesInAllowedPositionRule,
} from './validation';
// Create and format GraphQL errors.
+2 -2
View File
@@ -14,7 +14,7 @@ export function subscribe(
operationName?: string,
fieldResolver?: GraphQLFieldResolver<any, any>,
subscribeFieldResolver?: GraphQLFieldResolver<any, any>
): AsyncIterator<ExecutionResult>;
): Promise<AsyncIterator<ExecutionResult> | ExecutionResult>;
export function createSourceEventStream(
schema: GraphQLSchema,
@@ -26,4 +26,4 @@ export function createSourceEventStream(
},
operationName?: string,
fieldResolver?: GraphQLFieldResolver<any, any>
): AsyncIterable<any>;
): Promise<AsyncIterable<any>>;
+130
View File
@@ -1,2 +1,132 @@
export { validate, ValidationContext } from './validate';
export { specifiedRules } from './specifiedRules';
// Spec Section: "Argument Values Type Correctness"
export {
ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule
} from './rules/ArgumentsOfCorrectType';
// Spec Section: "Variable Default Values Are Correctly Typed"
export {
DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule
} from './rules/DefaultValuesOfCorrectType';
// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types"
export {
FieldsOnCorrectType as FieldsOnCorrectTypeRule
} from './rules/FieldsOnCorrectType';
// Spec Section: "Fragments on Composite Types"
export {
FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule
} from './rules/FragmentsOnCompositeTypes';
// Spec Section: "Argument Names"
export {
KnownArgumentNames as KnownArgumentNamesRule
} from './rules/KnownArgumentNames';
// Spec Section: "Directives Are Defined"
export {
KnownDirectives as KnownDirectivesRule
} from './rules/KnownDirectives';
// Spec Section: "Fragment spread target defined"
export {
KnownFragmentNames as KnownFragmentNamesRule
} from './rules/KnownFragmentNames';
// Spec Section: "Fragment Spread Type Existence"
export {
KnownTypeNames as KnownTypeNamesRule
} from './rules/KnownTypeNames';
// Spec Section: "Lone Anonymous Operation"
export {
LoneAnonymousOperation as LoneAnonymousOperationRule
} from './rules/LoneAnonymousOperation';
// Spec Section: "Fragments must not form cycles"
export {
NoFragmentCycles as NoFragmentCyclesRule
} from './rules/NoFragmentCycles';
// Spec Section: "All Variable Used Defined"
export {
NoUndefinedVariables as NoUndefinedVariablesRule
} from './rules/NoUndefinedVariables';
// Spec Section: "Fragments must be used"
export {
NoUnusedFragments as NoUnusedFragmentsRule
} from './rules/NoUnusedFragments';
// Spec Section: "All Variables Used"
export {
NoUnusedVariables as NoUnusedVariablesRule
} from './rules/NoUnusedVariables';
// Spec Section: "Field Selection Merging"
export {
OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule
} from './rules/OverlappingFieldsCanBeMerged';
// Spec Section: "Fragment spread is possible"
export {
PossibleFragmentSpreads as PossibleFragmentSpreadsRule
} from './rules/PossibleFragmentSpreads';
// Spec Section: "Argument Optionality"
export {
ProvidedNonNullArguments as ProvidedNonNullArgumentsRule
} from './rules/ProvidedNonNullArguments';
// Spec Section: "Leaf Field Selections"
export {
ScalarLeafs as ScalarLeafsRule
} from './rules/ScalarLeafs';
// Spec Section: "Subscriptions with Single Root Field"
export {
SingleFieldSubscriptions as SingleFieldSubscriptionsRule
} from './rules/SingleFieldSubscriptions';
// Spec Section: "Argument Uniqueness"
export {
UniqueArgumentNames as UniqueArgumentNamesRule
} from './rules/UniqueArgumentNames';
// Spec Section: "Directives Are Unique Per Location"
export {
UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule
} from './rules/UniqueDirectivesPerLocation';
// Spec Section: "Fragment Name Uniqueness"
export {
UniqueFragmentNames as UniqueFragmentNamesRule
} from './rules/UniqueFragmentNames';
// Spec Section: "Input Object Field Uniqueness"
export {
UniqueInputFieldNames as UniqueInputFieldNamesRule
} from './rules/UniqueInputFieldNames';
// Spec Section: "Operation Name Uniqueness"
export {
UniqueOperationNames as UniqueOperationNamesRule
} from './rules/UniqueOperationNames';
// Spec Section: "Variable Uniqueness"
export {
UniqueVariableNames as UniqueVariableNamesRule
} from './rules/UniqueVariableNames';
// Spec Section: "Variables are Input Types"
export {
VariablesAreInputTypes as VariablesAreInputTypesRule
} from './rules/VariablesAreInputTypes';
// Spec Section: "All Variable Usages Are Allowed"
export {
VariablesInAllowedPosition as VariablesInAllowedPositionRule
} from './rules/VariablesInAllowedPosition';
@@ -0,0 +1,9 @@
import { ValidationContext } from '../index';
/**
* Argument values of correct type
*
* A GraphQL document is only valid if all field argument literal values are
* of the type expected by their position.
*/
export function ArgumentsOfCorrectType(context: ValidationContext): any;
@@ -0,0 +1,9 @@
import { ValidationContext } from '../index';
/**
* Variable default values of correct type
*
* A GraphQL document is only valid if all variable default values are of the
* type expected by their definition.
*/
export function DefaultValuesOfCorrectType(context: ValidationContext): any;
@@ -0,0 +1,9 @@
import { ValidationContext } from '../index';
/**
* Fields on correct type
*
* A GraphQL document is only valid if all fields selected are defined by the
* parent type, or are an allowed meta field such as __typename.
*/
export function FieldsOnCorrectType(context: ValidationContext): any;
@@ -0,0 +1,10 @@
import { ValidationContext } from '../index';
/**
* Fragments on composite type
*
* Fragments use a type condition to determine if they apply, since fragments
* can only be spread into a composite type (object, interface, or union), the
* type condition must also be a composite type.
*/
export function FragmentsOnCompositeTypes(context: ValidationContext): any;
@@ -0,0 +1,9 @@
import { ValidationContext } from '../index';
/**
* Known argument names
*
* A GraphQL field is only valid if all supplied arguments are defined by
* that field.
*/
export function KnownArgumentNames(context: ValidationContext): any;

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