mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped
This commit is contained in:
@@ -157,7 +157,7 @@ If a package was never on DefinitelyTyped, it does not need to be added to `notN
|
||||
To lint a package, just add a `tslint.json` to that package containing `{ "extends": "../tslint.json" }`. All new packages must be linted.
|
||||
If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. For example:
|
||||
|
||||
```json
|
||||
```js
|
||||
{
|
||||
"extends": "../tslint.json",
|
||||
"rules": {
|
||||
@@ -255,6 +255,10 @@ transitively `react-router-bootstrap` (which depends on `react-router`) also add
|
||||
|
||||
Also, `/// <reference types=".." />` will not work with path mapping, so dependencies must use `import`.
|
||||
|
||||
#### The file history in GitHub looks incomplete.
|
||||
|
||||
GitHub doesn't [support](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames) file history for renamed files. Use [`git log --follow`](https://www.git-scm.com/docs/git-log) instead.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,445 +0,0 @@
|
||||
var x: BigNumber.BigNumber = new BigNumber(9)
|
||||
var y = new BigNumber(x)
|
||||
|
||||
BigNumber(435.345)
|
||||
|
||||
new BigNumber('5032485723458348569331745.33434346346912144534543')
|
||||
new BigNumber('4.321e+4')
|
||||
new BigNumber('-735.0918e-430')
|
||||
new BigNumber(Infinity)
|
||||
new BigNumber(NaN)
|
||||
new BigNumber('.5')
|
||||
new BigNumber('+2')
|
||||
new BigNumber(-10110100.1, 2)
|
||||
new BigNumber(-0b10110100)
|
||||
new BigNumber('123412421.234324', 5)
|
||||
new BigNumber('ff.8', 16)
|
||||
new BigNumber('0xff.8')
|
||||
|
||||
new BigNumber(9, 2)
|
||||
|
||||
new BigNumber(96517860459076817.4395)
|
||||
|
||||
new BigNumber('blurgh')
|
||||
|
||||
BigNumber.config({ DECIMAL_PLACES: 5 })
|
||||
new BigNumber(1.23456789)
|
||||
new BigNumber(1.23456789, 10)
|
||||
|
||||
BigNumber.config({ DECIMAL_PLACES: 5 })
|
||||
var BN = BigNumber.another({ DECIMAL_PLACES: 9 })
|
||||
|
||||
x = new BigNumber(1)
|
||||
y = new BN(1)
|
||||
|
||||
x.div(3)
|
||||
y.div(3)
|
||||
|
||||
BN = BigNumber.another()
|
||||
BN.config({ DECIMAL_PLACES: 9 })
|
||||
|
||||
BigNumber.config({ DECIMAL_PLACES: 5 })
|
||||
BigNumber.set({ DECIMAL_PLACES: 5 })
|
||||
BigNumber.config(5)
|
||||
|
||||
BigNumber.config({ ROUNDING_MODE: 0 })
|
||||
BigNumber.config(undefined, BigNumber.ROUND_UP)
|
||||
|
||||
BigNumber.config({ EXPONENTIAL_AT: 2 })
|
||||
new BigNumber(12.3)
|
||||
new BigNumber(123)
|
||||
new BigNumber(0.123)
|
||||
new BigNumber(0.0123)
|
||||
|
||||
BigNumber.config({ EXPONENTIAL_AT: [-7, 20] })
|
||||
new BigNumber(123456789)
|
||||
new BigNumber(0.000000123)
|
||||
|
||||
BigNumber.config({ EXPONENTIAL_AT: 1e+9 })
|
||||
|
||||
BigNumber.config({ EXPONENTIAL_AT: 0 })
|
||||
|
||||
BigNumber.config({ RANGE: 500 })
|
||||
BigNumber.config().RANGE
|
||||
new BigNumber('9.999e499')
|
||||
new BigNumber('1e500')
|
||||
new BigNumber('1e-499')
|
||||
new BigNumber('1e-500')
|
||||
|
||||
BigNumber.config({ RANGE: [-3, 4] })
|
||||
new BigNumber(99999)
|
||||
new BigNumber(100000)
|
||||
new BigNumber(0.001)
|
||||
new BigNumber(0.0001)
|
||||
|
||||
BigNumber.config({ ERRORS: false })
|
||||
|
||||
BigNumber.config({ CRYPTO: true })
|
||||
BigNumber.config().CRYPTO
|
||||
BigNumber.random()
|
||||
|
||||
BigNumber.config({ MODULO_MODE: BigNumber.EUCLID })
|
||||
BigNumber.config({ MODULO_MODE: 9 })
|
||||
|
||||
BigNumber.config({ POW_PRECISION: 100 })
|
||||
|
||||
BigNumber.config({
|
||||
FORMAT: {
|
||||
decimalSeparator: '.',
|
||||
groupSeparator: ',',
|
||||
groupSize: 3,
|
||||
secondaryGroupSize: 0,
|
||||
fractionGroupSeparator: ' ',
|
||||
fractionGroupSize: 0
|
||||
}
|
||||
});
|
||||
|
||||
BigNumber.config({
|
||||
DECIMAL_PLACES: 40,
|
||||
ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL,
|
||||
EXPONENTIAL_AT: [-10, 20],
|
||||
RANGE: [-500, 500],
|
||||
ERRORS: true,
|
||||
CRYPTO: true,
|
||||
MODULO_MODE: BigNumber.ROUND_FLOOR,
|
||||
POW_PRECISION: 80,
|
||||
FORMAT: {
|
||||
groupSize: 3,
|
||||
groupSeparator: ' ',
|
||||
decimalSeparator: ','
|
||||
}
|
||||
});
|
||||
|
||||
BigNumber.config(40, 7, [-10, 20], 500, 1, 1, 3, 80)
|
||||
|
||||
var obj = BigNumber.config();
|
||||
obj.ERRORS
|
||||
obj.RANGE
|
||||
|
||||
x = new BigNumber('3257869345.0378653')
|
||||
BigNumber.max(4e9, x, '123456789.9')
|
||||
|
||||
var arr = [12, '13', new BigNumber(14)]
|
||||
BigNumber.max(arr)
|
||||
|
||||
x = new BigNumber('3257869345.0378653')
|
||||
BigNumber.min(4e9, x, '123456789.9')
|
||||
|
||||
arr = [2, new BigNumber(-14), '-15.9999', -12]
|
||||
BigNumber.min(arr)
|
||||
|
||||
BigNumber.config({ DECIMAL_PLACES: 10 })
|
||||
BigNumber.random()
|
||||
BigNumber.random(20)
|
||||
|
||||
BigNumber.config({ ROUNDING_MODE: BigNumber.ROUND_CEIL })
|
||||
BigNumber.config({ ROUNDING_MODE: 2 })
|
||||
|
||||
x = new BigNumber(-0.8)
|
||||
y = x.absoluteValue()
|
||||
var z = y.abs()
|
||||
|
||||
x = new BigNumber(1.3)
|
||||
x.ceil()
|
||||
y = new BigNumber(-1.8)
|
||||
y.ceil()
|
||||
|
||||
x = new BigNumber(Infinity)
|
||||
y = new BigNumber(5)
|
||||
x.comparedTo(y)
|
||||
x.comparedTo(x.minus(1))
|
||||
y.cmp(NaN)
|
||||
y.cmp('110', 2)
|
||||
|
||||
x = new BigNumber(123.45)
|
||||
x.decimalPlaces()
|
||||
y = new BigNumber('9.9e-101')
|
||||
y.dp()
|
||||
|
||||
x = new BigNumber(355)
|
||||
y = new BigNumber(113)
|
||||
x.dividedBy(y)
|
||||
x.div(5)
|
||||
x.div(47, 16)
|
||||
|
||||
x = new BigNumber(5)
|
||||
y = new BigNumber(3)
|
||||
x.dividedToIntegerBy(y)
|
||||
x.divToInt(0.7)
|
||||
x.divToInt('0.f', 16)
|
||||
|
||||
0 === 1e-324
|
||||
x = new BigNumber(0)
|
||||
x.equals('1e-324')
|
||||
BigNumber(-0).eq(x)
|
||||
BigNumber(255).eq('ff', 16)
|
||||
|
||||
y = new BigNumber(NaN)
|
||||
y.equals(NaN)
|
||||
|
||||
x = new BigNumber(1.8)
|
||||
x.floor()
|
||||
y = new BigNumber(-1.3)
|
||||
y.floor()
|
||||
|
||||
0.1 > (0.3 - 0.2)
|
||||
x = new BigNumber(0.1)
|
||||
x.greaterThan(BigNumber(0.3).minus(0.2))
|
||||
BigNumber(0).gt(x)
|
||||
BigNumber(11, 3).gt(11.1, 2)
|
||||
|
||||
x = new BigNumber(0.3).minus(0.2)
|
||||
x.greaterThanOrEqualTo(0.1)
|
||||
BigNumber(1).gte(x)
|
||||
BigNumber(10, 18).gte('i', 36)
|
||||
|
||||
x = new BigNumber(1)
|
||||
x.isFinite()
|
||||
y = new BigNumber(Infinity)
|
||||
y.isFinite()
|
||||
|
||||
x = new BigNumber(1)
|
||||
x.isInteger()
|
||||
y = new BigNumber(123.456)
|
||||
y.isInt()
|
||||
|
||||
x = new BigNumber(NaN)
|
||||
x.isNaN()
|
||||
y = new BigNumber('Infinity')
|
||||
y.isNaN()
|
||||
|
||||
x = new BigNumber(-0)
|
||||
x.isNegative()
|
||||
y = new BigNumber(2)
|
||||
y.isNeg()
|
||||
|
||||
x = new BigNumber(-0)
|
||||
x.isZero() && x.isNeg()
|
||||
y = new BigNumber(Infinity)
|
||||
y.isZero()
|
||||
|
||||
x = new BigNumber(0.3).minus(0.2)
|
||||
x.lessThan(0.1)
|
||||
BigNumber(0).lt(x)
|
||||
BigNumber(11.1, 2).lt(11, 3)
|
||||
|
||||
x = new BigNumber(0.1)
|
||||
x.lessThanOrEqualTo(BigNumber(0.3).minus(0.2))
|
||||
BigNumber(-1).lte(x)
|
||||
BigNumber(10, 18).lte('i', 36)
|
||||
|
||||
x = new BigNumber(0.3)
|
||||
x.minus(0.1)
|
||||
x.sub(0.6, 20)
|
||||
|
||||
x = new BigNumber(1)
|
||||
x.modulo(0.9)
|
||||
y = new BigNumber(33)
|
||||
y.mod('a', 33)
|
||||
|
||||
x = new BigNumber(1.8)
|
||||
x.negated()
|
||||
y = new BigNumber(-1.3)
|
||||
y.neg()
|
||||
|
||||
x = new BigNumber(0.1)
|
||||
y = x.plus(0.2)
|
||||
BigNumber(0.7).plus(x).add(y)
|
||||
x.plus('0.1', 8)
|
||||
|
||||
x = new BigNumber(1.234)
|
||||
x.precision()
|
||||
y = new BigNumber(987000)
|
||||
y.sd()
|
||||
y.sd(true)
|
||||
|
||||
y = new BigNumber(x)
|
||||
y.round()
|
||||
y.round(1)
|
||||
y.round(2)
|
||||
y.round(10)
|
||||
y.round(0, 1)
|
||||
y.round(0, 6)
|
||||
y.round(1, 1)
|
||||
y.round(1, BigNumber.ROUND_HALF_EVEN)
|
||||
y
|
||||
|
||||
x = new BigNumber(1.23)
|
||||
x.shift(3)
|
||||
x.shift(-3)
|
||||
|
||||
x = new BigNumber(16)
|
||||
x.squareRoot()
|
||||
y = new BigNumber(3)
|
||||
y.sqrt()
|
||||
|
||||
x = new BigNumber(0.6)
|
||||
y = x.times(3)
|
||||
BigNumber('7e+500').times(y)
|
||||
x.times('-a', 16)
|
||||
|
||||
BigNumber.config({ DECIMAL_PLACES: 5, ROUNDING_MODE: 4 })
|
||||
x = new BigNumber(9876.54321)
|
||||
|
||||
x.toDigits()
|
||||
x.toDigits(6)
|
||||
x.toDigits(6, BigNumber.ROUND_UP)
|
||||
x.toDigits(2)
|
||||
x.toDigits(2, 1)
|
||||
x
|
||||
|
||||
y = new BigNumber(45.6)
|
||||
y.toExponential()
|
||||
y.toExponential(0)
|
||||
y.toExponential(1)
|
||||
y.toExponential(1, 1)
|
||||
y.toExponential(3)
|
||||
|
||||
y = new BigNumber(3.456)
|
||||
y.toFixed()
|
||||
y.toFixed(0)
|
||||
y.toFixed(2)
|
||||
y.toFixed(2, 1)
|
||||
y.toFixed(5)
|
||||
|
||||
var format = {
|
||||
decimalSeparator: '.',
|
||||
groupSeparator: ',',
|
||||
groupSize: 3,
|
||||
secondaryGroupSize: 0,
|
||||
fractionGroupSeparator: ' ',
|
||||
fractionGroupSize: 0
|
||||
}
|
||||
BigNumber.config({ FORMAT: format })
|
||||
|
||||
x = new BigNumber('123456789.123456789')
|
||||
x.toFormat()
|
||||
x.toFormat(1)
|
||||
|
||||
format.groupSeparator = ' '
|
||||
format.fractionGroupSize = 5
|
||||
x.toFormat()
|
||||
|
||||
BigNumber.config({
|
||||
FORMAT: {
|
||||
decimalSeparator: ',',
|
||||
groupSeparator: '.',
|
||||
groupSize: 3,
|
||||
secondaryGroupSize: 2
|
||||
}
|
||||
})
|
||||
|
||||
x.toFormat(6)
|
||||
|
||||
x = new BigNumber(1.75)
|
||||
x.toFraction()
|
||||
|
||||
var pi = new BigNumber('3.14159265358')
|
||||
pi.toFraction()
|
||||
pi.toFraction(100000)
|
||||
pi.toFraction(10000)
|
||||
pi.toFraction(100)
|
||||
pi.toFraction(10)
|
||||
pi.toFraction(1)
|
||||
|
||||
x = new BigNumber('177.7e+457')
|
||||
y = new BigNumber(235.4325)
|
||||
z = new BigNumber('0.0098074')
|
||||
|
||||
var str = JSON.stringify([x, y, z])
|
||||
|
||||
JSON.parse(str, (key, val) => key === '' ? val : new BigNumber(val))
|
||||
|
||||
x = new BigNumber(456.789)
|
||||
x.toNumber()
|
||||
{ +x }
|
||||
|
||||
y = new BigNumber('45987349857634085409857349856430985')
|
||||
y.toNumber()
|
||||
|
||||
z = new BigNumber(-0)
|
||||
1 / +z
|
||||
1 / z.toNumber()
|
||||
|
||||
x = new BigNumber(0.7)
|
||||
x.toPower(2)
|
||||
BigNumber(3).pow(-2)
|
||||
|
||||
y = new BigNumber(45.6)
|
||||
x.toPrecision()
|
||||
y.toPrecision()
|
||||
x.toPrecision(1)
|
||||
y.toPrecision(1)
|
||||
y.toPrecision(2, 0)
|
||||
y.toPrecision(2, 1)
|
||||
x.toPrecision(5)
|
||||
y.toPrecision(5)
|
||||
|
||||
x = new BigNumber(750000)
|
||||
x.toString()
|
||||
BigNumber.config({ EXPONENTIAL_AT: 5 })
|
||||
x.toString()
|
||||
|
||||
y = new BigNumber(362.875)
|
||||
y.toString(2)
|
||||
y.toString(9)
|
||||
y.toString(32)
|
||||
|
||||
BigNumber.config({ DECIMAL_PLACES: 4 });
|
||||
z = new BigNumber('1.23456789')
|
||||
z.toString()
|
||||
z.toString(10)
|
||||
|
||||
x = new BigNumber(123.456)
|
||||
x.truncated()
|
||||
y = new BigNumber(-12.3)
|
||||
y.trunc()
|
||||
|
||||
x = new BigNumber('-0')
|
||||
x.toString()
|
||||
x.valueOf()
|
||||
y = new BigNumber('1.777e+457')
|
||||
y.valueOf()
|
||||
|
||||
x = new BigNumber(0.123)
|
||||
x.toExponential()
|
||||
x.c
|
||||
x.e
|
||||
x.s
|
||||
|
||||
z = new BigNumber('-123.4567000e+2')
|
||||
z.toExponential()
|
||||
z.c
|
||||
z.e
|
||||
z.s
|
||||
|
||||
x = new BigNumber(3)
|
||||
x instanceof BigNumber
|
||||
x.isBigNumber
|
||||
|
||||
BN = BigNumber.another();
|
||||
|
||||
y = new BN(3)
|
||||
y instanceof BigNumber
|
||||
y.isBigNumber
|
||||
|
||||
y = new BigNumber(-0)
|
||||
y.c
|
||||
y.e
|
||||
y.s
|
||||
|
||||
try {
|
||||
// ...
|
||||
} catch (e) {
|
||||
if (e instanceof Error && e.name == 'BigNumber Error') {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
||||
x = new BigNumber("1.0")
|
||||
y = new BigNumber("1.1000")
|
||||
z = x.add(y)
|
||||
|
||||
x = new BigNumber("1.20")
|
||||
y = new BigNumber("3.45000")
|
||||
z = x.mul(y)
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
import blueimp = require('blueimp-md5');
|
||||
|
||||
function hash(): boolean {
|
||||
return blueimp.md5('hello world') === '5eb63bbbe01eeed093cb22bb8f5acdc3';
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
// Type definitions for blueimp-md5 v1.1.0
|
||||
// Project: https://github.com/blueimp/JavaScript-MD5
|
||||
// Definitions by: Ray Martone <https://github.com/rmartone>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export declare function md5(value: string, key?: string, raw?: boolean): string;
|
||||
@@ -1,47 +0,0 @@
|
||||
|
||||
|
||||
import fs = require('fs');
|
||||
import chokidar = require('chokidar');
|
||||
|
||||
var watcher = chokidar.watch('file, dir, or glob', {
|
||||
ignored: /[\/\\]\./, persistent: true
|
||||
});
|
||||
|
||||
var log = console.log.bind(console);
|
||||
|
||||
let str: string;
|
||||
let any: any;
|
||||
let stats: fs.Stats;
|
||||
|
||||
watcher
|
||||
.on('add', path => { str = path; })
|
||||
.on('addDir', path => { str = path; })
|
||||
.on('change', path => { str = path; })
|
||||
.on('unlink', path => { str = path; })
|
||||
.on('unlinkDir', path => { str = path; })
|
||||
.on('error', (error) => { any = error; })
|
||||
.on('ready', () => { })
|
||||
.on('raw', (event, path, details) => { str = event; str = path; any = details; })
|
||||
|
||||
// 'add', 'addDir' and 'change' events also receive stat() results as second
|
||||
// argument when available: http://nodejs.org/api/fs.html#fs_class_fs_stats
|
||||
watcher.on('change', (path, _stats) => {
|
||||
str = path;
|
||||
stats = _stats;
|
||||
});
|
||||
|
||||
// Watch new files.
|
||||
watcher.add('new-file');
|
||||
watcher.add(['new-file-2', 'new-file-3', '**/other-file*']);
|
||||
|
||||
// Un-watch some files.
|
||||
watcher.unwatch('new-file*');
|
||||
|
||||
// Only needed if watching is `persistent: true`.
|
||||
watcher.close();
|
||||
|
||||
// One-liner
|
||||
chokidar.watch('.', {ignored: /[\/\\]\./}).on('all', (event, path) => {
|
||||
str = event;
|
||||
str = path;
|
||||
});
|
||||
Vendored
-49
@@ -1,49 +0,0 @@
|
||||
// Type definitions for chokidar 1.4.3
|
||||
// Project: https://github.com/paulmillr/chokidar
|
||||
// Definitions by: Stefan Steinhart <https://github.com/reppners/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare module "chokidar"
|
||||
{
|
||||
export class FSWatcher
|
||||
{
|
||||
constructor(options?: WatchOptions);
|
||||
add(fileDirOrGlob:string):void;
|
||||
add(filesDirsOrGlobs:Array<string>):void;
|
||||
unwatch(fileDirOrGlob:string):void;
|
||||
unwatch(filesDirsOrGlobs:Array<string>):void;
|
||||
getWatched():any;
|
||||
on(event: 'add', fn: (path: string, stats?: fs.Stats) => void): this;
|
||||
on(event: 'change', fn: (path: string, stats?: fs.Stats) => void): this;
|
||||
on(event: 'unlink', fn: (path: string) => void): this;
|
||||
on(event: 'raw', fn: (event: string, path:string, details:any) => void): this;
|
||||
on(event: 'all', fn: (event: string, path: string) => void): this;
|
||||
on(event: string, fn: (path: string) => void): this;
|
||||
close(): this;
|
||||
}
|
||||
|
||||
interface WatchOptions
|
||||
{
|
||||
persistent?:boolean;
|
||||
ignored?:any;
|
||||
ignoreInitial?:boolean;
|
||||
followSymlinks?:boolean;
|
||||
cwd?:string;
|
||||
usePolling?:boolean;
|
||||
useFsEvents?:boolean;
|
||||
alwaysStat?:boolean;
|
||||
depth?:number;
|
||||
interval?:number;
|
||||
binaryInterval?:number;
|
||||
ignorePermissionErrors?:boolean;
|
||||
atomic?:boolean;
|
||||
awaitWriteFinish?:any;
|
||||
}
|
||||
|
||||
import fs = require("fs");
|
||||
|
||||
export function watch(fileDirOrGlob:string, options?:WatchOptions):FSWatcher;
|
||||
export function watch(filesDirsOrGlobs:Array<string>, options?:WatchOptions):FSWatcher;
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
import * as assert from "power-assert";
|
||||
import cucumber = require("cucumber");
|
||||
|
||||
function StepSample() {
|
||||
type Callback = cucumber.CallbackStepDefinition;
|
||||
type Table = cucumber.TableDefinition;
|
||||
type HookScenario = cucumber.HookScenario;
|
||||
type Hooks = cucumber.Hooks;
|
||||
var step = <cucumber.StepDefinitions>this;
|
||||
var hook = <cucumber.Hooks>this;
|
||||
|
||||
hook.setWorldConstructor(function() {
|
||||
this.visit = function(url: string, callback: Callback) {
|
||||
callback(null, 'pending');
|
||||
}
|
||||
})
|
||||
|
||||
hook.Before(function(scenario: HookScenario, callback: Callback){
|
||||
scenario.isFailed() && callback.pending();
|
||||
});
|
||||
|
||||
hook.Around(function(scenario: HookScenario, runScenario: (error:string, callback?:Function)=>void) {
|
||||
scenario.isFailed() && runScenario(null, function(){
|
||||
console.log('finish tasks');
|
||||
});
|
||||
});
|
||||
|
||||
hook.registerHandler('AfterFeatures', function (event:any, callback:Function) {
|
||||
callback();
|
||||
});
|
||||
|
||||
step.Given(/^I am on the Cucumber.js GitHub repository$/, function(callback:Callback) {
|
||||
this.visit('https://github.com/cucumber/cucumber-js', callback);
|
||||
});
|
||||
|
||||
step.When(/^I go to the README file$/, function(title:string, callback:Callback) {
|
||||
callback(null, 'pending');
|
||||
});
|
||||
|
||||
step.Then(/^I should see "(.*)" as the page title$/, { timeout:60*1000}, function(title:string, callback:Callback) {
|
||||
var pageTitle = this.browser.text('title');
|
||||
|
||||
if (title === pageTitle) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("Expected to be on page with title " + title));
|
||||
}
|
||||
});
|
||||
|
||||
// Type for data_table.js on
|
||||
// https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js
|
||||
|
||||
step.Given(/^a table step with Table raw$/, function(table:Table){
|
||||
var expected = [
|
||||
['Cucumber', 'Cucumis sativus'],
|
||||
['Burr Gherkin', 'Cucumis anguria']
|
||||
];
|
||||
|
||||
assert.deepEqual(table.raw(), expected);
|
||||
});
|
||||
|
||||
step.Given(/^a table step with Table rows$/, function(table: Table){
|
||||
var expected = [
|
||||
['Apricot', '5'],
|
||||
['Brocolli', '2'],
|
||||
['Cucumber', '10']
|
||||
];
|
||||
assert.deepEqual(table.rows(), expected)
|
||||
});
|
||||
|
||||
step.Given(/^a table step with Table rowHash$/, function(table:Table){
|
||||
var expected = {
|
||||
'Cucumber': 'Cucumis sativus',
|
||||
'Burr Gherkin': 'Cucumis anguria'
|
||||
};
|
||||
assert.deepEqual(table.rowsHash(), expected)
|
||||
});
|
||||
|
||||
step.Given(/^a table step$/, function(table:Table){
|
||||
var expected = [
|
||||
{'Vegetable': 'Apricot', 'Rating': '5'},
|
||||
{'Vegetable': 'Brocolli', 'Rating': '2'},
|
||||
{'Vegetable': 'Cucumber', 'Rating': '10'}
|
||||
];
|
||||
assert.deepEqual(table.hashes(), expected)
|
||||
});
|
||||
|
||||
cucumber.defineSupportCode(function(step: cucumber.StepDefinitions){
|
||||
step.Given( /^a variable set to (\d+)$/, (x:string) => {
|
||||
console.log("the number is: " + x);
|
||||
} );
|
||||
});
|
||||
cucumber.defineSupportCode(function(step: Hooks){
|
||||
step.After((scenario: HookScenario, callback?: Callback) => {
|
||||
console.log("After");
|
||||
callback();
|
||||
} )
|
||||
});
|
||||
|
||||
cucumber.defineSupportCode(function(hook: cucumber.Hooks){
|
||||
hook.addTransform({
|
||||
captureGroupRegexps: ['red|blue|green'],
|
||||
transformer: (arg: string) => arg,
|
||||
typeName: 'color'
|
||||
});
|
||||
});
|
||||
|
||||
cucumber.defineSupportCode(function({After, Given}) {
|
||||
Given( /^a variable set to (\d+)$/, (x:string) => {
|
||||
console.log("the number is: " + x);
|
||||
});
|
||||
After((scenario: HookScenario, callback?: Callback) => {
|
||||
console.log("After");
|
||||
callback();
|
||||
});
|
||||
});
|
||||
|
||||
let fns : cucumber.SupportCodeConsumer[] = cucumber.getSupportCodeFns()
|
||||
|
||||
cucumber.clearSupportCodeFns();
|
||||
}
|
||||
|
||||
function registerListener(): cucumber.EventListener {
|
||||
let listener = Object.assign(cucumber.Listener(), {
|
||||
handleBeforeScenarioEvent: (scenario: cucumber.events.ScenarioPayload, callback: () => void) => {
|
||||
|
||||
// do some interesting stuff ...
|
||||
|
||||
callback();
|
||||
}
|
||||
});
|
||||
|
||||
return listener;
|
||||
}
|
||||
Vendored
-224
@@ -1,224 +0,0 @@
|
||||
// Type definitions for cucumber-js
|
||||
// Project: https://github.com/cucumber/cucumber-js
|
||||
// Definitions by: Abraão Alves <https://github.com/abraaoalves>, Jan Molak <https://github.com/jan-molak>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = cucumber;
|
||||
|
||||
declare namespace cucumber {
|
||||
|
||||
export interface CallbackStepDefinition{
|
||||
pending : () => PromiseLike<any>;
|
||||
(error?:any, pending?: string):void;
|
||||
}
|
||||
|
||||
export interface TableDefinition{
|
||||
raw: () => Array<any>;
|
||||
rows: () => Array<any>;
|
||||
rowsHash: () => {};
|
||||
hashes: () => {};
|
||||
}
|
||||
|
||||
type StepDefinitionParam = string | CallbackStepDefinition | TableDefinition;
|
||||
|
||||
interface StepDefinitionCode {
|
||||
(...stepArgs: Array<StepDefinitionParam>): PromiseLike<any> | any | void;
|
||||
}
|
||||
|
||||
interface StepDefinitionOptions{
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
export interface StepDefinitions {
|
||||
Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void;
|
||||
Given(pattern: RegExp | string, code: StepDefinitionCode): void;
|
||||
When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void;
|
||||
When(pattern: RegExp | string, code: StepDefinitionCode): void;
|
||||
Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void;
|
||||
Then(pattern: RegExp | string, code: StepDefinitionCode): void;
|
||||
setDefaultTimeout(time:number): void;
|
||||
}
|
||||
|
||||
interface HookScenario{
|
||||
getKeyword():string;
|
||||
getName():string;
|
||||
getDescription():string;
|
||||
getUri():string;
|
||||
getLine():number;
|
||||
getTags():string[];
|
||||
getException():Error;
|
||||
getAttachments():any[];
|
||||
attach(data:any, mimeType?:string, callback?:(err?:any) => void):void;
|
||||
isSuccessful():boolean;
|
||||
isFailed():boolean;
|
||||
isPending():boolean;
|
||||
isUndefined():boolean;
|
||||
isSkipped():boolean;
|
||||
}
|
||||
|
||||
interface HookCode {
|
||||
(scenario: HookScenario, callback?: CallbackStepDefinition): void;
|
||||
}
|
||||
|
||||
interface AroundCode{
|
||||
(scenario: HookScenario, runScenario?: (error:string, callback?:Function)=>void): void;
|
||||
}
|
||||
|
||||
interface Transform {
|
||||
captureGroupRegexps: Array<RegExp | string>;
|
||||
transformer: (arg: string) => any;
|
||||
typeName: string;
|
||||
}
|
||||
|
||||
export interface Hooks {
|
||||
Before(code: HookCode): void;
|
||||
After(code: HookCode): void;
|
||||
Around(code: AroundCode):void;
|
||||
setDefaultTimeout(time:number): void;
|
||||
setWorldConstructor(world: () => void): void;
|
||||
registerHandler(handlerOption:string, code:(event:any, callback:CallbackStepDefinition) =>void): void;
|
||||
registerListener(listener: EventListener): void;
|
||||
addTransform(transform: Transform): void;
|
||||
}
|
||||
|
||||
export class EventListener {
|
||||
hear(event: events.Event, callback: ()=>void): void;
|
||||
hasHandlerForEvent(event: events.Event): boolean;
|
||||
buildHandlerNameForEvent(event: events.Event): string;
|
||||
getHandlerForEvent(event: events.Event): EventHook;
|
||||
buildHandlerName(shortName: string): string;
|
||||
setHandlerForEvent(shortName: string, handler: EventListener): void;
|
||||
}
|
||||
|
||||
export function Listener(): EventListener;
|
||||
|
||||
export namespace events {
|
||||
|
||||
interface Event {
|
||||
getName(): string;
|
||||
getPayloadItem(name: string): EventPayload;
|
||||
}
|
||||
|
||||
interface EventPayload {
|
||||
}
|
||||
|
||||
interface FeaturesPayload extends EventPayload {
|
||||
getFeatures(): any[]; // https://github.com/cucumber/cucumber-js/blob/dc698bf5bc10d591fa7adeec5fa21b2d90dc9679/lib/cucumber/runtime.js#L34
|
||||
}
|
||||
|
||||
interface FeaturesResultPayload extends EventPayload {
|
||||
getDuration(): any;
|
||||
getScenarioCounts(): any;
|
||||
getStepCounts(): any;
|
||||
isSuccessful(): boolean;
|
||||
}
|
||||
|
||||
interface FeaturePayload extends EventPayload {
|
||||
getStepKeywordByLines(): any;
|
||||
getScenarioKeyword(): string;
|
||||
getKeyword(): string;
|
||||
getName(): string;
|
||||
getDescription(): string;
|
||||
getUri(): string;
|
||||
getLine(): number;
|
||||
getTags(): Tag[];
|
||||
getScenarios(): ScenarioPayload[];
|
||||
getPayloadItem(): FeaturePayload;
|
||||
}
|
||||
|
||||
interface ScenarioPayload extends EventPayload {
|
||||
getName(): string;
|
||||
getKeyword(): string;
|
||||
getDescription(): string;
|
||||
getFeature(): FeaturePayload;
|
||||
getUri(): string;
|
||||
getUris(): string[];
|
||||
getLine(): number;
|
||||
getLines(): number[];
|
||||
getTags(): Tag[];
|
||||
getSteps(): any[];
|
||||
getPayloadItem(): ScenarioPayload;
|
||||
}
|
||||
|
||||
interface ScenarioResultPayload extends EventPayload {
|
||||
getFailureException(): Error;
|
||||
getScenario(): any;
|
||||
getStatus(): any;
|
||||
}
|
||||
|
||||
interface StepPayload extends EventPayload {
|
||||
isHidden(): boolean;
|
||||
isOutlineStep(): boolean;
|
||||
getKeyword(): string;
|
||||
getName(): string;
|
||||
hasUri(): boolean;
|
||||
getUri(): string;
|
||||
getLine(): number;
|
||||
getPreviousStep(): any;
|
||||
hasPreviousStep(): boolean;
|
||||
getAttachment(): any;
|
||||
getAttachmentContents(): any;
|
||||
getDocString(): string;
|
||||
getDataTable(): any;
|
||||
hasAttachment(): boolean;
|
||||
hasDocString(): boolean;
|
||||
hasDataTable(): boolean;
|
||||
ensureDataTableIsAttached(): void;
|
||||
isOutcomeStep(): boolean;
|
||||
isEventStep(): boolean;
|
||||
hasOutcomeStepKeyword(): boolean;
|
||||
hasEventStepKeyword(): boolean;
|
||||
isRepeatingOutcomeStep(): boolean;
|
||||
isRepeatingEventStep(): boolean;
|
||||
hasRepeatStepKeyword(): boolean;
|
||||
isPrecededByOutcomeStep(): boolean;
|
||||
isPrecededByEventStep(): boolean;
|
||||
}
|
||||
|
||||
interface StepResultPayload extends EventPayload {
|
||||
getAmbiguousStepDefinitions(): any[];
|
||||
getAttachments(): any[];
|
||||
getDuration(): any;
|
||||
getFailureException(): Error;
|
||||
getStep(): any;
|
||||
getStepDefinition(): any;
|
||||
getStatus(): any;
|
||||
hasAttachments(): boolean;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface Tag {
|
||||
getName(): string;
|
||||
getLine(): number;
|
||||
}
|
||||
|
||||
export interface Scenario {
|
||||
getKeyword(): string;
|
||||
getName(): string;
|
||||
getDescription(): string;
|
||||
getUri(): string;
|
||||
getLine(): number;
|
||||
getTags(): Tag[];
|
||||
getException(): Error;
|
||||
getAttachments(): any[];
|
||||
attach(data: any, mimeType?: string, callback?: (err?: any) => void): void;
|
||||
isSuccessful(): boolean;
|
||||
isFailed(): boolean;
|
||||
isPending(): boolean;
|
||||
isUndefined(): boolean;
|
||||
isSkipped(): boolean;
|
||||
}
|
||||
|
||||
interface EventHook {
|
||||
(event: events.Event, callback?: ()=>void): void;
|
||||
}
|
||||
|
||||
export interface SupportCodeConsumer {
|
||||
(stepDefinitions:StepDefinitions & Hooks):void;
|
||||
}
|
||||
|
||||
export function defineSupportCode(consumer:SupportCodeConsumer): void;
|
||||
export function getSupportCodeFns(): SupportCodeConsumer[];
|
||||
export function clearSupportCodeFns(): void;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Vendored
-126
@@ -1,126 +0,0 @@
|
||||
// Type definitions for fetch.io 3.1
|
||||
// Project: https://github.com/haoxins/fetch.io
|
||||
// Definitions by: newraina <https://github.com/newraina>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="whatwg-fetch" />
|
||||
|
||||
type TUrl = string;
|
||||
|
||||
type TMethod = 'delete' | 'get' | 'head' | 'options' | 'post' | 'put';
|
||||
|
||||
interface Query {
|
||||
[key: string]: number | boolean | string;
|
||||
}
|
||||
|
||||
interface Header {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
interface Options extends RequestInit {
|
||||
|
||||
prefix?: string;
|
||||
|
||||
query?: Query;
|
||||
|
||||
header?: Header;
|
||||
|
||||
beforeRequest?(url: TUrl, body: BodyInit): boolean;
|
||||
|
||||
afterResponse?(res: Response): void;
|
||||
|
||||
afterJSON?(body: any): void;
|
||||
}
|
||||
|
||||
declare namespace FetchIo {
|
||||
|
||||
class Request {
|
||||
|
||||
constructor(method: TMethod, url: TUrl, options: Options)
|
||||
|
||||
/**
|
||||
* HTTP delete method
|
||||
*/
|
||||
delete: (url: TUrl) => this;
|
||||
|
||||
/**
|
||||
* HTTP get method
|
||||
*/
|
||||
get: (url: TUrl) => this;
|
||||
|
||||
/**
|
||||
* HTTP head method
|
||||
*/
|
||||
head: (url: TUrl) => this;
|
||||
|
||||
/**
|
||||
* HTTP options method
|
||||
*/
|
||||
options: (url: TUrl) => this;
|
||||
|
||||
/**
|
||||
* HTTP post method
|
||||
*/
|
||||
post: (url: TUrl) => this;
|
||||
|
||||
/**
|
||||
* HTTP put method
|
||||
*/
|
||||
put: (url: TUrl) => this;
|
||||
|
||||
/**
|
||||
* Set Options
|
||||
*/
|
||||
config(key: string, value: any): this
|
||||
|
||||
config(opts: {[key: string]: any}): this
|
||||
|
||||
/**
|
||||
* Set Header
|
||||
*/
|
||||
set(key: string, value: any): this
|
||||
|
||||
set(opts: {[key: string]: any}): this
|
||||
|
||||
/**
|
||||
* Set Content-Type
|
||||
*/
|
||||
type(type: 'json' | 'form' | 'urlencoded'): this
|
||||
|
||||
/**
|
||||
* Add query string
|
||||
*/
|
||||
query(object: {[key: string]: any}): this
|
||||
|
||||
/**
|
||||
* Send data
|
||||
*/
|
||||
send(data: {[key: string]: any}): this
|
||||
|
||||
/**
|
||||
* ppend formData
|
||||
*/
|
||||
append(key: string, value: string): this
|
||||
|
||||
/**
|
||||
* Get Response directly
|
||||
*/
|
||||
then(resolve: (value?: Response) => void, reject?: (reason?: any) => void): Promise<any>
|
||||
|
||||
/**
|
||||
* Make Response to JSON
|
||||
*/
|
||||
json(strict?: boolean): Promise<any>
|
||||
|
||||
/**
|
||||
* Make Response to string
|
||||
*/
|
||||
text(): Promise<string>
|
||||
}
|
||||
|
||||
class Fetch extends Request {
|
||||
constructor(options?: Options)
|
||||
}
|
||||
}
|
||||
|
||||
export default FetchIo.Fetch;
|
||||
@@ -1,139 +0,0 @@
|
||||
import * as jspb from "google-protobuf";
|
||||
|
||||
/* This is a typescript version of a simple generated class from a proto file that is shown below. In order to make
|
||||
this ES5 JS file into TypeScript there have been quite a few modifications, but the same calls are made to the library
|
||||
classes.
|
||||
|
||||
// FILE: simple.proto
|
||||
syntax = "proto3";
|
||||
|
||||
package examplecom;
|
||||
|
||||
message MySimple {
|
||||
string my_string = 1;
|
||||
bool my_bool = 2;
|
||||
repeated string some_labels = 3;
|
||||
}
|
||||
*/
|
||||
|
||||
class MySimple extends jspb.Message {
|
||||
constructor(opt_data?: any) {
|
||||
super(); // This isn't actually called in the JS version of this file, but it's required by TS
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, MySimple.repeatedFields_, null);
|
||||
};
|
||||
|
||||
static repeatedFields_ = [3];
|
||||
|
||||
toObject(opt_includeInstance: boolean): {} {
|
||||
return MySimple.toObject(opt_includeInstance, this);
|
||||
};
|
||||
|
||||
static toObject(includeInstance: boolean, msg: MySimple): {} {
|
||||
const obj: {} = {
|
||||
myString: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
||||
myBool: jspb.Message.getFieldWithDefault(msg, 2, false),
|
||||
someLabelsList: jspb.Message.getField(msg, 3),
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
// This is commented out because it's not valid in TS, but it's a simple append to an object
|
||||
// obj['$jspbMessageInstance'] = msg;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
static deserializeBinary(bytes: Uint8Array) {
|
||||
const reader = new jspb.BinaryReader(bytes);
|
||||
const msg = new MySimple();
|
||||
return MySimple.deserializeBinaryFromReader(msg, reader);
|
||||
};
|
||||
|
||||
static deserializeBinaryFromReader(msg: MySimple, reader: jspb.BinaryReader) {
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup()) {
|
||||
break;
|
||||
}
|
||||
const field = reader.getFieldNumber();
|
||||
switch (field) {
|
||||
case 1:
|
||||
const value1 = (reader.readString());
|
||||
msg.setMyString(value1);
|
||||
break;
|
||||
case 2:
|
||||
const value2 = (reader.readBool());
|
||||
msg.setMyBool(value2);
|
||||
break;
|
||||
case 3:
|
||||
const value3 = (reader.readString());
|
||||
msg.addSomeLabels(value3);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
};
|
||||
|
||||
serializeBinary(): Uint8Array {
|
||||
const writer = new jspb.BinaryWriter();
|
||||
MySimple.serializeBinaryToWriter(this, writer);
|
||||
return writer.getResultBuffer();
|
||||
};
|
||||
|
||||
static serializeBinaryToWriter(message: MySimple, writer: jspb.BinaryWriter) {
|
||||
let f1 = message.getMyString();
|
||||
if (f1.length > 0) {
|
||||
writer.writeString(
|
||||
1,
|
||||
f1,
|
||||
);
|
||||
}
|
||||
const f2 = message.getMyBool();
|
||||
if (f2) {
|
||||
writer.writeBool(
|
||||
2,
|
||||
f2,
|
||||
);
|
||||
}
|
||||
const f3 = message.getSomeLabelsList();
|
||||
if (f3.length > 0) {
|
||||
writer.writeRepeatedString(
|
||||
3,
|
||||
f3,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
getMyString(): string {
|
||||
return jspb.Message.getFieldWithDefault(this, 1, "");
|
||||
}
|
||||
|
||||
setMyString(value: string) {
|
||||
jspb.Message.setField(this, 1, value);
|
||||
}
|
||||
|
||||
getMyBool(): boolean {
|
||||
return jspb.Message.getFieldWithDefault(this, 2, false);
|
||||
}
|
||||
|
||||
setMyBool(value: boolean) {
|
||||
jspb.Message.setField(this, 2, value);
|
||||
}
|
||||
|
||||
getSomeLabelsList(): string[] {
|
||||
return jspb.Message.getField(this, 3);
|
||||
}
|
||||
|
||||
setSomeLabelsList(value: string[]) {
|
||||
jspb.Message.setField(this, 3, value || []);
|
||||
}
|
||||
|
||||
addSomeLabels(value: string, opt_index?: number) {
|
||||
jspb.Message.addToRepeatedField(this, 3, value, opt_index);
|
||||
}
|
||||
|
||||
clearSomeLabelsList() {
|
||||
this.setSomeLabelsList([]);
|
||||
}
|
||||
}
|
||||
Vendored
-687
@@ -1,687 +0,0 @@
|
||||
// Type definitions for google-protobuf 3.2
|
||||
// Project: https://github.com/google/google-protobuf
|
||||
// Definitions by: Marcus Longmuir <https://github.com/marcuslongmuir/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type ByteSource = ArrayBuffer|Uint8Array|number[]|string;
|
||||
type ScalarFieldType = boolean|number|string;
|
||||
type RepeatedFieldType = ScalarFieldType[] | Uint8Array[];
|
||||
type AnyFieldType = ScalarFieldType | RepeatedFieldType | Uint8Array;
|
||||
type FieldValue = (string|number|boolean|Uint8Array|any/*This should be Array<FieldValue>, but that isn't allowed*/|undefined)
|
||||
|
||||
export abstract class Message {
|
||||
getJsPbMessageId(): (string | undefined);
|
||||
static initialize(msg: Message,
|
||||
data: Message.MessageArray,
|
||||
messageId: (string | number),
|
||||
suggestedPivot: number,
|
||||
repeatedFields: number[],
|
||||
oneofFields?: number[][] | null): void;
|
||||
static toObjectList<T extends Message>(field: T[],
|
||||
toObjectFn: (includeInstance: boolean,
|
||||
data: T) => {},
|
||||
includeInstance?: boolean): {}[];
|
||||
static toObjectExtension(msg: Message,
|
||||
obj: {},
|
||||
extensions: {[key: number]: ExtensionFieldInfo<Message>},
|
||||
getExtensionFn: (fieldInfo: ExtensionFieldInfo<Message>) => Message,
|
||||
includeInstance?: boolean): void;
|
||||
serializeBinaryExtensions(proto: Message,
|
||||
writer: BinaryWriter,
|
||||
extensions: {[key: number]: ExtensionFieldBinaryInfo<Message>},
|
||||
getExtensionFn: <T>(fieldInfo: ExtensionFieldInfo<T>) => T): void
|
||||
readBinaryExtension(proto: Message,
|
||||
reader: BinaryReader,
|
||||
extensions: {[key: number]: ExtensionFieldBinaryInfo<Message>},
|
||||
setExtensionFn: <T>(fieldInfo: ExtensionFieldInfo<T>,
|
||||
val: T) => void): void
|
||||
static getField(msg: Message,
|
||||
fieldNumber: number): FieldValue|null;
|
||||
static getOptionalFloatingPointField(msg: Message,
|
||||
fieldNumber: number): (number | undefined);
|
||||
static getRepeatedFloatingPointField(msg: Message,
|
||||
fieldNumber: number): number[];
|
||||
static bytesAsB64(bytes: Uint8Array): string;
|
||||
static bytesAsU8(str: string): Uint8Array;
|
||||
static bytesListAsB64(bytesList: Uint8Array[]): string[];
|
||||
static bytesListAsU8(strList: string[]): Uint8Array[];
|
||||
static getFieldWithDefault<T>(msg: Message,
|
||||
fieldNumber: number,
|
||||
defaultValue: T): T;
|
||||
static getMapField(msg: Message,
|
||||
fieldNumber: number,
|
||||
noLazyCreate: boolean,
|
||||
valueCtor: typeof Message): Map<any, any>;
|
||||
static setField(msg: Message,
|
||||
fieldNumber: number,
|
||||
value: FieldValue): void;
|
||||
static addToRepeatedField(msg: Message,
|
||||
fieldNumber: number,
|
||||
value: any,
|
||||
index?: number): void;
|
||||
static setOneofField(msg: Message,
|
||||
fieldNumber: number,
|
||||
oneof: number[],
|
||||
value: FieldValue): void;
|
||||
static computeOneofCase(msg: Message,
|
||||
oneof: number[]): number;
|
||||
static getWrapperField(msg: Message,
|
||||
ctor: typeof Message,
|
||||
fieldNumber: number,
|
||||
required?: number): Message;
|
||||
static getRepeatedWrapperField(msg: Message,
|
||||
ctor: typeof Message,
|
||||
fieldNumber: number): Message[];
|
||||
static setWrapperField(msg: Message,
|
||||
fieldNumber: number,
|
||||
value?: (Message|Map<any, any>)): void;
|
||||
static setOneofWrapperField(msg: Message,
|
||||
fieldNumber: number,
|
||||
oneof: number[],
|
||||
value: any): void;
|
||||
static setRepeatedWrapperField(msg: Message,
|
||||
fieldNumber: number,
|
||||
value: any): void;
|
||||
static addToRepeatedWrapperField(msg: Message,
|
||||
fieldNumber: number,
|
||||
value: any,
|
||||
ctor: typeof Message,
|
||||
index: number): any;
|
||||
static toMap(field: any[],
|
||||
mapKeyGetterFn: (field: any) => string,
|
||||
toObjectFn?: Message.StaticToObject,
|
||||
includeInstance?: boolean): void;
|
||||
toArray(): Message.MessageArray;
|
||||
toString(): string;
|
||||
getExtension<T>(fieldInfo: ExtensionFieldInfo<T>): T;
|
||||
setExtension<T>(fieldInfo: ExtensionFieldInfo<T>,
|
||||
value: T): void;
|
||||
static difference<T extends Message>(m1: T,
|
||||
m2: T): T;
|
||||
static equals(m1: Message,
|
||||
m2: Message): boolean;
|
||||
static compareExtensions(extension1: {},
|
||||
extension2: {}): boolean;
|
||||
static compareFields(field1: any,
|
||||
field2: any): boolean;
|
||||
cloneMessage(): Message;
|
||||
clone(): Message;
|
||||
static clone<T extends Message>(msg: T): T;
|
||||
static cloneMessage<T extends Message>(msg: T): T;
|
||||
static copyInto(fromMessage: Message,
|
||||
toMessage: Message): void;
|
||||
static registerMessageType(id: number,
|
||||
constructor: typeof Message): void;
|
||||
|
||||
abstract serializeBinary(): Uint8Array;
|
||||
abstract toObject(includeInstance?: boolean): {};
|
||||
|
||||
// These are `abstract static`, but that isn't allowed. Subclasses of Message will have these methods and properties
|
||||
// and not having them on Message makes using this class for its intended purpose quite difficult.
|
||||
static deserializeBinary(bytes: Uint8Array): Message;
|
||||
static deserializeBinaryFromReader(message: Message, reader: BinaryReader): Message;
|
||||
static serializeBinaryToWriter(message: Message, writer: BinaryWriter): void;
|
||||
static toObject(includeInstance: boolean, msg: Message): {};
|
||||
static extensions: {[key: number]: ExtensionFieldInfo<Message>};
|
||||
static extensionsBinary: {[key: number]: ExtensionFieldBinaryInfo<Message>};
|
||||
}
|
||||
|
||||
export namespace Message {
|
||||
export type MessageArray = any[]; // This type needs to reference itself
|
||||
interface StaticToObject {
|
||||
(includeInstance: boolean,
|
||||
msg: Message): {};
|
||||
}
|
||||
}
|
||||
|
||||
export class ExtensionFieldInfo<T> {
|
||||
fieldIndex: number;
|
||||
fieldName: number;
|
||||
ctor: typeof Message;
|
||||
toObjectFn: Message.StaticToObject;
|
||||
isRepeated: number;
|
||||
constructor(fieldIndex: number,
|
||||
fieldName: {[key: string]: number},
|
||||
ctor: typeof Message,
|
||||
toObjectFn: Message.StaticToObject,
|
||||
isRepeated: number);
|
||||
isMessageType(): boolean;
|
||||
}
|
||||
|
||||
export class ExtensionFieldBinaryInfo<T> {
|
||||
fieldInfo: ExtensionFieldInfo<T>;
|
||||
binaryReaderFn: BinaryRead;
|
||||
binaryWriterFn: BinaryWrite;
|
||||
opt_binaryMessageSerializeFn: (msg: Message,
|
||||
writer: BinaryWriter) => void;
|
||||
opt_binaryMessageDeserializeFn: (msg: Message,
|
||||
reader: BinaryReader) => Message;
|
||||
opt_isPacked: boolean;
|
||||
constructor(fieldInfo: ExtensionFieldInfo<T>,
|
||||
binaryReaderFn: BinaryRead,
|
||||
binaryWriterFn: BinaryWrite,
|
||||
opt_binaryMessageSerializeFn: (msg: Message,
|
||||
writer: BinaryWriter) => void,
|
||||
opt_binaryMessageDeserializeFn: (msg: Message,
|
||||
reader: BinaryReader) => Message,
|
||||
opt_isPacked: boolean);
|
||||
}
|
||||
|
||||
export class Map<K, V> {
|
||||
constructor(arr: Array<[K, V]>,
|
||||
valueCtor?: {new(init: any): V});
|
||||
toArray(): Array<[K, V]>;
|
||||
toObject(includeInstance: boolean,
|
||||
valueToObject: (includeInstance: boolean) => any): Array<[K, V]>;
|
||||
static fromObject<K, V>(entries: Array<[K, V]>,
|
||||
valueCtor: any,
|
||||
valueFromObject: any): Map<K, V>;
|
||||
getLength(): number;
|
||||
clear(): void;
|
||||
del(key: K): boolean;
|
||||
getEntryList(): Array<[K, V]>;
|
||||
entries(): Map.Iterator<[K, V]>;
|
||||
keys(): Map.Iterator<K>;
|
||||
forEach(callback: (entry: V,
|
||||
key: K) => void,
|
||||
thisArg?: {}): void;
|
||||
set(key: K,
|
||||
value: V): void;
|
||||
get(key: K): (V | undefined);
|
||||
has(key: K): boolean;
|
||||
}
|
||||
|
||||
export namespace Map {
|
||||
// This is implemented by jspb.Map.ArrayIteratorIterable_, but that class shouldn't be exported
|
||||
interface Iterator<T> {
|
||||
next(): IteratorResult<T>;
|
||||
}
|
||||
type IteratorResult<T> = {
|
||||
done: boolean,
|
||||
value: T,
|
||||
}
|
||||
}
|
||||
|
||||
interface BinaryReadReader {
|
||||
(msg: any,
|
||||
binaryReader: BinaryReader): void;
|
||||
}
|
||||
|
||||
interface BinaryRead {
|
||||
(msg: any,
|
||||
reader: BinaryReadReader): void;
|
||||
}
|
||||
|
||||
interface BinaryWriteCallback {
|
||||
(value: any,
|
||||
binaryWriter: BinaryWriter): void;
|
||||
}
|
||||
|
||||
interface BinaryWrite {
|
||||
(fieldNumber: number,
|
||||
value: any,
|
||||
writerCallback: BinaryWriteCallback): void;
|
||||
}
|
||||
|
||||
export class BinaryReader {
|
||||
constructor(bytes?: ByteSource,
|
||||
start?: number,
|
||||
length?: number);
|
||||
static alloc(bytes?: ByteSource,
|
||||
start?: number,
|
||||
length?: number): BinaryReader;
|
||||
alloc(bytes?: ByteSource,
|
||||
start?: number,
|
||||
length?: number): BinaryReader;
|
||||
free(): void;
|
||||
getFieldCursor(): number;
|
||||
getCursor(): number;
|
||||
getBuffer(): Uint8Array;
|
||||
getFieldNumber(): number;
|
||||
getWireType(): BinaryConstants.WireType;
|
||||
isEndGroup(): boolean;
|
||||
getError(): boolean;
|
||||
setBlock(bytes?: ByteSource,
|
||||
start?: number,
|
||||
length?: number): void;
|
||||
reset(): void;
|
||||
advance(count: number): void;
|
||||
nextField(): boolean;
|
||||
unskipHeader(): void;
|
||||
skipMatchingFields(): void;
|
||||
skipVarintField(): void;
|
||||
skipDelimitedField(): void;
|
||||
skipFixed32Field(): void;
|
||||
skipFixed64Field(): void;
|
||||
skipGroup(): void;
|
||||
skipField(): void;
|
||||
registerReadCallback(callbackName: string,
|
||||
callback: (binaryReader: BinaryReader) => any): void;
|
||||
runReadCallback(callbackName: string): any;
|
||||
readAny(fieldType: BinaryConstants.FieldType): AnyFieldType;
|
||||
readMessage: BinaryRead;
|
||||
readGroup(field: number,
|
||||
message: Message,
|
||||
reader: BinaryReadReader): void;
|
||||
getFieldDecoder(): BinaryDecoder;
|
||||
readInt32(): number;
|
||||
readInt32String(): string;
|
||||
readInt64(): number;
|
||||
readInt64String(): string;
|
||||
readUint32(): number;
|
||||
readUint32String(): string;
|
||||
readUint64(): number;
|
||||
readUint64String(): string;
|
||||
readSint32(): number;
|
||||
readSint64(): number;
|
||||
readSint64String(): string;
|
||||
readFixed32(): number;
|
||||
readFixed64(): number;
|
||||
readFixed64String(): string;
|
||||
readSfixed32(): number;
|
||||
readSfixed32String(): string;
|
||||
readSfixed64(): number;
|
||||
readSfixed64String(): string;
|
||||
readFloat(): number;
|
||||
readDouble(): number;
|
||||
readBool(): boolean;
|
||||
readEnum(): number;
|
||||
readString(): string;
|
||||
readBytes(): Uint8Array;
|
||||
readVarintHash64(): string;
|
||||
readFixedHash64(): string;
|
||||
readPackedInt32(): number[];
|
||||
readPackedInt32String(): string[];
|
||||
readPackedInt64(): number[];
|
||||
readPackedInt64String(): string[];
|
||||
readPackedUint32(): number[];
|
||||
readPackedUint32String(): string[];
|
||||
readPackedUint64(): number[];
|
||||
readPackedUint64String(): string[];
|
||||
readPackedSint32(): number[];
|
||||
readPackedSint64(): number[];
|
||||
readPackedSint64String(): string[];
|
||||
readPackedFixed32(): number[];
|
||||
readPackedFixed64(): number[];
|
||||
readPackedFixed64String(): string[];
|
||||
readPackedSfixed32(): number[];
|
||||
readPackedSfixed64(): number[];
|
||||
readPackedSfixed64String(): string[];
|
||||
readPackedFloat(): number[];
|
||||
readPackedDouble(): number[];
|
||||
readPackedBool(): boolean[];
|
||||
readPackedEnum(): number[];
|
||||
readPackedVarintHash64(): string[];
|
||||
readPackedFixedHash64(): string[];
|
||||
}
|
||||
|
||||
export class BinaryWriter {
|
||||
constructor();
|
||||
writeSerializedMessage(bytes: Uint8Array,
|
||||
start: number,
|
||||
end: number): void;
|
||||
maybeWriteSerializedMessage(bytes?: Uint8Array,
|
||||
start?: number,
|
||||
end?: number): void;
|
||||
reset(): void;
|
||||
getResultBuffer(): Uint8Array;
|
||||
getResultBase64String(): string;
|
||||
beginSubMessage(field: number): void;
|
||||
endSubMessage(field: number): void;
|
||||
writeAny(fieldType: BinaryConstants.FieldType,
|
||||
field: number,
|
||||
value: AnyFieldType): void;
|
||||
writeInt32(field: number,
|
||||
value?: number): void;
|
||||
writeInt32String(field: number,
|
||||
value?: string): void;
|
||||
writeInt64(field: number,
|
||||
value?: number): void;
|
||||
writeInt64String(field: number,
|
||||
value?: string): void;
|
||||
writeUint32(field: number,
|
||||
value?: number): void;
|
||||
writeUint32String(field: number,
|
||||
value?: string): void;
|
||||
writeUint64(field: number,
|
||||
value?: number): void;
|
||||
writeUint64String(field: number,
|
||||
value?: string): void;
|
||||
writeSint32(field: number,
|
||||
value?: number): void;
|
||||
writeSint64(field: number,
|
||||
value?: number): void;
|
||||
writeSint64String(field: number,
|
||||
value?: string): void;
|
||||
writeFixed32(field: number,
|
||||
value?: number): void;
|
||||
writeFixed64(field: number,
|
||||
value?: number): void;
|
||||
writeFixed64String(field: number,
|
||||
value?: string): void;
|
||||
writeSfixed32(field: number,
|
||||
value?: number): void;
|
||||
writeSfixed64(field: number,
|
||||
value?: number): void;
|
||||
writeSfixed64String(field: number,
|
||||
value?: string): void;
|
||||
writeFloat(field: number,
|
||||
value?: number): void;
|
||||
writeDouble(field: number,
|
||||
value?: number): void;
|
||||
writeBool(field: number,
|
||||
value?: boolean): void;
|
||||
writeEnum(field: number,
|
||||
value?: number): void;
|
||||
writeString(field: number,
|
||||
value?: string): void;
|
||||
writeBytes(field: number,
|
||||
value?: ByteSource): void;
|
||||
writeMessage: BinaryWrite;
|
||||
writeGroup(field: number,
|
||||
value: any,
|
||||
writeCallback: BinaryWriteCallback): void;
|
||||
writeFixedHash64(field: number,
|
||||
value?: string): void;
|
||||
writeVarintHash64(field: number,
|
||||
value?: string): void;
|
||||
writeRepeatedInt32(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedInt32String(field: number,
|
||||
value?: string[]): void;
|
||||
writeRepeatedInt64(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedInt64String(field: number,
|
||||
value?: string[]): void;
|
||||
writeRepeatedUint32(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedUint32String(field: number,
|
||||
value?: string[]): void;
|
||||
writeRepeatedUint64(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedUint64String(field: number,
|
||||
value?: string[]): void;
|
||||
writeRepeatedSint32(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedSint64(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedSint64String(field: number,
|
||||
value?: string[]): void;
|
||||
writeRepeatedFixed32(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedFixed64(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedFixed64String(field: number,
|
||||
value?: string[]): void;
|
||||
writeRepeatedSfixed32(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedSfixed64(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedSfixed64String(field: number,
|
||||
value?: string[]): void;
|
||||
writeRepeatedFloat(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedDouble(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedBool(field: number,
|
||||
value?: boolean[]): void;
|
||||
writeRepeatedEnum(field: number,
|
||||
value?: number[]): void;
|
||||
writeRepeatedString(field: number,
|
||||
value?: string[]): void;
|
||||
writeRepeatedBytes(field: number,
|
||||
value?: ByteSource[]): void;
|
||||
writeRepeatedMessage(field: number,
|
||||
value: Message[],
|
||||
writerCallback: BinaryWriteCallback): void;
|
||||
writeRepeatedGroup(field: number,
|
||||
value: Message[],
|
||||
writerCallback: BinaryWriteCallback): void;
|
||||
writeRepeatedFixedHash64(field: number,
|
||||
value?: string[]): void;
|
||||
writeRepeatedVarintHash64(field: number,
|
||||
value?: string[]): void;
|
||||
writePackedInt32(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedInt32String(field: number,
|
||||
value?: string[]): void;
|
||||
writePackedInt64(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedInt64String(field: number,
|
||||
value?: string[]): void;
|
||||
writePackedUint32(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedUint32String(field: number,
|
||||
value?: string[]): void;
|
||||
writePackedUint64(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedUint64String(field: number,
|
||||
value?: string[]): void;
|
||||
writePackedSint32(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedSint64(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedSint64String(field: number,
|
||||
value?: string[]): void;
|
||||
writePackedFixed32(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedFixed64(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedFixed64String(field: number,
|
||||
value?: string[]): void;
|
||||
writePackedSfixed32(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedSfixed64(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedSfixed64String(field: number,
|
||||
value?: string[]): void;
|
||||
writePackedFloat(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedDouble(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedBool(field: number,
|
||||
value?: boolean[]): void;
|
||||
writePackedEnum(field: number,
|
||||
value?: number[]): void;
|
||||
writePackedFixedHash64(field: number,
|
||||
value?: string[]): void;
|
||||
writePackedVarintHash64(field: number,
|
||||
value?: string[]): void;
|
||||
}
|
||||
|
||||
export class BinaryEncoder {
|
||||
constructor();
|
||||
length(): number;
|
||||
end(): number[];
|
||||
writeSplitVarint64(lowBits: number,
|
||||
highBits: number): void;
|
||||
writeSplitFixed64(lowBits: number,
|
||||
highBits: number): void;
|
||||
writeUnsignedVarint32(value: number): void;
|
||||
writeSignedVarint32(value: number): void;
|
||||
writeUnsignedVarint64(value: number): void;
|
||||
writeSignedVarint64(value: number): void;
|
||||
writeZigzagVarint32(value: number): void;
|
||||
writeZigzagVarint64(value: number): void;
|
||||
writeZigzagVarint64String(value: string): void;
|
||||
writeUint8(value: number): void;
|
||||
writeUint16(value: number): void;
|
||||
writeUint32(value: number): void;
|
||||
writeUint64(value: number): void;
|
||||
writeInt8(value: number): void;
|
||||
writeInt16(value: number): void;
|
||||
writeInt32(value: number): void;
|
||||
writeInt64(value: number): void;
|
||||
writeInt64String(value: string): void;
|
||||
writeFloat(value: number): void;
|
||||
writeDouble(value: number): void;
|
||||
writeBool(value: boolean): void;
|
||||
writeEnum(value: number): void;
|
||||
writeBytes(bytes: Uint8Array): void;
|
||||
writeVarintHash64(hash: string): void;
|
||||
writeFixedHash64(hash: string): void;
|
||||
writeString(value: string): number;
|
||||
}
|
||||
|
||||
export class BinaryDecoder {
|
||||
constructor(bytes?: ByteSource,
|
||||
start?: number,
|
||||
length?: number)
|
||||
static alloc(bytes?: ByteSource,
|
||||
start?: number,
|
||||
length?: number): BinaryDecoder;
|
||||
free(): void;
|
||||
clone(): BinaryDecoder;
|
||||
clear(): void;
|
||||
getBuffer(): Uint8Array;
|
||||
setBlock(data: ByteSource,
|
||||
start?: number,
|
||||
length?: number): void;
|
||||
getEnd(): number;
|
||||
setEnd(end: number): void;
|
||||
reset(): void;
|
||||
getCursor(): number;
|
||||
setCursor(cursor: number): void;
|
||||
advance(count: number): void;
|
||||
atEnd(): boolean;
|
||||
pastEnd(): boolean;
|
||||
getError(): boolean;
|
||||
skipVarint(): void;
|
||||
unskipVarint(value: number): void;
|
||||
readUnsignedVarint32(): number;
|
||||
readSignedVarint32(): number;
|
||||
readUnsignedVarint32String(): number;
|
||||
readSignedVarint32String(): number;
|
||||
readZigzagVarint32(): number;
|
||||
readUnsignedVarint64(): number;
|
||||
readUnsignedVarint64String(): number;
|
||||
readSignedVarint64(): number;
|
||||
readSignedVarint64String(): number;
|
||||
readZigzagVarint64(): number;
|
||||
readZigzagVarint64String(): number;
|
||||
readUint8(): number;
|
||||
readUint16(): number;
|
||||
readUint32(): number;
|
||||
readUint64(): number;
|
||||
readUint64String(): string;
|
||||
readInt8(): number;
|
||||
readInt16(): number;
|
||||
readInt32(): number;
|
||||
readInt64(): number;
|
||||
readInt64String(): string;
|
||||
readFloat(): number;
|
||||
readDouble(): number;
|
||||
readBool(): boolean;
|
||||
readEnum(): number;
|
||||
readString(length: number): string;
|
||||
readStringWithLength(): string;
|
||||
readBytes(length: number): Uint8Array;
|
||||
readVarintHash64(): string;
|
||||
readFixedHash64(): string;
|
||||
}
|
||||
|
||||
export class BinaryIterator {
|
||||
constructor(decoder?: BinaryDecoder,
|
||||
next?: () => number|boolean|string|null,
|
||||
elements?: Array<number|boolean|string>)
|
||||
static alloc(decoder?: BinaryDecoder,
|
||||
next?: () => number|boolean|string|null,
|
||||
elements?: Array<number|boolean|string>): BinaryIterator;
|
||||
free(): void;
|
||||
clear(): void;
|
||||
get(): (ScalarFieldType | null);
|
||||
atEnd(): boolean;
|
||||
next(): (ScalarFieldType | null);
|
||||
}
|
||||
|
||||
export namespace BinaryConstants {
|
||||
export enum FieldType {
|
||||
INVALID = -1,
|
||||
DOUBLE = 1,
|
||||
FLOAT = 2,
|
||||
INT64 = 3,
|
||||
UINT64 = 4,
|
||||
INT32 = 5,
|
||||
FIXED64 = 6,
|
||||
FIXED32 = 7,
|
||||
BOOL = 8,
|
||||
STRING = 9,
|
||||
GROUP = 10,
|
||||
MESSAGE = 11,
|
||||
BYTES = 12,
|
||||
UINT32 = 13,
|
||||
ENUM = 14,
|
||||
SFIXED32 = 15,
|
||||
SFIXED64 = 16,
|
||||
SINT32 = 17,
|
||||
SINT64 = 18,
|
||||
FHASH64 = 30,
|
||||
VHASH64 = 31,
|
||||
}
|
||||
|
||||
export enum WireType {
|
||||
INVALID = -1,
|
||||
VARINT = 0,
|
||||
FIXED64 = 1,
|
||||
DELIMITED = 2,
|
||||
START_GROUP = 3,
|
||||
END_GROUP = 4,
|
||||
FIXED32 = 5,
|
||||
}
|
||||
|
||||
const FieldTypeToWireType: (fieldType: FieldType) => WireType;
|
||||
|
||||
const INVALID_FIELD_NUMBER: number;
|
||||
const FLOAT32_EPS: number;
|
||||
const FLOAT32_MIN: number;
|
||||
const FLOAT32_MAX: number;
|
||||
const FLOAT64_EPS: number;
|
||||
const FLOAT64_MIN: number;
|
||||
const FLOAT64_MAX: number;
|
||||
const TWO_TO_20: number;
|
||||
const TWO_TO_23: number;
|
||||
const TWO_TO_31: number;
|
||||
const TWO_TO_32: number;
|
||||
const TWO_TO_52: number;
|
||||
const TWO_TO_63: number;
|
||||
const TWO_TO_64: number;
|
||||
const ZERO_HASH: string;
|
||||
}
|
||||
|
||||
export namespace arith {
|
||||
export class UInt64 {
|
||||
lo: number;
|
||||
hi: number;
|
||||
constructor(lo: number,
|
||||
hi: number);
|
||||
cmp(other: UInt64): number;
|
||||
rightShift(): UInt64;
|
||||
leftShift(): UInt64;
|
||||
msb(): boolean;
|
||||
lsb(): boolean;
|
||||
zero(): boolean;
|
||||
add(other: UInt64): UInt64;
|
||||
sub(other: UInt64): UInt64;
|
||||
static mul32x32(a: number,
|
||||
b: number): UInt64;
|
||||
mul(a: number): UInt64;
|
||||
div(divisor: number): [UInt64, UInt64];
|
||||
toString(): string;
|
||||
static fromString(str: string): UInt64;
|
||||
clone(): UInt64;
|
||||
}
|
||||
|
||||
export class Int64 {
|
||||
lo: number;
|
||||
hi: number;
|
||||
constructor(lo: number,
|
||||
hi: number);
|
||||
add(other: Int64): Int64;
|
||||
sub(other: Int64): Int64;
|
||||
clone(): Int64;
|
||||
toString(): string;
|
||||
static fromString(str: string): Int64;
|
||||
}
|
||||
}
|
||||
|
||||
// jspb.utils package excluded as it likely shouldn't be called by user code
|
||||
Vendored
-106
@@ -1,106 +0,0 @@
|
||||
// Type definitions for Google Analytics (Classic and Universal)
|
||||
// Project: https://developers.google.com/analytics/devguides/collection/gajs/, https://developers.google.com/analytics/devguides/collection/analyticsjs/method-reference
|
||||
// Definitions by: Ronnie Haakon Hegelund <http://ronniehegelund.blogspot.dk>, Pat Kujawa <http://patkujawa.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class Tracker {
|
||||
_trackPageview(): void;
|
||||
_getName(): string;
|
||||
_getAccount(): string;
|
||||
_getVersion(): string;
|
||||
_getVisitorCustomVar(index: number): string;
|
||||
_setAccount(): string;
|
||||
_setCustomVar(index: number, name: string, value: string, opt_scope?: number): boolean;
|
||||
_setSampleRate(newRate: string): void;
|
||||
_setSessionCookieTimeout(cookieTimeoutMillis: number): void;
|
||||
_setSiteSpeedSampleRate(sampleRate: number): void;
|
||||
_setVisitorCookieTimeout(milliseconds: number): void;
|
||||
_trackPageLoadTime(): void;
|
||||
}
|
||||
|
||||
interface GoogleAnalyticsCode {
|
||||
push(commandArray: string[]): void;
|
||||
push(func: Function): void;
|
||||
}
|
||||
|
||||
interface GoogleAnalyticsTracker {
|
||||
_getTracker(account: string): Tracker;
|
||||
_createTracker(opt_account: string, opt_name?: string): Tracker;
|
||||
_getTrackerByName(opt_name?: string): Tracker;
|
||||
_anonymizeIp(): void;
|
||||
}
|
||||
|
||||
interface GoogleAnalytics {
|
||||
type: string;
|
||||
src: string;
|
||||
async: boolean;
|
||||
}
|
||||
|
||||
declare namespace UniversalAnalytics {
|
||||
// https://developers.google.com/analytics/devguides/collection/analyticsjs/method-reference
|
||||
|
||||
enum HitType {
|
||||
'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing'
|
||||
}
|
||||
|
||||
interface ga {
|
||||
l: number;
|
||||
q: any[];
|
||||
|
||||
(command: 'send', hitType: 'event', eventCategory: string, eventAction: string,
|
||||
eventLabel?: string, eventValue?: number, fieldsObject?: {}): void;
|
||||
(command: 'send', hitType: 'event', fieldsObject: {
|
||||
eventCategory: string,
|
||||
eventAction: string,
|
||||
eventLabel?: string,
|
||||
eventValue?: number,
|
||||
nonInteraction?: boolean}): void;
|
||||
(command: 'send', fieldsObject: {
|
||||
hitType: HitType, // 'event'
|
||||
eventCategory: string,
|
||||
eventAction: string,
|
||||
eventLabel?: string,
|
||||
eventValue?: number,
|
||||
nonInteraction?: boolean}): void;
|
||||
(command: 'send', hitType: 'pageview', page: string): void;
|
||||
(command: 'send', hitType: 'social',
|
||||
socialNetwork: string, socialAction: string, socialTarget: string): void;
|
||||
(command: 'send', hitType: 'social',
|
||||
fieldsObject: {socialNetwork: string, socialAction: string, socialTarget: string}): void;
|
||||
(command: 'send', hitType: 'timing',
|
||||
timingCategory: string, timingVar: string, timingValue: number): void;
|
||||
(command: 'send', hitType: 'timing',
|
||||
fieldsObject: {timingCategory: string, timingVar: string, timingValue: number}): void;
|
||||
(command: 'send', fieldsObject: {}): void;
|
||||
(command: string, hitType: HitType, ...fields: any[]): void;
|
||||
|
||||
(command: 'create', trackingId: string, cookieDomain?: string, name?: string, fieldsObject?: {}): void;
|
||||
(command: 'remove'): void;
|
||||
|
||||
(command: string, ...fields: any[]): void;
|
||||
|
||||
(readyCallback: (defaultTracker?: UniversalAnalytics.Tracker) => void): void;
|
||||
|
||||
create(trackingId: string, cookieDomain: string, name: string, fieldsObject?: {}): UniversalAnalytics.Tracker;
|
||||
create(trackingId: string, cookieDomain: string, fieldsObject?: {}): UniversalAnalytics.Tracker;
|
||||
create(trackingId: string, fieldsObject?: {}): UniversalAnalytics.Tracker;
|
||||
|
||||
getAll(): UniversalAnalytics.Tracker[];
|
||||
getByName(name: string): UniversalAnalytics.Tracker;
|
||||
remove(name: string): void;
|
||||
}
|
||||
|
||||
interface Tracker {
|
||||
get<T>(fieldName: string): T;
|
||||
send(hitType: string, opt_fieldObject?: {}): void;
|
||||
set(fieldName: string, value: string): void;
|
||||
set(fieldName: string, value: {}): void;
|
||||
set(fieldName: string, value: number): void;
|
||||
set(fieldName: string, value: boolean): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare var gaClassic: GoogleAnalytics;
|
||||
declare var ga: UniversalAnalytics.ga;
|
||||
declare var _gaq: GoogleAnalyticsCode;
|
||||
declare var _gat: GoogleAnalyticsTracker;
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
// Type definitions for Highmaps 4.2.7
|
||||
// Project: http://www.highcharts.com/products/highmaps
|
||||
// Definitions by: Albert Ozimek <https://github.com/AlbertOzimek>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Static } from 'highcharts';
|
||||
|
||||
declare module 'highcharts' {
|
||||
export interface Static {
|
||||
mapChart(renderTo: string | HTMLElement, options: Options, callback?: (chart: ChartObject) => void): ChartObject;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
function test_NoDataToDisplay() {
|
||||
var chart = $("#container").highcharts();
|
||||
var chartHasData = chart.hasData();
|
||||
chart.hideNoData();
|
||||
chart.showNoData("Custom no data message");
|
||||
}
|
||||
|
||||
HighchartsNoDataToDisplay(Highcharts);
|
||||
@@ -1,17 +0,0 @@
|
||||
import { HTMLHint, RuleSet } from "htmlhint";
|
||||
|
||||
const htmlHintRules: RuleSet = {
|
||||
"tagname-lowercase": true,
|
||||
"attr-lowercase": true,
|
||||
"attr-value-double-quotes": true,
|
||||
"doctype-first": true,
|
||||
"tag-pair": true,
|
||||
"spec-char-escape": true,
|
||||
"id-unique": true,
|
||||
"src-not-empty": true,
|
||||
"attr-no-duplication": true,
|
||||
"title-require": true
|
||||
};
|
||||
|
||||
const result = HTMLHint.verify('<span></span>', htmlHintRules);
|
||||
const formatted = HTMLHint.format(result, { indent: 2 });
|
||||
Vendored
-67
@@ -1,67 +0,0 @@
|
||||
// Type definitions for http-codes 1.0
|
||||
// Project: https://github.com/flesler/node-http-codes
|
||||
// Definitions by: Mohamed Hegazy <https://github.com/mhegazy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export declare const ACCEPTED: number;
|
||||
export declare const ALREADY_REPORTED: number;
|
||||
export declare const BAD_GATEWAY: number;
|
||||
export declare const BAD_REQUEST: number;
|
||||
export declare const BANDWIDTH_LIMIT_EXCEEDED: number;
|
||||
export declare const CONFLICT: number;
|
||||
export declare const CONTINUE: number;
|
||||
export declare const CREATED: number;
|
||||
export declare const EXPECTATION_FAILED: number;
|
||||
export declare const FAILED_DEPENDENCY: number;
|
||||
export declare const FORBIDDEN: number;
|
||||
export declare const FOUND: number;
|
||||
export declare const GATEWAY_TIMEOUT: number;
|
||||
export declare const GONE: number;
|
||||
export declare const HTTP_VERSION_NOT_SUPPORTED: number;
|
||||
export declare const IM_A_TEAPOT: number;
|
||||
export declare const IM_USED: number;
|
||||
export declare const INSUFFICIENT_STORAGE: number;
|
||||
export declare const INTERNAL_SERVER_ERROR: number;
|
||||
export declare const LENGTH_REQUIRED: number;
|
||||
export declare const LOCKED: number;
|
||||
export declare const LOOP_DETECTED: number;
|
||||
export declare const METHOD_NOT_ALLOWED: number;
|
||||
export declare const MISDIRECTED_REQUEST: number;
|
||||
export declare const MOVED_PERMANENTLY: number;
|
||||
export declare const MULTIPLE_CHOICES: number;
|
||||
export declare const MULTI_STATUS: number;
|
||||
export declare const NETWORK_AUTHENTICATION_REQUIRED: number;
|
||||
export declare const NON_AUTHORITATIVE_INFORMATION: number;
|
||||
export declare const NOT_ACCEPTABLE: number;
|
||||
export declare const NOT_EXTENDED: number;
|
||||
export declare const NOT_FOUND: number;
|
||||
export declare const NOT_IMPLEMENTED: number;
|
||||
export declare const NOT_MODIFIED: number;
|
||||
export declare const NO_CONTENT: number;
|
||||
export declare const OK: number;
|
||||
export declare const PARTIAL_CONTENT: number;
|
||||
export declare const PAYLOAD_TOO_LARGE: number;
|
||||
export declare const PAYMENT_REQUIRED: number;
|
||||
export declare const PERMANENT_REDIRECT: number;
|
||||
export declare const PRECONDITION_FAILED: number;
|
||||
export declare const PRECONDITION_REQUIRED: number;
|
||||
export declare const PROCESSING: number;
|
||||
export declare const PROXY_AUTHENTICATION_REQUIRED: number;
|
||||
export declare const RANGE_NOT_SATISFIABLE: number;
|
||||
export declare const REQUEST_HEADER_FIELDS_TOO_LARGE: number;
|
||||
export declare const REQUEST_TIMEOUT: number;
|
||||
export declare const RESET_CONTENT: number;
|
||||
export declare const SEE_OTHER: number;
|
||||
export declare const SERVICE_UNAVAILABLE: number;
|
||||
export declare const SWITCHING_PROTOCOLS: number;
|
||||
export declare const TEMPORARY_REDIRECT: number;
|
||||
export declare const TOO_MANY_REQUESTS: number;
|
||||
export declare const UNAUTHORIZED: number;
|
||||
export declare const UNAVAILABLE_FOR_LEGAL_REASONS: number;
|
||||
export declare const UNORDERED_COLLECTION: number;
|
||||
export declare const UNPROCESSABLE_ENTITY: number;
|
||||
export declare const UNSUPPORTED_MEDIA_TYPE: number;
|
||||
export declare const UPGRADE_REQUIRED: number;
|
||||
export declare const URI_TOO_LONG: number;
|
||||
export declare const USE_PROXY: number;
|
||||
export declare const VARIANT_ALSO_NEGOTIATES: number;
|
||||
@@ -1,6 +0,0 @@
|
||||
import jmespath = require("jmespath");
|
||||
|
||||
const a = jmespath.search({foo: {bar: {baz: [0, 1, 2, 3, 4]}}}, "foo.bar.baz[2]");
|
||||
const b = jmespath.search({foo: {bar: {baz: [0, 1, 2, 3, 4]}}}, "foo.bar")
|
||||
const c = jmespath.search({"foo": [{"first": "a", "last": "b"}, {"first": "c", "last": "d"}]}, "foo[*].first");
|
||||
const d = jmespath.search({"foo": [{"age": 20}, {"age": 25}, {"age": 30}, {"age": 35}, {"age": 40}]}, "foo[?age > `30`]");
|
||||
Vendored
-896
@@ -1,896 +0,0 @@
|
||||
// Type definitions for Joint JS 1.0.1
|
||||
// Project: http://www.jointjs.com/
|
||||
// Definitions by: Aidan Reel <http://github.com/areel>, David Durman <http://github.com/DavidDurman>, Ewout Van Gossum <https://github.com/DenEwout>, Federico Caselli <https://github.com/CaselIT>, Chris Moran <https://github.com/ChrisMoran>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// typings: https://github.com/CaselIT/typings-jointjs
|
||||
|
||||
/// <reference types="backbone" />
|
||||
|
||||
|
||||
declare namespace joint {
|
||||
export var g: any;
|
||||
export var V: any;
|
||||
|
||||
namespace dia {
|
||||
interface Size {
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
interface Point {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
interface BBox extends Point, Size { }
|
||||
|
||||
interface TranslateOptions {
|
||||
restrictedArea?: BBox;
|
||||
transition?: TransitionOptions;
|
||||
}
|
||||
|
||||
interface TransitionOptions {
|
||||
delay?: number;
|
||||
duration?: number;
|
||||
timingFunction?: (t: number) => number;
|
||||
valueFunction?: (a: any, b: any) => (t: number) => any;
|
||||
}
|
||||
|
||||
interface DfsBfsOptions {
|
||||
inbound?: boolean;
|
||||
outbound?: boolean;
|
||||
deep?: boolean;
|
||||
}
|
||||
|
||||
interface ExploreOptions {
|
||||
breadthFirst?: boolean;
|
||||
deep?: boolean;
|
||||
}
|
||||
|
||||
class Graph extends Backbone.Model {
|
||||
constructor(attributes?: any, options?: { cellNamespace: any });
|
||||
addCell(cell: Cell | Cell[]): this;
|
||||
addCells(cells: Cell[]): this;
|
||||
resetCells(cells: Cell[], options?: any): this;
|
||||
getCell(id: string): Cell;
|
||||
getElements(): Element[];
|
||||
getLinks(): Link[];
|
||||
getCells(): Cell[];
|
||||
getFirstCell(): Cell;
|
||||
getLastCell(): Cell;
|
||||
getConnectedLinks(element: Cell, options?: { inbound?: boolean, outbound?: boolean, deep?: boolean }): Link[];
|
||||
disconnectLinks(cell: Cell, options?: any): void;
|
||||
removeLinks(cell: Cell, options?: any): void;
|
||||
translate(tx: number, ty?: number, options?: TranslateOptions): void;
|
||||
cloneCells(cells: Cell[]): { [id: string]: Cell };
|
||||
getSubgraph(cells: Cell[], options?: { deep?: boolean }): Cell[];
|
||||
cloneSubgraph(cells: Cell[], options?: { deep?: boolean }): { [id: string]: Cell };
|
||||
dfs(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: DfsBfsOptions, visited?: Object, distance?: number): void;
|
||||
bfs(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: DfsBfsOptions): void;
|
||||
search(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: { breadthFirst?: boolean }): void;
|
||||
getSuccessors(element: Element, options?: ExploreOptions): Element[];
|
||||
getPredecessors(element: Element, options?: ExploreOptions): Element[];
|
||||
isSuccessor(elementA: Element, elementB: Element): boolean;
|
||||
isPredecessor(elementA: Element, elementB: Element): boolean;
|
||||
isSource(element: Element): boolean;
|
||||
isSink(element: Element): boolean;
|
||||
getSources(): Element[];
|
||||
getSinks(): Element[];
|
||||
getNeighbors(element: Element, options?: DfsBfsOptions): Element[];
|
||||
isNeighbor(elementA: Element, elementB: Element, options?: { inbound?: boolean, outbound?: boolean; }): boolean;
|
||||
getCommonAncestor(...cells: Cell[]): Element;
|
||||
toJSON(): any;
|
||||
fromJSON(json: any, options?: any): this;
|
||||
clear(options?: any): this;
|
||||
findModelsFromPoint(rect: BBox): Element[];
|
||||
findModelsUnderElement(element: Element, options?: { searchBy?: 'bbox' | 'center' | 'origin' | 'corner' | 'topRight' | 'bottomLeft' }): Element[];
|
||||
getBBox(elements: Element[], options?: any): BBox;
|
||||
toGraphLib(): any; // graphlib graph object
|
||||
findModelsInArea(rect: BBox, options?: any): BBox | boolean;
|
||||
getCellsBBox(cells: Cell[], options?: any): BBox;
|
||||
getInboundEdges(node: string): Object;
|
||||
getOutboundEdges(node: string): Object;
|
||||
hasActiveBatch(name?: string): number | boolean;
|
||||
maxZIndex(): number;
|
||||
removeCells(cells: Cell[], options?: any): this;
|
||||
resize(width: number, height: number, options?: number): this;
|
||||
resizeCells(width: number, height: number, cells: Cell[], options?: number): this;
|
||||
set(key: Object | string, value: any, options?: any): this;
|
||||
startBatch(name: string, data?: Object): any;
|
||||
stopBatch(name: string, data?: Object): any;
|
||||
}
|
||||
|
||||
class Cell extends Backbone.Model {
|
||||
id: string;
|
||||
toJSON(): any;
|
||||
remove(options?: { disconnectLinks?: boolean }): this;
|
||||
toFront(options?: { deep?: boolean }): this;
|
||||
toBack(options?: { deep?: boolean }): this;
|
||||
getAncestors(): Cell[];
|
||||
isEmbeddedIn(element: Element, options?: { deep: boolean }): boolean;
|
||||
prop(key: string): any;
|
||||
prop(object: any): this;
|
||||
prop(key: string, value: any, options?: any): this;
|
||||
removeProp(path: string, options?: any): this;
|
||||
attr(key: string): any;
|
||||
attr(object: SVGAttributes): this;
|
||||
attr(key: string, value: any): this;
|
||||
clone(): Cell;
|
||||
clone(opt: { deep?: boolean }): Cell | Cell[];
|
||||
removeAttr(path: string | string[], options?: any): this;
|
||||
transition(path: string, value?: any, options?: TransitionOptions, delim?: string): number;
|
||||
getTransitions(): string[];
|
||||
stopTransitions(path?: string, delim?: string): this;
|
||||
addTo(graph: Graph, options?: any): this;
|
||||
isLink(): boolean;
|
||||
embed(cell: Cell, options?: any): this;
|
||||
findView(paper: Paper): CellView;
|
||||
getEmbeddedCells(options?: any): Cell[];
|
||||
initialize(options?: any): void;
|
||||
isElement(): boolean;
|
||||
isEmbedded(): boolean;
|
||||
processPorts(): void;
|
||||
startBatch(name: string, options?: any): this;
|
||||
stopBatch(name: string, options?: any): this;
|
||||
unembed(cell: Cell, options?: any): this;
|
||||
}
|
||||
|
||||
type Padding = number | {
|
||||
top?: number;
|
||||
right?: number;
|
||||
bottom?: number;
|
||||
left?: number
|
||||
};
|
||||
|
||||
class Element extends Cell {
|
||||
translate(tx: number, ty?: number, options?: TranslateOptions): this;
|
||||
position(options?: { parentRelative: boolean }): Point;
|
||||
position(x: number, y: number, options?: { parentRelative?: boolean }): this;
|
||||
resize(width: number, height: number, options?: { direction?: 'left' | 'right' | 'top' | 'bottom' | 'top-right' | 'top-left' | 'bottom-left' | 'bottom-right' }): this;
|
||||
rotate(deg: number, absolute?: boolean, origin?: Point): this;
|
||||
embed(cell: Cell): this;
|
||||
unembed(cell: Cell): this;
|
||||
getEmbeddedCells(options?: ExploreOptions): Cell[];
|
||||
fitEmbeds(options?: { deep?: boolean, padding?: Padding }): this;
|
||||
getBBox(options?: any): BBox;
|
||||
findView(paper: Paper): ElementView;
|
||||
isElement(): boolean;
|
||||
scale(scaleX: number, scaleY: number, origin?: Point, options?: any): this;
|
||||
addPort(port: any, opt?: any): this;
|
||||
addPorts(ports: any[], opt?: any): this;
|
||||
removePort(port: any, opt?: any): this;
|
||||
hasPorts(): boolean;
|
||||
hasPort(id: string): boolean;
|
||||
getPorts(): any[];
|
||||
getPort(id: string): any;
|
||||
getPortIndex(port: any): number;
|
||||
portProp(portId: string, path: any, value?: any, opt?: any): joint.dia.Element;
|
||||
}
|
||||
|
||||
interface CSSSelector {
|
||||
[key: string]: string | number | Object; // Object added to support special attributes like filter http://jointjs.com/api#SpecialAttributes:filter
|
||||
}
|
||||
|
||||
interface SVGAttributes {
|
||||
[selector: string]: CSSSelector;
|
||||
}
|
||||
|
||||
interface CellAttributes {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface TextAttrs extends SVGAttributes {
|
||||
text?: {
|
||||
[key: string]: string | number;
|
||||
text?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface Label {
|
||||
position: number;
|
||||
attrs?: TextAttrs;
|
||||
}
|
||||
interface LinkAttributes extends CellAttributes {
|
||||
source?: Point | { id: string, selector?: string, port?: string };
|
||||
target?: Point | { id: string, selector?: string, port?: string };
|
||||
labels?: Label[];
|
||||
vertices?: Point[];
|
||||
smooth?: boolean;
|
||||
attrs?: TextAttrs;
|
||||
z?: number;
|
||||
}
|
||||
|
||||
class Link extends Cell {
|
||||
markup: string;
|
||||
labelMarkup: string;
|
||||
toolMakup: string;
|
||||
vertexMarkup: string;
|
||||
arrowHeadMarkup: string;
|
||||
|
||||
constructor(attributes?: LinkAttributes, options?: Object);
|
||||
disconnect(): this;
|
||||
label(index?: number): any;
|
||||
label(index: number, value: Label): this;
|
||||
reparent(options?: any): Element;
|
||||
findView(paper: Paper): LinkView;
|
||||
getSourceElement(): Element;
|
||||
getTargetElement(): Element;
|
||||
hasLoop(options?: { deep?: boolean }): boolean;
|
||||
applyToPoints(fn: Function, options?: any): this;
|
||||
getRelationshipAncestor(): Element;
|
||||
isLink(): boolean;
|
||||
isRelationshipEmbeddedIn(element: Element): boolean;
|
||||
scale(sx: number, sy: number, origin: Point, optionts?: any): this;
|
||||
translate(tx: number, ty: number, options?: any): this;
|
||||
}
|
||||
|
||||
interface ManhattanRouterArgs {
|
||||
excludeTypes?: string[];
|
||||
excludeEnds?: 'source' | 'target';
|
||||
startDirections?: ['left' | 'right' | 'top' | 'bottom'];
|
||||
endDirections?: ['left' | 'right' | 'top' | 'bottom'];
|
||||
}
|
||||
|
||||
interface PaperOptions extends Backbone.ViewOptions<Graph> {
|
||||
el?: string | JQuery | HTMLElement;
|
||||
width?: number;
|
||||
height?: number;
|
||||
origin?: Point;
|
||||
gridSize?: number;
|
||||
perpendicularLinks?: boolean;
|
||||
elementView?: (element: Element) => ElementView | ElementView;
|
||||
linkView?: (link: Link) => LinkView | LinkView;
|
||||
defaultLink?: ((cellView: CellView, magnet: SVGElement) => Link) | Link;
|
||||
defaultRouter?: ((vertices: Point[], args: Object, linkView: LinkView) => Point[]) | { name: string, args?: ManhattanRouterArgs };
|
||||
defaultConnector?: ((sourcePoint: Point, targetPoint: Point, vertices: Point[], args: Object, linkView: LinkView) => string) | { name: string, args?: { radius?: number } };
|
||||
interactive?: ((cellView: CellView, event: string) => boolean) | boolean | { vertexAdd?: boolean, vertexMove?: boolean, vertexRemove?: boolean, arrowheadMove?: boolean };
|
||||
validateMagnet?: (cellView: CellView, magnet: SVGElement) => boolean;
|
||||
validateConnection?: (cellViewS: CellView, magnetS: SVGElement, cellViewT: CellView, magnetT: SVGElement, end: 'source' | 'target', linkView: LinkView) => boolean;
|
||||
linkConnectionPoint?: (linkView: LinkView, view: ElementView, magnet: SVGElement, reference: Point) => Point;
|
||||
snapLinks?: boolean | { radius: number };
|
||||
linkPinning?: boolean;
|
||||
markAvailable?: boolean;
|
||||
async?: boolean | { batchZise: number };
|
||||
embeddingMode?: boolean;
|
||||
validateEmbedding?: (childView: ElementView, parentView: ElementView) => boolean;
|
||||
restrictTranslate?: ((elementView: ElementView) => BBox) | boolean;
|
||||
guard?: (evt: Event, view: CellView) => boolean;
|
||||
multiLinks?: boolean;
|
||||
cellViewNamespace?: Object;
|
||||
/** useful undocumented option */
|
||||
clickThreshold?: number;
|
||||
highlighting?: any;
|
||||
}
|
||||
|
||||
interface ScaleContentOptions {
|
||||
padding?: number;
|
||||
preserveAspectRatio?: boolean;
|
||||
minScale?: number;
|
||||
minScaleX?: number;
|
||||
minScaleY?: number;
|
||||
maxScale?: number;
|
||||
maxScaleX?: number;
|
||||
maxScaleY?: number;
|
||||
scaleGrid?: number;
|
||||
fittingBBox?: BBox;
|
||||
}
|
||||
|
||||
interface FitToContentOptions {
|
||||
gridWidth?: number;
|
||||
gridHeight?: number;
|
||||
padding?: Padding;
|
||||
allowNewOrigin?: 'negative' | 'positive' | 'any';
|
||||
minWidth?: number;
|
||||
minHeight?: number;
|
||||
maxWidth?: number;
|
||||
maxHeight?: number;
|
||||
}
|
||||
|
||||
class Paper extends Backbone.View<Graph> {
|
||||
constructor(options?: PaperOptions);
|
||||
options: PaperOptions;
|
||||
svg: SVGElement;
|
||||
viewport: SVGGElement;
|
||||
defs: SVGDefsElement;
|
||||
setDimensions(width: number, height: number): void;
|
||||
setOrigin(x: number, y: number): void;
|
||||
scale(sx: number, sy?: number, ox?: number, oy?: number): this;
|
||||
findView(element: any): CellView;
|
||||
findViewByModel(model: Cell | string): CellView;
|
||||
findViewsFromPoint(point: Point): ElementView[];
|
||||
findViewsInArea(rect: BBox, options?: { strict?: boolean }): CellView[];
|
||||
fitToContent(options?: FitToContentOptions): void;
|
||||
scaleContentToFit(options?: ScaleContentOptions): void;
|
||||
getContentBBox(): BBox;
|
||||
clientToLocalPoint(p: Point): Point;
|
||||
|
||||
rotate(deg: number, ox?: number, oy?: number): Paper; // @todo not released yet though it's in the source code already
|
||||
|
||||
afterRenderViews(): void;
|
||||
asyncRenderViews(cells: Cell[], options?: any): void;
|
||||
beforeRenderViews(cells: Cell[]): Cell[];
|
||||
cellMouseout(evt: Event): void;
|
||||
cellMouseover(evt: Event): void;
|
||||
clearGrid(): this;
|
||||
contextmenu(evt: Event): void;
|
||||
createViewForModel(cell: Cell): CellView;
|
||||
drawGrid(options?: any): this;
|
||||
fitToContent(gridWidth?: number, gridHeight?: number, padding?: number, options?: any): void;
|
||||
getArea(): BBox;
|
||||
getDefaultLink(cellView: CellView, magnet: HTMLElement): Link;
|
||||
getModelById(id: string): Cell;
|
||||
getRestrictedArea(): BBox;
|
||||
guard(evt: Event, view: CellView): boolean;
|
||||
linkAllowed(linkViewOrModel: LinkView | Link): boolean;
|
||||
mouseclick(evt: Event): void;
|
||||
mousedblclick(evt: Event): void;
|
||||
mousewheel(evt: Event): void;
|
||||
onCellAdded(cell: Cell, graph: Graph, options: Object): void;
|
||||
onCellHighlight(cellView: CellView, magnetEl: HTMLElement, options?: any): void;
|
||||
onCellUnhighlight(cellView: CellView, magnetEl: HTMLElement, options?: any): void;
|
||||
onRemove(): void;
|
||||
pointerdown(evt: Event): void;
|
||||
pointermove(evt: Event): void;
|
||||
pointerup(evt: Event): void;
|
||||
remove(): this;
|
||||
removeView(cell: Cell): CellView;
|
||||
removeViews(): void;
|
||||
renderView(cell: Cell): CellView;
|
||||
resetViews(cellsCollection: Cell[], options: any): void;
|
||||
resolveHighlighter(options?: any): boolean | Object;
|
||||
setGridSize(gridSize: number): this;
|
||||
setInteractivity(value: any): void;
|
||||
snapToGrid(p: Point): Point;
|
||||
sortViews(): void;
|
||||
}
|
||||
|
||||
|
||||
interface GradientOptions {
|
||||
type: 'linearGradient' | 'radialGradient';
|
||||
stops: Array<{
|
||||
offset: string;
|
||||
color: string;
|
||||
opacity?: number;
|
||||
}>;
|
||||
}
|
||||
class CellViewGeneric<T extends Backbone.Model> extends Backbone.View<T> {
|
||||
getBBox(options?: { useModelGeometry?: boolean }): BBox;
|
||||
highlight(el?: any, options?: any): this;
|
||||
unhighlight(el?: any, options?: any): this;
|
||||
applyFilter(selector: string | HTMLElement, filter: Object): void;
|
||||
applyGradient(selector: string | HTMLElement, attr: 'fill' | 'stroke', gradient: GradientOptions): void;
|
||||
can(feature: string): boolean;
|
||||
findBySelector(selector: string): JQuery;
|
||||
findMagnet(el: any): HTMLElement;
|
||||
getSelector(el: HTMLElement, prevSelector: string): string;
|
||||
getStrokeBBox(el: any): BBox; // string|HTMLElement|Vectorizer
|
||||
mouseout(evt: Event): void;
|
||||
mouseover(evt: Event): void;
|
||||
mousewheel(evt: Event, x: number, y: number, delta: number): void
|
||||
notify(eventName: string): void;
|
||||
onChangeAttrs(cell: Cell, attrs: Backbone.ViewOptions<T>, options?: any): this;
|
||||
onSetTheme(oldTheme: string, newTheme: string): void;
|
||||
pointerclick(evt: Event, x: number, y: number): void;
|
||||
pointerdblclick(evt: Event, x: number, y: number): void;
|
||||
pointerdown(evt: Event, x: number, y: number): void;
|
||||
pointermove(evt: Event, x: number, y: number): void;
|
||||
pointerup(evt: Event, x: number, y: number): void;
|
||||
remove(): this;
|
||||
setInteractivity(value: any): void;
|
||||
setTheme(theme: string, options?: any): this;
|
||||
}
|
||||
|
||||
class CellView extends CellViewGeneric<Cell> { }
|
||||
|
||||
interface ElementViewAttributes {
|
||||
style?: string;
|
||||
text?: string;
|
||||
html?: string;
|
||||
"ref-x"?: string | number;
|
||||
"ref-y"?: string | number;
|
||||
"ref-dx"?: number;
|
||||
"ref-dy"?: number;
|
||||
"ref-width"?: string | number;
|
||||
"ref-height"?: string | number;
|
||||
ref?: string;
|
||||
"x-alignment"?: 'middle' | 'right' | number;
|
||||
"y-alignment"?: 'middle' | 'bottom' | number;
|
||||
port?: string;
|
||||
}
|
||||
class ElementView extends CellViewGeneric<Element> {
|
||||
scale(sx: number, sy: number): void; // @todo Documented in source but not released
|
||||
finalizeEmbedding(options?: any): void;
|
||||
getBBox(options?: any): BBox;
|
||||
pointerdown(evt: Event, x: number, y: number): void;
|
||||
pointermove(evt: Event, x: number, y: number): void;
|
||||
pointerup(evt: Event, x: number, y: number): void;
|
||||
positionRelative(vel: any, bbox: BBox, attributes: ElementViewAttributes, nodesBySelector?: Object): void; // Vectorizer
|
||||
prepareEmbedding(options?: any): void;
|
||||
processEmbedding(options?: any): void;
|
||||
render(): this;
|
||||
renderMarkup(): void;
|
||||
resize(): void;
|
||||
rotate(): void;
|
||||
translate(model: Backbone.Model, changes?: any, options?: any): void;
|
||||
update(cell: Cell, renderingOnlyAttrs?: Object): void;
|
||||
}
|
||||
|
||||
class LinkView extends CellViewGeneric<Link> {
|
||||
options: {
|
||||
shortLinkLength?: number,
|
||||
doubleLinkTools?: boolean,
|
||||
longLinkLength?: number,
|
||||
linkToolsOffset?: number,
|
||||
doubleLinkToolsOffset?: number,
|
||||
sampleInterval: number
|
||||
};
|
||||
getConnectionLength(): number;
|
||||
sendToken(token: SVGElement, duration?: number, callback?: () => void): void;
|
||||
addVertex(vertex: Point): number;
|
||||
getPointAtLength(length: number): Point; // Marked as public api in source but not in the documents
|
||||
createWatcher(endType: { id: string }): Function;
|
||||
findRoute(oldVertices: Point[]): Point[];
|
||||
getConnectionPoint(end: 'source' | 'target', selectorOrPoint: Element | Point, referenceSelectorOrPoint: Element | Point): Point;
|
||||
getPathData(vertices: Point[]): any;
|
||||
onEndModelChange(endType: 'source' | 'target', endModel?: Element, opt?: any): void;
|
||||
onLabelsChange(): void;
|
||||
onSourceChange(cell: Cell, sourceEnd: { id: string }, options: any): void;
|
||||
onTargetChange(cell: Cell, targetEnd: { id: string }, options: any): void;
|
||||
onToolsChange(): void;
|
||||
onVerticesChange(cell: Cell, changed: any, options: any): void;
|
||||
pointerdown(evt: Event, x: number, y: number): void;
|
||||
pointermove(evt: Event, x: number, y: number): void;
|
||||
pointerup(evt: Event, x: number, y: number): void;
|
||||
removeVertex(idx: number): this;
|
||||
render(): this;
|
||||
renderArrowheadMarkers(): this;
|
||||
renderLabels(): this;
|
||||
renderTools(): this;
|
||||
renderVertexMarkers(): this;
|
||||
startArrowheadMove(end: 'source' | 'target', options?: any): void;
|
||||
startListening(): void;
|
||||
update(model: any, attributes: any, options?: any): this;
|
||||
updateArrowheadMarkers(): this;
|
||||
updateAttributes(): void;
|
||||
updateConnection(options?: any): void;
|
||||
updateLabelPositions(): this;
|
||||
updateToolsPosition(): this;
|
||||
}
|
||||
}
|
||||
|
||||
namespace ui { }
|
||||
|
||||
namespace shapes {
|
||||
interface GenericAttributes<T> extends dia.CellAttributes {
|
||||
position?: dia.Point;
|
||||
size?: dia.Size;
|
||||
angle?: number;
|
||||
attrs?: T;
|
||||
}
|
||||
interface ShapeAttrs extends dia.CSSSelector {
|
||||
fill?: string;
|
||||
stroke?: string;
|
||||
r?: string | number;
|
||||
rx?: string | number;
|
||||
ry?: string | number;
|
||||
cx?: string | number;
|
||||
cy?: string | number;
|
||||
height?: string | number;
|
||||
width?: string | number;
|
||||
transform?: string;
|
||||
points?: string;
|
||||
'stroke-width'?: string | number;
|
||||
'ref-x'?: string | number;
|
||||
'ref-y'?: string | number;
|
||||
ref?: string
|
||||
}
|
||||
|
||||
namespace basic {
|
||||
class Generic extends dia.Element {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
interface RectAttrs extends dia.TextAttrs {
|
||||
rect?: ShapeAttrs;
|
||||
}
|
||||
class Rect extends Generic {
|
||||
constructor(attributes?: GenericAttributes<RectAttrs>, options?: Object);
|
||||
}
|
||||
class Text extends Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
|
||||
}
|
||||
interface CircleAttrs extends dia.TextAttrs {
|
||||
circle?: ShapeAttrs;
|
||||
}
|
||||
class Circle extends Generic {
|
||||
constructor(attributes?: GenericAttributes<CircleAttrs>, options?: Object);
|
||||
}
|
||||
interface EllipseAttrs extends dia.TextAttrs {
|
||||
ellipse?: ShapeAttrs;
|
||||
}
|
||||
class Ellipse extends Generic {
|
||||
constructor(attributes?: GenericAttributes<EllipseAttrs>, options?: Object);
|
||||
}
|
||||
interface PolygonAttrs extends dia.TextAttrs {
|
||||
polygon?: ShapeAttrs;
|
||||
}
|
||||
class Polygon extends Generic {
|
||||
constructor(attributes?: GenericAttributes<PolygonAttrs>, options?: Object);
|
||||
}
|
||||
interface PolylineAttrs extends dia.TextAttrs {
|
||||
polyline?: ShapeAttrs;
|
||||
}
|
||||
class Polyline extends Generic {
|
||||
constructor(attributes?: GenericAttributes<PolylineAttrs>, options?: Object);
|
||||
}
|
||||
class Image extends Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
|
||||
}
|
||||
interface PathAttrs extends dia.TextAttrs {
|
||||
path?: ShapeAttrs;
|
||||
}
|
||||
class Path extends Generic {
|
||||
constructor(attributes?: GenericAttributes<PathAttrs>, options?: Object);
|
||||
}
|
||||
interface RhombusAttrs extends dia.TextAttrs {
|
||||
path?: ShapeAttrs;
|
||||
}
|
||||
class Rhombus extends Generic {
|
||||
constructor(attributes?: GenericAttributes<RhombusAttrs>, options?: Object);
|
||||
}
|
||||
interface TextBlockAttrs extends dia.TextAttrs {
|
||||
rect?: ShapeAttrs;
|
||||
}
|
||||
class TextBlock extends Generic {
|
||||
constructor(attributes?: GenericAttributes<TextBlockAttrs>, options?: Object);
|
||||
updateSize(cell: dia.Cell, size: dia.Size): void;
|
||||
updateContent(cell: dia.Cell, content: string): void;
|
||||
}
|
||||
}
|
||||
|
||||
namespace chess {
|
||||
class KingWhite extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class KingBlack extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class QueenWhite extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class QueenBlack extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class RookWhite extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class RookBlack extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class BishopWhite extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class BishopBlack extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class KnightWhite extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class KnightBlack extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class PawnWhite extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class PawnBlack extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
}
|
||||
|
||||
namespace devs {
|
||||
interface ModelAttributes extends GenericAttributes<dia.SVGAttributes> {
|
||||
inPorts?: string[];
|
||||
outPorts?: string[];
|
||||
ports?: Object;
|
||||
}
|
||||
class Model extends basic.Generic {
|
||||
constructor(attributes?: ModelAttributes, options?: Object);
|
||||
changeInGroup(properties: any, opt?: any): boolean;
|
||||
changeOutGroup(properties: any, opt?: any): boolean;
|
||||
createPortItem(group: string, port: string): any;
|
||||
createPortItems(group: string, ports: string[]): any[];
|
||||
addOutPort(port: string, opt?: any): this;
|
||||
addInPort(port: string, opt?: any): this;
|
||||
removeOutPort(port: string, opt?: any): this;
|
||||
removeInPort(port: string, opt?: any): this;
|
||||
}
|
||||
class Coupled extends Model {
|
||||
constructor(attributes?: ModelAttributes, options?: Object);
|
||||
}
|
||||
class Atomic extends Model {
|
||||
constructor(attributes?: ModelAttributes, options?: Object);
|
||||
}
|
||||
class Link extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
}
|
||||
}
|
||||
|
||||
namespace erd {
|
||||
class Entity extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
|
||||
}
|
||||
class WeakEntity extends Entity {
|
||||
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
|
||||
}
|
||||
class Relationship extends dia.Element {
|
||||
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
|
||||
}
|
||||
class IdentifyingRelationship extends Relationship {
|
||||
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
|
||||
}
|
||||
interface AttributeAttrs extends dia.TextAttrs {
|
||||
ellipse?: ShapeAttrs;
|
||||
}
|
||||
class Attribute extends dia.Element {
|
||||
constructor(attributes?: GenericAttributes<AttributeAttrs>, options?: Object);
|
||||
}
|
||||
class Multivalued extends Attribute {
|
||||
constructor(attributes?: GenericAttributes<AttributeAttrs>, options?: Object);
|
||||
}
|
||||
class Derived extends Attribute {
|
||||
constructor(attributes?: GenericAttributes<AttributeAttrs>, options?: Object);
|
||||
}
|
||||
class Key extends Attribute {
|
||||
constructor(attributes?: GenericAttributes<AttributeAttrs>, options?: Object);
|
||||
}
|
||||
class Normal extends Attribute {
|
||||
constructor(attributes?: GenericAttributes<AttributeAttrs>, options?: Object);
|
||||
}
|
||||
interface ISAAttrs extends dia.Element {
|
||||
polygon?: ShapeAttrs;
|
||||
}
|
||||
class ISA extends dia.Element {
|
||||
constructor(attributes?: GenericAttributes<ISAAttrs>, options?: Object);
|
||||
}
|
||||
class Line extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
cardinality(value: string | number): void;
|
||||
}
|
||||
}
|
||||
|
||||
namespace fsa {
|
||||
class State extends basic.Circle {
|
||||
constructor(attributes?: GenericAttributes<basic.CircleAttrs>, options?: Object);
|
||||
}
|
||||
class StartState extends dia.Element {
|
||||
constructor(attributes?: GenericAttributes<basic.CircleAttrs>, options?: Object);
|
||||
}
|
||||
class EndState extends dia.Element {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class Arrow extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
}
|
||||
}
|
||||
|
||||
namespace logic {
|
||||
interface LogicAttrs extends ShapeAttrs {
|
||||
ref?: string;
|
||||
'ref-x'?: number | string;
|
||||
'ref-dx'?: number | string;
|
||||
'ref-y'?: number | string;
|
||||
'ref-dy'?: number | string;
|
||||
magnet?: boolean;
|
||||
'class'?: string;
|
||||
port?: string;
|
||||
}
|
||||
interface IOAttrs extends dia.TextAttrs {
|
||||
circle?: LogicAttrs;
|
||||
}
|
||||
class Gate extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
|
||||
}
|
||||
class IO extends Gate {
|
||||
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
|
||||
}
|
||||
class Input extends IO {
|
||||
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
|
||||
}
|
||||
class Output extends IO {
|
||||
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
|
||||
}
|
||||
class Gate11 extends Gate {
|
||||
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
|
||||
}
|
||||
class Gate21 extends Gate {
|
||||
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
|
||||
}
|
||||
interface Image {
|
||||
'xlink:href'?: string;
|
||||
}
|
||||
interface ImageAttrs extends LogicAttrs {
|
||||
image?: Image;
|
||||
}
|
||||
class Repeater extends Gate11 {
|
||||
constructor(attributes?: GenericAttributes<ImageAttrs>, options?: Object);
|
||||
operation(input: any): any;
|
||||
}
|
||||
class Note extends Gate11 {
|
||||
constructor(attributes?: GenericAttributes<ImageAttrs>, options?: Object);
|
||||
operation(input: any): boolean;
|
||||
}
|
||||
class Or extends Gate21 {
|
||||
constructor(attributes?: GenericAttributes<ImageAttrs>, options?: Object);
|
||||
operation(input1: any, input2: any): boolean;
|
||||
}
|
||||
class And extends Gate21 {
|
||||
constructor(attributes?: GenericAttributes<ImageAttrs>, options?: Object);
|
||||
operation(input1: any, input2: any): boolean;
|
||||
}
|
||||
class Nor extends Gate21 {
|
||||
constructor(attributes?: GenericAttributes<ImageAttrs>, options?: Object);
|
||||
operation(input1: any, input2: any): boolean;
|
||||
}
|
||||
class Nand extends Gate21 {
|
||||
constructor(attributes?: GenericAttributes<ImageAttrs>, options?: Object);
|
||||
operation(input1: any, input2: any): boolean;
|
||||
}
|
||||
class Xor extends Gate21 {
|
||||
constructor(attributes?: GenericAttributes<ImageAttrs>, options?: Object);
|
||||
operation(input1: any, input2: any): boolean;
|
||||
}
|
||||
class Xnor extends Gate21 {
|
||||
constructor(attributes?: GenericAttributes<ImageAttrs>, options?: Object);
|
||||
operation(input1: any, input2: any): boolean;
|
||||
}
|
||||
interface WireArgs extends dia.LinkAttributes {
|
||||
router?: Object;
|
||||
connector?: Object;
|
||||
}
|
||||
class Wire extends dia.Link {
|
||||
constructor(attributes?: WireArgs, options?: Object);
|
||||
}
|
||||
}
|
||||
|
||||
namespace org {
|
||||
interface MemberAttrs {
|
||||
rect?: ShapeAttrs;
|
||||
image?: ShapeAttrs;
|
||||
}
|
||||
class Member extends dia.Element {
|
||||
constructor(attributes?: GenericAttributes<MemberAttrs>, options?: Object);
|
||||
}
|
||||
class Arrow extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
}
|
||||
}
|
||||
|
||||
namespace pn {
|
||||
class Place extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class PlaceView extends dia.ElementView {
|
||||
renderTokens(): void;
|
||||
}
|
||||
class Transition extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<basic.RectAttrs>, options?: Object);
|
||||
}
|
||||
class Link extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
}
|
||||
}
|
||||
|
||||
namespace uml {
|
||||
interface ClassAttributes extends GenericAttributes<basic.RectAttrs> {
|
||||
name: string[];
|
||||
attributes: string[];
|
||||
methods: string[];
|
||||
}
|
||||
class Class extends basic.Generic {
|
||||
constructor(attributes?: ClassAttributes, options?: Object);
|
||||
getClassName(): string[];
|
||||
updateRectangles(): void;
|
||||
}
|
||||
class ClassView extends dia.ElementView {
|
||||
}
|
||||
class Abstract extends Class {
|
||||
constructor(attributes?: ClassAttributes, options?: Object);
|
||||
}
|
||||
class AbstractView extends ClassView {
|
||||
constructor(attributes?: ClassAttributes, options?: Object);
|
||||
}
|
||||
class Interface extends Class {
|
||||
constructor(attributes?: ClassAttributes, options?: Object);
|
||||
}
|
||||
class InterfaceView extends ClassView {
|
||||
constructor(attributes?: ClassAttributes, options?: Object);
|
||||
}
|
||||
class Generalization extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
}
|
||||
class Implementation extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
}
|
||||
class Aggregation extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
}
|
||||
class Composition extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
}
|
||||
class Association extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
}
|
||||
interface StateAttributes extends GenericAttributes<ShapeAttrs> {
|
||||
events?: string[];
|
||||
}
|
||||
class State extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<basic.CircleAttrs>, options?: Object);
|
||||
updateName(): void;
|
||||
updateEvents(): void;
|
||||
updatePath(): void;
|
||||
}
|
||||
class StartState extends basic.Circle {
|
||||
constructor(attributes?: GenericAttributes<basic.CircleAttrs>, options?: Object);
|
||||
}
|
||||
class EndState extends basic.Generic {
|
||||
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
|
||||
}
|
||||
class Transition extends dia.Link {
|
||||
constructor(attributes?: dia.LinkAttributes, options?: Object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace util {
|
||||
|
||||
namespace format {
|
||||
export function number(specifier: string, value: number): string;
|
||||
}
|
||||
|
||||
export function uuid(): string;
|
||||
export function guid(obj?: Object): string;
|
||||
export function nextFrame(callback: () => void, context?: Object): number;
|
||||
export function cancelFrame(requestId: number): void;
|
||||
export function flattenObject(object: Object, delim: string, stop: (node: any) => boolean): any;
|
||||
export function getByPath(object: Object, path: string, delim: string): any;
|
||||
export function setByPath(object: Object, path: string, value: Object, delim: string): any;
|
||||
export function unsetByPath(object: Object, path: string, delim: string): any;
|
||||
export function breakText(text: string, size: dia.Size, attrs?: dia.SVGAttributes, options?: { svgDocument?: SVGElement }): string;
|
||||
export function normalizeSides(box: number | { x?: number, y?: number, height?: number, width?: number }): dia.BBox;
|
||||
export function getElementBBox(el: Element): dia.BBox;
|
||||
export function setAttributesBySelector(el: Element, attrs: dia.SVGAttributes): void;
|
||||
export function sortElements(elements: Element[] | string | JQuery, comparator: (a: Element, b: Element) => number): Element[];
|
||||
export function shapePerimeterConnectionPoint(linkView: dia.LinkView, view: dia.ElementView, magnet: SVGElement, ref: dia.Point): dia.Point;
|
||||
export function imageToDataUri(url: string, callback: (err: Error, dataUri: string) => void): void;
|
||||
|
||||
// Not documented but used in examples
|
||||
/** @deprecated use lodash _.defaultsDeep */
|
||||
export function deepSupplement(objects: any, defaultIndicator?: any): any;
|
||||
|
||||
// Private functions
|
||||
/** @deprecated use lodash _.assign */
|
||||
export function mixin(objects: any[]): any;
|
||||
/** @deprecated use lodash _.defaults */
|
||||
export function supplement(objects: any[]): any;
|
||||
/** @deprecated use lodash _.mixin */
|
||||
export function deepMixin(objects: any[]): any;
|
||||
}
|
||||
|
||||
namespace layout {
|
||||
|
||||
interface LayoutOptions {
|
||||
nodeSep?: number;
|
||||
edgeSep?: number;
|
||||
rankSep?: number;
|
||||
rankDir?: 'TB' | 'BT' | 'LR' | 'RL';
|
||||
marginX?: number;
|
||||
marginY?: number;
|
||||
resizeCluster?: boolean;
|
||||
setPosition?: (element: dia.Element, position: dia.BBox) => void;
|
||||
setLinkVertices?: (link: dia.Link, vertices: Position[]) => void;
|
||||
}
|
||||
|
||||
export class DirectedGraph {
|
||||
static layout(graph: dia.Graph | dia.Cell[], options?: LayoutOptions): dia.BBox;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
/* code examples from documentation */
|
||||
|
||||
$().toastmessage('showNoticeToast', 'some message here');
|
||||
$().toastmessage('showSuccessToast', "some message here");
|
||||
$().toastmessage('showWarningToast', "some message here");
|
||||
$().toastmessage('showErrorToast', "some message here");
|
||||
|
||||
// user configured toastmessage:
|
||||
const toastObject = $().toastmessage('showToast', {
|
||||
text : 'Hello World',
|
||||
sticky : true,
|
||||
position : 'top-right',
|
||||
type : 'success',
|
||||
close : function () {console.log("toast is closed ...");}
|
||||
});
|
||||
|
||||
$().toastmessage('removeToast', toastObject);
|
||||
|
||||
// reconfiguring the toasts as sticky
|
||||
$().toastmessage({sticky : true});
|
||||
|
||||
// saving the newly created toast into a variable
|
||||
var myToast = $().toastmessage('showNoticeToast', 'some message here');
|
||||
|
||||
// removing the toast
|
||||
$().toastmessage('removeToast', myToast);
|
||||
|
||||
// user configuration of all toastmessages to come:
|
||||
$().toastmessage({
|
||||
text : 'Hello World',
|
||||
sticky : true,
|
||||
position : 'top-right',
|
||||
type : 'success',
|
||||
close : function () {console.log("toast is closed ...");}
|
||||
});
|
||||
|
||||
$().toastmessage({
|
||||
inEffectDuration: 600, // in effect duration in miliseconds
|
||||
stayTime: 3000, // time in miliseconds before the item has to disappear
|
||||
text: '', // content of the item
|
||||
sticky: false, // should the toast item sticky or not?
|
||||
type: 'notice', // notice, warning, error, success
|
||||
position: 'top-right', // top-left, top-center, top-right, middle-left, middle-center, middle-right
|
||||
// Position of the toast container holding different toast.
|
||||
// Position can be set only once at the very first call,
|
||||
// changing the position after the first call does nothing
|
||||
closeText: '', // text which will be shown as close button,
|
||||
// set to '' when you want to introduce an image via css
|
||||
close: undefined // callback function when the toastmessage is closed
|
||||
});
|
||||
|
||||
/* code examples from tests */
|
||||
|
||||
$('.toast-container').remove();
|
||||
|
||||
$().toastmessage('showSuccessToast', "SUCCESS");
|
||||
$().toastmessage('showNoticeToast', "NOTICE");
|
||||
$().toastmessage('showWarningToast', "WARNING");
|
||||
$().toastmessage('showErrorToast', "ERROR");
|
||||
$().toastmessage({
|
||||
sticky : true,
|
||||
position : 'top-right',
|
||||
closeText: ''
|
||||
});
|
||||
$().toastmessage('showToast', {
|
||||
text : 'Success Dialog',
|
||||
type : 'success'
|
||||
});
|
||||
$().toastmessage('showToast', {
|
||||
text : 'Success Dialog',
|
||||
sticky : true,
|
||||
position : 'top-right',
|
||||
type : 'success',
|
||||
closeText: '',
|
||||
close : () => {}
|
||||
});
|
||||
var toast = $().toastmessage('showToast', {
|
||||
text : 'Success Dialog',
|
||||
sticky : true,
|
||||
position : 'top-right',
|
||||
type : 'success',
|
||||
closeText: '',
|
||||
close : () => {}
|
||||
});
|
||||
$().toastmessage('removeToast', toast, { close : () => {} });
|
||||
Vendored
-16
@@ -1,16 +0,0 @@
|
||||
// Type definitions for jump.js 1.0
|
||||
// Project: https://github.com/callmecavs/jump.js
|
||||
// Definitions by: rhysd <https://rhysd.github.io>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare type TransitionFunc = (t: number, b: number, c: number, d: number) => number;
|
||||
declare interface JumpOptions {
|
||||
duration?: number;
|
||||
offset?: number;
|
||||
callback?: () => void;
|
||||
easing?: TransitionFunc;
|
||||
a11y?: boolean;
|
||||
}
|
||||
declare type Jump = (target: string | Element | number, opts?: JumpOptions) => void;
|
||||
declare const jump: Jump;
|
||||
export = jump;
|
||||
@@ -1,17 +0,0 @@
|
||||
|
||||
import compose = require('koa-compose');
|
||||
|
||||
var fn1: compose.Middleware<any> = function(context: any, next: () => Promise<void>): Promise<any> {
|
||||
return Promise
|
||||
.resolve(console.log('in fn1'))
|
||||
.then(() => next());
|
||||
};
|
||||
|
||||
var fn2: compose.Middleware<any> = function(context: any, next: () => Promise<void>): Promise<any> {
|
||||
return Promise
|
||||
.resolve(console.log('in fn2'))
|
||||
.then(() => next());
|
||||
};
|
||||
|
||||
|
||||
var fn = compose([fn1, fn2]);
|
||||
@@ -1,43 +0,0 @@
|
||||
|
||||
import { KramedOptions, kramed, KramedParser, KramedStatic, KramedRenderer } from 'kramed';
|
||||
|
||||
var options: KramedOptions = {
|
||||
gfm: true,
|
||||
tables: true,
|
||||
breaks: false,
|
||||
pedantic: false,
|
||||
sanitize: true,
|
||||
smartLists: true,
|
||||
silent: false,
|
||||
highlight: function (code: string, lang: string) {
|
||||
return '';
|
||||
},
|
||||
langPrefix: 'lang-',
|
||||
smartypants: false,
|
||||
renderer: new kramed.Renderer()
|
||||
};
|
||||
|
||||
function callback() {
|
||||
console.log('callback called');
|
||||
}
|
||||
|
||||
kramed.setOptions(options);
|
||||
|
||||
console.log(kramed('i am using __kramdown__.'));
|
||||
console.log(kramed('i am using __kramdown__.', options));
|
||||
console.log(kramed('i am using __kramdown__.', callback));
|
||||
console.log(kramed('i am using __kramdown__.', options, callback));
|
||||
|
||||
console.log(kramed.parse('i am using __kramdown__.'));
|
||||
console.log(kramed.parse('i am using __kramdown__.', options));
|
||||
console.log(kramed.parse('i am using __kramdown__.', callback));
|
||||
console.log(kramed.parse('i am using __kramdown__.', options, callback));
|
||||
|
||||
var text = 'something';
|
||||
var tokens = kramed.lexer(text, options);
|
||||
console.log(kramed.parser(tokens));
|
||||
|
||||
var renderer = new kramed.Renderer();
|
||||
renderer.heading = function(text, level, raw) {
|
||||
return text + level.toString() + raw;
|
||||
};
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
// Type definitions for leaflet-imageoverlay-rotated 0.1
|
||||
// Project: https://github.com/IvanSanchez/Leaflet.ImageOverlay.Rotated
|
||||
// Definitions by: Thomas Kleinke <https://github.com/tkleinke>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="leaflet" />
|
||||
|
||||
declare namespace L {
|
||||
|
||||
namespace ImageOverlay {
|
||||
|
||||
export interface Rotated extends L.ImageOverlay {
|
||||
reposition(topleft: L.LatLngExpression,
|
||||
topright: L.LatLngExpression,
|
||||
bottomleft: L.LatLngExpression): void;
|
||||
}
|
||||
}
|
||||
|
||||
namespace imageOverlay {
|
||||
|
||||
export function rotated(imgSrc: string | HTMLImageElement | HTMLCanvasElement,
|
||||
topleft: L.LatLngExpression,
|
||||
topright: L.LatLngExpression,
|
||||
bottomleft: L.LatLngExpression,
|
||||
options?: L.ImageOverlayOptions): L.ImageOverlay.Rotated;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
var topleft = L.latLng(40.52256691873593, -3.7743186950683594);
|
||||
var topright = L.latLng(40.5210255066156, -3.7734764814376835);
|
||||
var bottomleft = L.latLng(40.52180437272552, -3.7768453359603886);
|
||||
|
||||
var overlay = L.imageOverlay.rotated("image.jpg", topleft, topright, bottomleft, {
|
||||
opacity: 0.5,
|
||||
interactive: true
|
||||
});
|
||||
|
||||
overlay.reposition(topleft, topright, bottomleft);
|
||||
@@ -1,5 +0,0 @@
|
||||
import "linq4js";
|
||||
|
||||
let array: Array<string> = ["test", "test2", "test3", "test4", "test5"];
|
||||
|
||||
array.Add("test6").Remove("test3").Insert("test3", 2).Distinct().OrderBy(x => x).OrderByDescending(x => x).Select(x => x.length).Average();
|
||||
Vendored
-115
@@ -1,115 +0,0 @@
|
||||
// Type definitions for Mozilla's localForage
|
||||
// Project: https://github.com/mozilla/localforage
|
||||
// Definitions by: yuichi david pichsenmeister <https://github.com/3x14159265>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface LocalForageOptions {
|
||||
driver?: string | LocalForageDriver | LocalForageDriver[];
|
||||
|
||||
name?: string;
|
||||
|
||||
size?: number;
|
||||
|
||||
storeName?: string;
|
||||
|
||||
version?: number;
|
||||
|
||||
description?: string;
|
||||
}
|
||||
|
||||
interface LocalForageDbMethods {
|
||||
getItem<T>(key: string): Promise<T>;
|
||||
getItem<T>(key: string, callback: (err: any, value: T) => void): void;
|
||||
|
||||
setItem<T>(key: string, value: T): Promise<T>;
|
||||
setItem<T>(key: string, value: T, callback: (err: any, value: T) => void): void;
|
||||
|
||||
removeItem(key: string): Promise<void>;
|
||||
removeItem(key: string, callback: (err: any) => void): void;
|
||||
|
||||
clear(): Promise<void>;
|
||||
clear(callback: (err: any) => void): void;
|
||||
|
||||
length(): Promise<number>;
|
||||
length(callback: (err: any, numberOfKeys: number) => void): void;
|
||||
|
||||
key(keyIndex: number): Promise<string>;
|
||||
key(keyIndex: number, callback: (err: any, key: string) => void): void;
|
||||
|
||||
keys(): Promise<string[]>;
|
||||
keys(callback: (err: any, keys: string[]) => void): void;
|
||||
|
||||
iterate(iteratee: (value: any, key: string, iterationNumber: number) => any): Promise<any>;
|
||||
iterate(iteratee: (value: any, key: string, iterationNumber: number) => any,
|
||||
callback: (err: any, result: any) => void): void;
|
||||
}
|
||||
|
||||
interface LocalForageDriverSupportFunc {
|
||||
(): Promise<boolean>;
|
||||
}
|
||||
|
||||
interface LocalForageDriver extends LocalForageDbMethods {
|
||||
_driver: string;
|
||||
|
||||
_initStorage(options: LocalForageOptions): void;
|
||||
|
||||
_support?: boolean | LocalForageDriverSupportFunc;
|
||||
}
|
||||
|
||||
interface LocalForageSerializer {
|
||||
serialize<T>(value: T | ArrayBuffer | Blob, callback: (value: string, error: any) => void): void;
|
||||
|
||||
deserialize<T>(value: string): T | ArrayBuffer | Blob;
|
||||
|
||||
stringToBuffer(serializedString: string): ArrayBuffer;
|
||||
|
||||
bufferToString(buffer: ArrayBuffer): string;
|
||||
}
|
||||
|
||||
interface LocalForage extends LocalForageDbMethods {
|
||||
LOCALSTORAGE: string;
|
||||
WEBSQL: string;
|
||||
INDEXEDDB: string;
|
||||
|
||||
/**
|
||||
* Set and persist localForage options. This must be called before any other calls to localForage are made, but can be called after localForage is loaded.
|
||||
* If you set any config values with this method they will persist after driver changes, so you can call config() then setDriver()
|
||||
* @param {LocalForageOptions} options?
|
||||
*/
|
||||
config(options: LocalForageOptions): boolean;
|
||||
|
||||
/**
|
||||
* Create a new instance of localForage to point to a different store.
|
||||
* All the configuration options used by config are supported.
|
||||
* @param {LocalForageOptions} options
|
||||
*/
|
||||
createInstance(options: LocalForageOptions): LocalForage;
|
||||
|
||||
driver(): string;
|
||||
/**
|
||||
* Force usage of a particular driver or drivers, if available.
|
||||
* @param {string} driver
|
||||
*/
|
||||
setDriver(driver: string | string[]): Promise<void>;
|
||||
setDriver(driver: string | string[], callback: () => void, errorCallback: (error: any) => void): void;
|
||||
defineDriver(driver: LocalForageDriver): Promise<void>;
|
||||
defineDriver(driver: LocalForageDriver, callback: () => void, errorCallback: (error: any) => void): void;
|
||||
/**
|
||||
* Return a particular driver
|
||||
* @param {string} driver
|
||||
*/
|
||||
getDriver(driver: string): Promise<LocalForageDriver>;
|
||||
|
||||
getSerializer(): Promise<LocalForageSerializer>;
|
||||
getSerializer(callback: (serializer: LocalForageSerializer) => void): void;
|
||||
|
||||
supports(driverName: string): boolean;
|
||||
|
||||
ready(callback: () => void): void;
|
||||
ready(): Promise<void>;
|
||||
}
|
||||
|
||||
declare module "localforage" {
|
||||
let localforage: LocalForage;
|
||||
export = localforage;
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
|
||||
|
||||
declare let localForage: LocalForage;
|
||||
|
||||
namespace LocalForageTest {
|
||||
localForage.clear((err: any) => {
|
||||
let newError: any = err;
|
||||
});
|
||||
|
||||
localForage.iterate((str: string, key: string, num: number) => {
|
||||
let newStr: string = str;
|
||||
let newKey: string = key;
|
||||
let newNum: number = num;
|
||||
});
|
||||
|
||||
localForage.length((err: any, num: number) => {
|
||||
let newError: any = err;
|
||||
let newNumber: number = num;
|
||||
});
|
||||
|
||||
localForage.length().then((num: number) => {
|
||||
var newNumber: number = num;
|
||||
});
|
||||
|
||||
localForage.key(0, (err: any, value: string) => {
|
||||
let newError: any = err;
|
||||
let newValue: string = value;
|
||||
});
|
||||
|
||||
localForage.keys((err: any, keys: Array<string>) => {
|
||||
let newError: any = err;
|
||||
let newArray: Array<string> = keys;
|
||||
});
|
||||
|
||||
localForage.keys().then((keys: Array<string>) => {
|
||||
var newArray: Array<string> = keys;
|
||||
});
|
||||
|
||||
localForage.getItem("key",(err: any, str: string) => {
|
||||
let newError: any = err;
|
||||
let newStr: string = str
|
||||
});
|
||||
|
||||
localForage.getItem<string>("key").then((str: string) => {
|
||||
let newStr: string = str;
|
||||
});
|
||||
|
||||
localForage.setItem("key", "value",(err: any, str: string) => {
|
||||
let newError: any = err;
|
||||
let newStr: string = str
|
||||
});
|
||||
|
||||
localForage.setItem("key", "value").then((str: string) => {
|
||||
let newStr: string = str;
|
||||
});
|
||||
|
||||
localForage.removeItem("key",(err: any) => {
|
||||
let newError: any = err;
|
||||
});
|
||||
|
||||
localForage.removeItem("key").then(() => {
|
||||
});
|
||||
|
||||
localForage.getDriver("CustomDriver").then((result: LocalForageDriver) => {
|
||||
var driver: LocalForageDriver = result;
|
||||
// we need to use a variable for proper type guards before TS 2.0
|
||||
var _support = driver._support;
|
||||
if (typeof _support === "function") {
|
||||
// _support = _support.bind(driver);
|
||||
_support().then((result: boolean) => {
|
||||
let doesSupport: boolean = result;
|
||||
});
|
||||
} else if (typeof _support === "boolean") {
|
||||
let doesSupport: boolean = _support;
|
||||
}
|
||||
});
|
||||
|
||||
{
|
||||
let config: boolean;
|
||||
|
||||
config = localForage.config({
|
||||
name: "testyo",
|
||||
driver: localForage.LOCALSTORAGE
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let store: LocalForage;
|
||||
|
||||
store = localForage.createInstance({
|
||||
name: "da instance",
|
||||
driver: localForage.LOCALSTORAGE
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let testSerializer: LocalForageSerializer;
|
||||
|
||||
localForage.getSerializer()
|
||||
.then((serializer: LocalForageSerializer) => {
|
||||
testSerializer = serializer;
|
||||
});
|
||||
|
||||
localForage.getSerializer((serializer: LocalForageSerializer) => {
|
||||
testSerializer = serializer;
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let store: LocalForage;
|
||||
|
||||
store.ready()
|
||||
.then(() => {});
|
||||
|
||||
store.ready(() => {});
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
/**
|
||||
* Created by Joe Vanderstelt 2017-02-22.
|
||||
*/
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
import * as es6styleimport from 'nedb-logger';
|
||||
|
||||
import Q = require('q');
|
||||
import nedblogger = require('nedb-logger');
|
||||
|
||||
class BaseCollection<T> {
|
||||
|
||||
private dataStore: nedblogger;
|
||||
|
||||
constructor(dataStore: nedblogger) {
|
||||
|
||||
this.dataStore = dataStore;
|
||||
}
|
||||
|
||||
insert(document: T): Q.Promise<T> {
|
||||
|
||||
var deferred = Q.defer<T>();
|
||||
|
||||
this.dataStore.insert<T>(document, function(err: Error, newDoc: T) { // Callback is optional
|
||||
// newDoc is the newly inserted document, including its _id
|
||||
if (err) {
|
||||
deferred.reject(err);
|
||||
} else {
|
||||
deferred.resolve(newDoc);
|
||||
}
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Type 1: Persistent datastore with manual loading
|
||||
|
||||
import Datastore = require('nedb-logger');
|
||||
var db = new Datastore({filename: 'path/to/datafile'});
|
||||
|
||||
var doc: any = {
|
||||
hello: 'world'
|
||||
, n: 5
|
||||
, today: new Date()
|
||||
, nedbIsAwesome: true
|
||||
, notthere: null
|
||||
, notToBeSaved: undefined // Will not be saved
|
||||
, fruits: ['apple', 'orange', 'pear']
|
||||
, infos: {name: 'nedb'}
|
||||
};
|
||||
|
||||
db.insert(doc, function(err: Error, newDoc: any) { // Callback is optional
|
||||
// newDoc is the newly inserted document, including its _id
|
||||
// newDoc has no key called notToBeSaved since its value was undefined
|
||||
});
|
||||
|
||||
db.insert([{a: 5}, {a: 42}], function(err: Error, newdocs: any[]) {
|
||||
// Two documents were inserted in the database
|
||||
// newDocs is an array with these documents, augmented with their _id
|
||||
});
|
||||
Vendored
-709
@@ -1,709 +0,0 @@
|
||||
// Type definitions for node-form v1.0.13
|
||||
// Project: https://github.com/rsamec/form
|
||||
// Definitions by: Roman Samec <https://github.com/rsamec>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as Q from "q";
|
||||
|
||||
export as namespace Validation;
|
||||
|
||||
export = Validation;
|
||||
|
||||
declare namespace Validation {
|
||||
/**
|
||||
* Custom message functions.
|
||||
*/
|
||||
interface IErrorCustomMessage {
|
||||
(config: any, args: any): string;
|
||||
}
|
||||
/**
|
||||
* It represents a property validator for atomic object.
|
||||
*/
|
||||
interface IPropertyValidator {
|
||||
isAcceptable(s: any): boolean;
|
||||
customMessage?: IErrorCustomMessage;
|
||||
tagName?: string;
|
||||
}
|
||||
/**
|
||||
* It represents a property validator for simple string value.
|
||||
*/
|
||||
interface IStringValidator extends IPropertyValidator {
|
||||
isAcceptable(s: string): boolean;
|
||||
}
|
||||
/**
|
||||
* It represents an async property validator for atomic object.
|
||||
*/
|
||||
interface IAsyncPropertyValidator {
|
||||
isAcceptable(s: any): Q.Promise<boolean>;
|
||||
customMessage?: IErrorCustomMessage;
|
||||
isAsync: boolean;
|
||||
tagName?: string;
|
||||
}
|
||||
/**
|
||||
* It represents an async property validator for simple string value.
|
||||
*/
|
||||
interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator {
|
||||
isAcceptable(s: string): Q.Promise<boolean>;
|
||||
}
|
||||
/**
|
||||
* It defines compare operators.
|
||||
*/
|
||||
enum CompareOperator {
|
||||
LessThan = 0,
|
||||
LessThanEqual = 1,
|
||||
Equal = 2,
|
||||
NotEqual = 3,
|
||||
GreaterThanEqual = 4,
|
||||
GreaterThan = 5,
|
||||
}
|
||||
class StringFce {
|
||||
static format(s: string, args: any): string;
|
||||
}
|
||||
class NumberFce {
|
||||
static GetNegDigits(value: string): number;
|
||||
}
|
||||
class LettersOnlyValidator implements IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class ZipCodeValidator implements IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class EmailValidator implements IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class UrlValidator implements IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class RequiredValidator implements IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class DateValidator implements IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class DateISOValidator implements IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class NumberValidator implements IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class DigitValidator implements IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class SignedDigitValidator implements IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class MinLengthValidator implements IStringValidator {
|
||||
public MinLength: number;
|
||||
constructor(MinLength?: number);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class MaxLengthValidator implements IStringValidator {
|
||||
public MaxLength: number;
|
||||
constructor(MaxLength?: number);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class RangeLengthValidator implements IStringValidator {
|
||||
public RangeLength: number[];
|
||||
constructor(RangeLength?: number[]);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public MinLength : number;
|
||||
public MaxLength : number;
|
||||
public tagName: string;
|
||||
}
|
||||
class MinValidator implements IPropertyValidator {
|
||||
public Min: number;
|
||||
constructor(Min?: number);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class MaxValidator implements IPropertyValidator {
|
||||
public Max: number;
|
||||
constructor(Max?: number);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class RangeValidator implements IPropertyValidator {
|
||||
public Range: number[];
|
||||
constructor(Range?: number[]);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public Min : number;
|
||||
public Max : number;
|
||||
public tagName: string;
|
||||
}
|
||||
class StepValidator implements IPropertyValidator {
|
||||
public Step: string;
|
||||
constructor(Step?: string);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class PatternValidator implements IStringValidator {
|
||||
public Pattern: string;
|
||||
constructor(Pattern?: string);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class ContainsValidator implements IAsyncPropertyValidator {
|
||||
public Options: Q.Promise<any[]>;
|
||||
constructor(Options: Q.Promise<any[]>);
|
||||
public isAcceptable(s: string): Q.Promise<boolean>;
|
||||
public isAsync: boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
}
|
||||
declare namespace Validation {
|
||||
/**
|
||||
* basic error structure
|
||||
*/
|
||||
interface IError {
|
||||
HasError: boolean;
|
||||
ErrorMessage: string;
|
||||
TranslateArgs?: IErrorTranslateArgs;
|
||||
}
|
||||
/**
|
||||
* support for localization of error messages
|
||||
*/
|
||||
interface IErrorTranslateArgs {
|
||||
TranslateId: string;
|
||||
MessageArgs: any;
|
||||
CustomMessage?: IErrorCustomMessage;
|
||||
}
|
||||
/**
|
||||
* It defines conditional function.
|
||||
*/
|
||||
interface IOptional {
|
||||
(): boolean;
|
||||
}
|
||||
/**
|
||||
* It represents the validation result.
|
||||
*/
|
||||
interface IValidationFailure extends IError {
|
||||
IsAsync: boolean;
|
||||
Error: IError;
|
||||
}
|
||||
/**
|
||||
* This class provides unit of information about error.
|
||||
* Implements composite design pattern to enable nesting of error information.
|
||||
*/
|
||||
interface IValidationResult {
|
||||
/**
|
||||
* The name of error collection.
|
||||
*/
|
||||
Name: string;
|
||||
/**
|
||||
* Add error information to child collection of errors.
|
||||
* @param validationResult - error information to be added.
|
||||
*/
|
||||
Add(validationResult: IValidationResult): void;
|
||||
/**
|
||||
* Remove error information from child collection of errors.
|
||||
* @param index - index of error information to be removed.
|
||||
*/
|
||||
Remove(index: number): void;
|
||||
/**
|
||||
* Return collections of child errors information.
|
||||
*/
|
||||
Children: IValidationResult[];
|
||||
/**
|
||||
* Return true if there is any error.
|
||||
*/
|
||||
HasErrors: boolean;
|
||||
/**
|
||||
* Return true if there is any error and hasw dirty state.
|
||||
*/
|
||||
HasErrorsDirty: boolean;
|
||||
/**
|
||||
* Return error message, if there is no error, return empty string.
|
||||
*/
|
||||
ErrorMessage: string;
|
||||
/**
|
||||
* Return number of errors.
|
||||
*/
|
||||
ErrorCount: number;
|
||||
/**
|
||||
* It enables to have errors optional.
|
||||
*/
|
||||
Optional?: IOptional;
|
||||
/**
|
||||
* It enables support for localization of error messages.
|
||||
*/
|
||||
TranslateArgs?: IErrorTranslateArgs[];
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @ngdoc object
|
||||
* @name Error
|
||||
* @module Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* It represents basic error structure.
|
||||
*/
|
||||
class Error implements IError {
|
||||
public HasError: boolean;
|
||||
public ErrorMessage: string;
|
||||
constructor();
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @ngdoc object
|
||||
* @name ValidationFailure
|
||||
* @module Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* It represents validation failure.
|
||||
*/
|
||||
class ValidationFailure implements IError {
|
||||
public Error: IError;
|
||||
public IsAsync: boolean;
|
||||
constructor(Error: IError, IsAsync: boolean);
|
||||
public HasError : boolean;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @ngdoc object
|
||||
* @name ValidationResult
|
||||
* @module Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* It represents simple abstract error object.
|
||||
*/
|
||||
class ValidationResult implements IValidationResult {
|
||||
public Name: string;
|
||||
constructor(Name: string);
|
||||
public IsDirty: boolean;
|
||||
public Children : IValidationResult[];
|
||||
public Add(error: IValidationResult): void;
|
||||
public Remove(index: number): void;
|
||||
public Optional: IOptional;
|
||||
public TranslateArgs: IErrorTranslateArgs[];
|
||||
public HasErrorsDirty : boolean;
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @ngdoc object
|
||||
* @name CompositeValidationResult
|
||||
* @module Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* It represents composite error object.
|
||||
*/
|
||||
class CompositeValidationResult implements IValidationResult {
|
||||
public Name: string;
|
||||
public Children: IValidationResult[];
|
||||
constructor(Name: string);
|
||||
public Optional: IOptional;
|
||||
public AddFirst(error: IValidationResult): void;
|
||||
public Add(error: IValidationResult): void;
|
||||
public Remove(index: number): void;
|
||||
public HasErrorsDirty : boolean;
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs[];
|
||||
public LogErrors(headerMessage?: string): void;
|
||||
public Errors : {
|
||||
[name: string]: IValidationResult;
|
||||
};
|
||||
private FlattenErros;
|
||||
public SetDirty(): void;
|
||||
public SetPristine(): void;
|
||||
private SetDirtyEx(node, dirty);
|
||||
private flattenErrors(node, errorCollection);
|
||||
private traverse(node, indent);
|
||||
}
|
||||
}
|
||||
declare namespace Validation {
|
||||
/**
|
||||
* @ngdoc module
|
||||
* @name Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* # Validation (core module)
|
||||
* The module itself contains the essential components for an validation engine to function. The table below
|
||||
* lists a high level breakdown of each of the components (object, functions) available within this core module.
|
||||
*
|
||||
* <div doc-module-components="Validation"></div>
|
||||
*/
|
||||
/**
|
||||
* It defines validation function.
|
||||
*/
|
||||
interface IValidate {
|
||||
(args: IError): void;
|
||||
}
|
||||
/**
|
||||
* It defines async validation function.
|
||||
*/
|
||||
interface IAsyncValidate {
|
||||
(args: IError): Q.Promise<any>;
|
||||
}
|
||||
/**
|
||||
* It represents named validation function.
|
||||
*/
|
||||
interface IValidatorFce {
|
||||
Name: string;
|
||||
ValidationFce?: IValidate;
|
||||
AsyncValidationFce?: IAsyncValidate;
|
||||
}
|
||||
/**
|
||||
* This class represents custom validator.
|
||||
*/
|
||||
interface IValidator {
|
||||
Validate(context: any): IValidationFailure;
|
||||
ValidateAsync(context: any): Q.Promise<IValidationFailure>;
|
||||
Error: IError;
|
||||
}
|
||||
/**
|
||||
* It represents abstract validator for type of <T>.
|
||||
*/
|
||||
interface IAbstractValidator<T> {
|
||||
RuleFor(prop: string, validator: IPropertyValidator): any;
|
||||
ValidationFor(prop: string, validator: IValidatorFce): any;
|
||||
ValidatorFor<K>(prop: string, validator: IAbstractValidator<K>): any;
|
||||
/**
|
||||
* It creates new concrete validation rule and assigned data context to this rule.
|
||||
* @param name of the rule
|
||||
* @constructor
|
||||
*/
|
||||
CreateRule(name: string): IAbstractValidationRule<any>;
|
||||
CreateAbstractRule(name: string): IAbstractValidationRule<any>;
|
||||
CreateAbstractListRule(name: string): IAbstractValidationRule<any>;
|
||||
/**
|
||||
* return true if this validation rule is intended for list of items, otherwise true
|
||||
*/
|
||||
ForList: boolean;
|
||||
}
|
||||
/**
|
||||
* It represents concrete validation rule for type of <T>.
|
||||
*/
|
||||
interface IAbstractValidationRule<T> {
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures.
|
||||
*/
|
||||
Validate(context: T): IValidationResult;
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy.
|
||||
*/
|
||||
ValidateAsync(context: T): Q.Promise<IValidationResult>;
|
||||
/**
|
||||
* Performs validation and async validation using a validation context.
|
||||
*/
|
||||
ValidateAll(context: T): void;
|
||||
/**
|
||||
* Performs validation and async validation using a validation context for a passed field.
|
||||
*/
|
||||
ValidateField(context: T, propName: string): void;
|
||||
/**
|
||||
* Return validation results.
|
||||
*/
|
||||
ValidationResult: IValidationResult;
|
||||
Rules: {
|
||||
[name: string]: IPropertyValidationRule<T>;
|
||||
};
|
||||
Validators: {
|
||||
[name: string]: IValidator;
|
||||
};
|
||||
Children: {
|
||||
[name: string]: AbstractValidationRule<any>;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* It represents property validation rule for type of <T>.
|
||||
*/
|
||||
interface IPropertyValidationRule<T> {
|
||||
/**
|
||||
*The validators that are grouped under this rule.
|
||||
*/
|
||||
Validators: {
|
||||
[name: string]: any;
|
||||
};
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures.
|
||||
*/
|
||||
Validate(context: IValidationContext<T>): IValidationFailure[];
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy.
|
||||
*/
|
||||
ValidateAsync(context: IValidationContext<T>): Q.Promise<IValidationFailure[]>;
|
||||
}
|
||||
/**
|
||||
* It represents a data context for validation rule.
|
||||
*/
|
||||
interface IValidationContext<T> {
|
||||
/**
|
||||
* Return current value.
|
||||
*/
|
||||
Value: string;
|
||||
/**
|
||||
* Return property name for current data context.
|
||||
*/
|
||||
Key: string;
|
||||
/**
|
||||
* Data context for validation rule.
|
||||
*/
|
||||
Data: T;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @ngdoc object
|
||||
* @name AbstractValidator
|
||||
* @module Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* It enables to create custom validator for your own abstract object (class) and to assign validation rules to its properties.
|
||||
* You can assigned these rules
|
||||
*
|
||||
* + property validation rules - use _RuleFor_ property
|
||||
* + property async validation rules - use _RuleFor_ property
|
||||
* + shared validation rules - use _ValidationFor_ property
|
||||
* + custom object validator - use _ValidatorFor_ property - enables composition of child custom validators
|
||||
*/
|
||||
class AbstractValidator<T> implements IAbstractValidator<T> {
|
||||
public Validators: {
|
||||
[name: string]: IPropertyValidator[];
|
||||
};
|
||||
public AbstractValidators: {
|
||||
[name: string]: IAbstractValidator<any>;
|
||||
};
|
||||
public ValidationFunctions: {
|
||||
[name: string]: IValidatorFce[];
|
||||
};
|
||||
public RuleFor(prop: string, validator: IPropertyValidator): void;
|
||||
public ValidationFor(prop: string, fce: IValidatorFce): void;
|
||||
public ValidatorFor<K>(prop: string, validator: IAbstractValidator<K>, forList?: boolean): void;
|
||||
public CreateAbstractRule(name: string): AbstractValidationRule<T>;
|
||||
public CreateAbstractListRule(name: string): AbstractListValidationRule<T>;
|
||||
public CreateRule(name: string): AbstractValidationRule<T>;
|
||||
/**
|
||||
* Return true if this validation rule is intended for list of items, otherwise true.
|
||||
*/
|
||||
public ForList: boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @ngdoc object
|
||||
* @name AbstractValidationRule
|
||||
* @module Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* It represents concreate validator for custom object. It enables to assign validation rules to custom object properties.
|
||||
*/
|
||||
class AbstractValidationRule<T> implements IAbstractValidationRule<T> {
|
||||
public Name: string;
|
||||
public validator: AbstractValidator<T>;
|
||||
public ValidationResult: IValidationResult;
|
||||
public Rules: {
|
||||
[name: string]: IPropertyValidationRule<T>;
|
||||
};
|
||||
public Validators: {
|
||||
[name: string]: IValidator;
|
||||
};
|
||||
public Children: {
|
||||
[name: string]: AbstractValidationRule<any>;
|
||||
};
|
||||
/**
|
||||
* Return true if this validation rule is intended for list of items, otherwise true.
|
||||
*/
|
||||
public ForList: boolean;
|
||||
constructor(Name: string, validator: AbstractValidator<T>, forList?: boolean);
|
||||
public addChildren(): void;
|
||||
public SetOptional(fce: IOptional): void;
|
||||
private createRuleFor(prop);
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures.
|
||||
*/
|
||||
public Validate(context: T): IValidationResult;
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy.
|
||||
*/
|
||||
public ValidateAsync(context: T): Q.Promise<IValidationResult>;
|
||||
public ValidateAll(context: T): void;
|
||||
public ValidateField(context: T, propName: string): void;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @ngdoc object
|
||||
* @name AbstractListValidationRule
|
||||
* @module Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* It represents an validator for custom object. It enables to assign rules to custom object properties.
|
||||
*/
|
||||
class AbstractListValidationRule<T> extends AbstractValidationRule<T> {
|
||||
public Name: string;
|
||||
public validator: AbstractValidator<T>;
|
||||
constructor(Name: string, validator: AbstractValidator<T>);
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures.
|
||||
*/
|
||||
public Validate(context: any): IValidationResult;
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy.
|
||||
*/
|
||||
public ValidateAsync(context: any): Q.Promise<IValidationResult>;
|
||||
private getValidationRule(i);
|
||||
private getIndexedKey(i);
|
||||
public NotifyListChanged(list: any[]): void;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @ngdoc object
|
||||
* @name ValidationContext
|
||||
* @module Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* It represents a data context for validation rule.
|
||||
*/
|
||||
class ValidationContext<T> implements IValidationContext<T> {
|
||||
public Key: string;
|
||||
public Data: T;
|
||||
constructor(Key: string, Data: T);
|
||||
public Value : any;
|
||||
}
|
||||
class MessageLocalization {
|
||||
static customMsg: string;
|
||||
static defaultMessages: {
|
||||
"required": string;
|
||||
"remote": string;
|
||||
"email": string;
|
||||
"url": string;
|
||||
"date": string;
|
||||
"dateISO": string;
|
||||
"number": string;
|
||||
"digits": string;
|
||||
"signedDigits": string;
|
||||
"creditcard": string;
|
||||
"equalTo": string;
|
||||
"maxlength": string;
|
||||
"minlength": string;
|
||||
"rangelength": string;
|
||||
"range": string;
|
||||
"max": string;
|
||||
"min": string;
|
||||
"step": string;
|
||||
"contains": string;
|
||||
"mask": string;
|
||||
"custom": string;
|
||||
};
|
||||
static ValidationMessages: {
|
||||
"required": string;
|
||||
"remote": string;
|
||||
"email": string;
|
||||
"url": string;
|
||||
"date": string;
|
||||
"dateISO": string;
|
||||
"number": string;
|
||||
"digits": string;
|
||||
"signedDigits": string;
|
||||
"creditcard": string;
|
||||
"equalTo": string;
|
||||
"maxlength": string;
|
||||
"minlength": string;
|
||||
"rangelength": string;
|
||||
"range": string;
|
||||
"max": string;
|
||||
"min": string;
|
||||
"step": string;
|
||||
"contains": string;
|
||||
"mask": string;
|
||||
"custom": string;
|
||||
};
|
||||
static GetValidationMessage(validator: any): string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @ngdoc object
|
||||
* @name PropertyValidationRule
|
||||
* @module Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* It represents a property validation rule. The property has assigned collection of property validators.
|
||||
*/
|
||||
class PropertyValidationRule<T> extends ValidationResult implements IPropertyValidationRule<T> {
|
||||
public Name: string;
|
||||
public Validators: {
|
||||
[name: string]: any;
|
||||
};
|
||||
public ValidationFailures: {
|
||||
[name: string]: IValidationFailure;
|
||||
};
|
||||
constructor(Name: string, validatorsToAdd?: IPropertyValidator[]);
|
||||
public AddValidator(validator: any): void;
|
||||
public Errors : {
|
||||
[name: string]: IValidationFailure;
|
||||
};
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs[];
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures.
|
||||
*/
|
||||
public Validate(context: IValidationContext<T>): IValidationFailure[];
|
||||
public ValidateEx(value: any): IValidationFailure[];
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy.
|
||||
*/
|
||||
public ValidateAsync(context: IValidationContext<T>): Q.Promise<IValidationFailure[]>;
|
||||
/**
|
||||
* Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy.
|
||||
*/
|
||||
public ValidateAsyncEx(value: string): Q.Promise<IValidationFailure[]>;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @ngdoc object
|
||||
* @name Validator
|
||||
* @module Validation
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* It represents a custom validator. It enables to define your own shared validation rules
|
||||
*/
|
||||
class Validator extends ValidationResult implements IValidator {
|
||||
public Name: string;
|
||||
private ValidateFce;
|
||||
private AsyncValidationFce;
|
||||
public Error: IError;
|
||||
public ValidationFailures: {
|
||||
[name: string]: IValidationFailure;
|
||||
};
|
||||
constructor(Name: string, ValidateFce?: IValidate, AsyncValidationFce?: IAsyncValidate);
|
||||
public Optional: IOptional;
|
||||
public Validate(context: any): IValidationFailure;
|
||||
public ValidateAsync(context: any): Q.Promise<IValidationFailure>;
|
||||
public HasError : boolean;
|
||||
public Errors : {
|
||||
[name: string]: IValidationFailure;
|
||||
};
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs[];
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
interface IPerson{
|
||||
Checked:boolean;
|
||||
FirstName:string;
|
||||
LastName:string;
|
||||
Email:string;
|
||||
}
|
||||
|
||||
//create custom composite validator
|
||||
var personValidator = new Validation.AbstractValidator<IPerson>();
|
||||
|
||||
//create field validators
|
||||
var required = new Validation.RequiredValidator();
|
||||
var email = new Validation.EmailValidator();
|
||||
var maxLength = new Validation.MaxLengthValidator();
|
||||
maxLength.MaxLength = 15;
|
||||
|
||||
|
||||
personValidator.RuleFor("FirstName", required);
|
||||
personValidator.RuleFor("FirstName", maxLength);
|
||||
|
||||
personValidator.RuleFor("LastName", required);
|
||||
personValidator.RuleFor("LastName", maxLength);
|
||||
|
||||
personValidator.RuleFor("Email", required);
|
||||
personValidator.RuleFor("Email", email);
|
||||
+257
-215
@@ -1,94 +1,28 @@
|
||||
{
|
||||
"packages": [
|
||||
{
|
||||
"libraryName": "Moment",
|
||||
"typingsPackageName": "moment",
|
||||
"sourceRepoURL": "https://github.com/moment/moment",
|
||||
"asOfVersion": "2.13.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "ng-table",
|
||||
"typingsPackageName": "ng-table",
|
||||
"sourceRepoURL": "https://github.com/esvit/ng-table",
|
||||
"asOfVersion": "2.0.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "spotify-web-api-js",
|
||||
"typingsPackageName": "spotify-web-api-js",
|
||||
"sourceRepoURL": "https://github.com/JMPerez/spotify-web-api-js",
|
||||
"asOfVersion": "0.21.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Linq.JS",
|
||||
"typingsPackageName": "linq",
|
||||
"sourceRepoURL": "https://linqjs.codeplex.com/",
|
||||
"asOfVersion": "2.2.33"
|
||||
},
|
||||
{
|
||||
"libraryName": "Protractor",
|
||||
"typingsPackageName": "protractor",
|
||||
"sourceRepoURL": "https://github.com/angular/protractor",
|
||||
"asOfVersion": "4.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Dexie.js",
|
||||
"typingsPackageName": "dexie",
|
||||
"sourceRepoURL": "https://github.com/dfahlander/Dexie.js",
|
||||
"asOfVersion": "1.3.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "LinqSharp",
|
||||
"typingsPackageName": "linqsharp",
|
||||
"sourceRepoURL": "https://github.com/brunolm/LinqSharp",
|
||||
"libraryName": "ajv",
|
||||
"typingsPackageName": "ajv",
|
||||
"sourceRepoURL": "https://github.com/epoberezkin/ajv",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "TypeScript",
|
||||
"typingsPackageName": "typescript",
|
||||
"sourceRepoURL": "https://github.com/Microsoft/TypeScript",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "TypeScript",
|
||||
"typingsPackageName": "typescript-services",
|
||||
"sourceRepoURL": "https://github.com/Microsoft/TypeScript",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Prando",
|
||||
"typingsPackageName": "prando",
|
||||
"sourceRepoURL": "https://github.com/zeh/prando",
|
||||
"libraryName": "antd",
|
||||
"typingsPackageName": "antd",
|
||||
"sourceRepoURL": "https://github.com/ant-design/ant-design",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Shopify Prime",
|
||||
"typingsPackageName": "shopify-prime",
|
||||
"sourceRepoURL": "https://github.com/nozzlegear/shopify-prime",
|
||||
"asOfVersion": "2.0.0"
|
||||
"libraryName": "Argon2",
|
||||
"typingsPackageName": "argon2",
|
||||
"sourceRepoURL": "https://github.com/ranisalt/node-argon2",
|
||||
"asOfVersion": "0.15.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "SimpleSignal",
|
||||
"typingsPackageName": "simplesignal",
|
||||
"sourceRepoURL": "https://github.com/zeh/simplesignal",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Redux",
|
||||
"typingsPackageName": "redux",
|
||||
"sourceRepoURL": "https://github.com/reactjs/redux",
|
||||
"asOfVersion": "3.6.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Redux Thunk",
|
||||
"typingsPackageName": "redux-thunk",
|
||||
"sourceRepoURL": "https://github.com/gaearon/redux-thunk",
|
||||
"asOfVersion": "2.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Normalizr",
|
||||
"typingsPackageName": "normalizr",
|
||||
"sourceRepoURL": "https://github.com/paularmstrong/normalizr",
|
||||
"asOfVersion": "2.0.18"
|
||||
"libraryName": "axios",
|
||||
"typingsPackageName": "axios",
|
||||
"sourceRepoURL": "https://github.com/mzabriskie/axios",
|
||||
"asOfVersion": "0.14.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "camel-case",
|
||||
@@ -108,12 +42,90 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/constant-case",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "date-fns",
|
||||
"typingsPackageName": "date-fns",
|
||||
"sourceRepoURL": "https://github.com/date-fns/date-fns",
|
||||
"asOfVersion": "2.6.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Dexie.js",
|
||||
"typingsPackageName": "dexie",
|
||||
"sourceRepoURL": "https://github.com/dfahlander/Dexie.js",
|
||||
"asOfVersion": "1.3.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "dot-case",
|
||||
"typingsPackageName": "dot-case",
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/dot-case",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "dva",
|
||||
"typingsPackageName": "dva",
|
||||
"sourceRepoURL": "https://github.com/dvajs/dva",
|
||||
"asOfVersion": "1.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "ecmarkup",
|
||||
"typingsPackageName": "ecmarkup",
|
||||
"sourceRepoURL": "https://github.com/bterlson/ecmarkup",
|
||||
"asOfVersion": "3.4.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "FineUploader",
|
||||
"typingsPackageName": "fine-uploader",
|
||||
"sourceRepoURL": "http://fineuploader.com/",
|
||||
"asOfVersion": "5.14.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "gaea-model",
|
||||
"typingsPackageName": "gaea-model",
|
||||
"sourceRepoURL": "https://github.com/ascoders/gaea-model",
|
||||
"asOfVersion": "0.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Facebook's Immutable",
|
||||
"typingsPackageName": "immutable",
|
||||
"sourceRepoURL": "https://github.com/facebook/immutable-js",
|
||||
"asOfVersion": "3.8.7"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify",
|
||||
"typingsPackageName": "inversify",
|
||||
"sourceRepoURL": "http://inversify.io",
|
||||
"asOfVersion": "2.0.33"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify-binding-decorators",
|
||||
"typingsPackageName": "inversify-binding-decorators",
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-binding-decorators",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify-express-utils",
|
||||
"typingsPackageName": "inversify-express-utils",
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-express-utils",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify-inject-decorators",
|
||||
"typingsPackageName": "inversify-inject-decorators",
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-inject-decorators",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify-logger-middleware",
|
||||
"typingsPackageName": "inversify-logger-middleware",
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-logger-middleware",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify-restify-utils",
|
||||
"typingsPackageName": "inversify-restify-utils",
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-restify-utils",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "is-lower-case",
|
||||
"typingsPackageName": "is-lower-case",
|
||||
@@ -126,6 +138,30 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/is-upper-case",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "jsonschema",
|
||||
"typingsPackageName": "jsonschema",
|
||||
"sourceRepoURL": "https://github.com/tdegrunt/jsonschema",
|
||||
"asOfVersion": "1.1.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "Linq.JS",
|
||||
"typingsPackageName": "linq",
|
||||
"sourceRepoURL": "https://linqjs.codeplex.com/",
|
||||
"asOfVersion": "2.2.33"
|
||||
},
|
||||
{
|
||||
"libraryName": "LinqSharp",
|
||||
"typingsPackageName": "linqsharp",
|
||||
"sourceRepoURL": "https://github.com/brunolm/LinqSharp",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "localforage",
|
||||
"typingsPackageName": "localforage",
|
||||
"sourceRepoURL": "https://github.com/localForage/localForage",
|
||||
"asOfVersion": "0.0.34"
|
||||
},
|
||||
{
|
||||
"libraryName": "lower-case",
|
||||
"typingsPackageName": "lower-case",
|
||||
@@ -138,6 +174,36 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/lower-case-first",
|
||||
"asOfVersion": "1.0.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "mobservable",
|
||||
"typingsPackageName": "mobservable",
|
||||
"sourceRepoURL": "github.com/mweststrate/mobservable",
|
||||
"asOfVersion": "1.2.5"
|
||||
},
|
||||
{
|
||||
"libraryName": "Moment",
|
||||
"typingsPackageName": "moment",
|
||||
"sourceRepoURL": "https://github.com/moment/moment",
|
||||
"asOfVersion": "2.13.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "ng-table",
|
||||
"typingsPackageName": "ng-table",
|
||||
"sourceRepoURL": "https://github.com/esvit/ng-table",
|
||||
"asOfVersion": "2.0.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "Normalizr",
|
||||
"typingsPackageName": "normalizr",
|
||||
"sourceRepoURL": "https://github.com/paularmstrong/normalizr",
|
||||
"asOfVersion": "2.0.18"
|
||||
},
|
||||
{
|
||||
"libraryName": "Numbro",
|
||||
"typingsPackageName": "numbro",
|
||||
"sourceRepoURL": "https://github.com/foretagsplatsen/numbro/",
|
||||
"asOfVersion": "1.9.3"
|
||||
},
|
||||
{
|
||||
"libraryName": "param-case",
|
||||
"typingsPackageName": "param-case",
|
||||
@@ -156,18 +222,108 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/path-case",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "pixi-spine",
|
||||
"typingsPackageName": "pixi-spine",
|
||||
"sourceRepoURL": "https://github.com/pixijs/pixi-spine",
|
||||
"asOfVersion": "1.4.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "poly2tri.js",
|
||||
"typingsPackageName": "poly2tri",
|
||||
"sourceRepoURL": "https://github.com/r3mi/poly2tri.js",
|
||||
"asOfVersion": "1.4.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Prando",
|
||||
"typingsPackageName": "prando",
|
||||
"sourceRepoURL": "https://github.com/zeh/prando",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Protractor",
|
||||
"typingsPackageName": "protractor",
|
||||
"sourceRepoURL": "https://github.com/angular/protractor",
|
||||
"asOfVersion": "4.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Raven JS",
|
||||
"typingsPackageName": "raven-js",
|
||||
"sourceRepoURL": "https://github.com/getsentry/raven-js",
|
||||
"asOfVersion": "3.10.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Redux",
|
||||
"typingsPackageName": "redux",
|
||||
"sourceRepoURL": "https://github.com/reactjs/redux",
|
||||
"asOfVersion": "3.6.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "redux-persist",
|
||||
"typingsPackageName": "redux-persist",
|
||||
"sourceRepoURL": "https://github.com/rt2zz/redux-persist",
|
||||
"asOfVersion": "4.3.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "redux-persist-transform-compress",
|
||||
"typingsPackageName": "redux-persist-transform-compress",
|
||||
"sourceRepoURL": "https://github.com/rt2zz/redux-persist-transform-compress",
|
||||
"asOfVersion": "4.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "redux-saga",
|
||||
"typingsPackageName": "redux-saga",
|
||||
"sourceRepoURL": "https://github.com/redux-saga/redux-saga",
|
||||
"asOfVersion": "0.10.5"
|
||||
},
|
||||
{
|
||||
"libraryName": "Redux Thunk",
|
||||
"typingsPackageName": "redux-thunk",
|
||||
"sourceRepoURL": "https://github.com/gaearon/redux-thunk",
|
||||
"asOfVersion": "2.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "node-scanf",
|
||||
"typingsPackageName": "scanf",
|
||||
"sourceRepoURL": "https://github.com/Lellansin/node-scanf",
|
||||
"asOfVersion": "0.7.3"
|
||||
},
|
||||
{
|
||||
"libraryName": "sentence-case",
|
||||
"typingsPackageName": "sentence-case",
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/sentence-case",
|
||||
"asOfVersion": "1.1.3"
|
||||
},
|
||||
{
|
||||
"libraryName": "Shopify Prime",
|
||||
"typingsPackageName": "shopify-prime",
|
||||
"sourceRepoURL": "https://github.com/nozzlegear/shopify-prime",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "SimpleSignal",
|
||||
"typingsPackageName": "simplesignal",
|
||||
"sourceRepoURL": "https://github.com/zeh/simplesignal",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "snake-case",
|
||||
"typingsPackageName": "snake-case",
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/snake-case",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "spotify-web-api-js",
|
||||
"typingsPackageName": "spotify-web-api-js",
|
||||
"sourceRepoURL": "https://github.com/JMPerez/spotify-web-api-js",
|
||||
"asOfVersion": "0.21.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Sugar",
|
||||
"typingsPackageName": "sugar",
|
||||
"sourceRepoURL": "https://github.com/andrewplummer/Sugar",
|
||||
"asOfVersion": "2.0.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "swap-case",
|
||||
"typingsPackageName": "swap-case",
|
||||
@@ -180,6 +336,18 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/title-case",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "TypeScript",
|
||||
"typingsPackageName": "typescript",
|
||||
"sourceRepoURL": "https://github.com/Microsoft/TypeScript",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "TypeScript",
|
||||
"typingsPackageName": "typescript-services",
|
||||
"sourceRepoURL": "https://github.com/Microsoft/TypeScript",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "upper-case",
|
||||
"typingsPackageName": "upper-case",
|
||||
@@ -192,90 +360,12 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/upper-case-first",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "Sugar",
|
||||
"typingsPackageName": "sugar",
|
||||
"sourceRepoURL": "https://github.com/andrewplummer/Sugar",
|
||||
"asOfVersion": "2.0.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "ajv",
|
||||
"typingsPackageName": "ajv",
|
||||
"sourceRepoURL": "https://github.com/epoberezkin/ajv",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "date-fns",
|
||||
"typingsPackageName": "date-fns",
|
||||
"sourceRepoURL": "https://github.com/date-fns/date-fns",
|
||||
"asOfVersion": "2.6.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "vuejs",
|
||||
"typingsPackageName": "vue",
|
||||
"sourceRepoURL": "https://github.com/vuejs/vue",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Facebook's Immutable",
|
||||
"typingsPackageName": "immutable",
|
||||
"sourceRepoURL": "https://github.com/facebook/immutable-js",
|
||||
"asOfVersion": "3.8.7"
|
||||
},
|
||||
{
|
||||
"libraryName": "dva",
|
||||
"typingsPackageName": "dva",
|
||||
"sourceRepoURL": "https://github.com/dvajs/dva",
|
||||
"asOfVersion": "1.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify",
|
||||
"typingsPackageName": "inversify",
|
||||
"sourceRepoURL": "http://inversify.io",
|
||||
"asOfVersion": "2.0.33"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify-express-utils",
|
||||
"typingsPackageName": "inversify-express-utils",
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-express-utils",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify-binding-decorators",
|
||||
"typingsPackageName": "inversify-binding-decorators",
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-binding-decorators",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify-logger-middleware",
|
||||
"typingsPackageName": "inversify-logger-middleware",
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-logger-middleware",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify-inject-decorators",
|
||||
"typingsPackageName": "inversify-inject-decorators",
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-inject-decorators",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify-restify-utils",
|
||||
"typingsPackageName": "inversify-restify-utils",
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-restify-utils",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Argon2",
|
||||
"typingsPackageName": "argon2",
|
||||
"sourceRepoURL": "https://github.com/ranisalt/node-argon2",
|
||||
"asOfVersion": "0.15.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "node-scanf",
|
||||
"typingsPackageName": "scanf",
|
||||
"sourceRepoURL": "https://github.com/Lellansin/node-scanf",
|
||||
"asOfVersion": "0.7.3"
|
||||
},
|
||||
{
|
||||
"libraryName": "vue-router",
|
||||
"typingsPackageName": "vue-router",
|
||||
@@ -283,64 +373,16 @@
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "ecmarkup",
|
||||
"typingsPackageName": "ecmarkup",
|
||||
"sourceRepoURL": "https://github.com/bterlson/ecmarkup",
|
||||
"asOfVersion": "3.4.0"
|
||||
"libraryName": "x2js",
|
||||
"typingsPackageName": "x2js",
|
||||
"sourceRepoURL": "https://code.google.com/p/x2js/",
|
||||
"asOfVersion": "3.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "redux-saga",
|
||||
"typingsPackageName": "redux-saga",
|
||||
"sourceRepoURL": "https://github.com/redux-saga/redux-saga",
|
||||
"asOfVersion": "0.10.5"
|
||||
},
|
||||
{
|
||||
"libraryName": "axios",
|
||||
"typingsPackageName": "axios",
|
||||
"sourceRepoURL": "https://github.com/mzabriskie/axios",
|
||||
"asOfVersion": "0.14.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "gaea-model",
|
||||
"typingsPackageName": "gaea-model",
|
||||
"sourceRepoURL": "https://github.com/ascoders/gaea-model",
|
||||
"asOfVersion": "0.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "pixi-spine",
|
||||
"typingsPackageName": "pixi-spine",
|
||||
"sourceRepoURL": "https://github.com/pixijs/pixi-spine",
|
||||
"asOfVersion": "1.4.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "jsonschema",
|
||||
"typingsPackageName": "jsonschema",
|
||||
"sourceRepoURL": "https://github.com/tdegrunt/jsonschema",
|
||||
"asOfVersion": "1.1.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "Raven JS",
|
||||
"typingsPackageName": "raven-js",
|
||||
"sourceRepoURL": "https://github.com/getsentry/raven-js",
|
||||
"asOfVersion": "3.10.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "antd",
|
||||
"typingsPackageName": "antd",
|
||||
"sourceRepoURL": "https://github.com/ant-design/ant-design",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "FineUploader",
|
||||
"typingsPackageName": "fine-uploader",
|
||||
"sourceRepoURL": "http://fineuploader.com/",
|
||||
"asOfVersion": "5.14.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "mobservable",
|
||||
"typingsPackageName": "mobservable",
|
||||
"sourceRepoURL": "github.com/mweststrate/mobservable",
|
||||
"asOfVersion": "1.2.5"
|
||||
"libraryName": "@xmpp/jid",
|
||||
"typingsPackageName": "xmpp-jid",
|
||||
"sourceRepoURL": "github.com/node-xmpp/node-xmpp/",
|
||||
"asOfVersion": "1.2.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
-49
@@ -1,49 +0,0 @@
|
||||
// Type definitions for Numbro.js
|
||||
// Project: https://github.com/foretagsplatsen/numbro
|
||||
// Definitions by: Vincent Bortone <https://github.com/vbortone/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface NumbroLanguage {
|
||||
delimiters: {
|
||||
thousands: string;
|
||||
decimal: string;
|
||||
};
|
||||
abbreviations: {
|
||||
thousand: string;
|
||||
million: string;
|
||||
billion: string;
|
||||
trillion: string;
|
||||
};
|
||||
ordinal(num: number): string;
|
||||
currency: {
|
||||
symbol: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface Numbro {
|
||||
(value?: any): Numbro;
|
||||
version: string;
|
||||
isNumbro: boolean;
|
||||
language(key: string, values?: NumbroLanguage): Numbro;
|
||||
zeroFormat(format: string): string;
|
||||
clone(): Numbro;
|
||||
format(inputString?: string): string;
|
||||
formatCurrency(inputString?: string): string;
|
||||
unformat(inputString: string): number;
|
||||
value(): number;
|
||||
valueOf(): number;
|
||||
set (value: any): Numbro;
|
||||
add(value: any): Numbro;
|
||||
subtract(value: any): Numbro;
|
||||
multiply(value: any): Numbro;
|
||||
divide(value: any): Numbro;
|
||||
difference(value: any): number;
|
||||
}
|
||||
|
||||
declare var numbro: Numbro;
|
||||
|
||||
declare module "numbro" {
|
||||
|
||||
export = numbro;
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
|
||||
|
||||
var valueFormat: string = numbro(1000).format('0,0');
|
||||
// '1,000'
|
||||
|
||||
var valueUnformat: number = numbro().unformat('($10,000.00)');
|
||||
// '-10000'
|
||||
|
||||
var value3: Numbro = numbro(1000);
|
||||
var added: Numbro = value3.add(10);
|
||||
// 1010
|
||||
|
||||
var value4: Numbro = numbro(1000);
|
||||
var formatValue4a: string = value4.format('0,0');
|
||||
// '1,000'
|
||||
var formatValue4b: number = value4.value();
|
||||
// 1000
|
||||
|
||||
var value5: Numbro = numbro();
|
||||
value5.set(1000);
|
||||
var value5Num: number = value5.value();
|
||||
// 1000
|
||||
|
||||
var value6: Numbro = numbro(1000);
|
||||
var value: number = 100;
|
||||
var difference = value6.difference(value);
|
||||
// 900
|
||||
|
||||
var value7: Numbro = numbro(0);
|
||||
numbro.zeroFormat('N/A');
|
||||
var zeroString: string = value7.format('0.0');
|
||||
// 'N/A'
|
||||
|
||||
var a: Numbro = numbro(1000);
|
||||
var b: Numbro = numbro(a);
|
||||
var c: Numbro = a.clone();
|
||||
|
||||
var aVal: number = a.set(2000).value();
|
||||
// 2000
|
||||
var bVal: number = b.value();
|
||||
// 1000
|
||||
var cVal: number = c.add(10).value();
|
||||
// 1010
|
||||
Vendored
-113
@@ -1,113 +0,0 @@
|
||||
// Type definitions for poly2tri v0.9.10
|
||||
// Project: http://github.com/r3mi/poly2tri.js/
|
||||
// Definitions by: Elemar Junior <https://github.com/elemarjr/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace poly2tri {
|
||||
|
||||
interface IPointLike {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
class Point implements IPointLike {
|
||||
|
||||
x: number;
|
||||
y: number;
|
||||
|
||||
constructor(x: number, y: number);
|
||||
|
||||
toString(): string;
|
||||
|
||||
toJSON(): JSON;
|
||||
|
||||
clone(): Point;
|
||||
|
||||
set_zero(): Point;
|
||||
|
||||
set(x: number, y: number): Point;
|
||||
|
||||
negate(): Point;
|
||||
|
||||
add(n: IPointLike): Point;
|
||||
|
||||
sub(n: IPointLike): Point;
|
||||
|
||||
mul(s: number): Point;
|
||||
|
||||
length(): number;
|
||||
|
||||
normalize(): number;
|
||||
|
||||
equals(p: IPointLike): boolean;
|
||||
|
||||
static negate(p: IPointLike): Point;
|
||||
|
||||
static add(a: IPointLike, b: IPointLike): Point;
|
||||
|
||||
static sub(a: IPointLike, b: IPointLike): Point;
|
||||
|
||||
static mul(s: number, p: IPointLike): Point;
|
||||
|
||||
static cross(a: number, b: number): number;
|
||||
|
||||
static cross(a: IPointLike, b: number): number;
|
||||
|
||||
static cross(a: IPointLike, b: IPointLike): number;
|
||||
|
||||
static cross(a: number, b: IPointLike): number;
|
||||
|
||||
static toStringBase(p: IPointLike): string;
|
||||
|
||||
static toString(p: IPointLike): string;
|
||||
|
||||
static compare(a: IPointLike, b: IPointLike): number;
|
||||
|
||||
static equals(a: IPointLike, b: IPointLike): boolean;
|
||||
|
||||
static dot(a: IPointLike, b: IPointLike): number;
|
||||
}
|
||||
|
||||
|
||||
class SweepContext {
|
||||
constructor(contour: Array<IPointLike>);
|
||||
|
||||
constructor(contour: Array<IPointLike>, options: JSON);
|
||||
|
||||
addHole(polyline: Array<IPointLike>): SweepContext;
|
||||
|
||||
addHoles(holes: Array<Array<IPointLike>>): SweepContext;
|
||||
|
||||
addPoint(point: IPointLike): SweepContext;
|
||||
|
||||
addPoints(point: Array<IPointLike>): SweepContext;
|
||||
|
||||
triangulate(): SweepContext;
|
||||
|
||||
getBoundingBox(): { min: IPointLike; max: IPointLike; };
|
||||
|
||||
getTriangles(): Array<Triangle>;
|
||||
}
|
||||
|
||||
class Triangle {
|
||||
constructor(a: IPointLike, b: IPointLike, c: IPointLike);
|
||||
|
||||
toString(): string;
|
||||
|
||||
getPoint(index: number): IPointLike;
|
||||
|
||||
getPoints(): Array<IPointLike>;
|
||||
|
||||
containsPoint(point: IPointLike): boolean;
|
||||
|
||||
containsPoints(p1: IPointLike, p2: IPointLike): boolean;
|
||||
|
||||
isInterior(): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
|
||||
|
||||
function initializeCDT(): poly2tri.SweepContext {
|
||||
var contour = [
|
||||
new poly2tri.Point(100, 100),
|
||||
new poly2tri.Point(100, 300),
|
||||
new poly2tri.Point(300, 300),
|
||||
new poly2tri.Point(300, 100)
|
||||
];
|
||||
|
||||
var swctx = new poly2tri.SweepContext(contour);
|
||||
return swctx;
|
||||
}
|
||||
|
||||
function addHole() {
|
||||
var swctx = initializeCDT();
|
||||
var hole = [
|
||||
new poly2tri.Point(200, 200),
|
||||
new poly2tri.Point(200, 250),
|
||||
new poly2tri.Point(250, 250)
|
||||
];
|
||||
swctx.addHole(hole);
|
||||
}
|
||||
|
||||
function addHoles() {
|
||||
var swctx = initializeCDT();
|
||||
var hole1 = [
|
||||
new poly2tri.Point(200, 200),
|
||||
new poly2tri.Point(200, 250),
|
||||
new poly2tri.Point(250, 250)
|
||||
];
|
||||
|
||||
var hole2 = [
|
||||
new poly2tri.Point(110, 110),
|
||||
new poly2tri.Point(110, 120),
|
||||
new poly2tri.Point(120, 120)
|
||||
];
|
||||
|
||||
swctx.addHoles([hole1, hole2]);
|
||||
}
|
||||
|
||||
function addPoint() {
|
||||
var swctx = initializeCDT();
|
||||
var point = new poly2tri.Point(150, 150);
|
||||
swctx.addPoint(point);
|
||||
}
|
||||
|
||||
function addPoints() {
|
||||
var swctx = initializeCDT();
|
||||
var point1 = new poly2tri.Point(150, 150);
|
||||
var point2 = new poly2tri.Point(155, 155);
|
||||
swctx.addPoints([point1, point2]);
|
||||
swctx.addPoints([{x: 110, y: 120}]);
|
||||
}
|
||||
|
||||
function triangulate() {
|
||||
var swctx = initializeCDT();
|
||||
swctx.triangulate();
|
||||
var triangles = swctx.getTriangles();
|
||||
|
||||
triangles.forEach(t => {
|
||||
t.getPoints().forEach(p => {
|
||||
console.log(p.x, p.y);
|
||||
});
|
||||
var p1 = t.getPoint(0);
|
||||
var p2 = t.getPoint(1);
|
||||
var p3 = t.getPoint(2);
|
||||
});
|
||||
}
|
||||
|
||||
function chaining() {
|
||||
var swctx = initializeCDT();
|
||||
|
||||
var hole1 = [
|
||||
new poly2tri.Point(200, 200),
|
||||
new poly2tri.Point(200, 250),
|
||||
new poly2tri.Point(250, 250)
|
||||
];
|
||||
|
||||
var hole2 = [
|
||||
new poly2tri.Point(110, 110),
|
||||
new poly2tri.Point(110, 120),
|
||||
new poly2tri.Point(120, 120)
|
||||
];
|
||||
|
||||
var holes = [hole1, hole2];
|
||||
var point1 = new poly2tri.Point(150, 150);
|
||||
var point2 = new poly2tri.Point(155, 155);
|
||||
var points = [point1, point2, { x: 153, y: 153 }];
|
||||
|
||||
var triangles = swctx.addHoles(holes).addPoints(points).triangulate().getTriangles();
|
||||
}
|
||||
Vendored
-164
@@ -1,164 +0,0 @@
|
||||
// Type definitions for prism v1.4.4
|
||||
// Project: http://prismjs.com/
|
||||
// Definitions by: Erik Lieben <https://github.com/eriklieben>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace PrismJS {
|
||||
|
||||
/**
|
||||
* The Prism object
|
||||
*/
|
||||
interface Prism {
|
||||
|
||||
util: Util;
|
||||
languages: Languages;
|
||||
plugins: any;
|
||||
|
||||
/**
|
||||
* This is the most high-level function in Prism’s API. It fetches all the elements that have a .language-xxxx class and then calls Prism.highlightElement() on each one of them.
|
||||
*
|
||||
* @param {boolean} async - Whether to use Web Workers to improve performance and avoid blocking the UI when highlighting very large chunks of code. False by default.
|
||||
* @param {(element:Element)=>void} callback? - An optional callback to be invoked after the highlighting is done. Mostly useful when async is true, since in that case, the highlighting is done asynchronously.
|
||||
* @returns void
|
||||
*/
|
||||
highlightAll(async: boolean, callback?: (element: Element) => void): void;
|
||||
|
||||
/**
|
||||
* Highlights the code inside a single element.
|
||||
*
|
||||
* @param {Element} element - The element containing the code. It must have a class of language-xxxx to be processed, where xxxx is a valid language identifier.
|
||||
* @param {boolean} async - Whether to use Web Workers to improve performance and avoid blocking the UI when highlighting very large chunks of code. False by default.
|
||||
* @param {(element:Element)=>void} callback? - An optional callback to be invoked after the highlighting is done. Mostly useful when async is true, since in that case, the highlighting is done asynchronously.
|
||||
* @returns void
|
||||
*/
|
||||
highlightElement(element: Element, async: boolean, callback?: (element: Element) => void): void;
|
||||
|
||||
|
||||
/**
|
||||
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input and the language definitions to use, and returns a string with the HTML produced.
|
||||
*
|
||||
* @param {string} text - A string with the code to be highlighted.
|
||||
* @param {LanguageDefinition} grammer - An object containing the tokens to use. Usually a language definition like Prism.languages.markup
|
||||
* @param {LanguageDefinition} language
|
||||
* @returns string - The highlighted HTML
|
||||
*/
|
||||
highlight(text: string, grammer: LanguageDefinition, language?: LanguageDefinition): string;
|
||||
|
||||
/**
|
||||
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input and the language definitions to use,
|
||||
* and returns an array with the tokenized code. When the language definition includes nested tokens, the function is called recursively on each of
|
||||
* these tokens. This method could be useful in other contexts as well, as a very crude parser.
|
||||
*
|
||||
* @param {string} text - A string with the code to be highlighted.
|
||||
* @param {LanguageDefinition} grammar - An object containing the tokens to use. Usually a language definition like Prism.languages.markup
|
||||
* @param {LanguageDefinition} language
|
||||
* @returns Array - An array of strings, tokens (class Prism.Token) and other arrays.
|
||||
*/
|
||||
tokenize(text: string, grammar: LanguageDefinition, language?: LanguageDefinition): Array<string>;
|
||||
|
||||
fileHighlight(): void;
|
||||
|
||||
hooks: Hooks;
|
||||
}
|
||||
|
||||
interface Environment {
|
||||
element?: Element;
|
||||
language?: LanguageDefinition;
|
||||
grammer?: any;
|
||||
code?: any;
|
||||
highlightedCode?: any;
|
||||
type?: string;
|
||||
content?:string;
|
||||
tag?: string;
|
||||
classes?: Array<string>;
|
||||
attributes?: Array<string> | Object;
|
||||
parent?: Element;
|
||||
}
|
||||
|
||||
interface Identifier {
|
||||
value: number;
|
||||
}
|
||||
|
||||
interface Util {
|
||||
encode(tokens:Token | Array<Token> | string): Token | Array<Token> | string;
|
||||
type(o: Object): string;
|
||||
objId(obj: Object): Identifier;
|
||||
clone(o: LanguageDefinition): LanguageDefinition;
|
||||
}
|
||||
|
||||
interface LanguageDefinition {
|
||||
keyword?: RegExp | LanguageDefinition;
|
||||
number?: RegExp | LanguageDefinition;
|
||||
function?: RegExp | LanguageDefinition;
|
||||
string?: RegExp | LanguageDefinition;
|
||||
boolean?: RegExp | LanguageDefinition;
|
||||
operator?: RegExp | LanguageDefinition;
|
||||
punctuation?: RegExp | LanguageDefinition;
|
||||
atrule?: RegExp | LanguageDefinition;
|
||||
url?: RegExp | LanguageDefinition;
|
||||
selector?: RegExp | LanguageDefinition;
|
||||
property?: RegExp | LanguageDefinition;
|
||||
important?: RegExp | LanguageDefinition;
|
||||
style?: RegExp | LanguageDefinition;
|
||||
|
||||
/**
|
||||
* This option can be used to define one or more aliases for the matched token. The result will be, that the styles
|
||||
* of the token and its aliases are combined. This can be useful, to combine the styling of a well known token,
|
||||
* which is already supported by most of the themes, with a semantically correct token name. The option can be
|
||||
* set to a string literal or an array of string literals. In the following example the token name latex-equation
|
||||
* is not supported by any theme, but it will be highlighted the same as a string.
|
||||
*/
|
||||
alias?: string;
|
||||
|
||||
pattern?: RegExp;
|
||||
|
||||
/**
|
||||
* This option mitigates JavaScript’s lack of lookbehind. When set to true, the first capturing group in the regex
|
||||
* pattern is discarded when matching this token, so it effectively behaves as if it was lookbehind
|
||||
*/
|
||||
lookbehind?: boolean;
|
||||
|
||||
/**
|
||||
* This property accepts another object literal, with tokens that are allowed to be nested in this token.
|
||||
* This makes it easier to define certain languages. However, keep in mind that they’re slower and if coded poorly,
|
||||
* can even result in infinite recursion. For an example of nested tokens, check out the Markup language definition
|
||||
*/
|
||||
inside?: LanguageDefinition;
|
||||
|
||||
/**
|
||||
* Accepts an object literal with tokens and appends them to the end of the current object literal.
|
||||
*/
|
||||
rest?: Array<Token>;
|
||||
}
|
||||
|
||||
interface Languages extends Array<LanguageDefinition> {
|
||||
|
||||
extend(id: string, redef: LanguageDefinition): LanguageDefinition;
|
||||
|
||||
/**
|
||||
* Insert a token before another token in a language literal
|
||||
* As this needs to recreate the object (we cannot actually insert before keys in object literals),
|
||||
* we cannot just provide an object, we need anobject and a key.
|
||||
* @param inside The key (or language id) of the parent
|
||||
* @param before The key to insert before. If not provided, the function appends instead.
|
||||
* @param insert Object with the key/value pairs to insert
|
||||
* @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted.
|
||||
*/
|
||||
insertBefore(inside: string, before: string, insert: LanguageDefinition, root: Object): any;
|
||||
}
|
||||
|
||||
interface Hooks {
|
||||
all: Array<Array<(env: Environment) => void>>;
|
||||
add(name: string, callback: (env: Environment) => void):void;
|
||||
run(name: string, env: Environment): void;
|
||||
}
|
||||
|
||||
interface Token {
|
||||
type: string;
|
||||
content: Token | Array<Token> | string;
|
||||
alias: string;
|
||||
stringify(o:string| Array<any>, language: LanguageDefinition, parent: HTMLPreElement): string;
|
||||
}
|
||||
}
|
||||
|
||||
declare var Prism : PrismJS.Prism;
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
|
||||
var element = document.createElement("code");
|
||||
var callback = (element: Element) => console.log(element);
|
||||
|
||||
Prism.highlightElement(element, false, callback);
|
||||
Prism.highlightElement(element, false);
|
||||
Prism.highlightAll(true, callback);
|
||||
Prism.highlightAll(true);
|
||||
|
||||
Vendored
-26
@@ -1,26 +0,0 @@
|
||||
// Type definitions for Qajax
|
||||
// Project: https://github.com/gre/qajax
|
||||
// Definitions by: Boltmade <https://github.com/Boltmade>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as Q from "q";
|
||||
|
||||
export = Qajax;
|
||||
export as namespace Qajax;
|
||||
|
||||
declare function Qajax(url : string) : Q.Promise<XMLHttpRequest>;
|
||||
declare function Qajax(options : any) : Q.Promise<XMLHttpRequest>;
|
||||
declare function Qajax(url : string, options : any) : Q.Promise<XMLHttpRequest>;
|
||||
|
||||
declare namespace Qajax {
|
||||
export var defaults : any;
|
||||
export function filterStatus(validStatus : number) : (xhr : XMLHttpRequest) => Q.Promise<XMLHttpRequest>;
|
||||
export function filterStatus(validStatus : (status : number) => boolean) : (xhr : XMLHttpRequest) => Q.Promise<XMLHttpRequest>;
|
||||
export function filterSuccess() : Q.Promise<XMLHttpRequest>;
|
||||
|
||||
export function toJSON(xhr : XMLHttpRequest) : Q.Promise<any>;
|
||||
|
||||
export function getJSON(url : string) : Q.Promise<any>;
|
||||
|
||||
export function serialize(paramsObj : any) : string;
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
import Qajax = require("qajax");
|
||||
import * as Q from 'q';
|
||||
|
||||
// Based on https://github.com/gre/qajax/blob/master/test/qajax.js
|
||||
|
||||
function resetDefaults () {
|
||||
Qajax.defaults.logs = true;
|
||||
Qajax.defaults.timeout = 1000;
|
||||
Qajax.defaults.method = "GET";
|
||||
Qajax.defaults.headers = {};
|
||||
Qajax.defaults.base = "";
|
||||
}
|
||||
|
||||
var sample01url = "/test/dataset/sample01.json";
|
||||
var sample01json = [
|
||||
{ "name": "Jerome", "age": 20 },
|
||||
{ "name": "Gerard", "age": 30 },
|
||||
{ "name": "Martine", "age": 43 }
|
||||
];
|
||||
|
||||
var emptyUrl = "/test/dataset/empty";
|
||||
|
||||
function urlWithOptions (url : string, options : any) {
|
||||
return url+"?"+Qajax.serialize(options);
|
||||
}
|
||||
|
||||
Qajax;
|
||||
Qajax.filterStatus;
|
||||
Qajax.filterSuccess;
|
||||
Qajax.getJSON;
|
||||
Qajax.serialize({ foo: 123, bar: "toto" });
|
||||
Qajax.getJSON(sample01url).then((res) => true, (err) => true);
|
||||
Qajax(sample01url).then(Qajax.filterSuccess).then(Qajax.toJSON);
|
||||
Qajax(emptyUrl, { params: { status: 404 } }).then(Qajax.filterSuccess).then(Qajax.toJSON);
|
||||
Qajax({method: "POST", url: "/ECHO", data: "1234567890\nazerty\nuiopqsdfghjklm\nwxcvbn\n"}).then(Qajax.filterSuccess);
|
||||
Qajax({method: "POST", url: "/ECHO", data: { foo: 123, bar: { value: 42 }, arr: [1, 2, 3] }}).then(Qajax.filterSuccess).then(Qajax.toJSON);
|
||||
Qajax({ url: emptyUrl, params: { status: 201 } }).then(Qajax.filterStatus(200));
|
||||
Qajax({method: "POST", url: emptyUrl, params: { status: 500 }}).then(Qajax.filterSuccess).then(Qajax.toJSON);
|
||||
|
||||
var cancellationD = Q.defer();
|
||||
var cancellation = cancellationD.promise;
|
||||
Qajax({ cancellation: cancellation, url: urlWithOptions(emptyUrl, { latency: 400 }) }).then(Qajax.filterSuccess).then(Qajax.toJSON);
|
||||
|
||||
Qajax.defaults.timeout = 200;
|
||||
Qajax({method: "DELETE", url: sample01url, params: { latency: 500 }});
|
||||
|
||||
resetDefaults();
|
||||
Qajax({method: "POST", url: sample01url, params: { latency: 300 }, timeout: 2000});
|
||||
|
||||
Qajax.defaults.timeout = 200;
|
||||
Qajax({method: "DELETE", url: sample01url, params: { latency: 500 }, timeout: 0});
|
||||
|
||||
resetDefaults();
|
||||
Qajax({headers: { "X-Hello": "world" }, method: "GET", url: "/ECHO_HEADERS"}).then(Qajax.filterSuccess).then(Qajax.toJSON);
|
||||
Qajax({headers: { "X-Hi": "world" }, method: "GET", url: "/ECHO_HEADERS"}).then(Qajax.filterSuccess).then(Qajax.toJSON);
|
||||
Qajax.defaults.headers = {"X-Foo": "bar"};
|
||||
Qajax({method: "GET", url: "/ECHO_HEADERS"}).then(Qajax.filterSuccess).then(Qajax.toJSON);
|
||||
|
||||
resetDefaults();
|
||||
Qajax("sample01.json", {base: "/test/dataset/"}).then(Qajax.filterSuccess).then(Qajax.toJSON);
|
||||
Qajax.defaults.base = "/test/dataset/";
|
||||
Qajax("empty").then(Qajax.filterSuccess);
|
||||
|
||||
resetDefaults();
|
||||
Qajax.defaults.method = "POST";
|
||||
Qajax("/ECHO", { data: "1234567890\nazerty\nuiopqsdfghjklm\nwxcvbn\n", responseType: "text/plain" }).then(Qajax.filterSuccess);
|
||||
|
||||
resetDefaults();
|
||||
Qajax.getJSON(urlWithOptions(sample01url, { latency: 50 })).then((res) => true, (err) => true, () => true);
|
||||
-251
@@ -1,251 +0,0 @@
|
||||
import qs = require('qs');
|
||||
import * as assert from "power-assert";
|
||||
|
||||
qs.stringify({ a: 'b' });
|
||||
qs.stringify({ a: 'b', c: 'd' }, { delimiter: '&' });
|
||||
|
||||
qs.parse('a=b');
|
||||
qs.parse('a=b&c=d', { delimiter: '&' });
|
||||
|
||||
() => {
|
||||
var obj = qs.parse('a=c');
|
||||
assert.deepEqual(obj, { a: 'c' });
|
||||
|
||||
var str = qs.stringify(obj);
|
||||
assert.equal(str, 'a=c');
|
||||
}
|
||||
|
||||
() => {
|
||||
var plainObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true });
|
||||
assert.deepEqual(plainObject, { a: { hasOwnProperty: 'b' } });
|
||||
}
|
||||
|
||||
() => {
|
||||
var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true });
|
||||
assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } });
|
||||
}
|
||||
|
||||
() => {
|
||||
assert.deepEqual(qs.parse('a%5Bb%5D=c'), {
|
||||
a: { b: 'c' }
|
||||
});
|
||||
}
|
||||
|
||||
() => {
|
||||
assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), {
|
||||
foo: {
|
||||
bar: {
|
||||
baz: 'foobarbaz'
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
() => {
|
||||
var expected = {
|
||||
a: {
|
||||
b: {
|
||||
c: {
|
||||
d: {
|
||||
e: {
|
||||
f: {
|
||||
'[g][h][i]': 'j'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var string = 'a[b][c][d][e][f][g][h][i]=j';
|
||||
assert.deepEqual(qs.parse(string), expected);
|
||||
}
|
||||
|
||||
() => {
|
||||
var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
|
||||
assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } });
|
||||
}
|
||||
|
||||
() => {
|
||||
var limited = qs.parse('a=b&c=d', { parameterLimit: 1 });
|
||||
assert.deepEqual(limited, { a: 'b' });
|
||||
}
|
||||
|
||||
() => {
|
||||
var delimited = qs.parse('a=b;c=d', { delimiter: ';' });
|
||||
assert.deepEqual(delimited, { a: 'b', c: 'd' });
|
||||
}
|
||||
|
||||
() => {
|
||||
var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
|
||||
assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' });
|
||||
}
|
||||
|
||||
() => {
|
||||
var withDots = qs.parse('a.b=c', { allowDots: true });
|
||||
assert.deepEqual(withDots, { a: { b: 'c' } });
|
||||
}
|
||||
|
||||
() => {
|
||||
var withArray = qs.parse('a[]=b&a[]=c');
|
||||
assert.deepEqual(withArray, { a: ['b', 'c'] });
|
||||
}
|
||||
|
||||
() => {
|
||||
var withIndexes = qs.parse('a[1]=c&a[0]=b');
|
||||
assert.deepEqual(withIndexes, { a: ['b', 'c'] });
|
||||
}
|
||||
|
||||
() => {
|
||||
var noSparse = qs.parse('a[1]=b&a[15]=c');
|
||||
assert.deepEqual(noSparse, { a: ['b', 'c'] });
|
||||
}
|
||||
|
||||
() => {
|
||||
var withEmptyString = qs.parse('a[]=&a[]=b');
|
||||
assert.deepEqual(withEmptyString, { a: ['', 'b'] });
|
||||
|
||||
var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c');
|
||||
assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });
|
||||
}
|
||||
|
||||
() => {
|
||||
var withMaxIndex = qs.parse('a[100]=b');
|
||||
assert.deepEqual(withMaxIndex, { a: { '100': 'b' } });
|
||||
}
|
||||
|
||||
() => {
|
||||
var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 });
|
||||
assert.deepEqual(withArrayLimit, { a: { '1': 'b' } });
|
||||
}
|
||||
|
||||
() => {
|
||||
var noParsingArrays = qs.parse('a[]=b', { parseArrays: false });
|
||||
assert.deepEqual(noParsingArrays, { a: { '0': 'b' } });
|
||||
}
|
||||
|
||||
() => {
|
||||
var mixedNotation = qs.parse('a[0]=b&a[b]=c');
|
||||
assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });
|
||||
}
|
||||
|
||||
() => {
|
||||
var arraysOfObjects = qs.parse('a[][b]=c');
|
||||
assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });
|
||||
}
|
||||
|
||||
() => {
|
||||
assert.equal(qs.stringify({ a: 'b' }), 'a=b');
|
||||
assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
|
||||
}
|
||||
|
||||
() => {
|
||||
var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false });
|
||||
assert.equal(unencoded, 'a[b]=c');
|
||||
}
|
||||
|
||||
() => {
|
||||
var encoded = qs.stringify({ a: { b: 'c' } }, {
|
||||
encoder: function (str) {
|
||||
// Passed in values `a`, `b`, `c`
|
||||
return // Return encoded string
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
() => {
|
||||
var decoded = qs.parse('x=z', {
|
||||
decoder: function (str) {
|
||||
// Passed in values `x`, `z`
|
||||
return // Return decoded string
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
() => {
|
||||
qs.stringify({ a: ['b', 'c', 'd'] });
|
||||
// 'a[0]=b&a[1]=c&a[2]=d'
|
||||
}
|
||||
|
||||
() => {
|
||||
qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
|
||||
// 'a=b&a=c&a=d'
|
||||
}
|
||||
|
||||
() => {
|
||||
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
|
||||
// 'a[0]=b&a[1]=c'
|
||||
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
|
||||
// 'a[]=b&a[]=c'
|
||||
qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
|
||||
// 'a=b&a=c'
|
||||
}
|
||||
|
||||
() => {
|
||||
assert.equal(qs.stringify({ a: '' }), 'a=');
|
||||
}
|
||||
|
||||
() => {
|
||||
assert.equal(qs.stringify({ a: null, b: undefined }), 'a=');
|
||||
}
|
||||
|
||||
() => {
|
||||
assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
|
||||
}
|
||||
|
||||
() => {
|
||||
qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: function (prefix, value) {
|
||||
if (prefix == 'b') {
|
||||
// Return an `undefined` value to omit a property.
|
||||
return;
|
||||
}
|
||||
if (prefix == 'e[f]') {
|
||||
return value.getTime();
|
||||
}
|
||||
if (prefix == 'e[g][0]') {
|
||||
return value * 2;
|
||||
}
|
||||
return value;
|
||||
} });
|
||||
// 'a=b&c=d&e[f]=123&e[g][0]=4'
|
||||
qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] });
|
||||
// 'a=b&e=f'
|
||||
qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] });
|
||||
}
|
||||
|
||||
() => {
|
||||
var withNull = qs.stringify({ a: null, b: '' });
|
||||
assert.equal(withNull, 'a=&b=');
|
||||
}
|
||||
|
||||
() => {
|
||||
var equalsInsensitive = qs.parse('a&b=');
|
||||
assert.deepEqual(equalsInsensitive, { a: '', b: '' });
|
||||
}
|
||||
|
||||
() => {
|
||||
var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true });
|
||||
assert.equal(strictNull, 'a&b=');
|
||||
}
|
||||
|
||||
() => {
|
||||
var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true });
|
||||
assert.deepEqual(parsedStrictNull, { a: null, b: '' });
|
||||
}
|
||||
|
||||
() => {
|
||||
var nullsSkipped = qs.stringify({ a: 'b', c: null }, { skipNulls: true });
|
||||
assert.equal(nullsSkipped, 'a=b');
|
||||
}
|
||||
|
||||
() => {
|
||||
var encoder = () => {};
|
||||
var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder });
|
||||
assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I');
|
||||
}
|
||||
|
||||
() => {
|
||||
var decoder = () => {};
|
||||
var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder });
|
||||
assert.deepEqual(obj, { a: 'こんにちは!' });
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
|
||||
import qs = require('query-string');
|
||||
|
||||
|
||||
namespace stringify_tests {
|
||||
let result: string;
|
||||
// test obj
|
||||
result = qs.stringify({
|
||||
str: 'bar',
|
||||
strArray: ['baz'],
|
||||
num: 123,
|
||||
numArray: [456],
|
||||
bool: true,
|
||||
boolArray: [false],
|
||||
});
|
||||
|
||||
// test options
|
||||
result = qs.stringify({ foo: 'bar' }, { strict: false })
|
||||
result = qs.stringify({ foo: 'bar' }, { encode: false })
|
||||
result = qs.stringify({ foo: 'bar' }, { strict: false, encode: false })
|
||||
}
|
||||
|
||||
namespace parse_tests {
|
||||
let result: { [key: string]: string | string[] | null };
|
||||
result = qs.parse('?foo=bar');
|
||||
result = qs.parse('#foo=bar');
|
||||
result = qs.parse('&foo=bar&foo=baz');
|
||||
}
|
||||
|
||||
namespace extract_tests {
|
||||
let result: string;
|
||||
result = qs.extract('http://foo.bar/?abc=def&hij=klm');
|
||||
result = qs.extract('http://foo.bar/?foo=bar');
|
||||
}
|
||||
Vendored
-37
@@ -1,37 +0,0 @@
|
||||
// Type definitions for Rappid 1.5
|
||||
// Project: http://jointjs.com/about-rappid
|
||||
// Definitions by: Ewout Van Gossum <https://github.com/DenEwout>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="jointjs" />
|
||||
|
||||
declare namespace joint {
|
||||
namespace ui {
|
||||
interface Handle {
|
||||
name: string;
|
||||
position: string;
|
||||
icon: string;
|
||||
}
|
||||
|
||||
class SelectionView extends Backbone.Model {
|
||||
paper: joint.dia.Paper;
|
||||
graph: joint.dia.Graph;
|
||||
model: Backbone.Collection<joint.dia.Cell>;
|
||||
|
||||
constructor(opt: {
|
||||
paper: joint.dia.Paper;
|
||||
graph: joint.dia.Graph;
|
||||
model: Backbone.Collection<joint.dia.Cell>
|
||||
});
|
||||
|
||||
createSelectionBox(cellView: joint.dia.CellView): void;
|
||||
destroySelectionBox(cellView: joint.dia.CellView): void;
|
||||
startSelecting(evt: any): void;
|
||||
cancelSelection(): void;
|
||||
|
||||
addHandle(handle: Handle): void;
|
||||
removeHandle(name: string): void;
|
||||
changeHandle(name: string, handle: Handle): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
-113
@@ -1,113 +0,0 @@
|
||||
// Type definitions for react-day-picker v1.2.0
|
||||
// Project: https://github.com/gpbl/react-day-picker
|
||||
// Definitions by: Giampaolo Bellavite <https://github.com/gpbl>, Jason Killian <https://github.com/jkillian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="react" />
|
||||
|
||||
declare module "react-day-picker" {
|
||||
import DayPicker = ReactDayPicker.DayPicker;
|
||||
export = DayPicker;
|
||||
}
|
||||
|
||||
declare var DayPicker: typeof ReactDayPicker.DayPicker;
|
||||
|
||||
declare namespace ReactDayPicker {
|
||||
interface LocaleUtils {
|
||||
formatMonthTitle: (month: Date, locale: string) => string;
|
||||
formatWeekdayShort: (weekday: number, locale: string) => string;
|
||||
formatWeekdayLong: (weekday: number, locale: string) => string;
|
||||
getFirstDayOfWeek: (locale: string) => number;
|
||||
getMonths: (locale: string) => string[];
|
||||
}
|
||||
|
||||
interface DayModifiers {
|
||||
selected?: boolean;
|
||||
disabled?: boolean;
|
||||
[name: string]: boolean | undefined;
|
||||
}
|
||||
|
||||
interface Modifiers {
|
||||
[name: string]: (date: Date) => boolean;
|
||||
}
|
||||
|
||||
interface CaptionElementProps extends React.Props<any> {
|
||||
date?: Date;
|
||||
localeUtils?: LocaleUtils;
|
||||
locale?: string;
|
||||
onClick?: React.MouseEventHandler<{}>;
|
||||
}
|
||||
|
||||
interface NavbarElementProps extends React.Props<any> {
|
||||
className?: string;
|
||||
previousMonth?: Date;
|
||||
nextMonth?: Date;
|
||||
showPreviousButton?: boolean;
|
||||
showNextButton?: boolean;
|
||||
onPreviousClick(): void;
|
||||
onNextClick(): void;
|
||||
dir?: string;
|
||||
localeUtils?: LocaleUtils;
|
||||
locale?: string;
|
||||
|
||||
}
|
||||
|
||||
interface WeekdayElementProps extends React.Props<any> {
|
||||
weekday?: number;
|
||||
className?: string;
|
||||
localeUtils?: LocaleUtils;
|
||||
locale?: string;
|
||||
}
|
||||
|
||||
interface Props extends React.Props<DayPicker>{
|
||||
modifiers?: Modifiers;
|
||||
initialMonth?: Date;
|
||||
numberOfMonths?: number;
|
||||
renderDay?: (date: Date) => number | string | JSX.Element;
|
||||
enableOutsideDays?: boolean;
|
||||
firstDayOfWeek?:number;
|
||||
canChangeMonth?: boolean;
|
||||
disabledDays?: (date: Date) => boolean;
|
||||
fixedWeeks?: boolean;
|
||||
fromMonth?: Date;
|
||||
reverseMonths?: boolean;
|
||||
toMonth?: Date;
|
||||
localeUtils?: LocaleUtils;
|
||||
locale?: string;
|
||||
captionElement?: React.ReactElement<CaptionElementProps>;
|
||||
onDayClick?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any;
|
||||
onDayTouchTap?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any;
|
||||
onDayMouseEnter?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any;
|
||||
onDayMouseLeave?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any;
|
||||
onDayTouchEnd?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any;
|
||||
onDayTouchStart?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any;
|
||||
navbarElement?: React.ReactElement<NavbarElementProps>;
|
||||
weekdayElement?: React.ReactElement<WeekdayElementProps>;
|
||||
onMonthChange?: (month: Date) => any;
|
||||
onCaptionClick?: (e: React.SyntheticEvent<{}>, month: Date) => any;
|
||||
className?: string;
|
||||
selectedDays?: (date: Date) => boolean;
|
||||
style?: React.CSSProperties;
|
||||
tabIndex?: number;
|
||||
}
|
||||
|
||||
class DayPicker extends React.Component<Props, {}> {
|
||||
showMonth(month: Date): void;
|
||||
showPreviousMonth(): void;
|
||||
showNextMonth(): void;
|
||||
}
|
||||
|
||||
namespace DayPicker {
|
||||
var LocaleUtils: LocaleUtils;
|
||||
namespace DateUtils {
|
||||
function addMonths(d: Date, n: number): Date;
|
||||
function clone(d: Date): Date;
|
||||
function isSameDay(d1?: Date, d2?: Date): boolean;
|
||||
function isPastDay(d: Date): boolean;
|
||||
function isDayBetween(day: Date, startDate: Date, endDate: Date): boolean;
|
||||
function addDayToRange(day: Date, range: { from?: Date, to?: Date }): { from?: Date, to?: Date };
|
||||
function isDayInRange(day: Date, range: { from?: Date, to?: Date }): boolean;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
import * as React from 'react';
|
||||
import * as DayPicker2 from "react-day-picker";
|
||||
|
||||
function isSunday(day: Date) {
|
||||
return day.getDay() === 0;
|
||||
}
|
||||
|
||||
// make sure global variable version works
|
||||
function MyComponent2() {
|
||||
return <DayPicker ref="foo" initialMonth={ new Date(2016, 1) } localeUtils={DayPicker.LocaleUtils} modifiers={{ isSunday }} />
|
||||
}
|
||||
DayPicker.DateUtils.clone(new Date());
|
||||
DayPicker.DateUtils.isDayInRange(new Date(), {from: new Date()});
|
||||
|
||||
// make sure imported version works
|
||||
function MyComponent() {
|
||||
return <DayPicker2 ref="foo" initialMonth={ new Date(2016, 1) } localeUtils={DayPicker2.LocaleUtils} modifiers={{ isSunday }} />
|
||||
}
|
||||
DayPicker2.DateUtils.clone(new Date());
|
||||
DayPicker2.DateUtils.isDayInRange(new Date(), { from: new Date() });
|
||||
|
||||
// test interface for captionElement prop
|
||||
interface MyCaptionProps extends ReactDayPicker.CaptionElementProps { }
|
||||
class Caption extends React.Component<MyCaptionProps, {}> {
|
||||
render() {
|
||||
const { date, locale, localeUtils, onClick } = this.props;
|
||||
|
||||
if (!date || !localeUtils || typeof locale === 'undefined') {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="DayPicker-Caption" onClick={ onClick }>
|
||||
{ localeUtils.formatMonthTitle(date, locale) }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
<DayPicker captionElement={<Caption/>}/>
|
||||
Vendored
-8374
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
||||
import * as React from "react";
|
||||
import ReactPaginate = require("react-paginate");
|
||||
|
||||
class Test extends React.Component<{}, {}> {
|
||||
public render() {
|
||||
return (
|
||||
<ReactPaginate
|
||||
pageCount={1}
|
||||
pageRangeDisplayed={10}
|
||||
marginPagesDisplayed={2}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
Vendored
-49
@@ -1,49 +0,0 @@
|
||||
// Type definitions for redux-logger v2.6.0
|
||||
// Project: https://github.com/fcomb/redux-logger
|
||||
// Definitions by: Alexander Rusakov <https://github.com/arusakov/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as Redux from "redux";
|
||||
|
||||
// Trickery to get TypeScript to accept that our anonymous, non-default export is a function.
|
||||
// see https://github.com/Microsoft/TypeScript/issues/3612 for more
|
||||
declare namespace createLogger {
|
||||
export type LoggerPredicate = (getState: () => any, action: any) => boolean;
|
||||
|
||||
export type StateToString = (state: any) => string;
|
||||
export type ActionToString = (action: any) => string;
|
||||
export type ErrorToString = (error: any, prevState: any) => string;
|
||||
|
||||
export interface ColorsObject {
|
||||
title?: boolean | ActionToString;
|
||||
prevState?: boolean | StateToString;
|
||||
action?: boolean | ActionToString;
|
||||
nextState?: boolean | StateToString;
|
||||
error?: boolean | ErrorToString;
|
||||
}
|
||||
|
||||
export interface LevelObject {
|
||||
prevState?: string | boolean | StateToString;
|
||||
action?: string | boolean | ActionToString;
|
||||
nextState?: string | boolean | StateToString;
|
||||
error?: string | boolean | ErrorToString;
|
||||
}
|
||||
|
||||
export interface ReduxLoggerOptions {
|
||||
level?: string | ActionToString | LevelObject;
|
||||
duration?: boolean;
|
||||
timestamp?: boolean;
|
||||
colors?: ColorsObject;
|
||||
logger?: any;
|
||||
logErrors?: boolean;
|
||||
collapsed?: boolean | LoggerPredicate;
|
||||
predicate?: LoggerPredicate;
|
||||
stateTransformer?: (state: any) => any;
|
||||
actionTransformer?: (action: any) => any;
|
||||
errorTransformer?: (error: any) => any;
|
||||
diff?: boolean;
|
||||
diffPredicate?: LoggerPredicate;
|
||||
}
|
||||
}
|
||||
declare function createLogger(options?: createLogger.ReduxLoggerOptions): Redux.Middleware;
|
||||
export = createLogger;
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
// Type definitions for redux-persist-transform-compress 4.1
|
||||
// Project: https://github.com/rt2zz/redux-persist-transform-compress
|
||||
// Definitions by: Karol Janyst <https://github.com/LKay>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { PersistConfig, PersistTransformer } from "redux-persist";
|
||||
|
||||
export = createCompressor;
|
||||
declare function createCompressor (config?: PersistConfig): PersistTransformer;
|
||||
@@ -1,11 +0,0 @@
|
||||
import { createStore, Reducer, Store } from "redux"
|
||||
import { createPersistor, Persistor, PersistTransformer } from "redux-persist"
|
||||
import createCompressor = require("redux-persist-transform-compress")
|
||||
|
||||
const reducer: Reducer<any> = (state: any, action: any) => ({})
|
||||
|
||||
const compressor: PersistTransformer = createCompressor({ whitelist : ["foo"] })
|
||||
|
||||
const store: Store<any> = createStore(reducer)
|
||||
|
||||
const persistor: Persistor = createPersistor(store, { transforms : [compressor] })
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
// Type definitions for redux-persist-transform-encrypt 0.1
|
||||
// Project: https://github.com/maxdeviant/redux-persist-transform-encrypt#readme
|
||||
// Definitions by: Karol Janyst <https://github.com/LKay>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { PersistTransformer } from "redux-persist";
|
||||
|
||||
export as namespace ReduxPersistEncryptor;
|
||||
|
||||
export = createEncryptor;
|
||||
|
||||
declare function createEncryptor (config: createEncryptor.EncryptorConfig): PersistTransformer;
|
||||
|
||||
declare namespace createEncryptor {
|
||||
export interface EncryptorConfig {
|
||||
secretKey: string;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import { createStore, Reducer, Store } from "redux"
|
||||
import { createPersistor, Persistor, PersistTransformer } from "redux-persist"
|
||||
import { EncryptorConfig } from "redux-persist-transform-encrypt"
|
||||
import * as createEncryptor from "redux-persist-transform-encrypt"
|
||||
|
||||
const reducer: Reducer<any> = (state: any, action: any) => ({})
|
||||
|
||||
const config: EncryptorConfig = { secretKey : "foo" }
|
||||
const encryptor: PersistTransformer = createEncryptor(config)
|
||||
|
||||
const store: Store<any> = createStore(reducer)
|
||||
|
||||
const persistor: Persistor = createPersistor(store, { transforms : [encryptor] })
|
||||
@@ -1,15 +0,0 @@
|
||||
import { createStore, Reducer, Store } from "redux"
|
||||
import { createPersistor, Persistor, PersistTransformer } from "redux-persist"
|
||||
import createFilter from "redux-persist-transform-filter"
|
||||
|
||||
const reducer: Reducer<any> = (state: any, action: any) => ({})
|
||||
|
||||
const filter: PersistTransformer = createFilter(
|
||||
"foo",
|
||||
["foo.bar"],
|
||||
["fizz.buzz"]
|
||||
)
|
||||
|
||||
const store: Store<any> = createStore(reducer)
|
||||
|
||||
const persistor: Persistor = createPersistor(store, { transforms : [filter] })
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
export const KEY_PREFIX: string;
|
||||
export const REHYDRATE: string;
|
||||
Vendored
-66
@@ -1,66 +0,0 @@
|
||||
// Type definitions for redux-persist 4.0
|
||||
// Project: https://github.com/rt2zz/redux-persist
|
||||
// Definitions by: Karol Janyst <https://github.com/LKay>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Action, GenericStoreEnhancer, Store } from "redux";
|
||||
|
||||
export interface PersistAction<S> extends Action {
|
||||
payload?: S;
|
||||
error?: any;
|
||||
}
|
||||
|
||||
export interface PersistorRehydrateOptions {
|
||||
serial?: boolean;
|
||||
}
|
||||
|
||||
export interface Persistor {
|
||||
purge(keys?: string[]): void;
|
||||
rehydrate<A>(incoming: A, options?: PersistorRehydrateOptions): A;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
}
|
||||
|
||||
export type PersistCallback<A> = (err: any, response?: A) => void;
|
||||
|
||||
export interface PersistTransformer {
|
||||
in(state: any, key: string): any;
|
||||
out(state: any, key: string): any;
|
||||
}
|
||||
|
||||
export interface PersistStorage {
|
||||
setItem(key: string, value: any, callback?: PersistCallback<void>): Promise<void>;
|
||||
getItem<A>(key: string, callback?: PersistCallback<A>): Promise<A>;
|
||||
removeItem(key: string, callback?: PersistCallback<void>): Promise<void>;
|
||||
getAllKeys<A>(callback?: PersistCallback<A>): Promise<A>;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type PersistStateReconciler<A, B, C> = (state: A, inboundState: B, reducedState: C, log?: boolean) => C;
|
||||
|
||||
export interface PersistAutoRehydrateConfig<A, B, C> {
|
||||
stateReconcile?: PersistStateReconciler<A, B, C>;
|
||||
}
|
||||
|
||||
export interface PersistConfig {
|
||||
whitelist?: string[];
|
||||
blacklist?: string[];
|
||||
transforms?: PersistTransformer[];
|
||||
storage?: PersistStorage;
|
||||
debounce?: number;
|
||||
keyPrefix?: string;
|
||||
serialize?: (data: any) => string;
|
||||
deserialize?: (data: string) => any;
|
||||
}
|
||||
|
||||
export function autoRehydrate<A, B ,C> (config?: PersistAutoRehydrateConfig<A, B, C>): GenericStoreEnhancer;
|
||||
|
||||
export function createPersistor<A> (store: Store<A>, config?: PersistConfig): Persistor;
|
||||
|
||||
export function createTransform (inbound: any, outbound: any, config?: PersistConfig): PersistTransformer;
|
||||
|
||||
export function getStoredState(config?: PersistConfig, callback?: PersistCallback<any>): Promise<any>;
|
||||
|
||||
export function persistStore<A> (store: Store<A>, config?: PersistConfig, callback?: PersistCallback<any>): Persistor;
|
||||
|
||||
export function purgeStoredState (config?: PersistConfig, keys?: string[]): Promise<void>;
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"redux": "^3.6.0"
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
import { createStore, Store, Reducer } from "redux"
|
||||
import {
|
||||
autoRehydrate,
|
||||
createPersistor,
|
||||
createTransform,
|
||||
getStoredState,
|
||||
persistStore,
|
||||
purgeStoredState,
|
||||
PersistConfig,
|
||||
PersistAutoRehydrateConfig,
|
||||
PersistCallback,
|
||||
Persistor,
|
||||
PersistorRehydrateOptions,
|
||||
PersistTransformer
|
||||
} from "redux-persist"
|
||||
import { KEY_PREFIX, REHYDRATE } from "redux-persist/constants"
|
||||
import { asyncLocalStorage, asyncSessionStorage } from "redux-persist/storages"
|
||||
|
||||
const reducer: Reducer<any> = (state: any, action: any) => ({})
|
||||
|
||||
const persistCallback: PersistCallback<any> = (err: any, response: any) => {}
|
||||
|
||||
const transform: PersistTransformer = createTransform({}, {}, { whitelist : ["foo"] })
|
||||
|
||||
const persistConfig: PersistConfig = {
|
||||
blacklist : ["foo"],
|
||||
whitelist : ["bar"],
|
||||
storage : asyncLocalStorage,
|
||||
transforms : [transform],
|
||||
debounce : 1000,
|
||||
keyPrefix : KEY_PREFIX
|
||||
}
|
||||
|
||||
const rehydrateOptions: PersistorRehydrateOptions = { serial : true }
|
||||
|
||||
const autoRehydrateConfig: PersistAutoRehydrateConfig<any, any, any> = {
|
||||
stateReconcile: (state: any, inboundState: any, reducedState: any, log: boolean) => ({})
|
||||
}
|
||||
|
||||
const store: Store<any> = createStore(reducer, autoRehydrate(autoRehydrateConfig))
|
||||
const persistor: Persistor = persistStore(store, persistConfig, persistCallback)
|
||||
|
||||
purgeStoredState({ whitelist : ["foo"] }, ["bar"])
|
||||
|
||||
getStoredState(persistConfig, (err: any, restoredState: any) => {
|
||||
const store: Store<any> = createStore(reducer, restoredState)
|
||||
const persistor: Persistor = createPersistor(store, persistConfig)
|
||||
const secondaryPersistor: Persistor = createPersistor(store, { storage : asyncSessionStorage })
|
||||
persistor.pause()
|
||||
persistor.resume()
|
||||
persistor.purge(["foo", "bar"])
|
||||
persistor.rehydrate(restoredState, rehydrateOptions)
|
||||
})
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
import { PersistStorage } from "redux-persist";
|
||||
|
||||
export const asyncLocalStorage: PersistStorage;
|
||||
export const asyncSessionStorage: PersistStorage;
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"constants.d.ts",
|
||||
"storages.d.ts",
|
||||
"redux-persist-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"redux": "^3.6.0"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"redux": "^3.6.0"
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,11 @@
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import assert = require("assert");
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import JSON = require("comment-json");
|
||||
|
||||
function repeat(s: string, count: number) {
|
||||
return Array(count + 1).join(s);
|
||||
}
|
||||
|
||||
const home = path.join(__dirname, '..');
|
||||
const home = path.join(__dirname, "..", "types");
|
||||
|
||||
for (const dirName of fs.readdirSync(home)) {
|
||||
if (dirName.startsWith(".") || dirName === "node_modules" || dirName === "scripts") {
|
||||
|
||||
+5
-3
@@ -4,9 +4,11 @@ const execSync = require("child_process").execSync;
|
||||
const existsSync = require("fs").existsSync;
|
||||
const path = require("path");
|
||||
|
||||
const pkgPath = path.join("types", pkg);
|
||||
|
||||
// Path of tslint when `types-publisher` is symlinked
|
||||
const symlinkedTslintPath = "../node_modules/types-publisher/node_modules/tslint"
|
||||
let tslintPath = existsSync(path.join(pkg, symlinkedTslintPath)) ? symlinkedTslintPath : "../node_modules/tslint";
|
||||
const symlinkedTslintPath = "../../node_modules/types-publisher/node_modules/tslint"
|
||||
let tslintPath = existsSync(path.join(pkgPath, symlinkedTslintPath)) ? symlinkedTslintPath : "../node_modules/tslint";
|
||||
// An older version (e.g. abs/v0) is in a nested directory, so needs to look one more level up for tslint.
|
||||
if (pkg.includes("/") && pkg[pkg.length - 1] !== "/") {
|
||||
tslintPath = path.join("..", tslintPath);
|
||||
@@ -17,7 +19,7 @@ console.log(cmd);
|
||||
|
||||
try {
|
||||
// Child process writes directly to our own stdout
|
||||
execSync(cmd, { cwd: pkg, stdio: "inherit" });
|
||||
execSync(cmd, { cwd: pkgPath, stdio: "inherit" });
|
||||
} catch (_) {
|
||||
// Process should have printed out error info
|
||||
}
|
||||
|
||||
@@ -13,9 +13,10 @@ if (process.argv.length !== 5 && process.argv.length !== 6) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
rmdirRecursive(typingsPackageName);
|
||||
rmdirRecursive(path.join("types", typingsPackageName));
|
||||
const notNeededPackages = JSON.parse(fs.readFileSync("notNeededPackages.json", "utf-8"));
|
||||
notNeededPackages.packages.push({ libraryName, typingsPackageName, sourceRepoURL, asOfVersion });
|
||||
notNeededPackages.packages.sort((x, y) => x.typingsPackageName < y.typingsPackageName ? -1 : 1);
|
||||
fs.writeFileSync("notNeededPackages.json", JSON.stringify(notNeededPackages, undefined, 4), "utf-8");
|
||||
|
||||
function rmdirRecursive(dir) {
|
||||
|
||||
@@ -4,9 +4,13 @@
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitThis": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"baseUrl": "../types",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
"../types"
|
||||
],
|
||||
"types": [],
|
||||
"forceConsistentCasingInFileNames": true
|
||||
|
||||
Vendored
-226
@@ -1,226 +0,0 @@
|
||||
// Type definitions for Toastr 2.1.3
|
||||
// Project: https://github.com/CodeSeven/toastr
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
interface ToastrOptions {
|
||||
/**
|
||||
* Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery.
|
||||
*/
|
||||
showEasing?: string;
|
||||
/**
|
||||
* Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery.
|
||||
*/
|
||||
hideEasing?: string;
|
||||
/**
|
||||
* Use the jQuery show/hide method of your choice. These default to fadeIn/fadeOut. The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery.
|
||||
*/
|
||||
showMethod?: string;
|
||||
/**
|
||||
* Use the jQuery show/hide method of your choice. These default to fadeIn/fadeOut. The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery.
|
||||
*/
|
||||
hideMethod?: string;
|
||||
/**
|
||||
* Should a close button be shown
|
||||
*/
|
||||
closeButton?: boolean;
|
||||
/**
|
||||
* Html for the close button
|
||||
*/
|
||||
closeHtml?: string;
|
||||
/**
|
||||
* Should clicking on toast dismiss it?
|
||||
*/
|
||||
tapToDismiss?: boolean;
|
||||
/**
|
||||
* CSS class the toast element will be given
|
||||
*/
|
||||
toastClass?: string;
|
||||
/**
|
||||
* Id toast container will be given
|
||||
*/
|
||||
containerId?: string;
|
||||
/**
|
||||
* Should debug details be outputted to the console
|
||||
*/
|
||||
debug?: boolean;
|
||||
/**
|
||||
* Time in milliseconds the toast should take to show
|
||||
*/
|
||||
showDuration?: number;
|
||||
/**
|
||||
* onShown function callback
|
||||
**/
|
||||
onShown?: () => void;
|
||||
/**
|
||||
* Time in milliseconds the toast should take to hide
|
||||
*/
|
||||
hideDuration?: number;
|
||||
/**
|
||||
* onHidden function callback
|
||||
**/
|
||||
onHidden?: () => void;
|
||||
/**
|
||||
* Time in milliseconds the toast should be displayed after mouse over
|
||||
*/
|
||||
extendedTimeOut?: number;
|
||||
iconClasses?: {
|
||||
/**
|
||||
* Icon to use on error toasts
|
||||
*/
|
||||
error: string;
|
||||
/**
|
||||
* Icon to use on info toasts
|
||||
*/
|
||||
info: string;
|
||||
/**
|
||||
* Icon to use on success toasts
|
||||
*/
|
||||
success: string;
|
||||
/**
|
||||
* Icon to use on warning toasts
|
||||
*/
|
||||
warning: string;
|
||||
};
|
||||
/**
|
||||
* Icon to use for toast
|
||||
*/
|
||||
iconClass?: string;
|
||||
/**
|
||||
* Where toast should be displayed
|
||||
*/
|
||||
positionClass?: string;
|
||||
/**
|
||||
* Where toast should be displayed - background
|
||||
*/
|
||||
backgroundpositionClass?: string;
|
||||
/**
|
||||
* Time in milliseconds that the toast should be displayed
|
||||
*/
|
||||
timeOut?: number;
|
||||
/**
|
||||
* CSS class the title element will be given
|
||||
*/
|
||||
titleClass?: string;
|
||||
/**
|
||||
* CSS class the message element will be given
|
||||
*/
|
||||
messageClass?: string;
|
||||
/**
|
||||
* Set newest toast to appear on top
|
||||
**/
|
||||
newestOnTop?: boolean;
|
||||
/**
|
||||
* The element to put the toastr container
|
||||
**/
|
||||
target?: string;
|
||||
/**
|
||||
* Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content.
|
||||
*/
|
||||
preventDuplicates?: boolean;
|
||||
/**
|
||||
* Visually indicates how long before a toast expires.
|
||||
*/
|
||||
progressBar?: boolean;
|
||||
/**
|
||||
* Function to execute on toast click
|
||||
*/
|
||||
onclick?: () => void;
|
||||
/**
|
||||
* Set if toastr should parse containing html
|
||||
**/
|
||||
allowHtml?: boolean;
|
||||
/**
|
||||
* Set if toastr should escape html
|
||||
**/
|
||||
escapeHtml?: boolean;
|
||||
}
|
||||
|
||||
interface ToastrDisplayMethod {
|
||||
/**
|
||||
* Create a toast
|
||||
*
|
||||
* @param message Message to display in toast
|
||||
*/
|
||||
(message: string): JQuery;
|
||||
/**
|
||||
* Create a toast
|
||||
*
|
||||
* @param message Message to display in toast
|
||||
* @param title Title to display on toast
|
||||
*/
|
||||
(message: string, title: string): JQuery;
|
||||
/**
|
||||
* Create a toast
|
||||
*
|
||||
* @param message Message to display in toast
|
||||
* @param title Title to display on toast
|
||||
* @param overrides Option values for toast
|
||||
*/
|
||||
(message: string, title: string, overrides: ToastrOptions): JQuery;
|
||||
}
|
||||
|
||||
interface Toastr {
|
||||
/**
|
||||
* Clear toasts
|
||||
*/
|
||||
clear: {
|
||||
/**
|
||||
* Clear all toasts
|
||||
*/
|
||||
(): void;
|
||||
/**
|
||||
* Clear specific toast
|
||||
*
|
||||
* @param toast Toast to clear
|
||||
*/
|
||||
(toast: JQuery): void;
|
||||
/**
|
||||
* Clear specific toast
|
||||
*
|
||||
* @param toast Toast to clear
|
||||
* @param clearOptions force clearing a toast, ignoring focus
|
||||
*/
|
||||
(toast: JQuery, clearOptions: { force: boolean }): void;
|
||||
};
|
||||
/**
|
||||
* Removes all toasts (without animation)
|
||||
*/
|
||||
remove: {
|
||||
(): void;
|
||||
};
|
||||
/**
|
||||
* Create an error toast
|
||||
*/
|
||||
error: ToastrDisplayMethod;
|
||||
/**
|
||||
* Create an info toast
|
||||
*/
|
||||
info: ToastrDisplayMethod;
|
||||
/**
|
||||
* Create an options object
|
||||
*/
|
||||
options: ToastrOptions;
|
||||
/**
|
||||
* Create a success toast
|
||||
*/
|
||||
success: ToastrDisplayMethod;
|
||||
/**
|
||||
* Create a warning toast
|
||||
*/
|
||||
warning: ToastrDisplayMethod;
|
||||
/**
|
||||
* Get toastr version
|
||||
*/
|
||||
version: string;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
declare var toastr: Toastr;
|
||||
declare module "toastr" {
|
||||
export = toastr;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ "extends": "./node_modules/types-publisher/tslint-definitions.json" }
|
||||
+2
-2
@@ -444,7 +444,7 @@ declare namespace ablyLib {
|
||||
}
|
||||
}
|
||||
|
||||
export declare class Rest {
|
||||
export class Rest {
|
||||
constructor(options: ablyLib.ClientOptions | string);
|
||||
static Crypto: ablyLib.Crypto;
|
||||
static Message: ablyLib.MessageStatic;
|
||||
@@ -456,7 +456,7 @@ export declare class Rest {
|
||||
time: (paramsOrCallback?: ablyLib.timeCallback | any, callback?: ablyLib.timeCallback) => void;
|
||||
}
|
||||
|
||||
export declare class Realtime {
|
||||
export class Realtime {
|
||||
constructor(options: ablyLib.ClientOptions | string);
|
||||
static Crypto: ablyLib.Crypto;
|
||||
static Message: ablyLib.MessageStatic;
|
||||
+2
-2
@@ -4,11 +4,11 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace accepts {
|
||||
export interface Headers {
|
||||
interface Headers {
|
||||
[key: string]: string | string[];
|
||||
}
|
||||
|
||||
export interface Accepts {
|
||||
interface Accepts {
|
||||
/**
|
||||
* Return the first accepted charset. If nothing in `charsets` is accepted, then `false` is returned.
|
||||
*/
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user