mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped
This commit is contained in:
@@ -23,8 +23,5 @@
|
||||
"devDependencies": {
|
||||
"dtslint": "github:Microsoft/dtslint#production",
|
||||
"types-publisher": "Microsoft/types-publisher#production"
|
||||
},
|
||||
"dependencies": {
|
||||
"@egjs/axes": "^2.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
+10
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-any-union": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
-1
@@ -50,7 +50,10 @@ interface Acl {
|
||||
allowedPermissions: (userId: Value, resources: strings, cb?: AnyCallback) => Promise<void>;
|
||||
isAllowed: (userId: Value, resources: strings, permissions: strings, cb?: AllowedCallback) => Promise<boolean>;
|
||||
areAnyRolesAllowed: (roles: strings, resource: strings, permissions: strings, cb?: AllowedCallback) => Promise<any>;
|
||||
whatResources: (roles: strings, permissions: strings, cb?: AnyCallback) => Promise<any>;
|
||||
whatResources: {
|
||||
(roles: strings, cb?: AnyCallback): Promise<any>;
|
||||
(roles: strings, permissions: strings, cb?: AnyCallback): Promise<any>;
|
||||
}
|
||||
permittedResources: (roles: strings, permissions: strings, cb?: Function) => Promise<void>;
|
||||
middleware: (numPathComponents?: number, userId?: Value | GetUserId, actions?: strings) => express.RequestHandler;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,18 @@ acl.isAllowed('joed', 'blogs', 'view', (err, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
acl.whatResources('foo', (err, res) => {
|
||||
if (res) {
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
acl.whatResources('foo', 'view', (err, res) => {
|
||||
if (res) {
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
acl.isAllowed('jsmith', 'blogs', ['edit','view','delete'])
|
||||
.then((result) => {
|
||||
console.dir('jsmith is allowed blogs ' + result);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,16 +3,16 @@ import * as Agenda from "agenda";
|
||||
var mongoConnectionString = "mongodb://127.0.0.1/agenda";
|
||||
|
||||
var agenda = new Agenda({ db: { address: mongoConnectionString } });
|
||||
|
||||
|
||||
|
||||
|
||||
agenda.define('delete old users', (job, done) => {
|
||||
|
||||
});
|
||||
|
||||
agenda.on('ready', () => {
|
||||
agenda.every('3 minutes', 'delete old users');
|
||||
|
||||
// Alternatively, you could also do:
|
||||
|
||||
// Alternatively, you could also do:
|
||||
agenda.every('*/3 * * * *', 'delete old users');
|
||||
|
||||
agenda.start();
|
||||
@@ -81,6 +81,8 @@ agenda.stop(function() {
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
job.agenda.now('do the hokey pokey');
|
||||
|
||||
job.repeatEvery('10 minutes');
|
||||
|
||||
job.repeatAt('3:30pm');
|
||||
|
||||
Vendored
+6
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Agenda v0.8.9
|
||||
// Type definitions for Agenda v1.0.0
|
||||
// Project: https://github.com/rschmukler/agenda
|
||||
// Definitions by: Meir Gottlieb <https://github.com/meirgottlieb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -337,6 +337,11 @@ declare namespace Agenda {
|
||||
*/
|
||||
attrs: JobAttributes;
|
||||
|
||||
/**
|
||||
* The agenda that created the job.
|
||||
*/
|
||||
agenda: Agenda;
|
||||
|
||||
/**
|
||||
* Specifies an interval on which the job should repeat.
|
||||
* @param interval A human-readable format String, a cron format String, or a Number.
|
||||
|
||||
Vendored
+24
@@ -98,10 +98,34 @@ export interface Request {
|
||||
locale?: string;
|
||||
}
|
||||
|
||||
export interface ResolutionStatus {
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface ResolutionValue {
|
||||
name: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ResolutionValueContainer {
|
||||
value: ResolutionValue;
|
||||
}
|
||||
|
||||
export interface Resolution {
|
||||
authority: string;
|
||||
status: ResolutionStatus;
|
||||
values: ResolutionValueContainer[];
|
||||
}
|
||||
|
||||
export interface Resolutions {
|
||||
resolutionsPerAuthority: Resolution[];
|
||||
}
|
||||
|
||||
export interface SlotValue {
|
||||
confirmationStatus?: ConfirmationStatuses;
|
||||
name: string;
|
||||
value?: any;
|
||||
resolutions?: Resolutions;
|
||||
}
|
||||
|
||||
export interface Intent {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
+124
-158
@@ -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();
|
||||
|
||||
Vendored
+28
-19
@@ -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;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-any-union": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+79
-55
@@ -10,8 +10,12 @@ export { t as types };
|
||||
export type Node = t.Node;
|
||||
export import template = require('babel-template');
|
||||
export const version: string;
|
||||
import traverse, { Visitor } from "babel-traverse";
|
||||
import traverse, { Visitor, NodePath } from "babel-traverse";
|
||||
export { traverse, Visitor };
|
||||
import { BabylonOptions } from "babylon";
|
||||
export { BabylonOptions };
|
||||
import { GeneratorOptions } from "babel-generator";
|
||||
export { GeneratorOptions };
|
||||
|
||||
// A babel plugin is a simple function which must return an object matching
|
||||
// the following interface. Babel will throw if it finds unknown properties.
|
||||
@@ -38,14 +42,29 @@ export function transformFileSync(filename: string, opts?: TransformOptions): Ba
|
||||
export function transformFromAst(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult;
|
||||
|
||||
export interface TransformOptions {
|
||||
/** Filename to use when reading from stdin - this will be used in source-maps, errors etc. Default: "unknown". */
|
||||
filename?: string;
|
||||
/** Include the AST in the returned object. Default: `true`. */
|
||||
ast?: boolean;
|
||||
|
||||
/** Filename relative to `sourceRoot`. */
|
||||
filenameRelative?: string;
|
||||
/** Attach a comment after all non-user injected code. */
|
||||
auxiliaryCommentAfter?: string;
|
||||
|
||||
/** A source map object that the output source map will be based on. */
|
||||
inputSourceMap?: object;
|
||||
/** Attach a comment before all non-user injected code. */
|
||||
auxiliaryCommentBefore?: string;
|
||||
|
||||
/** Specify whether or not to use `.babelrc` and `.babelignore` files. Default: `true`. */
|
||||
babelrc?: boolean;
|
||||
|
||||
/** Enable code generation. Default: `true`. */
|
||||
code?: boolean;
|
||||
|
||||
/** write comments to generated output. Default: `true`. */
|
||||
comments?: boolean;
|
||||
|
||||
/**
|
||||
* Do not include superfluous whitespace characters and line terminators. When set to `"auto"`, `compact` is set to
|
||||
* `true` on input sizes of >100KB.
|
||||
*/
|
||||
compact?: boolean | "auto";
|
||||
|
||||
/**
|
||||
* This is an object of keys that represent different environments. For example, you may have:
|
||||
@@ -55,38 +74,68 @@ export interface TransformOptions {
|
||||
*/
|
||||
env?: object;
|
||||
|
||||
/** Retain line numbers - will result in really ugly code. Default: `false` */
|
||||
retainLines?: boolean;
|
||||
/** A path to an .babelrc file to extend. */
|
||||
extends?: string;
|
||||
|
||||
/** Filename to use when reading from stdin - this will be used in source-maps, errors etc. Default: "unknown". */
|
||||
filename?: string;
|
||||
|
||||
/** Filename relative to `sourceRoot`. */
|
||||
filenameRelative?: string;
|
||||
|
||||
/** An object containing the options to be passed down to the babel code generator, babel-generator. Default: `{}` */
|
||||
generatorOpts?: GeneratorOptions;
|
||||
|
||||
/**
|
||||
* Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`.
|
||||
* If falsy value is returned then the generated module id is used.
|
||||
*/
|
||||
getModuleId?(moduleName: string): string;
|
||||
|
||||
/** Enable/disable ANSI syntax highlighting of code frames. Default: `true`. */
|
||||
highlightCode?: boolean;
|
||||
|
||||
/** List of presets (a set of plugins) to load and use. */
|
||||
presets?: any[];
|
||||
|
||||
/** List of plugins to load and use. */
|
||||
plugins?: any[];
|
||||
|
||||
/** list of glob paths to **not** compile. Opposite to the `only` option. */
|
||||
ignore?: string[];
|
||||
|
||||
/** A source map object that the output source map will be based on. */
|
||||
inputSourceMap?: object;
|
||||
|
||||
/** Should the output be minified. Default: `false` */
|
||||
minified?: boolean;
|
||||
|
||||
/** Specify a custom name for module ids. */
|
||||
moduleId?: string;
|
||||
|
||||
/**
|
||||
* If truthy, insert an explicit id for modules. By default, all modules are anonymous.
|
||||
* (Not available for `common` modules).
|
||||
*/
|
||||
moduleIds?: boolean;
|
||||
|
||||
/** Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions. */
|
||||
moduleRoot?: string;
|
||||
|
||||
/**
|
||||
* A glob, regex, or mixed array of both, matching paths to only compile. Can also be an array of arrays containing
|
||||
* paths to explicitly match. When attempting to compile a non-matching file it's returned verbatim.
|
||||
*/
|
||||
only?: string | RegExp | Array<string | RegExp>;
|
||||
|
||||
/** Enable code generation. Default: `true`. */
|
||||
code?: boolean;
|
||||
/** Babylon parser options. */
|
||||
parserOpts?: BabylonOptions;
|
||||
|
||||
/** Include the AST in the returned object. Default: `true`. */
|
||||
ast?: boolean;
|
||||
/** List of plugins to load and use. */
|
||||
plugins?: any[];
|
||||
|
||||
/** A path to an .babelrc file to extend. */
|
||||
extends?: string;
|
||||
/** List of presets (a set of plugins) to load and use. */
|
||||
presets?: any[];
|
||||
|
||||
/** write comments to generated output. Default: `true`. */
|
||||
comments?: boolean;
|
||||
/** Retain line numbers - will result in really ugly code. Default: `false` */
|
||||
retainLines?: boolean;
|
||||
|
||||
/** Resolve a module source ie. import "SOURCE"; to a custom value. */
|
||||
resolveModuleSource?(source: string, filename: string): string;
|
||||
|
||||
/**
|
||||
* An optional callback that controls whether a comment should be output or not. Called as
|
||||
@@ -94,11 +143,8 @@ export interface TransformOptions {
|
||||
*/
|
||||
shouldPrintComment?(comment: string): boolean;
|
||||
|
||||
/**
|
||||
* Do not include superfluous whitespace characters and line terminators. When set to `"auto"`, `compact` is set to
|
||||
* `true` on input sizes of >100KB.
|
||||
*/
|
||||
compact?: boolean | "auto";
|
||||
/** Set `sources[0]` on returned source map. */
|
||||
sourceFileName?: string;
|
||||
|
||||
/**
|
||||
* If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a `sourceMappingURL`
|
||||
@@ -110,38 +156,16 @@ export interface TransformOptions {
|
||||
/** Set `file` on returned source map. */
|
||||
sourceMapTarget?: string;
|
||||
|
||||
/** Set `sources[0]` on returned source map. */
|
||||
sourceFileName?: string;
|
||||
|
||||
/** The root from which all sources are relative. */
|
||||
sourceRoot?: string;
|
||||
|
||||
/** Specify whether or not to use `.babelrc` and `.babelignore` files. Default: `true`. */
|
||||
babelrc?: boolean;
|
||||
/** Indicate the mode the code should be parsed in. Can be either “script” or “module”. Default: "module" */
|
||||
sourceType?: "script" | "module";
|
||||
|
||||
/** Attach a comment before all non-user injected code. */
|
||||
auxiliaryCommentBefore?: string;
|
||||
|
||||
/** Attach a comment after all non-user injected code. */
|
||||
auxiliaryCommentAfter?: string;
|
||||
|
||||
/**
|
||||
* Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`.
|
||||
* If falsy value is returned then the generated module id is used.
|
||||
/** An optional callback that can be used to wrap visitor methods.
|
||||
* NOTE: This is useful for things like introspection, and not really needed for implementing anything.
|
||||
*/
|
||||
getModuleId?(moduleName: string): string;
|
||||
|
||||
/** Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions. */
|
||||
moduleRoot?: string;
|
||||
|
||||
/**
|
||||
* If truthy, insert an explicit id for modules. By default, all modules are anonymous.
|
||||
* (Not available for `common` modules).
|
||||
*/
|
||||
moduleIds?: boolean;
|
||||
|
||||
/** Specify a custom name for module ids. */
|
||||
moduleId?: string;
|
||||
wrapPluginVisitorMethod?(pluginAlias: string, visitorType: 'enter' | 'exit', callback: (path: NodePath, state: any) => void): (path: NodePath, state: any) => void ;
|
||||
}
|
||||
|
||||
export interface BabelFileResult {
|
||||
|
||||
@@ -6,12 +6,12 @@ class DestroyWarn extends Marionette.Behavior {
|
||||
// just like you can in your Backbone Models
|
||||
// they will be overriden if you pass in an option with the same key
|
||||
defaults = {
|
||||
"message": "you are destroying!"
|
||||
message: 'you are destroying!'
|
||||
};
|
||||
|
||||
// behaviors have events that are bound to the views DOM
|
||||
events = {
|
||||
"click @ui.destroy": "warnBeforeDestroy"
|
||||
'click @ui.destroy': 'warnBeforeDestroy'
|
||||
};
|
||||
|
||||
warnBeforeDestroy() {
|
||||
@@ -22,34 +22,32 @@ class DestroyWarn extends Marionette.Behavior {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Marionette.Behaviors.getBehaviorClass = (options, key) => {
|
||||
if (key === "DestroyWarn")
|
||||
if (key === 'DestroyWarn')
|
||||
return DestroyWarn;
|
||||
|
||||
return undefined;
|
||||
};
|
||||
|
||||
class MyRouter extends Marionette.AppRouter {
|
||||
// "someMethod" must exist at controller.someMethod
|
||||
// 'someMethod' must exist at controller.someMethod
|
||||
appRoutes = {
|
||||
"some/route": "someMethod"
|
||||
'some/route': 'someMethod'
|
||||
};
|
||||
|
||||
/* standard routes can be mixed with appRoutes/Controllers above */
|
||||
routes = {
|
||||
"some/otherRoute": "someOtherMethod"
|
||||
'some/otherRoute': 'someOtherMethod'
|
||||
};
|
||||
|
||||
someOtherMethod() {
|
||||
// do something here.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class MyApplication extends Marionette.Application {
|
||||
initialize(options?: any) {
|
||||
console.log("initializing application");
|
||||
console.log('initializing application');
|
||||
this.layoutView = new AppLayoutView();
|
||||
}
|
||||
|
||||
@@ -60,12 +58,16 @@ class MyApplication extends Marionette.Application {
|
||||
this.mainRegion = new Marionette.Region({ el: '#main' });
|
||||
this.layoutView.addRegion('main', this.mainRegion);
|
||||
this.layoutView.render();
|
||||
this.layoutView.showChildView('main', new MyView(new MyModel));
|
||||
this.layoutView.showChildView('main', new MyView(new MyModel()));
|
||||
let view: Backbone.View<Backbone.Model> = this.layoutView.getChildView('main');
|
||||
let regions: {[key: string]: Marionette.Region} = this.layoutView.getRegions();
|
||||
let prefix: string = this.layoutView.childViewEventPrefix;
|
||||
let region: Marionette.Region = this.layoutView.removeRegion('main');
|
||||
let layout: Marionette.View<Backbone.Model> = this.layoutView.destroy();
|
||||
|
||||
let prefix: string;
|
||||
if (typeof this.layoutView.childViewEventPrefix === 'string') {
|
||||
this.layoutView.childViewEventPrefix;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,16 +77,15 @@ class AppLayoutView extends Marionette.View<Backbone.Model> {
|
||||
}
|
||||
|
||||
template() {
|
||||
return "<div id='main'></div>";
|
||||
return '<div id="main"></div>';
|
||||
}
|
||||
|
||||
initialize(options?: any) {
|
||||
console.log("initializing layoutview");
|
||||
console.log('initializing layoutview');
|
||||
}
|
||||
}
|
||||
|
||||
class MyModel extends Backbone.Model {
|
||||
|
||||
constructor(options?: any) {
|
||||
super(options);
|
||||
}
|
||||
@@ -99,22 +100,20 @@ class MyModel extends Backbone.Model {
|
||||
}
|
||||
|
||||
class MyBaseView extends Marionette.View<MyModel> {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.getOption<string>('foo');
|
||||
this.triggers = {
|
||||
'click .foo': 'bar'
|
||||
};
|
||||
super();
|
||||
this.getOption('foo');
|
||||
this.triggers = {
|
||||
'click .foo': 'bar'
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class MyView extends Marionette.View<MyModel> {
|
||||
behaviors: any;
|
||||
|
||||
constructor(model: MyModel) {
|
||||
super({ model: model });
|
||||
super({ model });
|
||||
|
||||
this.ui = {
|
||||
destroy: '.destroy'
|
||||
@@ -130,8 +129,7 @@ class MyView extends Marionette.View<MyModel> {
|
||||
template() {
|
||||
return '<h1>' + this.model.getName() + '</h1> <button class="destroy">Destroy Me</button>';
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
class MainRegion extends Marionette.Region {
|
||||
constructor() {
|
||||
@@ -140,7 +138,6 @@ class MainRegion extends Marionette.Region {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MyObject extends Marionette.Object {
|
||||
name: string;
|
||||
options: any;
|
||||
@@ -153,13 +150,13 @@ class MyObject extends Marionette.Object {
|
||||
name: 'Foo'
|
||||
};
|
||||
|
||||
this.on("before:destroy", () => {
|
||||
console.log("before:destroy");
|
||||
this.on('before:destroy', () => {
|
||||
console.log('before:destroy');
|
||||
});
|
||||
}
|
||||
|
||||
onBeforeDestroy(arg: any) {
|
||||
console.log("in onBeforeDestroy with arg " + arg);
|
||||
console.log('in onBeforeDestroy with arg ' + arg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +177,7 @@ class MyJQueryRegion extends Marionette.Region {
|
||||
class MyHtmlElRegion extends Marionette.Region {
|
||||
constructor() {
|
||||
super();
|
||||
this.el = document.querySelector("body");
|
||||
this.el = document.querySelector('body');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,77 +186,48 @@ class MyCollectionView extends Marionette.CollectionView<MyModel, MyView> {
|
||||
super();
|
||||
this.childView = MyView;
|
||||
this.childViewEvents = {
|
||||
render: function () {
|
||||
console.log("a childView has been rendered");
|
||||
render() {
|
||||
console.log('a childView has been rendered');
|
||||
}
|
||||
};
|
||||
|
||||
this.childViewOptions = function (model: any, index: any): any {
|
||||
this.childViewOptions = (model: any, index: any): any => {
|
||||
// do some calculations based on the model
|
||||
return {
|
||||
foo: "bar",
|
||||
childIndex: index
|
||||
}
|
||||
id: 'bar'
|
||||
};
|
||||
};
|
||||
|
||||
this.childViewOptions = {
|
||||
foo: "bar"
|
||||
id: 'bar'
|
||||
};
|
||||
|
||||
this.childViewEventPrefix = "some:prefix";
|
||||
|
||||
this.on('some:prefix:render', function () {
|
||||
this.childViewEventPrefix = 'some:prefix';
|
||||
|
||||
this.on('some:prefix:render', () => {
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var app: MyApplication;
|
||||
let app: MyApplication;
|
||||
|
||||
function ApplicationTests() {
|
||||
app = new MyApplication();
|
||||
|
||||
app.start();
|
||||
|
||||
var view = new MyView(new MyModel());
|
||||
let view = new MyView(new MyModel());
|
||||
app.mainRegion.show(view);
|
||||
}
|
||||
|
||||
function ObjectTests() {
|
||||
var obj = new MyObject();
|
||||
let obj = new MyObject();
|
||||
console.log(obj.getOption('name'));
|
||||
obj.destroy("goodbye");
|
||||
}
|
||||
|
||||
function RegionManagerTests() {
|
||||
var rm = new Marionette.RegionManager();
|
||||
rm.addRegions({
|
||||
contentRegion: {
|
||||
el: '#content',
|
||||
regionClass: MainRegion
|
||||
},
|
||||
|
||||
navigationRegion: {
|
||||
el: '#navigation',
|
||||
regionClass: MainRegion,
|
||||
|
||||
// Options passed to instance of `MyOtherRegion` for
|
||||
// the `navigationRegion` on `App`
|
||||
navigationOption: 42,
|
||||
anotherNavigationOption: 'foo'
|
||||
},
|
||||
|
||||
footerRegion: {
|
||||
regionClass: MainRegion,
|
||||
someOption: 42,
|
||||
someValue: 'value'
|
||||
}
|
||||
});
|
||||
obj.destroy('goodbye');
|
||||
}
|
||||
|
||||
function RegionTests() {
|
||||
var myView: Marionette.View<MyModel> = new MyView(new MyModel());
|
||||
let myView: Marionette.View<MyModel> = new MyView(new MyModel());
|
||||
|
||||
// render and display the view
|
||||
app.mainRegion.show(myView);
|
||||
@@ -268,28 +236,27 @@ function RegionTests() {
|
||||
app.mainRegion.empty();
|
||||
|
||||
myView = new MyView(new MyModel());
|
||||
app.mainRegion.show(myView, { preventDestroy: true, forceShow: true, triggerAttach: true, triggerBeforeAttach: false });
|
||||
app.mainRegion.show(myView, { preventDestroy: true });
|
||||
|
||||
var hasView: boolean = app.mainRegion.hasView();
|
||||
let hasView: boolean = app.mainRegion.hasView();
|
||||
|
||||
app.mainRegion.reset();
|
||||
|
||||
Marionette.Region.prototype.attachHtml = function (view: any): void {
|
||||
Marionette.Region.prototype.attachHtml = (view: any): void => {
|
||||
this.$el.empty().append(view.el);
|
||||
}
|
||||
};
|
||||
|
||||
myView = new Marionette.View<MyModel>({
|
||||
el: $("#existing-view-stuff")
|
||||
el: $('#existing-view-stuff')
|
||||
});
|
||||
|
||||
app.mainRegion.attachView(myView);
|
||||
app.mainRegion.show(myView);
|
||||
|
||||
app.mainRegion.on("empty", function (view: any, region: any, options: any) {
|
||||
app.mainRegion.on('empty', (view: any, region: any, options: any) => {
|
||||
// manipulate the `view` or do something extra
|
||||
// with the `region`
|
||||
// you also have access to the `options` that were passed to the Region.show call
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function ViewTests() {
|
||||
@@ -301,29 +268,27 @@ function ViewTests() {
|
||||
}
|
||||
|
||||
function CollectionViewTests() {
|
||||
var cv = new MyCollectionView();
|
||||
let cv = new MyCollectionView();
|
||||
cv.collection.add(new MyModel());
|
||||
app.mainRegion.attachView(cv);
|
||||
cv.addEmptyView(new MyModel, MyView);
|
||||
cv.proxyChildEvents(new MyView(new MyModel));
|
||||
let children: Backbone.ChildViewContainer<Marionette.View<Backbone.Model>> = cv.destroyChildren();
|
||||
let view: Marionette.CollectionView<Backbone.Model, Marionette.View<Backbone.Model>> = cv.destroy();
|
||||
app.mainRegion.show(cv);
|
||||
cv.emptyView = MyView;
|
||||
let view: Marionette.CollectionView<MyModel, MyView> = cv.destroy();
|
||||
}
|
||||
|
||||
class MyController extends Marionette.Controller {
|
||||
class MyController {
|
||||
doFoo() { }
|
||||
|
||||
doBar() { }
|
||||
}
|
||||
|
||||
function AppRouterTests() {
|
||||
var myController = new MyController();
|
||||
var router = new MyRouter();
|
||||
let myController = new MyController();
|
||||
let router = new MyRouter();
|
||||
|
||||
router.appRoute("/foo", "fooThat");
|
||||
router.appRoute('/foo', 'fooThat');
|
||||
|
||||
router.processAppRoutes(myController, {
|
||||
"foo": "doFoo",
|
||||
"bar/:id": "doBar"
|
||||
foo: 'doFoo',
|
||||
'bar/:id': 'doBar'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1196
-958
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-misused-new": false
|
||||
// TODOs
|
||||
"no-misused-new": false,
|
||||
"no-any-union": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"no-empty-interface": false,
|
||||
"array-type": false,
|
||||
"unified-signatures": false,
|
||||
"ban-types": false
|
||||
"ban-types": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -589,8 +589,10 @@ Promise.props({ num: 1, str: Promise.resolve('a') }).then(val => { propsValue =
|
||||
Promise.props(Promise.props({ num: 1, str: Promise.resolve('a') })).then(val => { propsValue = val });
|
||||
|
||||
var propsMapValue: Map<number, string>;
|
||||
Promise.resolve(new Map<number, Promise<string>>()).props().then(val => { propsMapValue = val });
|
||||
Promise.props(new Map<number, Promise<string>>()).then(val => { propsMapValue = val });
|
||||
Promise.resolve(new Map<number, string>()).props().then(val => { propsMapValue = val });
|
||||
Promise.resolve(new Map<number, PromiseLike<string>>()).props().then(val => { propsMapValue = val });
|
||||
Promise.props(new Map<number, string>()).then(val => { propsMapValue = val });
|
||||
Promise.props(new Map<number, PromiseLike<string>>()).then(val => { propsMapValue = val });
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
Vendored
+8
-8
@@ -46,7 +46,7 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
|
||||
* Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
|
||||
*/
|
||||
// Based on PromiseLike.then, but returns a Bluebird instance.
|
||||
then<U>(onFulfill?: (value: R) => U | Bluebird.Thenable<U>, onReject?: (error: any) => U | Bluebird.Thenable<U>): Bluebird<U>; // For simpler signature help.
|
||||
then<U>(onFulfill?: (value: R) => U | PromiseLike<U>, onReject?: (error: any) => U | PromiseLike<U>): Bluebird<U>; // For simpler signature help.
|
||||
then<TResult1 = R, TResult2 = never>(onfulfilled?: ((value: R) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Bluebird<TResult1 | TResult2>;
|
||||
|
||||
/**
|
||||
@@ -620,7 +620,7 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
|
||||
/**
|
||||
* Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
props<K, V>(this: PromiseLike<Map<K, Bluebird.Thenable<V> | V>>): Bluebird<Map<K, V>>;
|
||||
props<K, V>(this: PromiseLike<Map<K, PromiseLike<V> | V>>): Bluebird<Map<K, V>>;
|
||||
props<T>(this: PromiseLike<Bluebird.ResolvableProps<T>>): Bluebird<T>;
|
||||
|
||||
/**
|
||||
@@ -749,12 +749,12 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
|
||||
*
|
||||
* If you pass a `receiver`, the `nodeFunction` will be called as a method on the `receiver`.
|
||||
*/
|
||||
static promisify<T>(func: (callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): () => Bluebird<T>;
|
||||
static promisify<T, A1>(func: (arg1: A1, callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1) => Bluebird<T>;
|
||||
static promisify<T, A1, A2>(func: (arg1: A1, arg2: A2, callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2) => Bluebird<T>;
|
||||
static promisify<T, A1, A2, A3>(func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3) => Bluebird<T>;
|
||||
static promisify<T, A1, A2, A3, A4>(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird<T>;
|
||||
static promisify<T, A1, A2, A3, A4, A5>(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird<T>;
|
||||
static promisify<T>(func: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): () => Bluebird<T>;
|
||||
static promisify<T, A1>(func: (arg1: A1, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1) => Bluebird<T>;
|
||||
static promisify<T, A1, A2>(func: (arg1: A1, arg2: A2, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2) => Bluebird<T>;
|
||||
static promisify<T, A1, A2, A3>(func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3) => Bluebird<T>;
|
||||
static promisify<T, A1, A2, A3, A4>(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird<T>;
|
||||
static promisify<T, A1, A2, A3, A4, A5>(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird<T>;
|
||||
static promisify(nodeFunction: Function, options?: Bluebird.PromisifyOptions): Function;
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
// Type definitions for bootstrap.timepicker
|
||||
// Project: https://github.com/jdewit/bootstrap-timepicker
|
||||
// Definitions by: derikwhittaker <https://github.com/derikwhittaker>
|
||||
// Definitions by: derikwhittaker <https://github.com/derikwhittaker>, Heather Booker <https://github.com/heatherbooker>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
interface TimepickerOptions {
|
||||
defaultTime?: string|boolean;
|
||||
defaultTime?: string|boolean|Date;
|
||||
disableFocus?: boolean;
|
||||
disableMousewheel?: boolean;
|
||||
explicitMode?: boolean;
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Vendored
+132
-11
@@ -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>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ expect(wrapper).to.have.ref("test");
|
||||
expect(wrapper).to.be.selected();
|
||||
expect(wrapper).to.have.tagName("div");
|
||||
expect(wrapper).to.have.text("");
|
||||
expect(wrapper).to.contain.text("");
|
||||
expect(wrapper).to.have.type(Test);
|
||||
expect(wrapper).to.have.value("test");
|
||||
expect(wrapper).to.have.attr("test", "test");
|
||||
|
||||
Vendored
+6
@@ -26,6 +26,12 @@ declare namespace Chai {
|
||||
* @param code
|
||||
*/
|
||||
(selector: EnzymeSelector): Assertion;
|
||||
|
||||
/**
|
||||
* Assert that the given wrapper has the supplied text:
|
||||
* @param str
|
||||
*/
|
||||
text(str?: string): Assertion;
|
||||
}
|
||||
interface Assertion {
|
||||
/**
|
||||
|
||||
@@ -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' })
|
||||
|
||||
Vendored
+3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+21
-11
@@ -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 {
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-any-union": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"ban-types": false
|
||||
"ban-types": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import * as counterpart from 'counterpart';
|
||||
|
||||
counterpart('translation.to.be.used');
|
||||
counterpart(['translation', 'to', 'be', 'used']);
|
||||
|
||||
counterpart.setSeparator('*');
|
||||
|
||||
counterpart.onTranslationNotFound((locale: string, key: string, fallback: string, scope: string) => {});
|
||||
counterpart.offTranslationNotFound((locale: string, key: string, fallback: string, scope: string) => {});
|
||||
|
||||
counterpart.setMissingEntryGenerator((value: string) => {});
|
||||
|
||||
counterpart.setLocale('es');
|
||||
counterpart.getLocale();
|
||||
|
||||
counterpart.onLocaleChange((newLocale: string, oldLocale: string) => {});
|
||||
counterpart.offLocaleChange((newLocale: string, oldLocale: string) => {});
|
||||
|
||||
counterpart.setFallbackLocale('es');
|
||||
|
||||
counterpart.registerTranslations('es', { hello: 'Hola' });
|
||||
|
||||
counterpart.registerInterpolations({ library: 'Counterpart' });
|
||||
|
||||
counterpart.setKeyTransformer((value: string, options: object) => {
|
||||
return value.toUpperCase();
|
||||
});
|
||||
|
||||
counterpart.localize(new Date(), { format: 'short' });
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// Type definitions for counterpart 0.18
|
||||
// Project: https://github.com/martinandert/counterpart
|
||||
// Definitions by: santiagodoldan <https://github.com/santiagodoldan>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
type NotFoundHandler = (locale: string, key: string, fallback: string, scope: string) => void;
|
||||
type LocaleChangeHandler = (newLocale: string, oldLocale: string) => void;
|
||||
|
||||
interface Counterpart {
|
||||
(key: string|string[], options?: object): string;
|
||||
|
||||
setSeparator(value: string): string;
|
||||
onTranslationNotFound(callback: NotFoundHandler): void;
|
||||
offTranslationNotFound(callback: NotFoundHandler): void;
|
||||
setMissingEntryGenerator(callback: (value: string) => void): void;
|
||||
getLocale(): string;
|
||||
setLocale(value: string): string;
|
||||
onLocaleChange(callback: LocaleChangeHandler): void;
|
||||
offLocaleChange(callback: LocaleChangeHandler): void;
|
||||
setFallbackLocale(value: string|string[]): void;
|
||||
registerTranslations(locale: string, data: object): void;
|
||||
registerInterpolations(data: object): void;
|
||||
setKeyTransformer(callback: (value: string, options: object) => string): string;
|
||||
localize(date: Date, options: object): string;
|
||||
Instance: Counterpart;
|
||||
Translator: Counterpart;
|
||||
}
|
||||
|
||||
declare var counterpart: Counterpart;
|
||||
|
||||
export = counterpart;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"counterpart-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-any-union": false,
|
||||
"prefer-method-signature": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,8 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"no-any-union": false,
|
||||
"rules": {
|
||||
"no-any-union": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,7 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-any-union": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-any-union": false
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false
|
||||
}
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"rules": {
|
||||
// TODO
|
||||
"no-this-assignment": false,
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"rules": {
|
||||
// TODO
|
||||
"no-this-assignment": false,
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false,
|
||||
"no-empty-interface": false
|
||||
"no-empty-interface": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"no-any-union": false,
|
||||
"no-this-assignment": false,
|
||||
"unified-signatures": false
|
||||
}
|
||||
|
||||
@@ -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]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,16 @@ const RdYlBu: string = d3ScaleChromatic.interpolateRdYlBu(0); // rgb(103, 0, 31)
|
||||
const RdYlGn: string = d3ScaleChromatic.interpolateRdYlGn(0); // rgb(103, 0, 31)
|
||||
const Spectral: string = d3ScaleChromatic.interpolateSpectral(0); // rgb(158, 1, 66)
|
||||
|
||||
const schemeBrBG: string = d3ScaleChromatic.schemeBrBG[3][0]; // #d8b365
|
||||
const schemePRGn: string = d3ScaleChromatic.schemePRGn[3][0]; // #af8dc3
|
||||
const schemePiYG: string = d3ScaleChromatic.schemePiYG[3][0]; // #e9a3c9
|
||||
const schemePuOr: string = d3ScaleChromatic.schemePuOr[3][0]; // #998ec3
|
||||
const schemeRdBu: string = d3ScaleChromatic.schemeRdBu[3][0]; // #ef8a62
|
||||
const schemeRdGy: string = d3ScaleChromatic.schemeRdGy[3][0]; // #ef8a62
|
||||
const schemeRdYlBu: string = d3ScaleChromatic.schemeRdYlBu[3][0]; // #fc8d59
|
||||
const schemeRdYlGn: string = d3ScaleChromatic.schemeRdYlGn[3][0]; // #fc8d59
|
||||
const schemeSpectral: string = d3ScaleChromatic.schemeSpectral[3][0]; // #fc8d59
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Sequential
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -43,6 +53,13 @@ const Orange: string = d3ScaleChromatic.interpolateOranges(1); // rgb(127, 39, 4
|
||||
const Purple: string = d3ScaleChromatic.interpolatePurples(1); // rgb(63, 0, 125)
|
||||
const Red: string = d3ScaleChromatic.interpolateReds(1); // rgb(103, 0, 13)
|
||||
|
||||
const schemeBlues: string = d3ScaleChromatic.schemeBlues[3][0]; // #deebf7
|
||||
const schemeGreens: string = d3ScaleChromatic.schemeGreens[3][0]; // #e5f5e0
|
||||
const schemeGreys: string = d3ScaleChromatic.schemeGreys[3][0]; // #f0f0f0
|
||||
const schemeOranges: string = d3ScaleChromatic.schemeOranges[3][0]; // #fee6ce
|
||||
const schemePurples: string = d3ScaleChromatic.schemePurples[3][0]; // #efedf5
|
||||
const schemeReds: string = d3ScaleChromatic.schemeReds[3][0]; // #fee0d2
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Sequential(Multi-Hue)
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -58,3 +75,16 @@ const YlGnBu: string = d3ScaleChromatic.interpolateYlGnBu(1); // rgb(8, 29, 88)
|
||||
const YlGn: string = d3ScaleChromatic.interpolateYlGn(1); // rgb(0, 69, 41)
|
||||
const YlOrBr: string = d3ScaleChromatic.interpolateYlOrBr(1); // rgb(102, 37, 6)
|
||||
const YlOrRd: string = d3ScaleChromatic.interpolateYlOrRd(1); // rgb(128, 0, 38)
|
||||
|
||||
const schemeBuGn: string = d3ScaleChromatic.schemeBuGn[3][0]; // #e5f5f9
|
||||
const schemeBuPu: string = d3ScaleChromatic.schemeBuPu[3][0]; // #e0ecf4
|
||||
const schemeGnBu: string = d3ScaleChromatic.schemeGnBu[3][0]; // #e0f3db
|
||||
const schemeOrRd: string = d3ScaleChromatic.schemeOrRd[3][0]; // #fee8c8
|
||||
const schemePuBuGn: string = d3ScaleChromatic.schemePuBuGn[3][0]; // #ece2f0
|
||||
const schemePuBu: string = d3ScaleChromatic.schemePuBu[3][0]; // #ece7f2
|
||||
const schemePuRd: string = d3ScaleChromatic.schemePuRd[3][0]; // #e7e1ef
|
||||
const schemeRdPu: string = d3ScaleChromatic.schemeRdPu[3][0]; // #fde0dd
|
||||
const schemeYlGnBu: string = d3ScaleChromatic.schemeYlGnBu[3][0]; // #edf8b1
|
||||
const schemeYlGn: string = d3ScaleChromatic.schemeYlGn[3][0]; // #f7fcb9
|
||||
const schemeYlOrBr: string = d3ScaleChromatic.schemeYlOrBr[3][0]; // #fff7bc
|
||||
const schemeYlOrRd: string = d3ScaleChromatic.schemeYlOrRd[3][0]; // #ffeda0
|
||||
|
||||
Vendored
+226
-10
@@ -1,6 +1,9 @@
|
||||
// Type definitions for D3JS d3-scale-chromatic module 1.0
|
||||
// Type definitions for D3JS d3-scale-chromatic module 1.1
|
||||
// Project: https://github.com/d3/d3-scale-chromatic/
|
||||
// Definitions by: Hugues Stefanski <https://github.com/Ledragon>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
|
||||
// Definitions by: Hugues Stefanski <https://github.com/Ledragon>,
|
||||
// Alex Ford <https://github.com/gustavderdrache>,
|
||||
// Boris Yankov <https://github.com/borisyankov>,
|
||||
// Henrique Machado <https://github.com/henriquefm>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Last module patch version validated against: 1.0.2
|
||||
@@ -11,35 +14,35 @@
|
||||
/**
|
||||
* An array of eight categorical colors represented as RGB hexadecimal strings.
|
||||
*/
|
||||
export const schemeAccent: string[];
|
||||
export const schemeAccent: ReadonlyArray<string>;
|
||||
/**
|
||||
* An array of eight categorical colors represented as RGB hexadecimal strings.
|
||||
*/
|
||||
export const schemeDark2: string[];
|
||||
export const schemeDark2: ReadonlyArray<string>;
|
||||
/**
|
||||
* An array of twelve categorical colors represented as RGB hexadecimal strings.
|
||||
*/
|
||||
export const schemePaired: string[];
|
||||
export const schemePaired: ReadonlyArray<string>;
|
||||
/**
|
||||
* An array of nine categorical colors represented as RGB hexadecimal strings.
|
||||
*/
|
||||
export const schemePastel1: string[];
|
||||
export const schemePastel1: ReadonlyArray<string>;
|
||||
/**
|
||||
* An array of eight categorical colors represented as RGB hexadecimal strings.
|
||||
*/
|
||||
export const schemePastel2: string[];
|
||||
export const schemePastel2: ReadonlyArray<string>;
|
||||
/**
|
||||
* An array of nine categorical colors represented as RGB hexadecimal strings.
|
||||
*/
|
||||
export const schemeSet1: string[];
|
||||
export const schemeSet1: ReadonlyArray<string>;
|
||||
/**
|
||||
* An array of eight categorical colors represented as RGB hexadecimal strings.
|
||||
*/
|
||||
export const schemeSet2: string[];
|
||||
export const schemeSet2: ReadonlyArray<string>;
|
||||
/**
|
||||
* An array of twelve categorical colors represented as RGB hexadecimal strings.
|
||||
*/
|
||||
export const schemeSet3: string[];
|
||||
export const schemeSet3: ReadonlyArray<string>;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Diverging
|
||||
@@ -50,48 +53,112 @@ export const schemeSet3: string[];
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateBrBG(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “BrBG” diverging color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeBrBG[9] contains an array of nine strings representing the nine colors of the
|
||||
* brown-blue-green diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
|
||||
*/
|
||||
export const schemeBrBG: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “PRGn” diverging color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolatePRGn(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “PRGn” diverging color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemePRGn[9] contains an array of nine strings representing the nine colors of the
|
||||
* purple-green diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
|
||||
*/
|
||||
export const schemePRGn: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “PiYG” diverging color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolatePiYG(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “PiYG” diverging color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemePiYG[9] contains an array of nine strings representing the nine colors of the
|
||||
* pink-yellow-green diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
|
||||
*/
|
||||
export const schemePiYG: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “PuOr” diverging color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolatePuOr(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “PuOr” diverging color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemePuOr[9] contains an array of nine strings representing the nine colors of the
|
||||
* purple-orange diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
|
||||
*/
|
||||
export const schemePuOr: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “RdBu” diverging color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateRdBu(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “RdBu” diverging color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeRdBu[9] contains an array of nine strings representing the nine colors of the
|
||||
* red-blue diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
|
||||
*/
|
||||
export const schemeRdBu: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “RdGy” diverging color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateRdGy(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “RdGy” diverging color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeRdGy[9] contains an array of nine strings representing the nine colors of the
|
||||
* red-grey diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
|
||||
*/
|
||||
export const schemeRdGy: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “RdYlBu” diverging color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateRdYlBu(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “RdYlBu” diverging color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeRdYlBu[9] contains an array of nine strings representing the nine colors of the
|
||||
* red-yellow-blue diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
|
||||
*/
|
||||
export const schemeRdYlBu: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “RdYlGn” diverging color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateRdYlGn(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “RdYlGn” diverging color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeRdYlGn[9] contains an array of nine strings representing the nine colors of the
|
||||
* red-yellow-green diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
|
||||
*/
|
||||
export const schemeRdYlGn: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “Spectral” diverging color scheme represented as an RGB string.
|
||||
*
|
||||
@@ -99,6 +166,13 @@ export function interpolateRdYlGn(value: number): string;
|
||||
*/
|
||||
export function interpolateSpectral(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “Spectral” diverging color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeSpectral[9] contains an array of nine strings representing the nine colors of the
|
||||
* spectral diverging color scheme. Diverging color schemes support a size k ranging from 3 to 11.
|
||||
*/
|
||||
export const schemeSpectral: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Sequential
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -108,30 +182,70 @@ export function interpolateSpectral(value: number): string;
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateBlues(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “Blues” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeBlues[9] contains an array of nine strings representing the nine colors of the
|
||||
* blue sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeBlues: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “Greens” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateGreens(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “Greens” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeGreens[9] contains an array of nine strings representing the nine colors of the
|
||||
* green sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeGreens: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “Greys” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateGreys(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “Greys” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeGreys[9] contains an array of nine strings representing the nine colors of the
|
||||
* grey sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeGreys: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “Oranges” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateOranges(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “Oranges” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeOranges[9] contains an array of nine strings representing the nine colors of the
|
||||
* orange sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeOranges: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “Purples” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolatePurples(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “Purples” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemePurples[9] contains an array of nine strings representing the nine colors of the
|
||||
* purple sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemePurples: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “Reds” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
@@ -139,6 +253,13 @@ export function interpolatePurples(value: number): string;
|
||||
*/
|
||||
export function interpolateReds(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “Reds” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeReds[9] contains an array of nine strings representing the nine colors of the
|
||||
* red sequential color scheme. Sequential, single-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeReds: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Sequential(Multi-Hue)
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -149,69 +270,164 @@ export function interpolateReds(value: number): string;
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateBuGn(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “BuGn” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeBuGn[9] contains an array of nine strings representing the nine colors of the
|
||||
* blue-green sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeBuGn: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “BuPu” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateBuPu(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “BuPu” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeBuPu[9] contains an array of nine strings representing the nine colors of the
|
||||
* blue-purple sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeBuPu: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “GnBu” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateGnBu(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “GnBu” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeGnBu[9] contains an array of nine strings representing the nine colors of the
|
||||
* green-blue sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeGnBu: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “OrRd” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateOrRd(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “OrRd” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeOrRd[9] contains an array of nine strings representing the nine colors of the
|
||||
* orange-red sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeOrRd: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “PuBuGn” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolatePuBuGn(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “PuBuGn” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemePuBuGn[9] contains an array of nine strings representing the nine colors of the
|
||||
* purple-blue-green sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemePuBuGn: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “PuBu” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolatePuBu(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “PuBu” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemePuBu[9] contains an array of nine strings representing the nine colors of the
|
||||
* purple-blue sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemePuBu: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “PuRd” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolatePuRd(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “PuRd” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemePuRd[9] contains an array of nine strings representing the nine colors of the
|
||||
* purple-red sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemePuRd: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “RdPu” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateRdPu(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “RdPu” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeRdPu[9] contains an array of nine strings representing the nine colors of the
|
||||
* red-purple sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeRdPu: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “YlGnBu” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateYlGnBu(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “YlGnBu” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeYlGnBu[9] contains an array of nine strings representing the nine colors of the
|
||||
* yellow-green-blue sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeYlGnBu: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “YlGn” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateYlGn(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “YlGn” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeYlGn[9] contains an array of nine strings representing the nine colors of the
|
||||
* yellow-green sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeYlGn: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “YlOrBr” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateYlOrBr(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “YlOrBr” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeYlOrBr[9] contains an array of nine strings representing the nine colors of the
|
||||
* yellow-orange-brown sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeYlOrBr: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Given a number t in the range [0,1], returns the corresponding color from the “YlOrRd” sequential color scheme represented as an RGB string.
|
||||
*
|
||||
* @param value Number in the range [0, 1].
|
||||
*/
|
||||
export function interpolateYlOrRd(value: number): string;
|
||||
|
||||
/**
|
||||
* An array of arrays of hexadecimal color strings from the “YlOrRd” sequential color scheme. The kth element of this array contains
|
||||
* the color scheme of size k; for example, d3.schemeYlOrRd[9] contains an array of nine strings representing the nine colors of the
|
||||
* yellow-orange-red sequential color scheme. Sequential, multi-hue color schemes support a size k ranging from 3 to 9.
|
||||
*/
|
||||
export const schemeYlOrRd: ReadonlyArray<ReadonlyArray<string>>;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false,
|
||||
"callable-types": false
|
||||
"callable-types": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"rules": {
|
||||
// TODO
|
||||
"no-this-assignment": false,
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
// TODO
|
||||
"no-this-assignment": false,
|
||||
"unified-signatures": false,
|
||||
"callable-types": false
|
||||
"callable-types": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"rules": {
|
||||
// TODO
|
||||
"no-this-assignment": false,
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
Vendored
+7
-4
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
+26
-37
@@ -1,52 +1,41 @@
|
||||
import depd = require('depd');
|
||||
|
||||
var deprecate = depd("depd-tests");
|
||||
const deprecate = depd("depd-tests");
|
||||
|
||||
function assert(condition: boolean, message: string): void {
|
||||
if (!condition) {
|
||||
throw new Error(message);
|
||||
}
|
||||
}
|
||||
deprecate('message');
|
||||
|
||||
function testDepdMessage(...args: string[]): boolean {
|
||||
if (arguments.length < 1) {
|
||||
deprecate('testDepdMessage argument.lenth<1');
|
||||
return true;
|
||||
} else {
|
||||
console.log('normal logic');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
assert(testDepdMessage() === true, "Deprecated code must be triggered!");
|
||||
assert(testDepdMessage('a') === false, "Deprecated code must be triggered!");
|
||||
|
||||
interface ITestObject {
|
||||
p1: string;
|
||||
p2: string;
|
||||
}
|
||||
|
||||
var obj = <ITestObject>{ p1: 'deprecated property', p2: 'normal property' };
|
||||
const obj = { p1: 'deprecated property', p2: 'normal property' };
|
||||
deprecate.property(obj, 'p1', 'property [p1] is deprecated!');
|
||||
deprecate.property(obj, 'p3', 'property [p3] is deprecated!'); // $ExpectError
|
||||
|
||||
console.log(obj.p1);
|
||||
|
||||
interface ITestDeprecatedFunction {
|
||||
func1?: Function;
|
||||
func2?: Function;
|
||||
interface TestDeprecatedFunction {
|
||||
func1?(): void;
|
||||
func2?(arg: string): boolean;
|
||||
}
|
||||
const obj2 = <TestDeprecatedFunction> {};
|
||||
|
||||
var obj2 = <ITestDeprecatedFunction>{};
|
||||
|
||||
// message automatically derived from function name
|
||||
obj2.func1 = deprecate.function(function func1() {
|
||||
obj2.func1 = deprecate.function(() => {
|
||||
console.log('all calls to [func1] are deprecated ');
|
||||
});
|
||||
|
||||
// specific message
|
||||
obj2.func2 = deprecate.function(function () {
|
||||
// $ExpectError
|
||||
obj2.func2 = deprecate.function(() => {
|
||||
console.log('all calls to [func2] are deprecated ');
|
||||
}, 'func2');
|
||||
|
||||
obj2.func2 = deprecate.function((arg: string) => {
|
||||
console.log('all calls to [func2] are deprecated ');
|
||||
return true;
|
||||
}, 'func2');
|
||||
|
||||
obj2.func1();
|
||||
obj2.func2();
|
||||
obj2.func2('');
|
||||
|
||||
process.on('deprecation', error => {
|
||||
const err: depd.DeprecationError = error;
|
||||
error; // $ExpectType DeprecationError
|
||||
|
||||
err.name; // $ExpectType "DeprecationError"
|
||||
err.namespace; // $ExpectType string
|
||||
err.stack; // $ExpectType string
|
||||
});
|
||||
|
||||
Vendored
+35
-10
@@ -1,16 +1,41 @@
|
||||
// Type definitions for depd 1.1.0
|
||||
// Type definitions for depd 1.1
|
||||
// Project: https://github.com/dougwilson/nodejs-depd
|
||||
// Definitions by: Zhiyuan Wang <https://github.com/danny8002>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
|
||||
|
||||
declare function depd(namespace: string): Deprecate;
|
||||
|
||||
interface Deprecate {
|
||||
(message: string): void;
|
||||
function(fn: Function, message?: string): Function;
|
||||
property(obj: Object, prop: string, message: string): void;
|
||||
}
|
||||
/// <reference types="node" />
|
||||
|
||||
export = depd;
|
||||
|
||||
declare function depd(namespace: string): depd.Deprecate;
|
||||
|
||||
declare namespace depd {
|
||||
interface Deprecate {
|
||||
(message: string): void;
|
||||
// tslint:disable-next-line ban-types
|
||||
function<T extends Function>(fn: T, message?: string): T;
|
||||
property<T extends object>(obj: T, prop: keyof T, message: string): void;
|
||||
}
|
||||
|
||||
interface DeprecationError extends Error {
|
||||
readonly name: 'DeprecationError';
|
||||
namespace: string;
|
||||
stack: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface Process {
|
||||
addListener(event: 'deprecation', listener: (deprecationError: depd.DeprecationError) => void): this;
|
||||
emit(event: 'deprecation', code: depd.DeprecationError): boolean;
|
||||
on(event: 'deprecation', listener: (deprecationError: depd.DeprecationError) => void): this;
|
||||
once(event: 'deprecation', listener: (deprecationError: depd.DeprecationError) => void): this;
|
||||
prependListener(event: 'deprecation', listener: (deprecationError: depd.DeprecationError) => void): this;
|
||||
prependOnceListener(event: 'deprecation', listener: (deprecationError: depd.DeprecationError) => void): this;
|
||||
listeners(event: 'deprecation'): depd.DeprecationError[];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@@ -20,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"depd-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+12
-6
@@ -8,6 +8,15 @@ export = JsDiff;
|
||||
export as namespace JsDiff;
|
||||
|
||||
declare namespace JsDiff {
|
||||
interface ICaseOptions {
|
||||
ignoreCase: boolean;
|
||||
}
|
||||
|
||||
interface ILinesOptions {
|
||||
ignoreWhitespace?: boolean;
|
||||
newlineIsToken?: boolean;
|
||||
}
|
||||
|
||||
interface IDiffResult {
|
||||
value: string;
|
||||
count?: number;
|
||||
@@ -54,18 +63,15 @@ declare namespace JsDiff {
|
||||
tokenize(value: string): any; // return types are string or string[]
|
||||
}
|
||||
|
||||
function diffChars(oldStr: string, newStr: string): IDiffResult[];
|
||||
function diffChars(oldStr: string, newStr: string, options?: ICaseOptions): IDiffResult[];
|
||||
|
||||
function diffWords(oldStr: string, newStr: string): IDiffResult[];
|
||||
function diffWords(oldStr: string, newStr: string, options?: ICaseOptions): IDiffResult[];
|
||||
|
||||
function diffWordsWithSpace(oldStr: string, newStr: string): IDiffResult[];
|
||||
|
||||
function diffJson(oldObj: object, newObj: object): IDiffResult[];
|
||||
|
||||
function diffLines(oldStr: string, newStr: string, options?: {
|
||||
ignoreWhitespace?: boolean,
|
||||
newlineIsToken?: boolean,
|
||||
}): IDiffResult[];
|
||||
function diffLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[];
|
||||
|
||||
function diffCss(oldStr: string, newStr: string): IDiffResult[];
|
||||
|
||||
|
||||
Vendored
+1
@@ -488,6 +488,7 @@ declare namespace Dockerode {
|
||||
CpusetCpus: string;
|
||||
CpusetMems: string;
|
||||
Devices?: any;
|
||||
DiskQuota: number;
|
||||
KernelMemory: number;
|
||||
Memory: number;
|
||||
MemoryReservation: number;
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+16
-20
@@ -3,23 +3,18 @@
|
||||
// Definitions by: Dave Taylor <http://davetayls.me>, Samira Bazuzi <https://github.com/bazuzi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = DOMPurify;
|
||||
export as namespace DOMPurify;
|
||||
|
||||
declare var DOMPurify: DOMPurify;
|
||||
export declare function sanitize(source: string | Node): string;
|
||||
export declare function sanitize(source: string | Node, config: Config & { RETURN_DOM_FRAGMENT?: false; RETURN_DOM?: false; }): string;
|
||||
export declare function sanitize(source: string | Node, config: Config & { RETURN_DOM_FRAGMENT: true; }): DocumentFragment;
|
||||
export declare function sanitize(source: string | Node, config: Config & { RETURN_DOM: true; }): HTMLElement;
|
||||
export declare function sanitize(source: string | Node, config: Config): string | HTMLElement | DocumentFragment;
|
||||
export declare function addHook(hook: 'uponSanitizeElement', cb: (currentNode: Element, data: SanitizeElementHookEvent, config: Config) => void): void;
|
||||
export declare function addHook(hook: 'uponSanitizeAttribute', cb: (currentNode: Element, data: SanitizeAttributeHookEvent, config: Config) => void): void;
|
||||
export declare function addHook(hook: HookName, cb: (currentNode: Element, data: HookEvent, config: Config) => void): void;
|
||||
|
||||
interface DOMPurify {
|
||||
sanitize(source: string | Node): string;
|
||||
sanitize(source: string | Node, config: DOMPurifyConfig & { RETURN_DOM_FRAGMENT?: false; RETURN_DOM?: false; }): string;
|
||||
sanitize(source: string | Node, config: DOMPurifyConfig & { RETURN_DOM_FRAGMENT: true; }): DocumentFragment;
|
||||
sanitize(source: string | Node, config: DOMPurifyConfig & { RETURN_DOM: true; }): HTMLElement;
|
||||
sanitize(source: string | Node, config: DOMPurifyConfig): string | HTMLElement | DocumentFragment;
|
||||
addHook(hook: 'uponSanitizeElement', cb: (currentNode: Element, data: DOMPurifySanitizeElementHookEvent, config: DOMPurifyConfig) => void): void;
|
||||
addHook(hook: 'uponSanitizeAttribute', cb: (currentNode: Element, data: DOMPurifySanitizeAttributeHookEvent, config: DOMPurifyConfig) => void): void;
|
||||
addHook(hook: DOMPurifyHookName, cb: (currentNode: Element, data: DOMPurifyHookEvent, config: DOMPurifyConfig) => void): void;
|
||||
}
|
||||
|
||||
interface DOMPurifyConfig {
|
||||
interface Config {
|
||||
ADD_ATTR?: string[];
|
||||
ADD_TAGS?: string[];
|
||||
ALLOW_DATA_ATTR?: boolean;
|
||||
@@ -27,6 +22,7 @@ interface DOMPurifyConfig {
|
||||
ALLOWED_TAGS?: string[];
|
||||
FORBID_ATTR?: string[];
|
||||
FORBID_TAGS?: string[];
|
||||
FORCE_BODY?: boolean;
|
||||
KEEP_CONTENT?: boolean;
|
||||
RETURN_DOM?: boolean;
|
||||
RETURN_DOM_FRAGMENT?: boolean;
|
||||
@@ -36,7 +32,7 @@ interface DOMPurifyConfig {
|
||||
WHOLE_DOCUMENT?: boolean;
|
||||
}
|
||||
|
||||
type DOMPurifyHookName
|
||||
type HookName
|
||||
= 'beforeSanitizeElements'
|
||||
| 'uponSanitizeElement'
|
||||
| 'afterSanitizeElements'
|
||||
@@ -47,17 +43,17 @@ type DOMPurifyHookName
|
||||
| 'uponSanitizeShadowNode'
|
||||
| 'afterSanitizeShadowDOM';
|
||||
|
||||
type DOMPurifyHookEvent
|
||||
= DOMPurifySanitizeElementHookEvent
|
||||
| DOMPurifySanitizeAttributeHookEvent
|
||||
type HookEvent
|
||||
= SanitizeElementHookEvent
|
||||
| SanitizeAttributeHookEvent
|
||||
| null;
|
||||
|
||||
interface DOMPurifySanitizeElementHookEvent {
|
||||
interface SanitizeElementHookEvent {
|
||||
tagName: string;
|
||||
allowedTags: string[];
|
||||
}
|
||||
|
||||
interface DOMPurifySanitizeAttributeHookEvent {
|
||||
interface SanitizeAttributeHookEvent {
|
||||
attrName: string;
|
||||
attrValue: string;
|
||||
keepAttr: boolean;
|
||||
|
||||
Vendored
+175
-82
@@ -1,6 +1,6 @@
|
||||
// Type definitions for ej.web.all 15.3
|
||||
// Project: http://help.syncfusion.com/js/typescript
|
||||
// Definitions by: Syncfusion <https://github.com/syncfusion/>
|
||||
// Definitions by: Syncfusion <https://github.com/syncfusion>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/*!
|
||||
* filename: ej.web.all.d.ts
|
||||
* version : 15.3.0.26
|
||||
* version : 15.3.0.29
|
||||
* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved.
|
||||
* Use of this code is subject to the terms of our license.
|
||||
* A copy of the current license can be obtained at any time by e-mailing
|
||||
@@ -7791,7 +7791,7 @@ declare namespace ej {
|
||||
*/
|
||||
target?: string;
|
||||
|
||||
/** The title text to be displayed in the dialog header. In order to set title, you need to set showHeader as true since the title will be displayed in the dialog header.
|
||||
/** The title text to be displayed in the dialog header. In order to set title, you need to set "showHeader" as true since the title will be displayed in the dialog header.
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
@@ -16048,7 +16048,7 @@ declare namespace ej {
|
||||
*/
|
||||
autoHeight?: boolean;
|
||||
|
||||
/** This API holds configuration setting for paste clenaup behavior.
|
||||
/** This API holds configuration setting for paste cleanup behavior.
|
||||
* @Default {{ listConversion: false, cleanCSS: false, removeStyles: false, cleanElements: false }}
|
||||
*/
|
||||
pasteCleanupSettings?: PasteCleanupSettings;
|
||||
@@ -27283,7 +27283,7 @@ declare namespace ej {
|
||||
*/
|
||||
format?: string;
|
||||
|
||||
/** Sets the opacity of the dispalyed tooltip
|
||||
/** Sets the opacity of the displayed tooltip
|
||||
* @Default {0.95}
|
||||
*/
|
||||
opacity?: number;
|
||||
@@ -27949,6 +27949,11 @@ declare namespace ej {
|
||||
*/
|
||||
refreshControl(): void;
|
||||
|
||||
/** This function Destroy the PivotGrid widget all events bound using this._on will be unbind automatically and bring the control to pre-init state.
|
||||
* @returns {void}
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/** This function returns the height of all rows and width each and every column.
|
||||
* @returns {any}
|
||||
*/
|
||||
@@ -27957,7 +27962,7 @@ declare namespace ej {
|
||||
/** This function creates the conditional formatting dialog to apply conditional formatting for PivotGrid control.
|
||||
* @returns {void}
|
||||
*/
|
||||
createConditionalDialog(): void;
|
||||
openConditionalFormattingDialog(): void;
|
||||
|
||||
/** This function saves the current report to the database/local storage.
|
||||
* @returns {void}
|
||||
@@ -28163,11 +28168,16 @@ declare namespace ej {
|
||||
*/
|
||||
enableColumnResizing?: boolean;
|
||||
|
||||
/** Allows the user to fit the width of the columns based on its content. This is only applicable for enableColumnResizing option.
|
||||
/** Allows the user to fit the width of the column based on its maximum text width.
|
||||
* @Default {false}
|
||||
*/
|
||||
resizeColumnsToFit?: boolean;
|
||||
|
||||
/** Allows the user to enable/disable the context menu of Pivot buttons in the PivotGrid.
|
||||
* @Default {false}
|
||||
*/
|
||||
enableContextMenu?: boolean;
|
||||
|
||||
/** Allows the user to view large amount of data through virtual scrolling.
|
||||
* @Default {false}
|
||||
*/
|
||||
@@ -28616,14 +28626,6 @@ declare namespace ej {
|
||||
values?: any[];
|
||||
}
|
||||
|
||||
export interface DataSourceColumnsGroupByDate {
|
||||
|
||||
/** Contains the collection of formatString to group item from the field.
|
||||
* @Default {[]}
|
||||
*/
|
||||
interval?: any[];
|
||||
}
|
||||
|
||||
export interface DataSourceColumn {
|
||||
|
||||
/** Allows the user to bind the item by using its unique name as field name.
|
||||
@@ -28679,11 +28681,6 @@ declare namespace ej {
|
||||
* @Default {null}
|
||||
*/
|
||||
filterItems?: DataSourceColumnsFilterItems;
|
||||
|
||||
/** Allows the user to group the field by date. This is applicable only when the format is set as "date".
|
||||
* @Default {{}}
|
||||
*/
|
||||
groupByDate?: DataSourceColumnsGroupByDate;
|
||||
}
|
||||
|
||||
export interface DataSourceRowsAdvancedFilter {
|
||||
@@ -28728,14 +28725,6 @@ declare namespace ej {
|
||||
values?: any[];
|
||||
}
|
||||
|
||||
export interface DataSourceRowsGroupByDate {
|
||||
|
||||
/** Contains the collection of formatString to group item from the field.
|
||||
* @Default {[]}
|
||||
*/
|
||||
interval?: any[];
|
||||
}
|
||||
|
||||
export interface DataSourceRow {
|
||||
|
||||
/** Allows the user to bind the item by using its unique name as field name.
|
||||
@@ -28791,11 +28780,6 @@ declare namespace ej {
|
||||
* @Default {null}
|
||||
*/
|
||||
filterItems?: DataSourceRowsFilterItems;
|
||||
|
||||
/** Allows the user to group the field by date. This is applicable only when the format is set as "date".
|
||||
* @Default {{}}
|
||||
*/
|
||||
groupByDate?: DataSourceRowsGroupByDate;
|
||||
}
|
||||
|
||||
export interface DataSourceValuesMeasure {
|
||||
@@ -29128,6 +29112,16 @@ declare namespace ej {
|
||||
*/
|
||||
drillThroughDataTable?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for performing value sorting operation in PivotGrid.
|
||||
* @Default {ValueSorting}
|
||||
*/
|
||||
valueSorting?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for removing pivot button from GroupingBar/Field List.
|
||||
* @Default {RemoveButton}
|
||||
*/
|
||||
removeButton?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for write-back operation in OLAP Cube. This is only applicable in server-side component.
|
||||
* @Default {WriteBack}
|
||||
*/
|
||||
@@ -29215,6 +29209,11 @@ declare namespace ej {
|
||||
* @returns {void}
|
||||
*/
|
||||
refreshControl(): void;
|
||||
|
||||
/** This function Destroy the PivotSchemaDesigner widget all events bound using this._on will be unbind automatically and bring the control to pre-init state.
|
||||
* @returns {void}
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
export namespace PivotSchemaDesigner {
|
||||
|
||||
@@ -29269,7 +29268,7 @@ declare namespace ej {
|
||||
/** Allows the user to set custom name for the methods at service-end, communicated during AJAX post.
|
||||
* @Default {{}}
|
||||
*/
|
||||
serviceMethod?: ServiceMethod;
|
||||
serviceMethods?: any;
|
||||
|
||||
/** Connects the service using the specified URL for any server updates.
|
||||
* @Default {“â€}
|
||||
@@ -29372,39 +29371,6 @@ declare namespace ej {
|
||||
showNamedSets?: boolean;
|
||||
}
|
||||
|
||||
export interface ServiceMethod {
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for getting the values for the tree-view inside filter dialog.
|
||||
* @Default {FetchMembers}
|
||||
*/
|
||||
fetchMembers?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for filtering operation in Field List.
|
||||
* @Default {Filtering}
|
||||
*/
|
||||
filtering?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for the server-side action, on expanding members in Field List.
|
||||
* @Default {MemberExpanded}
|
||||
*/
|
||||
memberExpand?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for the server-side action, on dropping a node into Field List.
|
||||
* @Default {NodeDropped}
|
||||
*/
|
||||
nodeDropped?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for the server-side action on changing the checked state of a node in Field List.
|
||||
* @Default {NodeStateModified}
|
||||
*/
|
||||
nodeStateModified?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for button removing operation in Field List.
|
||||
* @Default {RemoveButton}
|
||||
*/
|
||||
removeButton?: string;
|
||||
}
|
||||
|
||||
enum Layouts {
|
||||
|
||||
///To set the layout as same in the Excel.
|
||||
@@ -29552,6 +29518,11 @@ declare namespace ej {
|
||||
*/
|
||||
refreshControl(): void;
|
||||
|
||||
/** This function Destroy the PivotChart widget all events bound using this._on will be unbind automatically and bring the control to pre-init state.
|
||||
* @returns {void}
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/** Renders the control with the pivot engine obtained from olap cube.
|
||||
* @returns {void}
|
||||
*/
|
||||
@@ -29648,6 +29619,11 @@ declare namespace ej {
|
||||
*/
|
||||
rotation?: number;
|
||||
|
||||
/** Allows the user to enable/disable the context menu options in the PivotChart.
|
||||
* @Default {false}
|
||||
*/
|
||||
enableContextMenu?: boolean;
|
||||
|
||||
/** Allows the user to set custom name for the methods at service-end, communicated on AJAX post.
|
||||
* @Default {{}}
|
||||
*/
|
||||
@@ -29675,6 +29651,10 @@ declare namespace ej {
|
||||
*/
|
||||
beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void;
|
||||
|
||||
/** Triggers before Pivot Engine starts to populate.
|
||||
*/
|
||||
beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void;
|
||||
|
||||
/** Triggers on performing drill up/down in PivotChart control.
|
||||
*/
|
||||
drillSuccess?(e: DrillSuccessEventArgs): void;
|
||||
@@ -29741,6 +29721,13 @@ declare namespace ej {
|
||||
element?: any;
|
||||
}
|
||||
|
||||
export interface BeforePivotEnginePopulateEventArgs {
|
||||
|
||||
/** returns the current instance of PivotChart.
|
||||
*/
|
||||
chartObj?: any;
|
||||
}
|
||||
|
||||
export interface DrillSuccessEventArgs {
|
||||
|
||||
/** returns the current instance of PivotChart.
|
||||
@@ -30132,6 +30119,16 @@ declare namespace ej {
|
||||
*/
|
||||
refreshControl(): void;
|
||||
|
||||
/** Returns the control tab string that displays currently in PivotClient.
|
||||
* @returns {void}
|
||||
*/
|
||||
getActiveTab(): void;
|
||||
|
||||
/** This function Destroy the PivotClient widget all events bound using this._on will be unbind automatically and bring the control to pre-init state.
|
||||
* @returns {void}
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/** Returns the OlapReport string maintained along with the axis elements information.
|
||||
* @returns {string}
|
||||
*/
|
||||
@@ -30186,6 +30183,11 @@ declare namespace ej {
|
||||
*/
|
||||
dataSource?: DataSource;
|
||||
|
||||
/** Enables the Drill-Through feature which retrieves the raw items that are used to create the specific cell in PivotGrid.
|
||||
* @Default {false}
|
||||
*/
|
||||
enableDrillThrough?: boolean;
|
||||
|
||||
/** Allows the user to customize the widget's layout and appearance.
|
||||
* @Default {{}}
|
||||
*/
|
||||
@@ -30196,7 +30198,7 @@ declare namespace ej {
|
||||
*/
|
||||
toolbarIconSettings?: ToolbarIconSettings;
|
||||
|
||||
/** Allows user to show unique name on pivotbutton.
|
||||
/** Allows user to show unique name on pivot button.
|
||||
* @Default {false}
|
||||
*/
|
||||
showUniqueNameOnPivotButton?: boolean;
|
||||
@@ -30276,6 +30278,11 @@ declare namespace ej {
|
||||
*/
|
||||
isResponsive?: boolean;
|
||||
|
||||
/** Options to customize the size of the PivotClient control.
|
||||
* @Default {Example:}
|
||||
*/
|
||||
size?: any;
|
||||
|
||||
/** Allows the user to set the localized language for the widget.
|
||||
* @Default {en-US}
|
||||
*/
|
||||
@@ -30335,6 +30342,10 @@ declare namespace ej {
|
||||
*/
|
||||
treeMapLoad?(e: TreeMapLoadEventArgs): void;
|
||||
|
||||
/** Triggers while clicking value cells in PivotGrid.
|
||||
*/
|
||||
drillThrough?(e: DrillThroughEventArgs): void;
|
||||
|
||||
/** Triggers while we initiate loading of the widget.
|
||||
*/
|
||||
load?(e: LoadEventArgs): void;
|
||||
@@ -30463,6 +30474,17 @@ declare namespace ej {
|
||||
element?: any;
|
||||
}
|
||||
|
||||
export interface DrillThroughEventArgs {
|
||||
|
||||
/** return the JSON records of the generated cells on drill-through operation.
|
||||
*/
|
||||
data?: any;
|
||||
|
||||
/** returns the HTML element of PivotClient.
|
||||
*/
|
||||
element?: any;
|
||||
}
|
||||
|
||||
export interface LoadEventArgs {
|
||||
|
||||
/** returns the HTML element of PivotClient component.
|
||||
@@ -31013,6 +31035,16 @@ declare namespace ej {
|
||||
*/
|
||||
loadReport?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for remove a report collection from the database.
|
||||
* @Default {RemoveReportFromDB}
|
||||
*/
|
||||
removeDBReport?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for rename the report collection in the database.
|
||||
* @Default {RenameReportInDB}
|
||||
*/
|
||||
renameDBReport?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for retrieving the MDX query for the current report.
|
||||
* @Default {GetMDXQuery}
|
||||
*/
|
||||
@@ -31067,6 +31099,16 @@ declare namespace ej {
|
||||
* @Default {CalculatedMember}
|
||||
*/
|
||||
calculatedMember?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for performing drill through operation.
|
||||
* @Default {DrillThroughHierarchies}
|
||||
*/
|
||||
drillThroughHierarchies?: string;
|
||||
|
||||
/** Allows the user to set the custom name for the service method responsible for performing drill through operation in data table.
|
||||
* @Default {DrillThroughDataTable}
|
||||
*/
|
||||
drillThroughDataTable?: string;
|
||||
}
|
||||
|
||||
enum ClientExportMode {
|
||||
@@ -31143,6 +31185,11 @@ declare namespace ej {
|
||||
*/
|
||||
renderControlFromJSON(): void;
|
||||
|
||||
/** This function Destroy the PivotGauge widget all events bound using this._on will be unbind automatically and bring the control to pre-init state.
|
||||
* @returns {void}
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/** Returns the OlapReport string maintained along with the axis elements information.
|
||||
* @returns {string}
|
||||
*/
|
||||
@@ -31598,6 +31645,11 @@ declare namespace ej {
|
||||
*/
|
||||
doAjaxPost(): void;
|
||||
|
||||
/** Performs an asynchronous HTTP (FullPost) submit.
|
||||
* @returns {void}
|
||||
*/
|
||||
doPostBack(): void;
|
||||
|
||||
/** Returns the OlapReport string maintained along with the axis elements information.
|
||||
* @returns {string}
|
||||
*/
|
||||
@@ -31632,6 +31684,11 @@ declare namespace ej {
|
||||
* @returns {void}
|
||||
*/
|
||||
renderControlSuccess(): void;
|
||||
|
||||
/** This function Destroy the PivotTreemap widget all events bound using this._on will be unbind automatically and bring the control to pre-init state.
|
||||
* @returns {void}
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
export namespace PivotTreeMap {
|
||||
|
||||
@@ -40686,6 +40743,8 @@ declare namespace ej {
|
||||
|
||||
XLRibbon: Spreadsheet.XLRibbon;
|
||||
|
||||
XLScroll: Spreadsheet.XLScroll;
|
||||
|
||||
XLSearch: Spreadsheet.XLSearch;
|
||||
|
||||
XLSelection: Spreadsheet.XLSelection;
|
||||
@@ -41339,6 +41398,15 @@ declare namespace ej {
|
||||
updateRibbonIcons(): void;
|
||||
}
|
||||
|
||||
export interface XLScroll {
|
||||
|
||||
/** This method is used to scroll the sheet content to the specified cell address in the Spreadsheet.
|
||||
* @param {string} Pass the cell address that you want to scroll to it.
|
||||
* @returns {void}
|
||||
*/
|
||||
scrollToCell(range: string): void;
|
||||
}
|
||||
|
||||
export interface XLSearch {
|
||||
|
||||
/** This method is used to find and replace all data by workbook in the Spreadsheet.
|
||||
@@ -44481,7 +44549,7 @@ declare namespace ej {
|
||||
|
||||
/** Returns the previous color of the signature.
|
||||
*/
|
||||
perviousColor?: string;
|
||||
previousColor?: string;
|
||||
|
||||
/** Returns the current color of the signature.
|
||||
*/
|
||||
@@ -44841,6 +44909,12 @@ declare namespace ej {
|
||||
* @returns {any}
|
||||
*/
|
||||
addToDictionary(customWord: string): any;
|
||||
|
||||
/** Retrieves the possible suggestion words for the error word passed as an argument.
|
||||
* @param {string} Error word to get the suggestions
|
||||
* @returns {any}
|
||||
*/
|
||||
getSuggestionWords(errorWord: string): any;
|
||||
}
|
||||
export namespace SpellCheck {
|
||||
|
||||
@@ -44893,6 +44967,11 @@ declare namespace ej {
|
||||
*/
|
||||
controlsToValidate?: string;
|
||||
|
||||
/** When set to true, allows sending Asynchronous ajax request for checking the spelling errors.
|
||||
* @Default {true}
|
||||
*/
|
||||
enableAsync?: boolean;
|
||||
|
||||
/** Triggers on the success of AJAX call request.
|
||||
*/
|
||||
actionSuccess?(e: ActionSuccessEventArgs): void;
|
||||
@@ -51357,7 +51436,7 @@ declare namespace ej.datavisualization {
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/** location - X and Y co-ordinate of the points with respect to chart area. axis - axis of the multilevellabels. multilevellabel - Multi level label details
|
||||
/** location - X and Y co-ordinate of the points with respect to chart area. axis - axis of the multi level labels. multiLevelLabel - Multi level label details
|
||||
*/
|
||||
data?: any;
|
||||
}
|
||||
@@ -52537,7 +52616,7 @@ declare namespace ej.datavisualization {
|
||||
/** Specifies the type of the trendline for the series.
|
||||
* @Default {linear. See TrendlinesType}
|
||||
*/
|
||||
type?: string;
|
||||
type?: ej.datavisualization.Chart.TrendlinesType|string;
|
||||
|
||||
/** Name for the trendlines that is to be displayed in the legend text.
|
||||
* @Default {trendline}
|
||||
@@ -52741,7 +52820,7 @@ declare namespace ej.datavisualization {
|
||||
*/
|
||||
dataSource?: any;
|
||||
|
||||
/** Specifies spline tension value for cardianal spline type. Value ranges from 0 to 1.
|
||||
/** Specifies spline tension value for cardinal spline type. Value ranges from 0 to 1.
|
||||
* @Default {0.5}
|
||||
*/
|
||||
cardinalSplineTension?: number;
|
||||
@@ -57013,7 +57092,7 @@ declare namespace ej.datavisualization {
|
||||
*/
|
||||
dataSource?: any;
|
||||
|
||||
/** Specifies spline tension values for cardianal spline type.Value ranges from 0 to 1.
|
||||
/** Specifies spline tension values for cardinal spline type.Value ranges from 0 to 1.
|
||||
* @Default {0.5}
|
||||
*/
|
||||
cardinalSplineTension?: number;
|
||||
@@ -57123,7 +57202,7 @@ declare namespace ej.datavisualization {
|
||||
splitMode?: ej.datavisualization.Chart.SplitMode|string;
|
||||
|
||||
/** Quartile calculation has been performed in three different formulas to render the boxplot series .
|
||||
* @Default {exclusive}
|
||||
* @Default {exclusive.See BoxPlotMode}
|
||||
*/
|
||||
boxPlotMode?: ej.datavisualization.Chart.LabelPosition|string;
|
||||
|
||||
@@ -57944,6 +58023,20 @@ declare namespace ej.datavisualization {
|
||||
Minus,
|
||||
}
|
||||
}
|
||||
namespace Chart {
|
||||
enum TrendlinesType {
|
||||
//string
|
||||
Linear,
|
||||
//string
|
||||
Exponential,
|
||||
//string
|
||||
Logarithmic,
|
||||
//string
|
||||
Power,
|
||||
//string
|
||||
Polynomial,
|
||||
}
|
||||
}
|
||||
namespace Chart {
|
||||
enum Mode {
|
||||
//string
|
||||
@@ -64669,22 +64762,22 @@ declare namespace ej.datavisualization {
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/** Sets the sourcenode of the connection data source item
|
||||
/** Sets the source node of the connection data source item
|
||||
* @Default {null}
|
||||
*/
|
||||
sourceNode?: string;
|
||||
|
||||
/** Sets the targetnode of the connection data source item
|
||||
/** Sets the target node of the connection data source item
|
||||
* @Default {null}
|
||||
*/
|
||||
targetNode?: string;
|
||||
|
||||
/** Sets the sourcepoint-x value of the connection data source item
|
||||
/** Sets the sourcePointX value of the connection data source item
|
||||
* @Default {null}
|
||||
*/
|
||||
sourcePointX?: string;
|
||||
|
||||
/** Sets the sourcePoint-y value of the connection data source item
|
||||
/** Sets the sourcePointY value of the connection data source item
|
||||
* @Default {null}
|
||||
*/
|
||||
sourcePointY?: string;
|
||||
@@ -64704,7 +64797,7 @@ declare namespace ej.datavisualization {
|
||||
*/
|
||||
crudAction?: DataSourceSettingsConnectionDataSourceCrudAction;
|
||||
|
||||
/** Specifies the customfields to get the updated data from client side to the server side
|
||||
/** Specifies the custom fields to get the updated data from client side to the server side
|
||||
* @Default {[]}
|
||||
*/
|
||||
customFields?: any[];
|
||||
@@ -64745,7 +64838,7 @@ declare namespace ej.datavisualization {
|
||||
*/
|
||||
crudAction?: DataSourceSettingsCrudAction;
|
||||
|
||||
/** Specifies the customfields to get the updated data from client side to the server side
|
||||
/** Specifies the custom fields to get the updated data from client side to the server side
|
||||
* @Default {[]}
|
||||
*/
|
||||
customFields?: any[];
|
||||
@@ -69214,7 +69307,7 @@ declare namespace ej.datavisualization {
|
||||
*/
|
||||
format?: string;
|
||||
|
||||
/** Sets the opacity of the dispalyed tooltip
|
||||
/** Sets the opacity of the displayed tooltip
|
||||
* @Default {0.95}
|
||||
*/
|
||||
opacity?: number;
|
||||
@@ -69885,7 +69978,7 @@ interface JQueryPromise<T> {
|
||||
*/
|
||||
cancel?: boolean;
|
||||
}
|
||||
interface JQueryDeferred<T> extends JQueryPromise<T> {
|
||||
interface JQueryDeferred<T> {
|
||||
/**
|
||||
* Returns the cancel option value.
|
||||
*/
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-padding": false,
|
||||
"no-any-union": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"strict-export-declare-modifiers": false
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ember-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strict": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODOs
|
||||
"no-any-union": false,
|
||||
"no-object-literal-type-assertion": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-any-union": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'));
|
||||
|
||||
Vendored
+4
-2
@@ -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.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2015",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
@@ -19,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"express-graphql-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user