mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Merge remote-tracking branch 'DefinitelyTyped/master'
This commit is contained in:
@@ -118,7 +118,7 @@ You may edit the `tsconfig.json` to add new files, to add `"target": "es6"` (nee
|
||||
|
||||
DefinitelyTyped members routinely monitor for new PRs, though keep in mind that the number of other PRs may slow things down.
|
||||
|
||||
For a good example package, see [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/base64-js).
|
||||
For a good example package, see [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js).
|
||||
|
||||
|
||||
#### Common mistakes
|
||||
@@ -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": {
|
||||
@@ -191,7 +191,7 @@ If you're adding a new major version of a library, you can copy `index.d.ts` to
|
||||
#### I notice some packages having a `package.json` here.
|
||||
|
||||
Usually you won't need this. When publishing a package we will normally automatically create a `package.json` for it.
|
||||
A `package.json` may be included for the sake of specifying dependencies. Here's an [example](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/pikaday/package.json).
|
||||
A `package.json` may be included for the sake of specifying dependencies. Here's an [example](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json).
|
||||
We do not allow other fields, such as `"description"`, to be defined manually.
|
||||
Also, if you need to reference an older version of typings, you must do that by adding `"dependencies": { "@types/foo": "x.y.z" }` to the package.json.
|
||||
|
||||
@@ -231,7 +231,7 @@ Before making your change, please create a new subfolder with the current versio
|
||||
1. Update the relative paths in `tsconfig.json` as well as `tslint.json`.
|
||||
2. Add path mapping rules to ensure that tests are running against the intended version.
|
||||
|
||||
For example [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/history/v2/tsconfig.json) looks like:
|
||||
For example [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) looks like:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -250,11 +250,15 @@ For example [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/Defi
|
||||
```
|
||||
|
||||
Please note that unless upgrading something backwards-compatible like `node`, all packages depending of the updated package need a path mapping to it, as well as packages depending on *those*.
|
||||
For example, `react-router` depends on `history@2`, so [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/react-router/tsconfig.json) has a path mapping to `"history": [ "history/v2" ]`;
|
||||
transitively `react-router-bootstrap` (which depends on `react-router`) also adds a path mapping in its [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/react-router-bootstrap/tsconfig.json).
|
||||
For example, `react-router` depends on `history@2`, so [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) has a path mapping to `"history": [ "history/v2" ]`;
|
||||
transitively `react-router-bootstrap` (which depends on `react-router`) also adds a path mapping in its [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json).
|
||||
|
||||
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,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/auth0-js": "latest"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/auth0-js": "latest"
|
||||
}
|
||||
}
|
||||
@@ -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,8 +0,0 @@
|
||||
|
||||
|
||||
import d3dsv = require("d3-dsv");
|
||||
|
||||
var csv = d3dsv(",");
|
||||
|
||||
var rows = csv.parse("a,b,c\n1,2,3\n4,5,6");
|
||||
|
||||
@@ -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
-140
@@ -1,140 +0,0 @@
|
||||
// Type definitions for heatmap.js v2.0
|
||||
// Project: https://github.com/pa7/heatmap.js/
|
||||
// Definitions by: Yang Guan <https://github.com/lookuptable>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="leaflet" />
|
||||
|
||||
/*
|
||||
* Configuration object of a heatmap
|
||||
*/
|
||||
interface HeatmapConfiguration {
|
||||
|
||||
/*
|
||||
* A background color string in form of hexcode, color name, or rgb(a)
|
||||
*/
|
||||
backgroundColor?: string;
|
||||
|
||||
/*
|
||||
* The blur factor that will be applied to all datapoints. The higher the
|
||||
* blur factor is, the smoother the gradients will be
|
||||
* Default value: 0.85
|
||||
*/
|
||||
blur?: number;
|
||||
|
||||
/*
|
||||
* An object that represents the gradient
|
||||
*/
|
||||
gradient?: any;
|
||||
|
||||
/*
|
||||
* The property name of your latitude coordinate in a datapoint
|
||||
* Default value: 'x'
|
||||
*/
|
||||
latField?: string;
|
||||
|
||||
/*
|
||||
* The property name of your longitude coordinate in a datapoint
|
||||
* Default value: 'y'
|
||||
*/
|
||||
lngField?: string;
|
||||
|
||||
/*
|
||||
* The maximal opacity the highest value in the heatmap will have. (will be
|
||||
* overridden if opacity set)
|
||||
* Default value: 0.6
|
||||
*/
|
||||
maxOpacity?: number;
|
||||
|
||||
/*
|
||||
* The minimum opacity the lowest value in the heatmap will have (will be
|
||||
* overridden if opacity set)
|
||||
*/
|
||||
minOpacity?: number;
|
||||
|
||||
/*
|
||||
* A global opacity for the whole heatmap. This overrides maxOpacity and
|
||||
* minOpacity if set
|
||||
*/
|
||||
opacity?: number;
|
||||
|
||||
/*
|
||||
* The radius each datapoint will have (if not specified on the datapoint
|
||||
* itself)
|
||||
*/
|
||||
radius?: number;
|
||||
|
||||
/**
|
||||
* Scales the radius based on map zoom.
|
||||
*/
|
||||
scaleRadius?: boolean;
|
||||
|
||||
/*
|
||||
* Indicate whether the heatmap should use a global extrema or a local
|
||||
* extrema (the maximum and minimum of the currently displayed viewport)
|
||||
*/
|
||||
useLocalExtrema?: boolean;
|
||||
|
||||
/*
|
||||
* The property name of the value/weight in a datapoint
|
||||
* Default value: 'value'
|
||||
*/
|
||||
valueField?: string;
|
||||
}
|
||||
|
||||
/*
|
||||
* A single data point on a heatmap. The keys are specified by
|
||||
* HeatmapConfig.latField, HeatmapConfig.lngField and HeatmapConfig.valueField
|
||||
*/
|
||||
interface HeatmapDataPoint {
|
||||
[index: string]: number;
|
||||
}
|
||||
|
||||
/*
|
||||
* An object representing the set of data points on a heatmap
|
||||
*/
|
||||
interface HeatmapData {
|
||||
|
||||
/*
|
||||
* An array of HeatmapDataPoints
|
||||
*/
|
||||
data: HeatmapDataPoint[];
|
||||
|
||||
/*
|
||||
* Max value of the valueField
|
||||
*/
|
||||
max?: number;
|
||||
|
||||
/*
|
||||
* Min value of the valueField
|
||||
*/
|
||||
min?: number;
|
||||
}
|
||||
|
||||
/*
|
||||
* The overlay layer to be added onto leaflet map
|
||||
*/
|
||||
declare class HeatmapOverlay {
|
||||
|
||||
/*
|
||||
* Initialization function
|
||||
*/
|
||||
constructor(configuration: HeatmapConfiguration)
|
||||
|
||||
/*
|
||||
* Create DOM elements for an overlay, adding them to map panes and puts
|
||||
* listeners on relevant map events
|
||||
*/
|
||||
onAdd(map: L.Map): void;
|
||||
|
||||
/*
|
||||
* Remove the overlay's elements from the DOM and remove listeners
|
||||
* previously added by onAdd()
|
||||
*/
|
||||
onRemove(map: L.Map): void;
|
||||
|
||||
/*
|
||||
* Initialize a heatmap instance with the given dataset
|
||||
*/
|
||||
setData(data: HeatmapData): void;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/leaflet": "^0.7"
|
||||
}
|
||||
}
|
||||
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`]");
|
||||
@@ -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,7 +0,0 @@
|
||||
{
|
||||
"extends": "../tslint.json",
|
||||
|
||||
"noImplicitAny": "true",
|
||||
"noImplicitThis": "true",
|
||||
"strictNullChecks": "true"
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/leaflet": "^0.7"
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"leaflet-curve-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/leaflet": "^0.7"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/leaflet": "^0.7"
|
||||
}
|
||||
}
|
||||
-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 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/leaflet": "^0.7"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/leaflet": "^1.0"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/leaflet": "^0.7"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/leaflet": "^0.7"
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"leaflet.fullscreen-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -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
-411
@@ -1,411 +0,0 @@
|
||||
// Type definitions for Mapbox 1.6
|
||||
// Project: https://www.mapbox.com/mapbox.js/
|
||||
// Definitions by: Maxime Fabre <https://github.com/anahkiasen/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="leaflet"/>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////// MAP OBJECT /////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Map
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
var accessToken: string;
|
||||
|
||||
/**
|
||||
* Create and automatically configure a map with layers, markers, and interactivity.
|
||||
*/
|
||||
function map(element: string|Element, idOrTileJson: any, options?: MapOptions): L.mapbox.Map;
|
||||
|
||||
interface MapOptions extends L.Map.MapOptions {
|
||||
featureLayer?: FeatureLayerOptions;
|
||||
gridLayer?: any;
|
||||
tileLayer?: TileLayerOptions;
|
||||
infoControl?: ControlOptions;
|
||||
legendControl?: ControlOptions;
|
||||
shareControl?: ShareControlOptions;
|
||||
}
|
||||
|
||||
type FilterFunction = (feature: any) => boolean;
|
||||
|
||||
interface Map extends L.Map {
|
||||
tileLayer: L.mapbox.TileLayer;
|
||||
gridLayer: L.mapbox.GridLayer;
|
||||
featureLayer: L.mapbox.FeatureLayer;
|
||||
|
||||
gridControl: L.mapbox.GridControl;
|
||||
infoControl: L.mapbox.InfoControl;
|
||||
legendControl: L.mapbox.LegendControl;
|
||||
shareControl: L.mapbox.ShareControl;
|
||||
|
||||
getTileJSON(): any;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////// LAYERS ///////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// TileLayer
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
/**
|
||||
* You can add a tiled layer to your map with L.mapbox.tileLayer(), a simple interface to layers from Mapbox and elsewhere.
|
||||
*/
|
||||
function tileLayer(idOrTileJson: string, options?: TileLayerOptions): L.mapbox.TileLayer;
|
||||
|
||||
interface TileLayerOptions extends L.TileLayerOptions {
|
||||
retinaVersion?: string;
|
||||
}
|
||||
|
||||
interface TileLayer extends L.TileLayer {
|
||||
|
||||
/**
|
||||
* Returns this layer's TileJSON object which determines its tile source, zoom bounds and other metadata.
|
||||
*/
|
||||
getTileJSON(): any;
|
||||
|
||||
/**
|
||||
* Set the image format of tiles in this layer. You can use lower-quality tiles in order to load maps faster
|
||||
*/
|
||||
setFormat(format: string): TileLayer;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// GridLayer
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
/**
|
||||
* An L.mapbox.gridLayer loads UTFGrid tiles of interactivity into your map, which you can easily access with L.mapbox.gridControl.
|
||||
*/
|
||||
function gridLayer(idOrTileJson: any): L.mapbox.GridLayer;
|
||||
|
||||
interface GridLayer {
|
||||
|
||||
active(): boolean;
|
||||
addTo(map: L.mapbox.Map): any;
|
||||
onAdd(map: L.mapbox.Map): any;
|
||||
onRemove(): any;
|
||||
|
||||
/**
|
||||
* Bind an event handler to a given event on this L.mapbox.gridLayer instance. GridLayers expose a number of useful events that give you access to UTFGrid data as the user interacts with the map.
|
||||
*/
|
||||
on(event: string, handler: Function, context?: any): any;
|
||||
|
||||
/**
|
||||
* Returns this layer's TileJSON object which determines its tile source, zoom bounds and other metadata.
|
||||
*/
|
||||
getTileJSON(): any;
|
||||
|
||||
/**
|
||||
* Load data for a given latitude, longitude point on the map, and call the callback function with that data, if any.
|
||||
*/
|
||||
getData(latlng: L.LatLng, callback: Function): any;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// FeatureLayer
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
/**
|
||||
* L.mapbox.featureLayer provides an easy way to integrate GeoJSON from Mapbox and elsewhere into your map.
|
||||
*/
|
||||
function featureLayer(idOrGeoJson?: any, options?: FeatureLayerOptions): L.mapbox.FeatureLayer;
|
||||
|
||||
interface FeatureLayerOptions {
|
||||
filter?: FilterFunction;
|
||||
sanitizer?: (template: string) => string;
|
||||
}
|
||||
|
||||
interface FeatureLayer extends L.FeatureGroup<L.ILayer> {
|
||||
|
||||
/**
|
||||
* Load GeoJSON data for this layer from the URL given by url.
|
||||
*/
|
||||
loadURL(url: string): any;
|
||||
|
||||
/**
|
||||
* Load marker GeoJSON data from a map with the given id on Mapbox.
|
||||
*/
|
||||
loadID(id: string): any;
|
||||
|
||||
/**
|
||||
* Sets the filter function for this data layer.
|
||||
*/
|
||||
setFilter(filter: FilterFunction): any;
|
||||
|
||||
/**
|
||||
* Gets the filter function for this data layer.
|
||||
*/
|
||||
getFilter(): FilterFunction;
|
||||
|
||||
/**
|
||||
* Set the contents of a markers layer: run the provided features through
|
||||
* the filter function and then through the factory function to create
|
||||
* elements for the map. If the layer already has features, they are
|
||||
* replaced with the new features. An empty array will clear the
|
||||
* layer of all features.
|
||||
*/
|
||||
setGeoJSON(geojson: any): L.mapbox.FeatureLayer;
|
||||
|
||||
/**
|
||||
* Get the contents of this layer as GeoJSON data.
|
||||
*/
|
||||
getGeoJSON(): any;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////// GEOCODING /////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Geocoder
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
/**
|
||||
* A low-level interface to geocoding, useful for more complex uses and reverse-geocoding.
|
||||
*/
|
||||
function geocoder(id: string): L.mapbox.Geocoder;
|
||||
|
||||
interface Geocoder {
|
||||
|
||||
getURL(): string;
|
||||
setURL(url: string): any;
|
||||
setID(id: string): any;
|
||||
setTileJSON(tilejson: any): any;
|
||||
queryURL(url: string): string;
|
||||
|
||||
/**
|
||||
* Queries the geocoder with a query string, and returns its result, if any.
|
||||
*/
|
||||
query(queryString: string, callback: Function): any;
|
||||
|
||||
/**
|
||||
* Queries the geocoder with a location, and returns its result, if any.
|
||||
*/
|
||||
reverseQuery(location: any, callback: Function): any;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////// CONTROLS ////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
interface ControlOptions extends L.ControlOptions {
|
||||
sanitizer?: (template: string) => string;
|
||||
}
|
||||
}
|
||||
|
||||
// InfoControl
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
/**
|
||||
* A map control that shows a toggleable info container. If set, attribution is auto-detected from active layers and added to the info container.
|
||||
*/
|
||||
function infoControl(options?: ControlOptions): InfoControl;
|
||||
|
||||
interface InfoControl extends L.Control {
|
||||
|
||||
onAdd(map: L.mapbox.Map): any;
|
||||
onRemove(map: L.mapbox.Map): any;
|
||||
|
||||
/**
|
||||
* Adds an info string to infoControl.
|
||||
*/
|
||||
addInfo(info: string): any;
|
||||
|
||||
/**
|
||||
* Removes an info string from infoControl
|
||||
*/
|
||||
removeInfo(info: string): any;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// LegendControl
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
/**
|
||||
* A map control that shows legends added to maps in Mapbox.
|
||||
* Legends are auto-detected from active layers.
|
||||
*/
|
||||
function legendControl(options?: ControlOptions): LegendControl;
|
||||
|
||||
interface LegendControl extends L.Control {
|
||||
|
||||
onAdd(map: L.mapbox.Map): any;
|
||||
|
||||
/**
|
||||
* Adds a legend to the legendControl.
|
||||
*/
|
||||
addLegend(legend: string): any;
|
||||
|
||||
/**
|
||||
* Removes a legend from the legendControl.
|
||||
*/
|
||||
removeLegend(legend: string): any;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// GridControl
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
/**
|
||||
* Interaction is what we call interactive parts of maps that are created with
|
||||
* the powerful tooltips & regions system in TileMill. Under the hood, it's powered by the open UTFGrid specification.
|
||||
*/
|
||||
function gridControl(layer: string, options?: GridControlOptions): GridControl;
|
||||
|
||||
interface GridControlOptions extends ControlOptions {
|
||||
template?: string;
|
||||
follow?: boolean;
|
||||
pinnable?: boolean;
|
||||
touchTeaser?: boolean;
|
||||
location?: boolean;
|
||||
}
|
||||
|
||||
interface GridControl extends L.Control {
|
||||
onAdd(map: L.mapbox.Map): any;
|
||||
onRemove(map: L.mapbox.Map): any;
|
||||
|
||||
/**
|
||||
* If a tooltip is currently shown by the gridControl, hide and close it.
|
||||
*/
|
||||
hide(): any;
|
||||
|
||||
/**
|
||||
* Change the Mustache template used to transform the UTFGrid data in the map's interactivity into HTML for display.
|
||||
*/
|
||||
setTemplate(template: string): any;
|
||||
}
|
||||
}
|
||||
|
||||
// GeocoderControl
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
/**
|
||||
* Adds geocoder functionality as well as a UI element to a map. This uses the Mapbox Geocoding API.
|
||||
*/
|
||||
function geocoderControl(id: string, options?: GeocoderControlOptions): GeocoderControl;
|
||||
|
||||
interface GeocoderControlOptions extends L.ControlOptions {
|
||||
keepOpen?: boolean;
|
||||
}
|
||||
|
||||
interface GeocoderControl {
|
||||
getURL(): string;
|
||||
onAdd(map: L.mapbox.Map): any;
|
||||
|
||||
/**
|
||||
* Set the url used for geocoding.
|
||||
*/
|
||||
setURL(url: string): any;
|
||||
|
||||
/**
|
||||
* Set the map id used for geocoding.
|
||||
*/
|
||||
setID(id: string): any;
|
||||
|
||||
/**
|
||||
* Set the TileJSON used for geocoding.
|
||||
*/
|
||||
setTileJSON(tilejson: any): any;
|
||||
|
||||
/**
|
||||
* Bind a listener to an event emitted by the geocoder control. Supported additional events are
|
||||
*/
|
||||
on(event: string, callback: Function): any;
|
||||
}
|
||||
}
|
||||
|
||||
// ShareControl
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
/**
|
||||
* Adds a "Share" button to the map, which can be used to share the map to Twitter or Facebook, or generate HTML for a map embed.
|
||||
*/
|
||||
function shareControl(id: string, options?: ShareControlOptions): ShareControl;
|
||||
|
||||
interface ShareControlOptions extends L.ControlOptions {
|
||||
url?: string;
|
||||
}
|
||||
|
||||
interface ShareControl extends L.Control {
|
||||
onAdd(map: L.mapbox.Map): any;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////// MARKERS ///////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox.marker {
|
||||
/**
|
||||
* A core icon generator used in L.mapbox.marker.style
|
||||
*/
|
||||
function icon(feature: any): L.Icon;
|
||||
|
||||
/**
|
||||
* An icon generator for use in conjunction with pointToLayer to generate markers from the Mapbox Markers API and support the simplestyle-spec for features.
|
||||
*/
|
||||
function style(feature: any, latlng: any): L.Marker;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////// SIMPLESTYLE ///////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox.simplestyle {
|
||||
/**
|
||||
* Given a GeoJSON Feature with optional simplestyle-spec properties, return an options object formatted to be used as Leaflet Path options.
|
||||
*/
|
||||
function style(feature: any): L.PathOptions;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////// UTILITY //////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
/**
|
||||
* A HTML sanitization function, with the same effect as the default value of the sanitizer option of L.mapbox.featureLayer, L.mapbox.gridControl, and L.mapbox.legendControl.
|
||||
*/
|
||||
function sanitize(text: string): string;
|
||||
|
||||
/**
|
||||
* A mustache template rendering function, as used by the templating feature provided by L.mapbox.gridControl.
|
||||
*/
|
||||
function template(template: string, data?: any): string;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////// CONFIGURATION //////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace L.mapbox {
|
||||
export class config {
|
||||
static FORCE_HTTPS: boolean;
|
||||
|
||||
static HTTP_URLS: string[];
|
||||
|
||||
static HTTPS_URLS: string[];
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/leaflet": "^0.7"
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"mapbox-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
-83
@@ -1,83 +0,0 @@
|
||||
// Type definitions for msgpack.js - MessagePack JavaScript Implementation
|
||||
// Project: https://github.com/uupaa/msgpack.js/
|
||||
// Definitions by: Shinya Mochizuki <https://github.com/enrapt-mochizuki/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface MsgPackStatic {
|
||||
/**
|
||||
* @param data string or ByteArray.
|
||||
* @param toString return string value if true.
|
||||
*
|
||||
* @return string or ByteArray or false. pack failed if false.
|
||||
*/
|
||||
pack(data: any, toString?: boolean): any;
|
||||
|
||||
/**
|
||||
* @param data string or ByteArray.
|
||||
*
|
||||
* @return string or ByteArray or undefined. unpack failed if undefined.
|
||||
*/
|
||||
unpack(data: any): any;
|
||||
|
||||
worker: string;
|
||||
|
||||
upload(url: string, option: MsgPackUploadOption, callback: MsgPackUploadCallback): void;
|
||||
|
||||
download(url: string, option: MsgPackDownloadOption, callback: MsgPackDownloadCallback): void;
|
||||
}
|
||||
|
||||
interface MsgPackUploadOption {
|
||||
/**
|
||||
* string or ByteArray
|
||||
*/
|
||||
data: any;
|
||||
|
||||
/**
|
||||
* use WebWorker if true.
|
||||
*/
|
||||
worker?: boolean;
|
||||
|
||||
/**
|
||||
* timeout sec.
|
||||
*/
|
||||
timeout?: number;
|
||||
|
||||
before?: (xhr: XMLHttpRequest, option: MsgPackUploadOption) => void;
|
||||
|
||||
after?: (xhr: XMLHttpRequest, option: MsgPackUploadOption, result: MsgPackCallbackResult) => void;
|
||||
}
|
||||
|
||||
interface MsgPackUploadCallback {
|
||||
(data: string, option: MsgPackUploadOption, result: MsgPackCallbackResult): void;
|
||||
}
|
||||
|
||||
interface MsgPackDownloadOption {
|
||||
/**
|
||||
* use WebWorker if true.
|
||||
*/
|
||||
worker?: boolean;
|
||||
|
||||
/**
|
||||
* timeout sec.
|
||||
*/
|
||||
timeout?: number;
|
||||
|
||||
before?: (xhr: XMLHttpRequest, option: MsgPackDownloadOption) => void;
|
||||
|
||||
after?: (xhr: XMLHttpRequest, option: MsgPackDownloadOption, result: MsgPackCallbackResult) => void;
|
||||
}
|
||||
|
||||
interface MsgPackDownloadCallback {
|
||||
/**
|
||||
* @param data string or ByteArray
|
||||
*/
|
||||
(data: any, option: MsgPackDownloadCallback, result: MsgPackCallbackResult): void;
|
||||
}
|
||||
|
||||
interface MsgPackCallbackResult {
|
||||
status: number;
|
||||
|
||||
ok: boolean;
|
||||
}
|
||||
|
||||
declare var msgpack: MsgPackStatic;
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
|
||||
var packed = msgpack.pack("");
|
||||
msgpack.unpack(packed);
|
||||
|
||||
var packedString = msgpack.pack("", true);
|
||||
msgpack.unpack(packedString);
|
||||
|
||||
var url = "http://example.com";
|
||||
|
||||
var uploadOption = {
|
||||
data: "",
|
||||
worker: false,
|
||||
timeout: 10,
|
||||
before: (xhr: XMLHttpRequest, option: MsgPackUploadOption) => { },
|
||||
after: (xhr: XMLHttpRequest, option: MsgPackUploadOption, result: MsgPackCallbackResult) => { }
|
||||
};
|
||||
var uploadCallback = (data: string, option: MsgPackUploadOption, result: MsgPackCallbackResult) => { };
|
||||
msgpack.upload(url, uploadOption, uploadCallback);
|
||||
|
||||
var downloadOption = {
|
||||
worker: false,
|
||||
timeout: 10,
|
||||
before: (xhr: XMLHttpRequest, option: MsgPackDownloadOption) => { },
|
||||
after: (xhr: XMLHttpRequest, option: MsgPackDownloadOption, result: MsgPackCallbackResult) => { }
|
||||
};
|
||||
var downloadCallback = (data: any, option: MsgPackDownloadOption, result: MsgPackCallbackResult) => { };
|
||||
msgpack.download(url, downloadOption, downloadCallback);
|
||||
@@ -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
|
||||
});
|
||||
+29
-11
@@ -5,12 +5,6 @@
|
||||
"typingsPackageName": "ajv",
|
||||
"sourceRepoURL": "https://github.com/epoberezkin/ajv",
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Numbro",
|
||||
"typingsPackageName": "numbro",
|
||||
"sourceRepoURL": "https://github.com/foretagsplatsen/numbro/",
|
||||
"asOfVersion": "1.9.3"
|
||||
},
|
||||
{
|
||||
"libraryName": "antd",
|
||||
@@ -163,10 +157,10 @@
|
||||
"asOfVersion": "1.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "localforage",
|
||||
"typingsPackageName": "localforage",
|
||||
"sourceRepoURL": "https://github.com/localForage/localForage",
|
||||
"asOfVersion": "0.0.34"
|
||||
"libraryName": "localforage",
|
||||
"typingsPackageName": "localforage",
|
||||
"sourceRepoURL": "https://github.com/localForage/localForage",
|
||||
"asOfVersion": "0.0.34"
|
||||
},
|
||||
{
|
||||
"libraryName": "lower-case",
|
||||
@@ -204,6 +198,12 @@
|
||||
"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",
|
||||
@@ -228,6 +228,12 @@
|
||||
"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",
|
||||
@@ -252,6 +258,18 @@
|
||||
"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",
|
||||
@@ -367,4 +385,4 @@
|
||||
"asOfVersion": "1.2.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import parse = require('parse-unit')
|
||||
let [number, length] = parse('10px')
|
||||
number === 50
|
||||
length === 'px'
|
||||
@@ -1,98 +0,0 @@
|
||||
{
|
||||
"jsRules": {
|
||||
"class-name": true,
|
||||
"comment-format": [
|
||||
true,
|
||||
"check-space"
|
||||
],
|
||||
"indent": [
|
||||
true,
|
||||
"spaces"
|
||||
],
|
||||
"no-duplicate-variable": true,
|
||||
"no-eval": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unsafe-finally": true,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-open-brace",
|
||||
"check-whitespace"
|
||||
],
|
||||
"quotemark": [
|
||||
true,
|
||||
"double"
|
||||
],
|
||||
"semicolon": [
|
||||
true,
|
||||
"always"
|
||||
],
|
||||
"triple-equals": [
|
||||
true,
|
||||
"allow-null-check"
|
||||
],
|
||||
"variable-name": [
|
||||
true,
|
||||
"ban-keywords"
|
||||
],
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type"
|
||||
]
|
||||
},
|
||||
"rules": {
|
||||
"class-name": true,
|
||||
"comment-format": [
|
||||
true,
|
||||
"check-space"
|
||||
],
|
||||
"indent": [
|
||||
true,
|
||||
"spaces"
|
||||
],
|
||||
"no-eval": true,
|
||||
"no-internal-module": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unsafe-finally": true,
|
||||
"no-var-keyword": true,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-open-brace",
|
||||
"check-whitespace"
|
||||
],
|
||||
"quotemark": [
|
||||
true,
|
||||
"double"
|
||||
],
|
||||
"semicolon": [
|
||||
true,
|
||||
"always"
|
||||
],
|
||||
"triple-equals": [
|
||||
true,
|
||||
"allow-null-check"
|
||||
],
|
||||
"typedef-whitespace": [
|
||||
true,
|
||||
{
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
}
|
||||
],
|
||||
"variable-name": false,
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type"
|
||||
]
|
||||
}
|
||||
}
|
||||
Vendored
-39
@@ -1,39 +0,0 @@
|
||||
// Type definitions for plotly.js
|
||||
// Project: https://plot.ly/javascript/
|
||||
// Definitions by: Martin Duparc <https://github.com/martinduparc>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface PlotlyConfig {
|
||||
staticPlot?: boolean,
|
||||
editable?: boolean,
|
||||
autosizable?: boolean,
|
||||
fillFrame?: boolean,
|
||||
frameMargins?: number,
|
||||
scrollZoom?: boolean,
|
||||
doubleClick?: string,
|
||||
showTips?: boolean,
|
||||
showLink?: boolean,
|
||||
sendData?: boolean,
|
||||
linkText?: string,
|
||||
showSources?: boolean,
|
||||
displayModeBar?: string|boolean,
|
||||
modeBarButtonsToRemove?: any[],
|
||||
modeBarButtonsToAdd?: any[],
|
||||
modeBarButtons?: boolean,
|
||||
displaylogo?: boolean,
|
||||
plotGlPixelRatio?: number,
|
||||
setBackground?: any,
|
||||
topojsonURL?: string,
|
||||
mapboxAccessToken?: string,
|
||||
logging?: boolean
|
||||
}
|
||||
|
||||
interface PlotlyStatic {
|
||||
newPlot(divid:string | HTMLElement, data:any[], layout?:any, config?:PlotlyConfig):void;
|
||||
}
|
||||
|
||||
declare module "plotly.js" {
|
||||
export = plotly;
|
||||
}
|
||||
|
||||
declare var plotly:PlotlyStatic;
|
||||
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);
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/temp": "latest",
|
||||
"@types/node": "latest"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"protractor": "latest",
|
||||
"@types/selenium-webdriver": "latest"
|
||||
}
|
||||
}
|
||||
Vendored
-110
@@ -1,110 +0,0 @@
|
||||
// Type definitions for protractor-helpers v1.0.0
|
||||
// Project: https://github.com/wix/protractor-helpers
|
||||
// Definitions by: John Cant <https://github.com/johncant/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="selenium-webdriver" />
|
||||
/// <reference types="jasmine" />
|
||||
|
||||
// ElementArrayFinder
|
||||
|
||||
declare namespace protractor {
|
||||
interface ElementArrayFinder {
|
||||
getByText(text: string) : protractor.ElementFinder;
|
||||
$$data(hook: string) : protractor.ElementArrayFinder;
|
||||
}
|
||||
|
||||
interface ElementFinder {
|
||||
$data(hook: string) : protractor.ElementFinder;
|
||||
}
|
||||
}
|
||||
|
||||
// Globals
|
||||
|
||||
declare function $data(hook: string) : protractor.ElementFinder;
|
||||
declare function $$data(hook: string) : protractor.ElementArrayFinder;
|
||||
|
||||
|
||||
// Locators
|
||||
|
||||
// TODO - find out about result of querySelector and querySelector all.
|
||||
// Are they Locator s?
|
||||
declare namespace protractor {
|
||||
interface IProtractorLocatorStrategy {
|
||||
dataHook(hook: string, optParentElement?: protractor.ElementFinder, optRootSelector?: string) : webdriver.Locator;
|
||||
dataHookAll(hook: string, optParentElement?: protractor.ElementFinder, optRootSelector?: string) : webdriver.Locator;
|
||||
}
|
||||
}
|
||||
|
||||
// Matchers
|
||||
// TODO - Typescript doesn't really help much here
|
||||
// we don't know what type is being tested.
|
||||
// Fixing this would require modifying the
|
||||
// jasmine d.ts.
|
||||
|
||||
declare namespace jasmine {
|
||||
interface Matchers {
|
||||
toBePresent() : boolean;
|
||||
toBeDisplayed() : boolean;
|
||||
toHaveCountOf(expectedCount : number) : boolean;
|
||||
toHaveText(expectedText : string) : boolean;
|
||||
toMatchRegex(regex : RegExp) : boolean;
|
||||
toMatchMoney(expectedValue : number, currencySymbol? : string) : boolean;
|
||||
toMatchMoneyWithFraction(expectedValue : number, currencySymbol?: string) : boolean;
|
||||
toHaveValue(actual: string | number) : boolean;
|
||||
toHaveClass(className : string) : boolean;
|
||||
toHaveUrl(url : string) : boolean;
|
||||
toBeDisabled() : boolean;
|
||||
toBeChecked() : boolean;
|
||||
toBeValid() : boolean;
|
||||
toBeInvalid() : boolean;
|
||||
toBeInvalidRequired() : boolean;
|
||||
// Copied definitions from angular-translate.
|
||||
toMatchTranslated(translationId : string, interpolateParams? : any) : boolean;
|
||||
toMatchTranslated(translationId : string[], interpolateParams? : any) : boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
declare module "protractor-helpers" {
|
||||
|
||||
function not(arg: webdriver.promise.IThenable<any>) : webdriver.promise.IThenable<boolean>;
|
||||
|
||||
// Copied definitions from angular-translate.
|
||||
function translate(translationId: string, interpolateParams?: any): webdriver.promise.IThenable<string>;
|
||||
function translate(translationId: string[], interpolateParams?: any): webdriver.promise.IThenable<{ [key: string]: string }>;
|
||||
|
||||
function safeGet(url: string) : void;
|
||||
|
||||
function maximizeWindow(width?: number, height?: number) : void; // TODO
|
||||
function resetPosition() : void;
|
||||
function moveToElement(hook: string) : void;
|
||||
function displayHover(element: protractor.ElementFinder) : void;
|
||||
|
||||
function waitForElement(element: protractor.ElementFinder, timeout?: number) : void;
|
||||
function waitForElementToDisappear(element: protractor.ElementFinder, timeout?: number) : void;
|
||||
|
||||
function selectOptionByText(select: protractor.ElementFinder, text: string) : void;
|
||||
function selectOptionByIndex(select: protractor.ElementFinder, index: number) : void;
|
||||
|
||||
function selectOption(option: protractor.ElementFinder) : void
|
||||
|
||||
function isFirefox() : boolean;
|
||||
function isIE() : boolean;
|
||||
|
||||
function createMessage(actual : string, message : string, isNot : any) : string; // isNot : boolean too inflexible
|
||||
function createMessage(actual : protractor.ElementFinder, message : string, isNot : any) : string; // isNot : boolean too inflexible
|
||||
function createMessage(actual : protractor.ElementArrayFinder, message : string, isNot : any) : string; // isNot : boolean too inflexible
|
||||
|
||||
function clearAndSetValue(input : protractor.ElementFinder, value : string) : void; // TODO - sendKeys(value)
|
||||
|
||||
function hasClass(element: protractor.ElementFinder, className: string) : webdriver.promise.IThenable<boolean>;
|
||||
function hasValue(element: protractor.ElementFinder, expectedValue: string) : webdriver.promise.IThenable<boolean>;
|
||||
function hasValue(element: protractor.ElementFinder, expectedValue: number) : webdriver.promise.IThenable<boolean>;
|
||||
function hasLink(element: protractor.ElementFinder, url: string) : webdriver.promise.IThenable<boolean>;
|
||||
function isDisabled(element: protractor.ElementFinder) : webdriver.promise.IThenable<boolean>;
|
||||
function isChecked(element: protractor.ElementFinder) : webdriver.promise.IThenable<boolean>;
|
||||
function getFilteredConsoleErrors() : webdriver.promise.IThenable<string[]>; // TODO - discuss handling in IE
|
||||
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/jasmine": "^2.2.34",
|
||||
"@types/selenium-webdriver": "2.44.28"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/selenium-webdriver": "~2.44.28"
|
||||
}
|
||||
}
|
||||
-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
-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
-40
@@ -1,40 +0,0 @@
|
||||
// Type definitions for react-notification-system-redux 1.0
|
||||
// Project: https://github.com/gor181/react-notification-system-redux
|
||||
// Definitions by: Karol Janyst <https://github.com/LKay>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import { Component } from "react";
|
||||
import { Action } from "redux";
|
||||
import { Attributes, Notification } from "react-notification-system";
|
||||
|
||||
export as namespace Notifications;
|
||||
|
||||
export = Notifications;
|
||||
|
||||
declare class Notifications extends Component<Notifications.NotificationsProps, any> {}
|
||||
|
||||
declare namespace Notifications {
|
||||
|
||||
export type NotificationsState = Notification[];
|
||||
|
||||
export type NotificationLevel = "error" | "warning" | "info" | "success";
|
||||
|
||||
export type NotificationsReducer<A extends Action> = (state: NotificationsState, action: A) => NotificationsState;
|
||||
|
||||
export type NotificationShow = (opts?: Notification) => Action;
|
||||
|
||||
export interface NotificationsProps extends Attributes {
|
||||
notifications?: Notification[];
|
||||
}
|
||||
|
||||
export const reducer: NotificationsReducer<any>;
|
||||
|
||||
export const show: (opts?: Notification, level?: NotificationLevel) => Action;
|
||||
export const error: NotificationShow;
|
||||
export const hide: (opts?: Notification | string | number) => Action;
|
||||
export const info: NotificationShow;
|
||||
export const success: NotificationShow;
|
||||
export const warning: NotificationShow;
|
||||
}
|
||||
|
||||
@@ -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
-27
@@ -1,27 +0,0 @@
|
||||
// Type definitions for react-sticky 5.0
|
||||
// Project: https://github.com/captivationsoftware/react-sticky
|
||||
// Definitions by: Matej Lednicky <http://www.thinkcreatix.com/>, Curtis Warren <https://github.com/curtisw0>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
declare module "react-sticky" {
|
||||
|
||||
export var StickyContainer: React.ComponentClass<React.HTMLAttributes<HTMLDivElement>>;
|
||||
|
||||
export interface StickyProps {
|
||||
isActive?: boolean;
|
||||
className?: string;
|
||||
style?: any;
|
||||
stickyClassName?: string;
|
||||
stickyStyle?: any;
|
||||
topOffset?: number;
|
||||
bottomOffset?: number;
|
||||
onStickyStateChange?: (isSticky: boolean) => void;
|
||||
}
|
||||
|
||||
export var Sticky: React.ComponentClass<StickyProps>;
|
||||
|
||||
}
|
||||
|
||||
Vendored
-198
@@ -1,198 +0,0 @@
|
||||
// Type definitions for react-svg-pan-zoom 2.5
|
||||
// Project: https://github.com/chrvadala/react-svg-pan-zoom#readme
|
||||
// Definitions by: Huy Nguyen <https://github.com/huy-nguyen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
import * as React from 'react';
|
||||
|
||||
declare module 'react-svg-pan-zoom' {
|
||||
|
||||
// String constants:
|
||||
const MODE_IDLE = 'idle';
|
||||
const MODE_PANNING = 'panning';
|
||||
const MODE_ZOOMING = 'zooming';
|
||||
|
||||
export const TOOL_AUTO = 'auto';
|
||||
export const TOOL_NONE = 'none';
|
||||
export const TOOL_PAN = 'pan';
|
||||
export const TOOL_ZOOM_IN = 'zoom-in';
|
||||
export const TOOL_ZOOM_OUT = 'zoom-out';
|
||||
|
||||
export const POSITION_NONE = 'none';
|
||||
export const POSITION_TOP = 'top';
|
||||
export const POSITION_RIGHT = 'right';
|
||||
export const POSITION_BOTTOM = 'bottom';
|
||||
export const POSITION_LEFT = 'left';
|
||||
|
||||
export type Mode = typeof MODE_IDLE | typeof MODE_PANNING | typeof MODE_ZOOMING;
|
||||
|
||||
export interface Value {
|
||||
version: 2,
|
||||
mode: Mode,
|
||||
focus: boolean,
|
||||
a: number,
|
||||
b: number,
|
||||
c: number,
|
||||
d: number,
|
||||
e: number,
|
||||
f: number,
|
||||
viewerWidth: number,
|
||||
viewerHeight: number,
|
||||
SVGWidth: number,
|
||||
SVGHeight: number,
|
||||
startX?: number | null,
|
||||
startY?: number | null,
|
||||
endX?: number | null,
|
||||
endY?: number | null,
|
||||
|
||||
}
|
||||
|
||||
export type Tool = typeof TOOL_AUTO | typeof TOOL_NONE | typeof TOOL_PAN |
|
||||
typeof TOOL_ZOOM_IN | typeof TOOL_ZOOM_OUT
|
||||
export type ToolbarPosition = typeof POSITION_NONE | typeof POSITION_TOP | typeof POSITION_RIGHT |
|
||||
typeof POSITION_BOTTOM | typeof POSITION_LEFT
|
||||
|
||||
|
||||
export interface OptionalProps {
|
||||
//background of the viewer
|
||||
background: React.CSSProperties,
|
||||
|
||||
//background of the svg
|
||||
SVGBackground: string,
|
||||
|
||||
//value of the viewer (current point of view)
|
||||
value: Value | null,
|
||||
|
||||
//CSS style of the Viewer
|
||||
style: object,
|
||||
|
||||
//className of the Viewer
|
||||
className: string,
|
||||
|
||||
//detect zoom operation performed trough pinch gesture or mouse scroll
|
||||
detectWheel: boolean,
|
||||
|
||||
//perform PAN if the mouse is on viewer border
|
||||
detectAutoPan: boolean,
|
||||
|
||||
//toolbar position
|
||||
toolbarPosition: ToolbarPosition,
|
||||
|
||||
//handler something changed
|
||||
onChangeValue: (value: Value) => void,
|
||||
|
||||
//handler tool changed
|
||||
onChangeTool: (tool: Tool) => void,
|
||||
|
||||
// Note: The `T` type parameter is the type of the `target` of the event:
|
||||
//handler click
|
||||
onClick: <T>(event: ViewerMouseEvent<T>) => void,
|
||||
|
||||
//handler double click
|
||||
onDoubleClick: <T>(event: ViewerMouseEvent<T>) => void,
|
||||
|
||||
//handler mouseup
|
||||
onMouseUp: <T>(event: ViewerMouseEvent<T>) => void,
|
||||
|
||||
//handler mousemove
|
||||
onMouseMove: <T>(event: ViewerMouseEvent<T>) => void,
|
||||
|
||||
//handler mousedown
|
||||
onMouseDown: <T>(event: ViewerMouseEvent<T>) => void,
|
||||
|
||||
//if disabled the user can move the image outside the viewer
|
||||
preventPanOutside: boolean,
|
||||
|
||||
//how much scale in or out
|
||||
scaleFactor: number,
|
||||
|
||||
//current active tool (TOOL_NONE, TOOL_PAN, TOOL_ZOOM_IN, TOOL_ZOOM_OUT)
|
||||
tool: Tool,
|
||||
|
||||
//modifier keys //https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState
|
||||
modifierKeys: string[],
|
||||
|
||||
//override default toolbar component
|
||||
// TODO: specify function type more clearly
|
||||
customToolbar: React.Component<any, any> | React.StatelessComponent<any>,
|
||||
|
||||
// How about touch events? They are in README but not in `propTypes`.
|
||||
}
|
||||
|
||||
export interface RequiredProps {
|
||||
//width of the viewer displayed on screen
|
||||
width: number,
|
||||
//height of the viewer displayed on screen
|
||||
height: number,
|
||||
|
||||
//accept only one node SVG
|
||||
// TODO: Figure out how to constrain `children` or maybe just leave it commented out
|
||||
// because `children` is already implicit props
|
||||
// children: () => any
|
||||
}
|
||||
|
||||
export type Props = RequiredProps & Partial<OptionalProps>
|
||||
|
||||
class ReactSVGPanZoom extends React.Component<Props, {}> {
|
||||
pan(SVGDeltaX: number, SVGDeltaY: number): void
|
||||
zoom(SVGPointX: number, SVGPointY: number, scaleFactor: number): void
|
||||
fitSelection(selectionSVGPointX: number, selectionSVGPointY: number, selectionWidth: number, selectionHeight: number): void
|
||||
fitToViewer(): void
|
||||
setPointOnViewerCenter(SVGPointX: number, SVGPointY: number, zoomLevel: number): void
|
||||
reset(): void
|
||||
zoomOnViewerCenter(scaleFactor: number): void
|
||||
getValue(): Value
|
||||
setValue(value: Value): void
|
||||
getTool(): Tool
|
||||
setTool(tool: Tool): void
|
||||
}
|
||||
|
||||
|
||||
export interface Point {
|
||||
x: number,
|
||||
y: number,
|
||||
}
|
||||
|
||||
export interface ViewerMouseEvent<T>{
|
||||
originalEvent: React.MouseEvent<T>,
|
||||
SVGViewer: SVGSVGElement,
|
||||
point: Point,
|
||||
x: number,
|
||||
y: number,
|
||||
scaleFactor: number,
|
||||
translationX: number,
|
||||
translationY: number,
|
||||
preventDefault(): void
|
||||
stopPropagation(): void
|
||||
}
|
||||
|
||||
export interface ViewerTouchEvent<T> {
|
||||
originalEvent: React.TouchEvent<T>,
|
||||
SVGViewer: SVGSVGElement,
|
||||
points: Point[],
|
||||
changedPoints: Point[],
|
||||
scaleFactor: number,
|
||||
translationX: number,
|
||||
translationY: number,
|
||||
preventDefault(): void
|
||||
stopPropagation(): void
|
||||
}
|
||||
|
||||
// Utility functions exposed:
|
||||
export function pan(value: Value, SVGDeltaX: number, SVGDeltaY: number, panLimit?: number): Value
|
||||
|
||||
export function zoom(value: Value, SVGPointX: number, SVGPointY: number, scaleFactor: number): Value
|
||||
|
||||
export function fitSelection(
|
||||
value: Value, selectionSVGPointX: number, selectionSVGPointY: number, selectionWidth: number, selectionHeight: number): Value
|
||||
|
||||
export function fitToViewer(value: Value): Value
|
||||
|
||||
export function zoomOnViewerCenter(value: Value, scaleFactor: number): Value
|
||||
|
||||
export function setPointOnViewerCenter(value: Value, SVGPointX: number, SVGPointY: number, zoomLevel: number): Value
|
||||
|
||||
export function reset(value: Value): Value
|
||||
}
|
||||
|
||||
|
||||
Vendored
-29
@@ -1,29 +0,0 @@
|
||||
// Type definitions for ReactCSS v1.0.0
|
||||
// Project: http://reactcss.com/
|
||||
// Definitions by: Karol Janyst <https://github.com/LKay>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import * as React from "react"
|
||||
|
||||
|
||||
interface LoopableProps {
|
||||
"first-child"?: boolean
|
||||
"last-child"?: boolean
|
||||
even?: boolean
|
||||
odd?: boolean
|
||||
[nthChild: string]: boolean
|
||||
}
|
||||
|
||||
interface HoverProps {
|
||||
hover?: boolean
|
||||
}
|
||||
|
||||
interface Classes {
|
||||
default: any
|
||||
[scope: string]: any
|
||||
}
|
||||
|
||||
export function hover<A>(component: React.ComponentClass<A> | React.StatelessComponent<A>): React.ComponentClass<A>
|
||||
export function loop(i: number, length: number): LoopableProps
|
||||
export default function reactCSS(classes: Classes, ...activations: Array<any>): any
|
||||
@@ -1,21 +0,0 @@
|
||||
import * as React from "react"
|
||||
import { StatelessComponent } from "react"
|
||||
import { render } from "react-dom"
|
||||
import { default as reactCSS, hover, loop, LoopableProps, HoverProps } from "reactcss"
|
||||
|
||||
interface TestProps extends HoverProps { }
|
||||
|
||||
var styles: any = reactCSS({
|
||||
default: {},
|
||||
hover: {}
|
||||
}, { hover: true })
|
||||
|
||||
var loopProps: LoopableProps = loop(1, 10)
|
||||
|
||||
var TestComponent: StatelessComponent<TestProps>
|
||||
var Test = hover(TestComponent)
|
||||
|
||||
render(
|
||||
<Test />,
|
||||
document.getElementById("main")
|
||||
)
|
||||
@@ -1,13 +0,0 @@
|
||||
import {
|
||||
Reducer,
|
||||
Action,
|
||||
} from 'redux';
|
||||
import reduceReducers from 'reduce-reducers';
|
||||
|
||||
interface TestStore {
|
||||
a: number,
|
||||
b: string
|
||||
}
|
||||
let firstReducer: (state: TestStore, action: Action) => TestStore = (a, b) => a;
|
||||
let secondReducer: (state: TestStore, action: Action) => TestStore = (a, b) => a
|
||||
let finalReducer: (state: TestStore, action: Action) => TestStore = reduceReducers(firstReducer, secondReducer);
|
||||
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"
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// Tests for RxJS-BackPressure TypeScript definitions
|
||||
// Tests by Igor Oleinikov <https://github.com/Igorbek>
|
||||
|
||||
function testPausable() {
|
||||
var o: Rx.Observable<string> = {} as any;
|
||||
|
||||
var pauser = new Rx.Subject<boolean>();
|
||||
|
||||
var p = o.pausable(pauser);
|
||||
p = o.pausableBuffered(pauser);
|
||||
}
|
||||
|
||||
function testControlled() {
|
||||
var o: Rx.Observable<string> = {} as any;
|
||||
var c = o.controlled();
|
||||
|
||||
var d: Rx.IDisposable = c.request();
|
||||
d = c.request(5);
|
||||
}
|
||||
@@ -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,7 +13,7 @@ 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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
tinymce.init(
|
||||
{
|
||||
selector: 'textarea',
|
||||
height: 500,
|
||||
menubar: false,
|
||||
plugins: [
|
||||
'advlist autolink lists link image charmap print preview anchor',
|
||||
'searchreplace visualblocks code fullscreen',
|
||||
'insertdatetime media table contextmenu paste code'
|
||||
],
|
||||
toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
|
||||
content_css: '//www.tinymce.com/css/codepen.min.css'
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
let t = new TinyMce.util.Color('#FFFFFF');
|
||||
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" }
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user