mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Merged with master
This commit is contained in:
commit
409b1c7961
@ -1,6 +1,6 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "iojs-v2"
|
||||
|
||||
sudo: false
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/// <reference path='acl-mongodbBackend.d.ts'/>
|
||||
/// <reference path='acl.d.ts'/>
|
||||
|
||||
// https://github.com/OptimalBits/node_acl/blob/master/Readme.md
|
||||
import Acl = require('acl');
|
||||
@ -14,4 +14,3 @@ acl.allow('guest', 'blogs', 'view');
|
||||
|
||||
// allow function accepts arrays as any parameter
|
||||
acl.allow('member', 'blogs', ['edit','view', 'delete']);
|
||||
|
||||
|
||||
22
acl/acl-mongodbBackend.d.ts
vendored
22
acl/acl-mongodbBackend.d.ts
vendored
@ -1,22 +0,0 @@
|
||||
// Type definitions for node_acl 0.4.7
|
||||
// Project: https://github.com/optimalbits/node_acl
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="acl.d.ts" />
|
||||
/// <reference path="../mongodb/mongodb.d.ts" />
|
||||
|
||||
declare module "acl" {
|
||||
import mongo = require('mongodb');
|
||||
|
||||
interface AclStatic {
|
||||
mongodbBackend: MongodbBackendStatic;
|
||||
}
|
||||
|
||||
interface MongodbBackend extends Backend<Callback> { }
|
||||
interface MongodbBackendStatic {
|
||||
new(db: mongo.Db, prefix: string, useSingle: boolean): MongodbBackend;
|
||||
new(db: mongo.Db, prefix: string): MongodbBackend;
|
||||
new(db: mongo.Db): MongodbBackend;
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
/// <reference path='acl-redisBackend.d.ts'/>
|
||||
/// <reference path='acl.d.ts'/>
|
||||
|
||||
// https://github.com/OptimalBits/node_acl/blob/master/Readme.md
|
||||
import Acl = require('acl');
|
||||
|
||||
21
acl/acl-redisBackend.d.ts
vendored
21
acl/acl-redisBackend.d.ts
vendored
@ -1,21 +0,0 @@
|
||||
// Type definitions for node_acl 0.4.7
|
||||
// Project: https://github.com/optimalbits/node_acl
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="acl.d.ts" />
|
||||
/// <reference path='../redis/redis.d.ts'/>
|
||||
|
||||
declare module "acl" {
|
||||
import redis = require('redis');
|
||||
|
||||
interface AclStatic {
|
||||
redisBackend: RedisBackendStatic;
|
||||
}
|
||||
|
||||
interface RedisBackend extends Backend<redis.RedisClient> { }
|
||||
interface RedisBackendStatic {
|
||||
new(redis: redis.RedisClient, prefix: string): RedisBackend;
|
||||
new(redis: redis.RedisClient): RedisBackend;
|
||||
}
|
||||
}
|
||||
30
acl/acl.d.ts
vendored
30
acl/acl.d.ts
vendored
@ -6,6 +6,9 @@
|
||||
/// <reference path="../bluebird/bluebird.d.ts" />
|
||||
/// <reference path='../node/node.d.ts'/>
|
||||
|
||||
/// <reference path='../redis/redis.d.ts'/>
|
||||
/// <reference path="../mongodb/mongodb.d.ts" />
|
||||
|
||||
declare module "acl" {
|
||||
import http = require('http');
|
||||
import Promise = require("bluebird");
|
||||
@ -115,6 +118,33 @@ declare module "acl" {
|
||||
end: () => void;
|
||||
}
|
||||
|
||||
// for redis backend
|
||||
import redis = require('redis');
|
||||
|
||||
interface AclStatic {
|
||||
redisBackend: RedisBackendStatic;
|
||||
}
|
||||
|
||||
interface RedisBackend extends Backend<redis.RedisClient> { }
|
||||
interface RedisBackendStatic {
|
||||
new(redis: redis.RedisClient, prefix: string): RedisBackend;
|
||||
new(redis: redis.RedisClient): RedisBackend;
|
||||
}
|
||||
|
||||
// for mongodb backend
|
||||
import mongo = require('mongodb');
|
||||
|
||||
interface AclStatic {
|
||||
mongodbBackend: MongodbBackendStatic;
|
||||
}
|
||||
|
||||
interface MongodbBackend extends Backend<Callback> { }
|
||||
interface MongodbBackendStatic {
|
||||
new(db: mongo.Db, prefix: string, useSingle: boolean): MongodbBackend;
|
||||
new(db: mongo.Db, prefix: string): MongodbBackend;
|
||||
new(db: mongo.Db): MongodbBackend;
|
||||
}
|
||||
|
||||
var _: AclStatic;
|
||||
export = _;
|
||||
}
|
||||
|
||||
4
auth0/auth0.d.ts
vendored
4
auth0/auth0.d.ts
vendored
@ -9,10 +9,6 @@ interface Window {
|
||||
token: string;
|
||||
}
|
||||
|
||||
interface Location {
|
||||
origin: string;
|
||||
}
|
||||
|
||||
/** This is the interface for the main Auth0 client. */
|
||||
interface Auth0Static {
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ function test_dom_element() {
|
||||
}
|
||||
|
||||
function test_dom_event() {
|
||||
var event = new CKEDITOR.dom.event(new Event());
|
||||
var event = new CKEDITOR.dom.event(new Event(""));
|
||||
alert(event.getKey());
|
||||
alert(event.getKeystroke() == 65);
|
||||
alert(event.getKeystroke() == CKEDITOR.CTRL + 65);
|
||||
|
||||
502
core-js/core-js-tests.ts
Normal file
502
core-js/core-js-tests.ts
Normal file
@ -0,0 +1,502 @@
|
||||
/// <reference path="core-js.d.ts" />
|
||||
|
||||
interface Point { x: number; y: number; }
|
||||
interface Point3D extends Point { z: number; }
|
||||
|
||||
let a: any;
|
||||
let s: string;
|
||||
let i: number;
|
||||
let b: boolean;
|
||||
let f: () => void;
|
||||
let o: Object;
|
||||
let r: RegExp;
|
||||
let sym: symbol;
|
||||
let e: Error;
|
||||
let date: Date;
|
||||
let key: PropertyKey;
|
||||
let point: Point;
|
||||
let point3d: Point3D;
|
||||
let arrayOfPoint: Point[];
|
||||
let arrayOfPoint3D: Point3D[];
|
||||
let arrayOfSymbol: symbol[];
|
||||
let arrayOfPropertyKey: PropertyKey[];
|
||||
let arrayOfAny: any[];
|
||||
let arrayOfStringAny: [string, any][];
|
||||
let arrayLikeOfAny: ArrayLike<any>;
|
||||
let iterableOfPoint: Iterable<Point>;
|
||||
let iterableOfStringPoint: Iterable<[string, Point]>;
|
||||
let iterableOfPointPoint3D: Iterable<[Point, Point3D]>;
|
||||
let iterableIteratorOfPoint: IterableIterator<Point>;
|
||||
let iterableIteratorOfNumberPoint: IterableIterator<[number, Point]>;
|
||||
let iterableIteratorOfNumber: IterableIterator<number>;
|
||||
let iterableIteratorOfString: IterableIterator<string>;
|
||||
let iterableIteratorOfPointPoint: IterableIterator<[Point, Point]>;
|
||||
let iterableIteratorOfNode: IterableIterator<Node>;
|
||||
let iterableIteratorOfStringPoint: IterableIterator<[string, Point]>;
|
||||
let iterableIteratorOfAny: IterableIterator<any>;
|
||||
let iterableIteratorOfPropertyKey: IterableIterator<PropertyKey>;
|
||||
let iterableIteratorOfPropertyKeyPoint: IterableIterator<[PropertyKey, Point]>;
|
||||
let nodeList: NodeList;
|
||||
let pd: PropertyDescriptor;
|
||||
let pdm: PropertyDescriptorMap;
|
||||
let map: Map<string, Point>;
|
||||
let set: Set<Point>;
|
||||
let weakMap: WeakMap<Point, Point3D>;
|
||||
let weakSet: WeakSet<Point>;
|
||||
let $forOfPoint: $for<Point>;
|
||||
let $forOfPoint3D: $for<Point3D>;
|
||||
let promiseLikeOfPoint: PromiseLike<Point>;
|
||||
let promiseLikeOfPoint3D: PromiseLike<Point3D>;
|
||||
let promiseOfPoint: Promise<Point>;
|
||||
let promiseOfPoint3D: Promise<Point3D>;
|
||||
let promiseOfArrayOfPoint: Promise<Point[]>;
|
||||
let promiseOfVoid: Promise<void>;
|
||||
let dictOfPoint: Dict<Point>;
|
||||
let dictOfPoint3D: Dict<Point3D>;
|
||||
let dictOfAny: Dict<any>;
|
||||
|
||||
// #############################################################################################
|
||||
// ECMAScript 6: Object & Function
|
||||
// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of,
|
||||
// es6.object.to-string, es6.function.name and es6.function.has-instance.
|
||||
// #############################################################################################
|
||||
|
||||
point = Object.assign(point, point);
|
||||
b = Object.is(point, point);
|
||||
Object.setPrototypeOf(point, point);
|
||||
s = f.name;
|
||||
b = f[Symbol.hasInstance](point);
|
||||
|
||||
// #############################################################################################
|
||||
// ECMAScript 6: Array
|
||||
// Modules: es6.array.from, es6.array.of, es6.array.copy-within, es6.array.fill, es6.array.find,
|
||||
// and es6.array.find-index
|
||||
// #############################################################################################
|
||||
|
||||
point = arrayOfPoint.find(p => b);
|
||||
i = arrayOfPoint.findIndex(p => b);
|
||||
arrayOfPoint = arrayOfPoint.fill(point, i, arrayOfPoint.length);
|
||||
arrayOfPoint = arrayOfPoint.copyWithin(i, i, i);
|
||||
a = arrayOfPoint[Symbol.unscopables];
|
||||
arrayOfPoint = Array.from(arrayOfPoint);
|
||||
arrayOfPoint = Array.from(iterableOfPoint);
|
||||
arrayOfPoint3D = Array.from(arrayOfPoint, point => point3d);
|
||||
arrayOfPoint3D = Array.from(arrayOfPoint, point => point3d, a);
|
||||
arrayOfPoint3D = Array.from(iterableOfPoint, point => point3d);
|
||||
arrayOfPoint3D = Array.from(iterableOfPoint, point => point3d, a);
|
||||
arrayOfPoint = Array.of(point, point);
|
||||
|
||||
// #############################################################################################
|
||||
// ECMAScript 6: String & RegExp
|
||||
// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at,
|
||||
// es6.string.ends-with, es6.string.includes, es6.string.repeat,
|
||||
// es6.string.starts-with, and es6.regexp
|
||||
// #############################################################################################
|
||||
|
||||
i = s.codePointAt(i);
|
||||
b = s.includes(s, i);
|
||||
b = s.endsWith(s, i);
|
||||
s = s.repeat(i);
|
||||
b = s.startsWith(s, i);
|
||||
s = String.fromCodePoint(i, i);
|
||||
s = String.raw`abc`;
|
||||
s = r.flags;
|
||||
|
||||
// #############################################################################################
|
||||
// ECMAScript 6: Number & Math
|
||||
// Modules: es6.number.constructor, es6.number.statics, and es6.math
|
||||
// #############################################################################################
|
||||
|
||||
i = Number.EPSILON;
|
||||
b = Number.isFinite(i);
|
||||
b = Number.isInteger(i);
|
||||
b = Number.isNaN(i);
|
||||
b = Number.isSafeInteger(i);
|
||||
i = Number.MAX_SAFE_INTEGER;
|
||||
i = Number.MIN_SAFE_INTEGER;
|
||||
i = Number.parseFloat(s);
|
||||
i = Number.parseInt(s);
|
||||
i = Number.parseInt(s, i);
|
||||
i = Math.clz32(i);
|
||||
i = Math.imul(i, i);
|
||||
i = Math.sign(i);
|
||||
i = Math.log10(i);
|
||||
i = Math.log2(i);
|
||||
i = Math.log1p(i);
|
||||
i = Math.expm1(i);
|
||||
i = Math.cosh(i);
|
||||
i = Math.sinh(i);
|
||||
i = Math.tanh(i);
|
||||
i = Math.acosh(i);
|
||||
i = Math.asinh(i);
|
||||
i = Math.atanh(i);
|
||||
i = Math.hypot(i, i);
|
||||
i = Math.trunc(i);
|
||||
i = Math.fround(i);
|
||||
i = Math.cbrt(i);
|
||||
|
||||
// #############################################################################################
|
||||
// ECMAScript 6: Symbols
|
||||
// Modules: es6.symbol
|
||||
// #############################################################################################
|
||||
|
||||
sym = Symbol();
|
||||
sym = Symbol(s);
|
||||
sym = Symbol.for(s);
|
||||
s = Symbol.keyFor(sym);
|
||||
sym = Symbol.hasInstance;
|
||||
sym = Symbol.isConcatSpreadable;
|
||||
sym = Symbol.iterator;
|
||||
sym = Symbol.match;
|
||||
sym = Symbol.replace;
|
||||
sym = Symbol.search;
|
||||
sym = Symbol.species;
|
||||
sym = Symbol.split;
|
||||
sym = Symbol.toPrimitive;
|
||||
sym = Symbol.toStringTag;
|
||||
sym = Symbol.unscopables;
|
||||
b = o.hasOwnProperty(sym);
|
||||
b = o.hasOwnProperty(i);
|
||||
b = o.propertyIsEnumerable(sym);
|
||||
b = o.propertyIsEnumerable(i);
|
||||
arrayOfSymbol = Object.getOwnPropertySymbols(a);
|
||||
pd = Object.getOwnPropertyDescriptor(a, sym);
|
||||
pd = Object.getOwnPropertyDescriptor(a, i);
|
||||
Object.defineProperty(a, sym, pd);
|
||||
Object.defineProperty(a, i, pd);
|
||||
s = Math[Symbol.toStringTag];
|
||||
s = JSON[Symbol.toStringTag];
|
||||
|
||||
// Non-standard
|
||||
Symbol.useSimple();
|
||||
Symbol.userSetter();
|
||||
|
||||
// #############################################################################################
|
||||
// ECMAScript 6: Collections
|
||||
// Modules: es6.map, es6.set, es6.weak-map, and es6.weak-set
|
||||
// #############################################################################################
|
||||
|
||||
map.clear();
|
||||
map.delete(s);
|
||||
map.forEach((value: Point, key: string) => { });
|
||||
point = map.get(s);
|
||||
b = map.has(s);
|
||||
map = map.set(s, point);
|
||||
i = map.size;
|
||||
map = new Map<string, Point>();
|
||||
map = new Map(iterableOfStringPoint);
|
||||
|
||||
set.clear();
|
||||
set.delete(point);
|
||||
set.forEach((value: Point, key: Point) => { });
|
||||
b = set.has(point);
|
||||
set = set.add(point);
|
||||
i = set.size;
|
||||
set = new Set<Point>();
|
||||
set = new Set(iterableOfPoint);
|
||||
|
||||
weakMap.delete(point);
|
||||
point3d = weakMap.get(point);
|
||||
b = weakMap.has(point);
|
||||
weakMap = weakMap.set(point, point3d);
|
||||
weakMap = new WeakMap<Point, Point3D>();
|
||||
weakMap = new WeakMap(iterableOfPointPoint3D);
|
||||
|
||||
weakSet.delete(point);
|
||||
weakSet = weakSet.add(point);
|
||||
b = weakSet.has(point);
|
||||
weakSet = new WeakSet<Point>();
|
||||
weakSet = new WeakSet(iterableOfPoint);
|
||||
|
||||
// #############################################################################################
|
||||
// ECMAScript 6: Iterators
|
||||
// Modules: es6.string.iterator, es6.array.iterator, es6.map, es6.set, web.dom.iterable
|
||||
// #############################################################################################
|
||||
|
||||
iterableIteratorOfPoint = arrayOfPoint[Symbol.iterator]();
|
||||
iterableIteratorOfNumberPoint = arrayOfPoint.entries();
|
||||
iterableIteratorOfNumber = arrayOfPoint.keys();
|
||||
iterableIteratorOfPoint = arrayOfPoint.values();
|
||||
iterableIteratorOfStringPoint = map.entries();
|
||||
iterableIteratorOfString = map.keys();
|
||||
iterableIteratorOfPoint = map.values();
|
||||
iterableIteratorOfStringPoint = map[Symbol.iterator]();
|
||||
iterableIteratorOfPointPoint = set.entries();
|
||||
iterableIteratorOfPoint = set.keys();
|
||||
iterableIteratorOfPoint = set.values();
|
||||
iterableIteratorOfPoint = set[Symbol.iterator]();
|
||||
iterableIteratorOfNode = nodeList[Symbol.iterator]();
|
||||
|
||||
$for(iterableOfPoint).of((value: Point) => { });
|
||||
arrayOfPoint = $for(iterableOfPoint).array();
|
||||
arrayOfPoint3D = $for(iterableOfPoint).array(p => point3d);
|
||||
$forOfPoint = $for(iterableOfPoint).filter(p => b);
|
||||
$forOfPoint3D = $for(iterableOfPoint).map(p => point3d);
|
||||
|
||||
// #############################################################################################
|
||||
// ECMAScript 6: Promises
|
||||
// Modules: es6.promise
|
||||
// #############################################################################################
|
||||
|
||||
promiseLikeOfPoint.then((point: Point) => { });
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then();
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point);
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint);
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => point);
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint, e => point);
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => promiseLikeOfPoint);
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => { });
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint, e => { });
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d);
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D);
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => point3d);
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D, e => point3d);
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => promiseLikeOfPoint3D);
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => { });
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D, e => { });
|
||||
promiseOfPoint.then((point: Point) => { });
|
||||
promiseOfPoint = promiseOfPoint.then();
|
||||
promiseOfPoint = promiseOfPoint.then(p => point);
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.then(p => point, e => point);
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint, e => point);
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint, e => point);
|
||||
promiseOfPoint = promiseOfPoint.then(p => point, e => promiseOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.then(p => point, e => promiseLikeOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.then(p => point, e => { });
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint, e => { });
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint, e => { });
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => point3d);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => point3d);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D, e => point3d);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D, e => point3d);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => promiseOfPoint3D);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => promiseLikeOfPoint3D);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => { });
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D, e => { });
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D, e => { });
|
||||
promiseOfPoint = promiseOfPoint.catch(e => point);
|
||||
promiseOfPoint = promiseOfPoint.catch(e => promiseOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.catch(e => promiseLikeOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.catch(e => { });
|
||||
promiseOfPoint3D = promiseOfPoint.catch(e => point3d);
|
||||
promiseOfPoint3D = promiseOfPoint.catch(e => promiseOfPoint3D);
|
||||
promiseOfPoint3D = promiseOfPoint.catch(e => promiseLikeOfPoint3D);
|
||||
promiseOfPoint = new Promise<Point>((resolve, reject) => resolve(point));
|
||||
promiseOfPoint = new Promise<Point>((resolve, reject) => resolve(promiseOfPoint));
|
||||
promiseOfPoint = new Promise<Point>((resolve, reject) => resolve(promiseLikeOfPoint));
|
||||
promiseOfPoint = new Promise<Point>((resolve, reject) => reject(e));
|
||||
promiseOfArrayOfPoint = Promise.all(arrayOfPoint);
|
||||
promiseOfArrayOfPoint = Promise.all(iterableOfPoint);
|
||||
promiseOfPoint = Promise.race(arrayOfPoint);
|
||||
promiseOfPoint = Promise.race(iterableOfPoint);
|
||||
promiseOfVoid = Promise.resolve();
|
||||
promiseOfPoint = Promise.resolve(point3d);
|
||||
promiseOfPoint = Promise.resolve(promiseOfPoint);
|
||||
promiseOfPoint = Promise.resolve(promiseLikeOfPoint);
|
||||
promiseOfVoid = Promise.reject(e);
|
||||
promiseOfPoint = Promise.reject<Point>(e);
|
||||
|
||||
// #############################################################################################
|
||||
// ECMAScript 6: Reflect
|
||||
// Modules: es6.reflect
|
||||
// #############################################################################################
|
||||
|
||||
a = Reflect.apply(f, a, arrayLikeOfAny);
|
||||
a = Reflect.construct(f, arrayLikeOfAny, a);
|
||||
b = Reflect.defineProperty(a, s, pd);
|
||||
b = Reflect.defineProperty(a, i, pd);
|
||||
b = Reflect.defineProperty(a, sym, pd);
|
||||
b = Reflect.deleteProperty(a, s);
|
||||
b = Reflect.deleteProperty(a, i);
|
||||
b = Reflect.deleteProperty(a, sym);
|
||||
iterableIteratorOfAny = Reflect.enumerate(a);
|
||||
a = Reflect.get(a, s, a);
|
||||
a = Reflect.get(a, i, a);
|
||||
a = Reflect.get(a, sym, a);
|
||||
pd = Reflect.getOwnPropertyDescriptor(a, s);
|
||||
pd = Reflect.getOwnPropertyDescriptor(a, i);
|
||||
pd = Reflect.getOwnPropertyDescriptor(a, sym);
|
||||
a = Reflect.getPrototypeOf(a);
|
||||
b = Reflect.has(a, s);
|
||||
b = Reflect.has(a, i);
|
||||
b = Reflect.has(a, sym);
|
||||
b = Reflect.isExtensible(a);
|
||||
arrayOfPropertyKey = Reflect.ownKeys(a);
|
||||
b = Reflect.preventExtensions(a);
|
||||
b = Reflect.set(a, s, a, a);
|
||||
b = Reflect.set(a, i, a, a);
|
||||
b = Reflect.set(a, sym, a, a);
|
||||
b = Reflect.setPrototypeOf(a, a);
|
||||
|
||||
// #############################################################################################
|
||||
// ECMAScript 7
|
||||
// Modules: es7.array.includes, es7.string.at, es7.string.lpad, es7.string.rpad,
|
||||
// es7.object.to-array, es7.object.get-own-property-descriptors, es7.regexp.escape,
|
||||
// es7.map.to-json, and es7.set.to-json
|
||||
// #############################################################################################
|
||||
|
||||
b = arrayOfPoint.includes(point, i);
|
||||
s = s.at(i);
|
||||
s = s.lpad(i, s);
|
||||
s = s.rpad(i, s);
|
||||
arrayOfAny = Object.values(a);
|
||||
arrayOfStringAny = Object.entries(a);
|
||||
pdm = Object.getOwnPropertyDescriptors(a);
|
||||
s = RegExp.escape(s);
|
||||
a = map.toJSON();
|
||||
a = set.toJSON();
|
||||
|
||||
// #############################################################################################
|
||||
// Mozilla JavaScript: Array generics
|
||||
// Modules: js.array.statics
|
||||
// #############################################################################################
|
||||
|
||||
i = Array.push(arrayOfPoint, point, point);
|
||||
point = Array.pop(arrayOfPoint);
|
||||
arrayOfPoint = Array.concat(arrayOfPoint, arrayOfPoint);
|
||||
s = Array.join(arrayOfPoint, s);
|
||||
arrayOfPoint = Array.reverse(arrayOfPoint);
|
||||
point = Array.shift(arrayOfPoint);
|
||||
arrayOfPoint = Array.slice(arrayOfPoint, i, i);
|
||||
arrayOfPoint = Array.sort(arrayOfPoint, (a: Point, b: Point) => i);
|
||||
arrayOfPoint = Array.splice(arrayOfPoint, i);
|
||||
arrayOfPoint = Array.splice(arrayOfPoint, i, i, point, point);
|
||||
i = Array.unshift(arrayOfPoint, point, point);
|
||||
i = Array.indexOf(arrayOfPoint, point, i);
|
||||
i = Array.lastIndexOf(arrayOfPoint, point, i);
|
||||
b = Array.every(arrayOfPoint, (value: Point, index: number, array: Point[]) => b, a);
|
||||
b = Array.some(arrayOfPoint, (value: Point, index: number, array: Point[]) => b, a);
|
||||
Array.forEach(arrayOfPoint, (value: Point, index: number, array: Point[]) => { }, a);
|
||||
arrayOfPoint3D = Array.map(arrayOfPoint, (value: Point, index: number, array: Point[]) => point3d, a);
|
||||
arrayOfPoint = Array.filter(arrayOfPoint, (value: Point, index: number, array: Point[]) => b, a);
|
||||
point = Array.reduce(arrayOfPoint, (prev: Point, value: Point, index: number, array: Point[]) => point, point);
|
||||
point3d = Array.reduce(arrayOfPoint, (prev: Point3D, value: Point, index: number, array: Point[]) => point3d, point3d);
|
||||
point = Array.reduceRight(arrayOfPoint, (prev: Point, value: Point, index: number, array: Point[]) => point, point);
|
||||
point3d = Array.reduceRight(arrayOfPoint, (prev: Point3D, value: Point, index: number, array: Point[]) => point3d, point3d);
|
||||
iterableIteratorOfNumberPoint = Array.entries(arrayOfPoint);
|
||||
iterableIteratorOfNumber = Array.keys(arrayOfPoint);
|
||||
iterableIteratorOfPoint = Array.values(arrayOfPoint);
|
||||
point = Array.find(arrayOfPoint, p => b);
|
||||
i = Array.findIndex(arrayOfPoint, p => b);
|
||||
arrayOfPoint = Array.fill(arrayOfPoint, point, i, arrayOfPoint.length);
|
||||
arrayOfPoint = Array.copyWithin(arrayOfPoint, i, i, i);
|
||||
b = Array.includes(arrayOfPoint, point, i);
|
||||
arrayOfPoint = Array.turn(arrayOfPoint, (memo: Point[], value: Point, index: number, array: Point[]) => arrayOfPoint, arrayOfPoint);
|
||||
arrayOfPoint3D = Array.turn(arrayOfPoint, (memo: Point3D[], value: Point, index: number, array: Point[]) => arrayOfPoint3D, arrayOfPoint3D);
|
||||
|
||||
// #############################################################################################
|
||||
// Object - https://github.com/zloirock/core-js/#object
|
||||
// Modules: core.object
|
||||
// #############################################################################################
|
||||
|
||||
// Non-standard
|
||||
b = Object.isObject(a);
|
||||
s = Object.classof(a);
|
||||
point = Object.define(point, a);
|
||||
point = Object.make(point, a);
|
||||
|
||||
// #############################################################################################
|
||||
// Console - https://github.com/zloirock/core-js/#console
|
||||
// Modules: core.log
|
||||
// #############################################################################################
|
||||
|
||||
// Non-standard
|
||||
log(a, a, a);
|
||||
log.log(a, a, a);
|
||||
log.enable();
|
||||
log.disable();
|
||||
|
||||
// #############################################################################################
|
||||
// Dict - https://github.com/zloirock/core-js/#dict
|
||||
// Modules: core.dict
|
||||
// #############################################################################################
|
||||
|
||||
// Non-standard
|
||||
point = dictOfPoint[s];
|
||||
point = dictOfPoint[i];
|
||||
point = dictOfPoint[sym];
|
||||
dictOfPoint = new Dict(dictOfPoint);
|
||||
dictOfAny = new Dict(point);
|
||||
dictOfPoint = Dict(dictOfPoint);
|
||||
dictOfAny = Dict(point);
|
||||
b = Dict.isDict(a);
|
||||
iterableIteratorOfPoint = Dict.values(dictOfPoint);
|
||||
iterableIteratorOfPropertyKey = Dict.keys(dictOfPoint);
|
||||
iterableIteratorOfPropertyKeyPoint = Dict.entries(dictOfPoint);
|
||||
b = Dict.has(dictOfPoint, s);
|
||||
b = Dict.has(dictOfPoint, i);
|
||||
b = Dict.has(dictOfPoint, sym);
|
||||
point = Dict.get(dictOfPoint, s);
|
||||
point = Dict.get(dictOfPoint, i);
|
||||
point = Dict.get(dictOfPoint, sym);
|
||||
dictOfPoint = Dict.set(dictOfPoint, s, point);
|
||||
dictOfPoint = Dict.set(dictOfPoint, i, point);
|
||||
dictOfPoint = Dict.set(dictOfPoint, sym, point);
|
||||
Dict.forEach(dictOfPoint, (value: Point, key: PropertyKey, dict: Dict<Point>) => { }, a);
|
||||
dictOfPoint3D = Dict.map(dictOfPoint, (value: Point, key: PropertyKey, dict: Dict<Point>) => point3d, a);
|
||||
dictOfPoint3D = Dict.mapPairs(dictOfPoint, (value: Point, key: PropertyKey, dict: Dict<Point>) => [s, point3d], a);
|
||||
dictOfPoint3D = Dict.mapPairs(dictOfPoint, (value: Point, key: PropertyKey, dict: Dict<Point>) => [i, point3d], a);
|
||||
dictOfPoint3D = Dict.mapPairs(dictOfPoint, (value: Point, key: PropertyKey, dict: Dict<Point>) => [sym, point3d], a);
|
||||
dictOfPoint = Dict.filter(dictOfPoint, (value: Point, key: PropertyKey, dict: Dict<Point>) => b, a);
|
||||
b = Dict.some(dictOfPoint, (value: Point, key: PropertyKey, dict: Dict<Point>) => b, a);
|
||||
b = Dict.every(dictOfPoint, (value: Point, key: PropertyKey, dict: Dict<Point>) => b, a);
|
||||
point = Dict.find(dictOfPoint, (value: Point, key: PropertyKey, dict: Dict<Point>) => b, a);
|
||||
key = Dict.findKey(dictOfPoint, (value: Point, key: PropertyKey, dict: Dict<Point>) => b, a);
|
||||
key = Dict.keyOf(dictOfPoint, point);
|
||||
b = Dict.includes(dictOfPoint, point);
|
||||
point = Dict.reduce(dictOfPoint, (prev: Point, value: Point, key: PropertyKey, dict: Dict<Point>) => point, point);
|
||||
point3d = Dict.reduce(dictOfPoint, (prev: Point3D, value: Point, key: PropertyKey, dict: Dict<Point>) => point3d, point3d);
|
||||
dictOfPoint = Dict.turn(dictOfPoint, (memo: Dict<Point>, value: Point, key: PropertyKey, dict: Dict<Point>) => { }, dictOfPoint);
|
||||
dictOfPoint3D = Dict.turn(dictOfPoint, (memo: Dict<Point3D>, value: Point, key: PropertyKey, dict: Dict<Point>) => { }, dictOfPoint3D);
|
||||
|
||||
// #############################################################################################
|
||||
// Partial application - https://github.com/zloirock/core-js/#partial-application
|
||||
// Modules: core.function.part
|
||||
// #############################################################################################
|
||||
|
||||
// Non-standard
|
||||
a = f.part(a, a);
|
||||
|
||||
// #############################################################################################
|
||||
// Date formatting - https://github.com/zloirock/core-js/#date-formatting
|
||||
// Modules: core.date
|
||||
// #############################################################################################
|
||||
|
||||
// Non-standard
|
||||
s = date.format(s, s);
|
||||
s = date.formatUTC(s, s);
|
||||
|
||||
// #############################################################################################
|
||||
// Array - https://github.com/zloirock/core-js/#array
|
||||
// Modules: core.array.turn
|
||||
// #############################################################################################
|
||||
|
||||
// Non-standard
|
||||
arrayOfPoint = arrayOfPoint.turn((memo: Point[], value: Point, key: PropertyKey, array: Point[]) => { }, arrayOfPoint);
|
||||
arrayOfPoint3D = arrayOfPoint.turn((memo: Point3D[], value: Point, key: PropertyKey, array: Point[]) => { }, arrayOfPoint3D);
|
||||
|
||||
// #############################################################################################
|
||||
// Number - https://github.com/zloirock/core-js/#number
|
||||
// Modules: core.number.iterator
|
||||
// #############################################################################################
|
||||
|
||||
iterableIteratorOfNumber = i[Symbol.iterator]();
|
||||
|
||||
// #############################################################################################
|
||||
// Escaping characters - https://github.com/zloirock/core-js/#escaping-characters
|
||||
// Modules: core.string.escape-html
|
||||
// #############################################################################################
|
||||
|
||||
s = s.escapeHTML();
|
||||
s = s.unescapeHTML();
|
||||
|
||||
// #############################################################################################
|
||||
// delay - https://github.com/zloirock/core-js/#delay
|
||||
// Modules: core.delay
|
||||
// #############################################################################################
|
||||
|
||||
promiseOfVoid = delay(i);
|
||||
BIN
core-js/core-js-tests.ts.tscparams
Normal file
BIN
core-js/core-js-tests.ts.tscparams
Normal file
Binary file not shown.
3037
core-js/core-js.d.ts
vendored
Normal file
3037
core-js/core-js.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
d3/d3.d.ts
vendored
2
d3/d3.d.ts
vendored
@ -2810,7 +2810,7 @@ declare module d3 {
|
||||
|
||||
nodes(root: T): T[];
|
||||
|
||||
links(nodes: T[]): cluster.Link<T>;
|
||||
links(nodes: T[]): cluster.Link<T>[];
|
||||
|
||||
children(): (node: T) => T[];
|
||||
children(accessor: (node: T) => T[]): Cluster<T>;
|
||||
|
||||
2
dojo/dojox.widget.d.ts
vendored
2
dojo/dojox.widget.d.ts
vendored
@ -23018,7 +23018,7 @@ declare module dojox {
|
||||
*/
|
||||
class PortletSettings extends dijit._Container implements dijit.layout.ContentPane {
|
||||
constructor(params?: Object, srcNodeRef?: HTMLElement);
|
||||
inherited: { (arguments: IArguments): any };
|
||||
inherited: { (args: IArguments): any };
|
||||
/**
|
||||
* Custom press, release, and click synthetic events
|
||||
* which trigger on a left mouse click, touch, or space/enter keyup.
|
||||
|
||||
@ -25,10 +25,10 @@ d.destroy();
|
||||
d.element.appendChild(document.createElement("div"));
|
||||
d.tether.position();
|
||||
|
||||
d.on("open", () => null);
|
||||
d.on("close", () => null);
|
||||
d.once("close", () => null);
|
||||
d.off("close", () => null);
|
||||
d.on("open", () => false);
|
||||
d.on("close", () => false);
|
||||
d.once("close", () => false);
|
||||
d.off("close", () => false);
|
||||
d.off("open");
|
||||
|
||||
var e = new Drop({
|
||||
|
||||
2
ember/ember.d.ts
vendored
2
ember/ember.d.ts
vendored
@ -1420,7 +1420,7 @@ declare module Ember {
|
||||
Creates an instance of the class.
|
||||
@param arguments A hash containing values with which to initialize the newly instantiated object.
|
||||
**/
|
||||
static create<T extends Mixin>(...arguments: CoreObjectArguments[]): T;
|
||||
static create<T extends Mixin>(...args: CoreObjectArguments[]): T;
|
||||
detect(obj: any): boolean;
|
||||
reopen<T extends Mixin>(args?: {}): T;
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ function FSTest(): void {
|
||||
FS.symlink('file', 'link');
|
||||
|
||||
FS.writeFile('forbidden', 'can\'t touch this');
|
||||
FS.chmod('forbidden', 0000);
|
||||
FS.chmod('forbidden', parseInt("0000", 8));
|
||||
|
||||
FS.writeFile('file', 'foobar');
|
||||
FS.truncate('file', 3);
|
||||
|
||||
59
es6-collections/es6-collections-tests.ts
Normal file
59
es6-collections/es6-collections-tests.ts
Normal file
@ -0,0 +1,59 @@
|
||||
/// <reference path="es6-collections.d.ts" />
|
||||
|
||||
interface Point { x: number; y: number; }
|
||||
let a: any;
|
||||
let s: string;
|
||||
let b: boolean;
|
||||
let i: number;
|
||||
let pt: Point;
|
||||
let arrayOfPoint: Point[];
|
||||
let arrayOfStringPoint: [string, Point][];
|
||||
let arrayOfPointString: [Point, string][];
|
||||
let map: Map<string, Point>;
|
||||
let set: Set<Point>;
|
||||
let weakMap: WeakMap<Point, string>;
|
||||
let weakSet: WeakSet<Point>;
|
||||
let iteratorOfString: Iterator<String>;
|
||||
let iteratorOfStringPoint: Iterator<[String, Point]>;
|
||||
let iteratorOfPoint: Iterator<Point>;
|
||||
let iteratorOfPointPoint: Iterator<[Point, Point]>;
|
||||
|
||||
map = new Map<string, Point>();
|
||||
map = new Map(arrayOfStringPoint);
|
||||
map.clear();
|
||||
b = map.delete(s);
|
||||
map.forEach((value: Point, key: string, map: Map<string, Point>) => { }, a);
|
||||
pt = map.get(s);
|
||||
b = map.has(s);
|
||||
map = map.set(s, pt);
|
||||
iteratorOfStringPoint = map.entries();
|
||||
iteratorOfString = map.keys();
|
||||
iteratorOfPoint = map.values();
|
||||
i = map.size;
|
||||
|
||||
set = new Set<Point>();
|
||||
set = new Set(arrayOfPoint);
|
||||
set.clear();
|
||||
b = set.delete(pt);
|
||||
set.forEach((value: Point, key: Point, set: Set<Point>) => { }, a);
|
||||
b = set.has(pt);
|
||||
set = set.add(pt);
|
||||
iteratorOfPointPoint = set.entries();
|
||||
iteratorOfPoint = set.keys();
|
||||
iteratorOfPoint = set.values();
|
||||
i = set.size;
|
||||
|
||||
weakMap = new WeakMap<Point, string>();
|
||||
weakMap = new WeakMap(arrayOfPointString);
|
||||
weakMap.clear();
|
||||
b = weakMap.delete(pt);
|
||||
s = weakMap.get(pt);
|
||||
b = weakMap.has(pt);
|
||||
weakMap = weakMap.set(pt, s);
|
||||
|
||||
weakSet = new WeakSet<Point>();
|
||||
weakSet = new WeakSet(arrayOfPoint);
|
||||
weakSet.clear();
|
||||
b = weakSet.delete(pt);
|
||||
b = weakSet.has(pt);
|
||||
weakSet = weakSet.add(pt);
|
||||
1
es6-collections/es6-collections-tests.ts.tscparams
Normal file
1
es6-collections/es6-collections-tests.ts.tscparams
Normal file
@ -0,0 +1 @@
|
||||
--noImplicitAny --module commonjs --target es5
|
||||
113
es6-collections/es6-collections.d.ts
vendored
Normal file
113
es6-collections/es6-collections.d.ts
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
// Type definitions for es6-collections v0.5.1
|
||||
// Project: https://github.com/WebReflection/es6-collections/
|
||||
// Definitions by: Ron Buckton <http://github.com/rbuckton>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/* *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
interface IteratorResult<T> {
|
||||
done: boolean;
|
||||
value?: T;
|
||||
}
|
||||
|
||||
interface Iterator<T> {
|
||||
next(value?: any): IteratorResult<T>;
|
||||
return?(value?: any): IteratorResult<T>;
|
||||
throw?(e?: any): IteratorResult<T>;
|
||||
}
|
||||
|
||||
interface ForEachable<T> {
|
||||
forEach(callbackfn: (value: T) => void): void;
|
||||
}
|
||||
|
||||
interface Map<K, V> {
|
||||
clear(): void;
|
||||
delete(key: K): boolean;
|
||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
||||
get(key: K): V;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): Map<K, V>;
|
||||
entries(): Iterator<[K, V]>;
|
||||
keys(): Iterator<K>;
|
||||
values(): Iterator<V>;
|
||||
size: number;
|
||||
}
|
||||
|
||||
interface MapConstructor {
|
||||
new <K, V>(): Map<K, V>;
|
||||
new <K, V>(iterable: ForEachable<[K, V]>): Map<K, V>;
|
||||
prototype: Map<any, any>;
|
||||
}
|
||||
|
||||
declare var Map: MapConstructor;
|
||||
|
||||
interface Set<T> {
|
||||
add(value: T): Set<T>;
|
||||
clear(): void;
|
||||
delete(value: T): boolean;
|
||||
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
||||
has(value: T): boolean;
|
||||
entries(): Iterator<[T, T]>;
|
||||
keys(): Iterator<T>;
|
||||
values(): Iterator<T>;
|
||||
size: number;
|
||||
}
|
||||
|
||||
interface SetConstructor {
|
||||
new <T>(): Set<T>;
|
||||
new <T>(iterable: ForEachable<T>): Set<T>;
|
||||
prototype: Set<any>;
|
||||
}
|
||||
|
||||
declare var Set: SetConstructor;
|
||||
|
||||
interface WeakMap<K, V> {
|
||||
delete(key: K): boolean;
|
||||
clear(): void;
|
||||
get(key: K): V;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): WeakMap<K, V>;
|
||||
}
|
||||
|
||||
interface WeakMapConstructor {
|
||||
new <K, V>(): WeakMap<K, V>;
|
||||
new <K, V>(iterable: ForEachable<[K, V]>): WeakMap<K, V>;
|
||||
prototype: WeakMap<any, any>;
|
||||
}
|
||||
|
||||
declare var WeakMap: WeakMapConstructor;
|
||||
|
||||
interface WeakSet<T> {
|
||||
delete(value: T): boolean;
|
||||
clear(): void;
|
||||
add(value: T): WeakSet<T>;
|
||||
has(value: T): boolean;
|
||||
}
|
||||
|
||||
interface WeakSetConstructor {
|
||||
new <T>(): WeakSet<T>;
|
||||
new <T>(iterable: ForEachable<T>): WeakSet<T>;
|
||||
prototype: WeakSet<any>;
|
||||
}
|
||||
|
||||
declare var WeakSet: WeakSetConstructor;
|
||||
|
||||
declare module "es6-collections" {
|
||||
var Map: MapConstructor;
|
||||
var Set: SetConstructor;
|
||||
var WeakMap: WeakMapConstructor;
|
||||
var WeakSet: WeakSetConstructor;
|
||||
}
|
||||
222
es6-shim/es6-shim-tests.ts
Normal file
222
es6-shim/es6-shim-tests.ts
Normal file
@ -0,0 +1,222 @@
|
||||
/// <reference path="es6-shim.d.ts" />
|
||||
|
||||
interface Point { x: number; y: number; }
|
||||
interface Point3D extends Point { z: number; }
|
||||
|
||||
let a: any;
|
||||
let s: string;
|
||||
let i: number;
|
||||
let b: boolean;
|
||||
let f: () => void;
|
||||
let o: Object;
|
||||
let r: RegExp;
|
||||
let sym: symbol;
|
||||
let e: Error;
|
||||
let date: Date;
|
||||
let key: PropertyKey;
|
||||
let point: Point;
|
||||
let point3d: Point3D;
|
||||
let arrayOfPoint: Point[];
|
||||
let arrayOfPoint3D: Point3D[];
|
||||
let arrayOfSymbol: symbol[];
|
||||
let arrayOfPropertyKey: PropertyKey[];
|
||||
let arrayOfAny: any[];
|
||||
let arrayOfStringAny: [string, any][];
|
||||
let arrayLikeOfAny: ArrayLike<any>;
|
||||
let iterableOfPoint: IterableShim<Point>;
|
||||
let iterableOfStringPoint: IterableShim<[string, Point]>;
|
||||
let iterableOfPointPoint3D: IterableShim<[Point, Point3D]>;
|
||||
let iterableIteratorOfPoint: IterableIteratorShim<Point>;
|
||||
let iterableIteratorOfNumberPoint: IterableIteratorShim<[number, Point]>;
|
||||
let iterableIteratorOfNumber: IterableIteratorShim<number>;
|
||||
let iterableIteratorOfString: IterableIteratorShim<string>;
|
||||
let iterableIteratorOfPointPoint: IterableIteratorShim<[Point, Point]>;
|
||||
let iterableIteratorOfNode: IterableIteratorShim<Node>;
|
||||
let iterableIteratorOfStringPoint: IterableIteratorShim<[string, Point]>;
|
||||
let iterableIteratorOfAny: IterableIteratorShim<any>;
|
||||
let iterableIteratorOfPropertyKey: IterableIteratorShim<PropertyKey>;
|
||||
let iterableIteratorOfPropertyKeyPoint: IterableIteratorShim<[PropertyKey, Point]>;
|
||||
let nodeList: NodeList;
|
||||
let pd: PropertyDescriptor;
|
||||
let pdm: PropertyDescriptorMap;
|
||||
let map: Map<string, Point>;
|
||||
let set: Set<Point>;
|
||||
let weakMap: WeakMap<Point, Point3D>;
|
||||
let weakSet: WeakSet<Point>;
|
||||
let promiseLikeOfPoint: PromiseLike<Point>;
|
||||
let promiseLikeOfPoint3D: PromiseLike<Point3D>;
|
||||
let promiseOfPoint: Promise<Point>;
|
||||
let promiseOfPoint3D: Promise<Point3D>;
|
||||
let promiseOfArrayOfPoint: Promise<Point[]>;
|
||||
let promiseOfVoid: Promise<void>;
|
||||
|
||||
point = Object.assign(point, point);
|
||||
b = Object.is(point, point);
|
||||
Object.setPrototypeOf(point, point);
|
||||
point = arrayOfPoint.find(p => b);
|
||||
i = arrayOfPoint.findIndex(p => b);
|
||||
arrayOfPoint = arrayOfPoint.fill(point, i, arrayOfPoint.length);
|
||||
arrayOfPoint = arrayOfPoint.copyWithin(i, i, i);
|
||||
arrayOfPoint = Array.from(arrayOfPoint);
|
||||
arrayOfPoint = Array.from(iterableOfPoint);
|
||||
arrayOfPoint3D = Array.from(arrayOfPoint, point => point3d);
|
||||
arrayOfPoint3D = Array.from(arrayOfPoint, point => point3d, a);
|
||||
arrayOfPoint3D = Array.from(iterableOfPoint, point => point3d);
|
||||
arrayOfPoint3D = Array.from(iterableOfPoint, point => point3d, a);
|
||||
arrayOfPoint = Array.of(point, point);
|
||||
i = s.codePointAt(i);
|
||||
b = s.includes(s, i);
|
||||
b = s.endsWith(s, i);
|
||||
s = s.repeat(i);
|
||||
b = s.startsWith(s, i);
|
||||
s = String.fromCodePoint(i, i);
|
||||
s = String.raw`abc`;
|
||||
s = r.flags;
|
||||
i = Number.EPSILON;
|
||||
b = Number.isFinite(i);
|
||||
b = Number.isInteger(i);
|
||||
b = Number.isNaN(i);
|
||||
b = Number.isSafeInteger(i);
|
||||
i = Number.MAX_SAFE_INTEGER;
|
||||
i = Number.MIN_SAFE_INTEGER;
|
||||
i = Number.parseFloat(s);
|
||||
i = Number.parseInt(s);
|
||||
i = Number.parseInt(s, i);
|
||||
i = Math.clz32(i);
|
||||
i = Math.imul(i, i);
|
||||
i = Math.sign(i);
|
||||
i = Math.log10(i);
|
||||
i = Math.log2(i);
|
||||
i = Math.log1p(i);
|
||||
i = Math.expm1(i);
|
||||
i = Math.cosh(i);
|
||||
i = Math.sinh(i);
|
||||
i = Math.tanh(i);
|
||||
i = Math.acosh(i);
|
||||
i = Math.asinh(i);
|
||||
i = Math.atanh(i);
|
||||
i = Math.hypot(i, i);
|
||||
i = Math.trunc(i);
|
||||
i = Math.fround(i);
|
||||
i = Math.cbrt(i);
|
||||
map.clear();
|
||||
map.delete(s);
|
||||
map.forEach((value: Point, key: string) => { });
|
||||
point = map.get(s);
|
||||
b = map.has(s);
|
||||
map = map.set(s, point);
|
||||
i = map.size;
|
||||
map = new Map<string, Point>();
|
||||
map = new Map(iterableOfStringPoint);
|
||||
set.clear();
|
||||
set.delete(point);
|
||||
set.forEach((value: Point, key: Point) => { });
|
||||
b = set.has(point);
|
||||
set = set.add(point);
|
||||
i = set.size;
|
||||
set = new Set<Point>();
|
||||
set = new Set(iterableOfPoint);
|
||||
weakMap.delete(point);
|
||||
point3d = weakMap.get(point);
|
||||
b = weakMap.has(point);
|
||||
weakMap = weakMap.set(point, point3d);
|
||||
weakMap = new WeakMap<Point, Point3D>();
|
||||
weakMap = new WeakMap(iterableOfPointPoint3D);
|
||||
weakSet.delete(point);
|
||||
weakSet = weakSet.add(point);
|
||||
b = weakSet.has(point);
|
||||
weakSet = new WeakSet<Point>();
|
||||
weakSet = new WeakSet(iterableOfPoint);
|
||||
iterableIteratorOfNumberPoint = arrayOfPoint.entries();
|
||||
iterableIteratorOfNumber = arrayOfPoint.keys();
|
||||
iterableIteratorOfPoint = arrayOfPoint.values();
|
||||
iterableIteratorOfPointPoint = set.entries();
|
||||
iterableIteratorOfPoint = set.keys();
|
||||
iterableIteratorOfPoint = set.values();
|
||||
promiseLikeOfPoint.then((point: Point) => { });
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then();
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point);
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint);
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => point);
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint, e => point);
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => promiseLikeOfPoint);
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => { });
|
||||
promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint, e => { });
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d);
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D);
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => point3d);
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D, e => point3d);
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => promiseLikeOfPoint3D);
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => { });
|
||||
promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D, e => { });
|
||||
promiseOfPoint.then((point: Point) => { });
|
||||
promiseOfPoint = promiseOfPoint.then();
|
||||
promiseOfPoint = promiseOfPoint.then(p => point);
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.then(p => point, e => point);
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint, e => point);
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint, e => point);
|
||||
promiseOfPoint = promiseOfPoint.then(p => point, e => promiseOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.then(p => point, e => promiseLikeOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.then(p => point, e => { });
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint, e => { });
|
||||
promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint, e => { });
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => point3d);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => point3d);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D, e => point3d);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D, e => point3d);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => promiseOfPoint3D);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => promiseLikeOfPoint3D);
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => { });
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D, e => { });
|
||||
promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D, e => { });
|
||||
promiseOfPoint = promiseOfPoint.catch(e => point);
|
||||
promiseOfPoint = promiseOfPoint.catch(e => promiseOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.catch(e => promiseLikeOfPoint);
|
||||
promiseOfPoint = promiseOfPoint.catch(e => { });
|
||||
promiseOfPoint3D = promiseOfPoint.catch(e => point3d);
|
||||
promiseOfPoint3D = promiseOfPoint.catch(e => promiseOfPoint3D);
|
||||
promiseOfPoint3D = promiseOfPoint.catch(e => promiseLikeOfPoint3D);
|
||||
promiseOfPoint = new Promise<Point>((resolve, reject) => resolve(point));
|
||||
promiseOfPoint = new Promise<Point>((resolve, reject) => resolve(promiseOfPoint));
|
||||
promiseOfPoint = new Promise<Point>((resolve, reject) => resolve(promiseLikeOfPoint));
|
||||
promiseOfPoint = new Promise<Point>((resolve, reject) => reject(e));
|
||||
promiseOfArrayOfPoint = Promise.all(arrayOfPoint);
|
||||
promiseOfArrayOfPoint = Promise.all(iterableOfPoint);
|
||||
promiseOfPoint = Promise.race(arrayOfPoint);
|
||||
promiseOfPoint = Promise.race(iterableOfPoint);
|
||||
promiseOfVoid = Promise.resolve();
|
||||
promiseOfPoint = Promise.resolve(point3d);
|
||||
promiseOfPoint = Promise.resolve(promiseOfPoint);
|
||||
promiseOfPoint = Promise.resolve(promiseLikeOfPoint);
|
||||
promiseOfVoid = Promise.reject(e);
|
||||
promiseOfPoint = Promise.reject<Point>(e);
|
||||
a = Reflect.apply(f, a, arrayLikeOfAny);
|
||||
a = Reflect.construct(f, arrayLikeOfAny);
|
||||
b = Reflect.defineProperty(a, s, pd);
|
||||
b = Reflect.defineProperty(a, i, pd);
|
||||
b = Reflect.defineProperty(a, sym, pd);
|
||||
b = Reflect.deleteProperty(a, s);
|
||||
b = Reflect.deleteProperty(a, i);
|
||||
b = Reflect.deleteProperty(a, sym);
|
||||
iterableIteratorOfAny = Reflect.enumerate(a);
|
||||
a = Reflect.get(a, s, a);
|
||||
a = Reflect.get(a, i, a);
|
||||
a = Reflect.get(a, sym, a);
|
||||
pd = Reflect.getOwnPropertyDescriptor(a, s);
|
||||
pd = Reflect.getOwnPropertyDescriptor(a, i);
|
||||
pd = Reflect.getOwnPropertyDescriptor(a, sym);
|
||||
a = Reflect.getPrototypeOf(a);
|
||||
b = Reflect.has(a, s);
|
||||
b = Reflect.has(a, i);
|
||||
b = Reflect.has(a, sym);
|
||||
b = Reflect.isExtensible(a);
|
||||
arrayOfPropertyKey = Reflect.ownKeys(a);
|
||||
b = Reflect.preventExtensions(a);
|
||||
b = Reflect.set(a, s, a, a);
|
||||
b = Reflect.set(a, i, a, a);
|
||||
b = Reflect.set(a, sym, a, a);
|
||||
b = Reflect.setPrototypeOf(a, a);
|
||||
1
es6-shim/es6-shim-tests.ts.tscparams
Normal file
1
es6-shim/es6-shim-tests.ts.tscparams
Normal file
@ -0,0 +1 @@
|
||||
--noImplicitAny --module commonjs --target es5
|
||||
673
es6-shim/es6-shim.d.ts
vendored
Normal file
673
es6-shim/es6-shim.d.ts
vendored
Normal file
@ -0,0 +1,673 @@
|
||||
// Type definitions for es6-shim v0.31.2
|
||||
// Project: https://github.com/paulmillr/es6-shim
|
||||
// Definitions by: Ron Buckton <http://github.com/rbuckton>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare type PropertyKey = string | number | symbol;
|
||||
|
||||
interface IteratorResult<T> {
|
||||
done: boolean;
|
||||
value?: T;
|
||||
}
|
||||
|
||||
interface IterableShim<T> {
|
||||
/**
|
||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
||||
*/
|
||||
"_es6-shim iterator_"(): Iterator<T>;
|
||||
}
|
||||
|
||||
interface Iterator<T> {
|
||||
next(value?: any): IteratorResult<T>;
|
||||
return?(value?: any): IteratorResult<T>;
|
||||
throw?(e?: any): IteratorResult<T>;
|
||||
}
|
||||
|
||||
interface IterableIteratorShim<T> extends IterableShim<T>, Iterator<T> {
|
||||
/**
|
||||
* Shim for an ES6 iterable iterator. Not intended for direct use by user code.
|
||||
*/
|
||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
||||
}
|
||||
|
||||
interface StringConstructor {
|
||||
/**
|
||||
* Return the String value whose elements are, in order, the elements in the List elements.
|
||||
* If length is 0, the empty string is returned.
|
||||
*/
|
||||
fromCodePoint(...codePoints: number[]): string;
|
||||
|
||||
/**
|
||||
* String.raw is intended for use as a tag function of a Tagged Template String. When called
|
||||
* as such the first argument will be a well formed template call site object and the rest
|
||||
* parameter will contain the substitution values.
|
||||
* @param template A well-formed template string call site representation.
|
||||
* @param substitutions A set of substitution values.
|
||||
*/
|
||||
raw(template: TemplateStringsArray, ...substitutions: any[]): string;
|
||||
}
|
||||
|
||||
interface String {
|
||||
/**
|
||||
* Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
|
||||
* value of the UTF-16 encoded code point starting at the string element at position pos in
|
||||
* the String resulting from converting this object to a String.
|
||||
* If there is no element at that position, the result is undefined.
|
||||
* If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
|
||||
*/
|
||||
codePointAt(pos: number): number;
|
||||
|
||||
/**
|
||||
* Returns true if searchString appears as a substring of the result of converting this
|
||||
* object to a String, at one or more positions that are
|
||||
* greater than or equal to position; otherwise, returns false.
|
||||
* @param searchString search string
|
||||
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
|
||||
*/
|
||||
includes(searchString: string, position?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
||||
* same as the corresponding elements of this object (converted to a String) starting at
|
||||
* endPosition – length(this). Otherwise returns false.
|
||||
*/
|
||||
endsWith(searchString: string, endPosition?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns a String value that is made from count copies appended together. If count is 0,
|
||||
* T is the empty String is returned.
|
||||
* @param count number of copies to append
|
||||
*/
|
||||
repeat(count: number): string;
|
||||
|
||||
/**
|
||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
||||
* same as the corresponding elements of this object (converted to a String) starting at
|
||||
* position. Otherwise returns false.
|
||||
*/
|
||||
startsWith(searchString: string, position?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns an <a> HTML anchor element and sets the name attribute to the text value
|
||||
* @param name
|
||||
*/
|
||||
anchor(name: string): string;
|
||||
|
||||
/** Returns a <big> HTML element */
|
||||
big(): string;
|
||||
|
||||
/** Returns a <blink> HTML element */
|
||||
blink(): string;
|
||||
|
||||
/** Returns a <b> HTML element */
|
||||
bold(): string;
|
||||
|
||||
/** Returns a <tt> HTML element */
|
||||
fixed(): string
|
||||
|
||||
/** Returns a <font> HTML element and sets the color attribute value */
|
||||
fontcolor(color: string): string
|
||||
|
||||
/** Returns a <font> HTML element and sets the size attribute value */
|
||||
fontsize(size: number): string;
|
||||
|
||||
/** Returns a <font> HTML element and sets the size attribute value */
|
||||
fontsize(size: string): string;
|
||||
|
||||
/** Returns an <i> HTML element */
|
||||
italics(): string;
|
||||
|
||||
/** Returns an <a> HTML element and sets the href attribute value */
|
||||
link(url: string): string;
|
||||
|
||||
/** Returns a <small> HTML element */
|
||||
small(): string;
|
||||
|
||||
/** Returns a <strike> HTML element */
|
||||
strike(): string;
|
||||
|
||||
/** Returns a <sub> HTML element */
|
||||
sub(): string;
|
||||
|
||||
/** Returns a <sup> HTML element */
|
||||
sup(): string;
|
||||
|
||||
/**
|
||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
||||
*/
|
||||
"_es6-shim iterator_"(): IterableIteratorShim<string>;
|
||||
}
|
||||
|
||||
interface ArrayLike<T> {
|
||||
length: number;
|
||||
[n: number]: T;
|
||||
}
|
||||
|
||||
interface ArrayConstructor {
|
||||
/**
|
||||
* Creates an array from an array-like object.
|
||||
* @param arrayLike An array-like object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
||||
|
||||
/**
|
||||
* Creates an array from an iterable object.
|
||||
* @param iterable An iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from<T, U>(iterable: IterableShim<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like object.
|
||||
* @param arrayLike An array-like object to convert to an array.
|
||||
*/
|
||||
from<T>(arrayLike: ArrayLike<T>): Array<T>;
|
||||
|
||||
/**
|
||||
* Creates an array from an iterable object.
|
||||
* @param iterable An iterable object to convert to an array.
|
||||
*/
|
||||
from<T>(iterable: IterableShim<T>): Array<T>;
|
||||
|
||||
/**
|
||||
* Returns a new array from a set of elements.
|
||||
* @param items A set of elements to include in the new array object.
|
||||
*/
|
||||
of<T>(...items: T[]): Array<T>;
|
||||
}
|
||||
|
||||
interface Array<T> {
|
||||
/**
|
||||
* Returns the value of the first element in the array where predicate is true, and undefined
|
||||
* otherwise.
|
||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
||||
* immediately returns that element value. Otherwise, find returns undefined.
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
|
||||
|
||||
/**
|
||||
* Returns the index of the first element in the array where predicate is true, and undefined
|
||||
* otherwise.
|
||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
||||
* immediately returns that element value. Otherwise, find returns undefined.
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
|
||||
|
||||
/**
|
||||
* Returns the this object after filling the section identified by start and end with value
|
||||
* @param value value to fill array section with
|
||||
* @param start index to start filling the array at. If start is negative, it is treated as
|
||||
* length+start where length is the length of the array.
|
||||
* @param end index to stop filling the array at. If end is negative, it is treated as
|
||||
* length+end.
|
||||
*/
|
||||
fill(value: T, start?: number, end?: number): T[];
|
||||
|
||||
/**
|
||||
* Returns the this object after copying a section of the array identified by start and end
|
||||
* to the same array starting at position target
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start: number, end?: number): T[];
|
||||
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIteratorShim<[number, T]>;
|
||||
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIteratorShim<number>;
|
||||
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIteratorShim<T>;
|
||||
|
||||
/**
|
||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
||||
*/
|
||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
||||
}
|
||||
|
||||
interface NumberConstructor {
|
||||
/**
|
||||
* The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
|
||||
* that is representable as a Number value, which is approximately:
|
||||
* 2.2204460492503130808472633361816 x 10−16.
|
||||
*/
|
||||
EPSILON: number;
|
||||
|
||||
/**
|
||||
* Returns true if passed value is finite.
|
||||
* Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
|
||||
* number. Only finite values of the type number, result in true.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isFinite(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is an integer, false otherwise.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isInteger(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
|
||||
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
|
||||
* to a number. Only values of the type number, that are also NaN, result in true.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isNaN(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is a safe integer.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isSafeInteger(number: number): boolean;
|
||||
|
||||
/**
|
||||
* The value of the largest integer n such that n and n + 1 are both exactly representable as
|
||||
* a Number value.
|
||||
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
|
||||
*/
|
||||
MAX_SAFE_INTEGER: number;
|
||||
|
||||
/**
|
||||
* The value of the smallest integer n such that n and n − 1 are both exactly representable as
|
||||
* a Number value.
|
||||
* The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
|
||||
*/
|
||||
MIN_SAFE_INTEGER: number;
|
||||
|
||||
/**
|
||||
* Converts a string to a floating-point number.
|
||||
* @param string A string that contains a floating-point number.
|
||||
*/
|
||||
parseFloat(string: string): number;
|
||||
|
||||
/**
|
||||
* Converts A string to an integer.
|
||||
* @param s A string to convert into a number.
|
||||
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
|
||||
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
|
||||
* All other strings are considered decimal.
|
||||
*/
|
||||
parseInt(string: string, radix?: number): number;
|
||||
}
|
||||
|
||||
interface ObjectConstructor {
|
||||
/**
|
||||
* Copy the values of all of the enumerable own properties from one or more source objects to a
|
||||
* target object. Returns the target object.
|
||||
* @param target The target object to copy to.
|
||||
* @param sources One or more source objects to copy properties from.
|
||||
*/
|
||||
assign(target: any, ...sources: any[]): any;
|
||||
|
||||
/**
|
||||
* Returns true if the values are the same value, false otherwise.
|
||||
* @param value1 The first value.
|
||||
* @param value2 The second value.
|
||||
*/
|
||||
is(value1: any, value2: any): boolean;
|
||||
|
||||
/**
|
||||
* Sets the prototype of a specified object o to object proto or null. Returns the object o.
|
||||
* @param o The object to change its prototype.
|
||||
* @param proto The value of the new prototype or null.
|
||||
* @remarks Requires `__proto__` support.
|
||||
*/
|
||||
setPrototypeOf(o: any, proto: any): any;
|
||||
}
|
||||
|
||||
interface RegExp {
|
||||
/**
|
||||
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
|
||||
* The characters in this string are sequenced and concatenated in the following order:
|
||||
*
|
||||
* - "g" for global
|
||||
* - "i" for ignoreCase
|
||||
* - "m" for multiline
|
||||
* - "u" for unicode
|
||||
* - "y" for sticky
|
||||
*
|
||||
* If no flags are set, the value is the empty string.
|
||||
*/
|
||||
flags: string;
|
||||
}
|
||||
|
||||
interface Math {
|
||||
/**
|
||||
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
clz32(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the result of 32-bit multiplication of two numbers.
|
||||
* @param x First number
|
||||
* @param y Second number
|
||||
*/
|
||||
imul(x: number, y: number): number;
|
||||
|
||||
/**
|
||||
* Returns the sign of the x, indicating whether x is positive, negative or zero.
|
||||
* @param x The numeric expression to test
|
||||
*/
|
||||
sign(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the base 10 logarithm of a number.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
log10(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the base 2 logarithm of a number.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
log2(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the natural logarithm of 1 + x.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
log1p(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
|
||||
* the natural logarithms).
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
expm1(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic cosine of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
cosh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic sine of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
sinh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic tangent of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
tanh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the inverse hyperbolic cosine of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
acosh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the inverse hyperbolic sine of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
asinh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the inverse hyperbolic tangent of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
atanh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the square root of the sum of squares of its arguments.
|
||||
* @param values Values to compute the square root for.
|
||||
* If no arguments are passed, the result is +0.
|
||||
* If there is only one argument, the result is the absolute value.
|
||||
* If any argument is +Infinity or -Infinity, the result is +Infinity.
|
||||
* If any argument is NaN, the result is NaN.
|
||||
* If all arguments are either +0 or −0, the result is +0.
|
||||
*/
|
||||
hypot(...values: number[]): number;
|
||||
|
||||
/**
|
||||
* Returns the integral part of the a numeric expression, x, removing any fractional digits.
|
||||
* If x is already an integer, the result is x.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
trunc(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the nearest single precision float representation of a number.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
fround(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns an implementation-dependent approximation to the cube root of number.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
cbrt(x: number): number;
|
||||
}
|
||||
|
||||
interface PromiseLike<T> {
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
* @param onrejected The callback to execute when the Promise is rejected.
|
||||
* @returns A Promise for the completion of which ever callback is executed.
|
||||
*/
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the completion of an asynchronous operation
|
||||
*/
|
||||
interface Promise<T> {
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
* @param onrejected The callback to execute when the Promise is rejected.
|
||||
* @returns A Promise for the completion of which ever callback is executed.
|
||||
*/
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
|
||||
|
||||
/**
|
||||
* Attaches a callback for only the rejection of the Promise.
|
||||
* @param onrejected The callback to execute when the Promise is rejected.
|
||||
* @returns A Promise for the completion of the callback.
|
||||
*/
|
||||
catch(onrejected?: (reason: any) => T | PromiseLike<T>): Promise<T>;
|
||||
catch(onrejected?: (reason: any) => void): Promise<T>;
|
||||
}
|
||||
|
||||
interface PromiseConstructor {
|
||||
/**
|
||||
* A reference to the prototype.
|
||||
*/
|
||||
prototype: Promise<any>;
|
||||
|
||||
/**
|
||||
* Creates a new Promise.
|
||||
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
|
||||
* a resolve callback used resolve the promise with a value or the result of another promise,
|
||||
* and a reject callback used to reject the promise with a provided reason or error.
|
||||
*/
|
||||
new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
|
||||
|
||||
/**
|
||||
* Creates a Promise that is resolved with an array of results when all of the provided Promises
|
||||
* resolve, or rejected when any Promise is rejected.
|
||||
* @param values An array of Promises.
|
||||
* @returns A new Promise.
|
||||
*/
|
||||
all<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T[]>;
|
||||
|
||||
/**
|
||||
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
|
||||
* or rejected.
|
||||
* @param values An array of Promises.
|
||||
* @returns A new Promise.
|
||||
*/
|
||||
race<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T>;
|
||||
|
||||
/**
|
||||
* Creates a new rejected promise for the provided reason.
|
||||
* @param reason The reason the promise was rejected.
|
||||
* @returns A new rejected Promise.
|
||||
*/
|
||||
reject(reason: any): Promise<void>;
|
||||
|
||||
/**
|
||||
* Creates a new rejected promise for the provided reason.
|
||||
* @param reason The reason the promise was rejected.
|
||||
* @returns A new rejected Promise.
|
||||
*/
|
||||
reject<T>(reason: any): Promise<T>;
|
||||
|
||||
/**
|
||||
* Creates a new resolved promise for the provided value.
|
||||
* @param value A promise.
|
||||
* @returns A promise whose internal state matches the provided promise.
|
||||
*/
|
||||
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
||||
|
||||
/**
|
||||
* Creates a new resolved promise .
|
||||
* @returns A resolved promise.
|
||||
*/
|
||||
resolve(): Promise<void>;
|
||||
}
|
||||
|
||||
declare var Promise: PromiseConstructor;
|
||||
|
||||
interface Map<K, V> {
|
||||
clear(): void;
|
||||
delete(key: K): boolean;
|
||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
||||
get(key: K): V;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): Map<K, V>;
|
||||
size: number;
|
||||
entries(): IterableIteratorShim<[K, V]>;
|
||||
keys(): IterableIteratorShim<K>;
|
||||
values(): IterableIteratorShim<V>;
|
||||
}
|
||||
|
||||
interface MapConstructor {
|
||||
new <K, V>(): Map<K, V>;
|
||||
new <K, V>(iterable: IterableShim<[K, V]>): Map<K, V>;
|
||||
prototype: Map<any, any>;
|
||||
}
|
||||
|
||||
declare var Map: MapConstructor;
|
||||
|
||||
interface Set<T> {
|
||||
add(value: T): Set<T>;
|
||||
clear(): void;
|
||||
delete(value: T): boolean;
|
||||
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
||||
has(value: T): boolean;
|
||||
size: number;
|
||||
entries(): IterableIteratorShim<[T, T]>;
|
||||
keys(): IterableIteratorShim<T>;
|
||||
values(): IterableIteratorShim<T>;
|
||||
}
|
||||
|
||||
interface SetConstructor {
|
||||
new <T>(): Set<T>;
|
||||
new <T>(iterable: IterableShim<T>): Set<T>;
|
||||
prototype: Set<any>;
|
||||
}
|
||||
|
||||
declare var Set: SetConstructor;
|
||||
|
||||
interface WeakMap<K, V> {
|
||||
delete(key: K): boolean;
|
||||
get(key: K): V;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): WeakMap<K, V>;
|
||||
}
|
||||
|
||||
interface WeakMapConstructor {
|
||||
new <K, V>(): WeakMap<K, V>;
|
||||
new <K, V>(iterable: IterableShim<[K, V]>): WeakMap<K, V>;
|
||||
prototype: WeakMap<any, any>;
|
||||
}
|
||||
|
||||
declare var WeakMap: WeakMapConstructor;
|
||||
|
||||
interface WeakSet<T> {
|
||||
add(value: T): WeakSet<T>;
|
||||
delete(value: T): boolean;
|
||||
has(value: T): boolean;
|
||||
}
|
||||
|
||||
interface WeakSetConstructor {
|
||||
new <T>(): WeakSet<T>;
|
||||
new <T>(iterable: IterableShim<T>): WeakSet<T>;
|
||||
prototype: WeakSet<any>;
|
||||
}
|
||||
|
||||
declare var WeakSet: WeakSetConstructor;
|
||||
|
||||
declare module Reflect {
|
||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
||||
function enumerate(target: any): IterableIteratorShim<any>;
|
||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
||||
function getPrototypeOf(target: any): any;
|
||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
||||
function isExtensible(target: any): boolean;
|
||||
function ownKeys(target: any): Array<PropertyKey>;
|
||||
function preventExtensions(target: any): boolean;
|
||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
||||
function setPrototypeOf(target: any, proto: any): boolean;
|
||||
}
|
||||
|
||||
declare module "es6-shim" {
|
||||
var String: StringConstructor;
|
||||
var Array: ArrayConstructor;
|
||||
var Number: NumberConstructor;
|
||||
var Math: Math;
|
||||
var Object: ObjectConstructor;
|
||||
var Map: MapConstructor;
|
||||
var Set: SetConstructor;
|
||||
var WeakMap: WeakMapConstructor;
|
||||
var WeakSet: WeakSetConstructor;
|
||||
var Promise: PromiseConstructor;
|
||||
module Reflect {
|
||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
||||
function enumerate(target: any): Iterator<any>;
|
||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
||||
function getPrototypeOf(target: any): any;
|
||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
||||
function isExtensible(target: any): boolean;
|
||||
function ownKeys(target: any): Array<PropertyKey>;
|
||||
function preventExtensions(target: any): boolean;
|
||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
||||
function setPrototypeOf(target: any, proto: any): boolean;
|
||||
}
|
||||
}
|
||||
@ -740,7 +740,7 @@ function sample8() {
|
||||
}
|
||||
|
||||
for (var i = activeObjectButtons.length; i--;) {
|
||||
activeObjectButtons[i].disabled = true;
|
||||
activeObjectButtons[i];
|
||||
}
|
||||
|
||||
canvas.on('object:selected', onObjectSelected);
|
||||
@ -750,7 +750,7 @@ function sample8() {
|
||||
var selectedObject = e.target;
|
||||
|
||||
for (var i = activeObjectButtons.length; i--;) {
|
||||
activeObjectButtons[i].disabled = false;
|
||||
activeObjectButtons[i];
|
||||
}
|
||||
|
||||
lockHorizontallyEl.innerHTML = (selectedObject.lockMovementX ? 'Unlock horizontal movement' : 'Lock horizontal movement');
|
||||
@ -762,7 +762,7 @@ function sample8() {
|
||||
|
||||
canvas.on('selection:cleared', function(e) {
|
||||
for (var i = activeObjectButtons.length; i--;) {
|
||||
activeObjectButtons[i].disabled = true;
|
||||
activeObjectButtons[i];
|
||||
}
|
||||
});
|
||||
|
||||
@ -889,7 +889,6 @@ function sample8() {
|
||||
var cmdUnderlineBtn = document.getElementById('text-cmd-underline');
|
||||
if (cmdUnderlineBtn) {
|
||||
activeObjectButtons.push(cmdUnderlineBtn);
|
||||
cmdUnderlineBtn.disabled = true;
|
||||
cmdUnderlineBtn.onclick = function() {
|
||||
var activeObject = <fabric.IText>canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
@ -903,7 +902,6 @@ function sample8() {
|
||||
var cmdLinethroughBtn = document.getElementById('text-cmd-linethrough');
|
||||
if (cmdLinethroughBtn) {
|
||||
activeObjectButtons.push(cmdLinethroughBtn);
|
||||
cmdLinethroughBtn.disabled = true;
|
||||
cmdLinethroughBtn.onclick = function() {
|
||||
var activeObject = <fabric.IText>canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
@ -917,7 +915,6 @@ function sample8() {
|
||||
var cmdOverlineBtn = document.getElementById('text-cmd-overline');
|
||||
if (cmdOverlineBtn) {
|
||||
activeObjectButtons.push(cmdOverlineBtn);
|
||||
cmdOverlineBtn.disabled = true;
|
||||
cmdOverlineBtn.onclick = function() {
|
||||
var activeObject = <fabric.IText>canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
@ -931,7 +928,6 @@ function sample8() {
|
||||
var cmdBoldBtn = document.getElementById('text-cmd-bold');
|
||||
if (cmdBoldBtn) {
|
||||
activeObjectButtons.push(cmdBoldBtn);
|
||||
cmdBoldBtn.disabled = true;
|
||||
cmdBoldBtn.onclick = function() {
|
||||
var activeObject = <fabric.IText>canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
@ -945,7 +941,6 @@ function sample8() {
|
||||
var cmdItalicBtn = document.getElementById('text-cmd-italic');
|
||||
if (cmdItalicBtn) {
|
||||
activeObjectButtons.push(cmdItalicBtn);
|
||||
cmdItalicBtn.disabled = true;
|
||||
cmdItalicBtn.onclick = function() {
|
||||
var activeObject = <fabric.IText>canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
@ -959,7 +954,6 @@ function sample8() {
|
||||
var cmdShadowBtn = document.getElementById('text-cmd-shadow');
|
||||
if (cmdShadowBtn) {
|
||||
activeObjectButtons.push(cmdShadowBtn);
|
||||
cmdShadowBtn.disabled = true;
|
||||
cmdShadowBtn.onclick = function() {
|
||||
var activeObject = <fabric.IText>canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
@ -973,7 +967,6 @@ function sample8() {
|
||||
var textAlignSwitch = document.getElementById('text-align');
|
||||
if (textAlignSwitch) {
|
||||
activeObjectButtons.push(textAlignSwitch);
|
||||
textAlignSwitch.disabled = true;
|
||||
textAlignSwitch.onchange = function() {
|
||||
var activeObject = <fabric.IText>canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
@ -986,7 +979,6 @@ function sample8() {
|
||||
var fontFamilySwitch = document.getElementById('font-family');
|
||||
if (fontFamilySwitch) {
|
||||
activeObjectButtons.push(fontFamilySwitch);
|
||||
fontFamilySwitch.disabled = true;
|
||||
fontFamilySwitch.onchange = function() {
|
||||
var activeObject = <fabric.IText>canvas.getActiveObject();
|
||||
if (activeObject && activeObject.type === 'text') {
|
||||
|
||||
24
fluxxor/fluxxor.d.ts
vendored
24
fluxxor/fluxxor.d.ts
vendored
@ -3,7 +3,7 @@
|
||||
// Definitions by: Yuichi Murata <https://github.com/mrk21>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path='../react/legacy/react-0.12.d.ts' />
|
||||
///<reference path='../react/react.d.ts' />
|
||||
///<reference path='../eventemitter3/eventemitter3.d.ts' />
|
||||
|
||||
declare module Fluxxor {
|
||||
@ -14,7 +14,7 @@ declare module Fluxxor {
|
||||
doDispatchLoop(action: Function): void;
|
||||
waitForStores(store: Store, stores: string[], fn: Function): void;
|
||||
}
|
||||
|
||||
|
||||
class Flux extends EventEmitter3.EventEmitter {
|
||||
constructor(stores: any, actions: any);
|
||||
addActions(actions: any): void;
|
||||
@ -26,40 +26,40 @@ declare module Fluxxor {
|
||||
stores: any;
|
||||
actions: any;
|
||||
}
|
||||
|
||||
|
||||
interface Store extends EventEmitter3.EventEmitter {
|
||||
bindActions(...args: Array<string|Function>): void;
|
||||
bindActions(args: Array<string|Function>): void;
|
||||
waitFor(stores: string[], fn: Function): void;
|
||||
}
|
||||
|
||||
|
||||
interface StoreSpec {
|
||||
initialize?(instance?: any, options?: {}): void;
|
||||
actions?: any;
|
||||
}
|
||||
|
||||
|
||||
interface StoreClass {
|
||||
new (options?: {}): any;
|
||||
}
|
||||
|
||||
|
||||
interface Context {
|
||||
flux: Flux;
|
||||
}
|
||||
|
||||
|
||||
interface FluxMixin {
|
||||
getFlux(): Flux;
|
||||
}
|
||||
|
||||
|
||||
interface FluxChildMixin {
|
||||
getFlux(): Flux;
|
||||
}
|
||||
|
||||
|
||||
interface StoreWatchMixin<StoreState> {
|
||||
getStateFromFlux(): StoreState;
|
||||
}
|
||||
|
||||
function FluxMixin(React: React.Exports): FluxMixin;
|
||||
function FluxChildMixin(React: React.Exports): FluxChildMixin;
|
||||
|
||||
function FluxMixin(React: typeof __React): FluxMixin;
|
||||
function FluxChildMixin(React: typeof __React): FluxChildMixin;
|
||||
function StoreWatchMixin<StoreState>(...storeNames: string[]): StoreWatchMixin<StoreState>;
|
||||
function createStore(spec: StoreSpec): StoreClass;
|
||||
var version: string;
|
||||
|
||||
4243
googlemaps/google.maps.d.ts
vendored
4243
googlemaps/google.maps.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@ -18,6 +18,6 @@ gulp.task("concat:newLine", () => {
|
||||
|
||||
gulp.task("concat:vinyl", () => {
|
||||
gulp.src(["file*.txt"])
|
||||
.pipe(concat({ path: "file.txt", stat: { mode: 0666 } }))
|
||||
.pipe(concat({ path: "file.txt", stat: { mode: parseInt("0666", 8) } }))
|
||||
.pipe(gulp.dest("build"));
|
||||
});
|
||||
|
||||
@ -11,11 +11,11 @@ function tests() {
|
||||
hello: 'world'
|
||||
};
|
||||
hooker.hook(objectToHook, 'hello', () => { });
|
||||
hooker.hook(objectToHook, 'hello', () => {
|
||||
hooker.hook(objectToHook, 'hello', (): any => {
|
||||
return null;
|
||||
});
|
||||
hooker.hook(objectToHook, ['hello', 'foo'], () => { });
|
||||
hooker.hook(objectToHook, ['hello', 'bar'], () => {
|
||||
hooker.hook(objectToHook, ['hello', 'bar'], (): any => {
|
||||
return null;
|
||||
});
|
||||
hooker.hook(objectToHook, 'bar', () => {
|
||||
|
||||
37
jquery-knob/jquery-knob-tests.ts
Normal file
37
jquery-knob/jquery-knob-tests.ts
Normal file
@ -0,0 +1,37 @@
|
||||
/// <reference path="jquery-knob.d.ts"/>
|
||||
|
||||
// create from html attrs
|
||||
$('<input type="text" name="knob" value="50" data-min="0" data-max="100">').knob();
|
||||
|
||||
// create with object
|
||||
$('<input type="text" name="knob-2">').knob({
|
||||
min: 0,
|
||||
max: 100,
|
||||
angleArc: 270
|
||||
});
|
||||
|
||||
// hooks
|
||||
var hookKnob = $('<input type="text" name="knob-2">').knob({
|
||||
release: function(value) {
|
||||
console.log(value);
|
||||
},
|
||||
change: function(value) {
|
||||
console.log(value);
|
||||
},
|
||||
draw: function() {
|
||||
console.log(this);
|
||||
},
|
||||
cancel: function() {
|
||||
console.log(this);
|
||||
},
|
||||
format: function(value) {
|
||||
console.log(value);
|
||||
}
|
||||
});
|
||||
|
||||
// trigger
|
||||
hookKnob.trigger('release');
|
||||
hookKnob.trigger('change');
|
||||
hookKnob.trigger('draw');
|
||||
hookKnob.trigger('cancel');
|
||||
hookKnob.trigger('format');
|
||||
116
jquery-knob/jquery-knob.d.ts
vendored
Normal file
116
jquery-knob/jquery-knob.d.ts
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
// Type definitions for jQuery Knob 1.2.11
|
||||
// Project: http://anthonyterrien.com/knob/
|
||||
// Definitions by: Iain Buchanan <https://github.com/iain8/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare module JQueryKnob {
|
||||
export interface JQueryKnobOptions {
|
||||
/**
|
||||
* min value | default=0
|
||||
*/
|
||||
min?: number;
|
||||
/**
|
||||
* max value | default=100
|
||||
*/
|
||||
max?: number;
|
||||
/**
|
||||
* step size | default=1
|
||||
*/
|
||||
step?: number;
|
||||
/**
|
||||
* starting angle in degrees | default=0
|
||||
*/
|
||||
angleOffset?: number;
|
||||
/**
|
||||
* arc size in degrees | default=360
|
||||
*/
|
||||
angleArc?: number;
|
||||
/**
|
||||
* stop at min & max on keydown/mousewheel | default=true
|
||||
*/
|
||||
stopper?: boolean;
|
||||
/**
|
||||
* disable input and events | default=false
|
||||
*/
|
||||
readOnly?: boolean;
|
||||
/**
|
||||
* direction of progression | default=clockwise
|
||||
*/
|
||||
rotation?: string;
|
||||
/**
|
||||
* display mode "cursor", cursor size could be changed passing a
|
||||
* numeric value to the option, default width is used when passing
|
||||
* boolean value "true" | default=gauge
|
||||
*/
|
||||
cursor?: string | boolean;
|
||||
/**
|
||||
* gauge thickness
|
||||
*/
|
||||
thickness?: number;
|
||||
/**
|
||||
* gauge stroke endings | default=butt, round=rounded line endings
|
||||
*/
|
||||
lineCap?: string;
|
||||
/**
|
||||
* dial width
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* default=true | false=hide input
|
||||
*/
|
||||
displayInput?: boolean;
|
||||
/**
|
||||
* default=false | true=displays the previous value with transparency
|
||||
*/
|
||||
displayPrevious?: boolean;
|
||||
/**
|
||||
* foreground color
|
||||
*/
|
||||
fgColor?: string;
|
||||
/**
|
||||
* input value (number) color
|
||||
*/
|
||||
inputColor?: string;
|
||||
/**
|
||||
* font family
|
||||
*/
|
||||
font?: string;
|
||||
/**
|
||||
* font weight
|
||||
*/
|
||||
fontWeight?: string;
|
||||
/**
|
||||
* background color
|
||||
*/
|
||||
bgColor?: string;
|
||||
/**
|
||||
* executed on release
|
||||
*/
|
||||
release?: (value: number) => void;
|
||||
/**
|
||||
* executed at each change of the value
|
||||
*/
|
||||
change?: (value: number) => void;
|
||||
/**
|
||||
* when drawing the canvas
|
||||
*/
|
||||
draw?: () => void;
|
||||
/**
|
||||
* triggered on [esc] keydown
|
||||
*/
|
||||
cancel?: () => void;
|
||||
/**
|
||||
* allows to format output (add unit %, ms...)
|
||||
*/
|
||||
format?: (value: number) => void;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Create a knob for the given input field, with optional options
|
||||
*/
|
||||
knob(options?: JQueryKnob.JQueryKnobOptions): JQuery;
|
||||
}
|
||||
@ -1618,7 +1618,7 @@ function test_spinner() {
|
||||
},
|
||||
_parse: function (value) {
|
||||
if (typeof value === "string") {
|
||||
if (Number(value) == value) {
|
||||
if (Number(value) == <any>value) {
|
||||
return Number(value);
|
||||
}
|
||||
return 123;
|
||||
@ -1822,4 +1822,4 @@ function test_widget() {
|
||||
var isDisabled = $(".selector").jQuery.Widget("option", "disabled");
|
||||
$(".selector").jQuery.Widget("option", "disabled", true);
|
||||
$(".selector").jQuery.Widget("option", { disabled: true });
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,6 @@ function BaseClassExtensions_Date_Tests() {
|
||||
}
|
||||
|
||||
function BaseClassExtensions_Boolean_Tests() {
|
||||
|
||||
Boolean.parse("false");
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ function d() {
|
||||
function e() {
|
||||
mock({
|
||||
'some/dir': mock.directory({
|
||||
mode: 0755,
|
||||
mode: parseInt("0755", 8),
|
||||
items: {
|
||||
file1: 'file one content',
|
||||
file2: new Buffer([8, 6, 7, 5, 3, 0, 9])
|
||||
|
||||
16
node/node.d.ts
vendored
16
node/node.d.ts
vendored
@ -9,6 +9,14 @@
|
||||
* *
|
||||
************************************************/
|
||||
|
||||
// compat for TypeScript 1.5.3
|
||||
// if you use with --target es3 or --target es5 and use below definitions,
|
||||
// use the lib.es6.d.ts that is bundled with TypeScript 1.5.3.
|
||||
interface MapConstructor {}
|
||||
interface WeakMapConstructor {}
|
||||
interface SetConstructor {}
|
||||
interface WeakSetConstructor {}
|
||||
|
||||
/************************************************
|
||||
* *
|
||||
* GLOBAL *
|
||||
@ -271,7 +279,7 @@ declare module NodeJS {
|
||||
Int8Array: typeof Int8Array;
|
||||
Intl: typeof Intl;
|
||||
JSON: typeof JSON;
|
||||
Map: typeof Map;
|
||||
Map: MapConstructor;
|
||||
Math: typeof Math;
|
||||
NaN: typeof NaN;
|
||||
Number: typeof Number;
|
||||
@ -280,7 +288,7 @@ declare module NodeJS {
|
||||
RangeError: typeof RangeError;
|
||||
ReferenceError: typeof ReferenceError;
|
||||
RegExp: typeof RegExp;
|
||||
Set: typeof Set;
|
||||
Set: SetConstructor;
|
||||
String: typeof String;
|
||||
Symbol: Function;
|
||||
SyntaxError: typeof SyntaxError;
|
||||
@ -290,8 +298,8 @@ declare module NodeJS {
|
||||
Uint32Array: typeof Uint32Array;
|
||||
Uint8Array: typeof Uint8Array;
|
||||
Uint8ClampedArray: Function;
|
||||
WeakMap: typeof WeakMap;
|
||||
WeakSet: Function;
|
||||
WeakMap: WeakMapConstructor;
|
||||
WeakSet: WeakSetConstructor;
|
||||
clearImmediate: (immediateId: any) => void;
|
||||
clearInterval: (intervalId: NodeJS.Timer) => void;
|
||||
clearTimeout: (timeoutId: NodeJS.Timer) => void;
|
||||
|
||||
180
npm-shrinkwrap.json
generated
180
npm-shrinkwrap.json
generated
@ -8,39 +8,39 @@
|
||||
"resolved": "https://registry.npmjs.org/definition-tester/-/definition-tester-0.2.0.tgz",
|
||||
"dependencies": {
|
||||
"bluebird": {
|
||||
"version": "2.7.1",
|
||||
"from": "bluebird@^2.5.3",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.7.1.tgz"
|
||||
"version": "2.9.34",
|
||||
"from": "bluebird@>=2.5.3 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.34.tgz"
|
||||
},
|
||||
"definition-header": {
|
||||
"version": "0.1.0",
|
||||
"from": "definition-header@^0.1.0",
|
||||
"from": "definition-header@>=0.1.0 <0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/definition-header/-/definition-header-0.1.0.tgz",
|
||||
"dependencies": {
|
||||
"joi": {
|
||||
"version": "4.9.0",
|
||||
"from": "joi@^4.0.0",
|
||||
"from": "joi@>=4.0.0 <5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/joi/-/joi-4.9.0.tgz",
|
||||
"dependencies": {
|
||||
"hoek": {
|
||||
"version": "2.11.0",
|
||||
"from": "hoek@^2.2.x",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.11.0.tgz"
|
||||
"version": "2.14.0",
|
||||
"from": "hoek@>=2.2.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.14.0.tgz"
|
||||
},
|
||||
"topo": {
|
||||
"version": "1.0.2",
|
||||
"from": "topo@1.x.x",
|
||||
"from": "topo@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/topo/-/topo-1.0.2.tgz"
|
||||
},
|
||||
"isemail": {
|
||||
"version": "1.1.1",
|
||||
"from": "isemail@1.x.x",
|
||||
"from": "isemail@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isemail/-/isemail-1.1.1.tgz"
|
||||
},
|
||||
"moment": {
|
||||
"version": "2.9.0",
|
||||
"from": "moment@2.x.x",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.9.0.tgz"
|
||||
"version": "2.10.3",
|
||||
"from": "moment@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.10.3.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -50,76 +50,138 @@
|
||||
"resolved": "https://registry.npmjs.org/joi-assert/-/joi-assert-0.0.3.tgz",
|
||||
"dependencies": {
|
||||
"assertion-error": {
|
||||
"version": "1.0.0",
|
||||
"from": "assertion-error@^1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.0.tgz"
|
||||
"version": "1.0.1",
|
||||
"from": "assertion-error@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.1.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parsimmon": {
|
||||
"version": "0.5.1",
|
||||
"from": "parsimmon@^0.5.0",
|
||||
"from": "parsimmon@>=0.5.0 <0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-0.5.1.tgz",
|
||||
"dependencies": {
|
||||
"pjs": {
|
||||
"version": "5.1.1",
|
||||
"from": "pjs@5.x",
|
||||
"from": "pjs@>=5.0.0 <6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pjs/-/pjs-5.1.1.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"xregexp": {
|
||||
"version": "2.0.0",
|
||||
"from": "xregexp@~2.0.0",
|
||||
"from": "xregexp@>=2.0.0 <2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"findup-sync": {
|
||||
"version": "0.2.1",
|
||||
"from": "findup-sync@~0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.2.1.tgz"
|
||||
"from": "findup-sync@>=0.2.1 <0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.2.1.tgz",
|
||||
"dependencies": {
|
||||
"glob": {
|
||||
"version": "4.3.5",
|
||||
"from": "glob@>=4.3.0 <4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz",
|
||||
"dependencies": {
|
||||
"inflight": {
|
||||
"version": "1.0.4",
|
||||
"from": "inflight@>=1.0.4 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
|
||||
"dependencies": {
|
||||
"wrappy": {
|
||||
"version": "1.0.1",
|
||||
"from": "wrappy@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.1",
|
||||
"from": "inherits@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "2.0.9",
|
||||
"from": "minimatch@>=2.0.1 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.9.tgz",
|
||||
"dependencies": {
|
||||
"brace-expansion": {
|
||||
"version": "1.1.0",
|
||||
"from": "brace-expansion@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz",
|
||||
"dependencies": {
|
||||
"balanced-match": {
|
||||
"version": "0.2.0",
|
||||
"from": "balanced-match@>=0.2.0 <0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"from": "concat-map@0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.3.2",
|
||||
"from": "once@>=1.3.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz",
|
||||
"dependencies": {
|
||||
"wrappy": {
|
||||
"version": "1.0.1",
|
||||
"from": "wrappy@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"git-wrapper": {
|
||||
"version": "0.1.1",
|
||||
"from": "git-wrapper@~0.1.1",
|
||||
"from": "git-wrapper@>=0.1.1 <0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/git-wrapper/-/git-wrapper-0.1.1.tgz"
|
||||
},
|
||||
"glob": {
|
||||
"version": "4.3.5",
|
||||
"from": "glob@^4.3.2",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz",
|
||||
"version": "4.5.3",
|
||||
"from": "glob@>=4.3.2 <5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz",
|
||||
"dependencies": {
|
||||
"inflight": {
|
||||
"version": "1.0.4",
|
||||
"from": "inflight@^1.0.4",
|
||||
"from": "inflight@>=1.0.4 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
|
||||
"dependencies": {
|
||||
"wrappy": {
|
||||
"version": "1.0.1",
|
||||
"from": "wrappy@1",
|
||||
"from": "wrappy@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.1",
|
||||
"from": "inherits@2",
|
||||
"from": "inherits@>=2.0.0 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "2.0.1",
|
||||
"from": "minimatch@^2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz",
|
||||
"version": "2.0.9",
|
||||
"from": "minimatch@>=2.0.1 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.9.tgz",
|
||||
"dependencies": {
|
||||
"brace-expansion": {
|
||||
"version": "1.1.0",
|
||||
"from": "brace-expansion@^1.0.0",
|
||||
"from": "brace-expansion@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz",
|
||||
"dependencies": {
|
||||
"balanced-match": {
|
||||
"version": "0.2.0",
|
||||
"from": "balanced-match@^0.2.0",
|
||||
"from": "balanced-match@>=0.2.0 <0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
|
||||
},
|
||||
"concat-map": {
|
||||
@ -132,13 +194,13 @@
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.3.1",
|
||||
"from": "once@^1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz",
|
||||
"version": "1.3.2",
|
||||
"from": "once@>=1.3.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz",
|
||||
"dependencies": {
|
||||
"wrappy": {
|
||||
"version": "1.0.1",
|
||||
"from": "wrappy@1",
|
||||
"from": "wrappy@>=1.0.0 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
|
||||
}
|
||||
}
|
||||
@ -147,17 +209,17 @@
|
||||
},
|
||||
"lazy.js": {
|
||||
"version": "0.4.0",
|
||||
"from": "lazy.js@~0.4.0",
|
||||
"from": "lazy.js@>=0.4.0 <0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lazy.js/-/lazy.js-0.4.0.tgz"
|
||||
},
|
||||
"manticore": {
|
||||
"version": "0.2.4",
|
||||
"from": "manticore@^0.2.4",
|
||||
"from": "manticore@>=0.2.4 <0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/manticore/-/manticore-0.2.4.tgz",
|
||||
"dependencies": {
|
||||
"JSONStream": {
|
||||
"version": "0.8.4",
|
||||
"from": "JSONStream@^0.8.4",
|
||||
"from": "JSONStream@>=0.8.4 <0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz",
|
||||
"dependencies": {
|
||||
"jsonparse": {
|
||||
@ -166,30 +228,30 @@
|
||||
"resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz"
|
||||
},
|
||||
"through": {
|
||||
"version": "2.3.6",
|
||||
"from": "through@>=2.2.7 <3",
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.6.tgz"
|
||||
"version": "2.3.8",
|
||||
"from": "through@>=2.2.7 <3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "1.2.4",
|
||||
"from": "bluebird@^1.2.4",
|
||||
"from": "bluebird@>=1.2.4 <2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz"
|
||||
},
|
||||
"through2": {
|
||||
"version": "0.5.1",
|
||||
"from": "through2@^0.5.1",
|
||||
"from": "through2@>=0.5.1 <0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz",
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
"version": "1.0.33",
|
||||
"from": "readable-stream@~1.0.17",
|
||||
"from": "readable-stream@>=1.0.17 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz",
|
||||
"dependencies": {
|
||||
"core-util-is": {
|
||||
"version": "1.0.1",
|
||||
"from": "core-util-is@~1.0.0",
|
||||
"from": "core-util-is@>=1.0.0 <1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
|
||||
},
|
||||
"isarray": {
|
||||
@ -199,43 +261,43 @@
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "0.10.31",
|
||||
"from": "string_decoder@~0.10.x",
|
||||
"from": "string_decoder@>=0.10.0 <0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.1",
|
||||
"from": "inherits@~2.0.1",
|
||||
"from": "inherits@>=2.0.1 <2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"xtend": {
|
||||
"version": "3.0.0",
|
||||
"from": "xtend@~3.0.0",
|
||||
"from": "xtend@>=3.0.0 <3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type-detect": {
|
||||
"version": "0.1.2",
|
||||
"from": "type-detect@^0.1.2",
|
||||
"from": "type-detect@>=0.1.2 <0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.2.tgz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"optimist": {
|
||||
"version": "0.6.1",
|
||||
"from": "optimist@~0.6.1",
|
||||
"from": "optimist@>=0.6.1 <0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
|
||||
"dependencies": {
|
||||
"wordwrap": {
|
||||
"version": "0.0.2",
|
||||
"from": "wordwrap@~0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
|
||||
"version": "0.0.3",
|
||||
"from": "wordwrap@>=0.0.2 <0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz"
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.10",
|
||||
"from": "minimist@~0.0.1",
|
||||
"from": "minimist@>=0.0.1 <0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz"
|
||||
}
|
||||
}
|
||||
@ -243,9 +305,9 @@
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "1.4.1",
|
||||
"from": "typescript@1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-1.4.1.tgz"
|
||||
"version": "1.5.3",
|
||||
"from": "typescript@1.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-1.5.3.tgz"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,6 +36,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"definition-tester": "0.2.0",
|
||||
"typescript": "1.4.1"
|
||||
"typescript": "1.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ class User implements IUser {
|
||||
//#endregion
|
||||
|
||||
// Sample from https://github.com/jaredhanson/passport-local#configure-strategy
|
||||
passport.use(new local.Strategy(function (username, password, done) {
|
||||
passport.use(new local.Strategy((username: any, password: any, done: any) => {
|
||||
User.findOne({ username: username }, function (err, user) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
|
||||
@ -556,7 +556,7 @@ function test_globalization() {
|
||||
|
||||
function test_inAppBrowser() {
|
||||
var ref = window.open('http://apache.org', '_blank', 'location=yes');
|
||||
ref.addEventListener('loadstart', function () { alert(event.url); });
|
||||
ref.addEventListener('loadstart', function () { alert(event); });
|
||||
ref.removeEventListener('loadstart', null);
|
||||
ref.close();
|
||||
}
|
||||
@ -716,4 +716,4 @@ function test_storage() {
|
||||
var value = window.localStorage.getItem("key");
|
||||
window.localStorage.removeItem("key");
|
||||
window.localStorage.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,9 +69,9 @@ var customizedAssert2 = assert.customize({
|
||||
circular: '#@Circular#',
|
||||
lineSeparator: '\n',
|
||||
ambiguousEastAsianCharWidth: 2,
|
||||
widthOf: () => null,
|
||||
stringify: () => null,
|
||||
diff: () => null,
|
||||
widthOf: () => false,
|
||||
stringify: () => false,
|
||||
diff: () => false,
|
||||
writerClass: null,
|
||||
renderers: [
|
||||
'./built-in/file',
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
///<reference path='../../react/legacy/react-0.12.d.ts' />
|
||||
|
||||
declare module 'react-0.12' {
|
||||
var exports: React.Exports;
|
||||
export = exports;
|
||||
}
|
||||
@ -1,347 +0,0 @@
|
||||
///<reference path='react-router-0.12-test.d.ts' />
|
||||
///<reference path="react-router-0.12.d.ts" />
|
||||
"use strict";
|
||||
|
||||
import React = require('react-0.12');
|
||||
import Router = ReactRouter;
|
||||
|
||||
// Mixin
|
||||
class NavigationTest<T extends Router.Navigation> {
|
||||
v: T;
|
||||
|
||||
makePath() {
|
||||
var v1: string = this.v.makePath('to');
|
||||
var v2: string = this.v.makePath('to', {id: 1});
|
||||
var v3: string = this.v.makePath('to', {id: 1}, {type: 'json'});
|
||||
}
|
||||
makeHref() {
|
||||
var v1: string = this.v.makeHref('to');
|
||||
var v2: string = this.v.makeHref('to', {id: 1});
|
||||
var v3: string = this.v.makeHref('to', {id: 1}, {type: 'json'});
|
||||
}
|
||||
transitionTo() {
|
||||
var v1: void = this.v.transitionTo('to');
|
||||
var v2: void = this.v.transitionTo('to', {id: 1});
|
||||
var v3: void = this.v.transitionTo('to', {id: 1}, {type: 'json'});
|
||||
}
|
||||
replaceWith() {
|
||||
var v1: void = this.v.replaceWith('to');
|
||||
var v2: void = this.v.replaceWith('to', {id: 1});
|
||||
var v3: void = this.v.replaceWith('to', {id: 1}, {type: 'json'});
|
||||
}
|
||||
goBack() {
|
||||
var v1: void = this.v.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
class StateTest<T extends Router.State> {
|
||||
v: T;
|
||||
|
||||
getPath() {
|
||||
var v1: string = this.v.getPath();
|
||||
}
|
||||
|
||||
getRoutes() {
|
||||
var v1: Router.Route[] = this.v.getRoutes();
|
||||
}
|
||||
|
||||
getPathname() {
|
||||
var v1: string = this.v.getPathname();
|
||||
}
|
||||
|
||||
getParams() {
|
||||
var v1: {} = this.v.getParams();
|
||||
}
|
||||
|
||||
getQuery() {
|
||||
var v1: {} = this.v.getQuery();
|
||||
}
|
||||
|
||||
isActive() {
|
||||
var v1: boolean = this.v.isActive('to');
|
||||
var v2: boolean = this.v.isActive('to', {id: 1});
|
||||
var v3: boolean = this.v.isActive('to', {id: 1}, {type: 'json'});
|
||||
}
|
||||
}
|
||||
|
||||
class RouteHandlerMixinTest<T extends Router.RouteHandlerMixin> {
|
||||
v: T;
|
||||
|
||||
getRouteDepth() {
|
||||
var v1: number = this.v.getRouteDepth();
|
||||
}
|
||||
|
||||
createChildRouteHandler() {
|
||||
var v1: Router.RouteHandler = this.v.createChildRouteHandler({ref: 'hoge'});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Location
|
||||
class LocationTest<T extends Router.LocationBase> {
|
||||
v: T;
|
||||
|
||||
push() {
|
||||
var v1: void = this.v.push('path/to/hoge');
|
||||
}
|
||||
|
||||
replace() {
|
||||
var v1: void = this.v.replace('path/to/hoge');
|
||||
}
|
||||
|
||||
pop() {
|
||||
var v1: void = this.v.pop();
|
||||
}
|
||||
|
||||
getCurrentPath() {
|
||||
var v1: void = this.v.getCurrentPath();
|
||||
}
|
||||
}
|
||||
new LocationTest<Router.HashLocation>();
|
||||
new LocationTest<Router.HistoryLocation>();
|
||||
new LocationTest<Router.RefreshLocation>();
|
||||
|
||||
class LocationListenerTest<T extends Router.LocationListener> {
|
||||
v: T;
|
||||
|
||||
addChangeListener() {
|
||||
var v1: void = this.v.addChangeListener(() => console.log(1));
|
||||
}
|
||||
|
||||
removeChangeListener() {
|
||||
var v1: void = this.v.removeChangeListener(() => console.log(1));
|
||||
}
|
||||
}
|
||||
new LocationListenerTest<Router.HashLocation>();
|
||||
new LocationListenerTest<Router.HistoryLocation>();
|
||||
|
||||
|
||||
// Behavior
|
||||
class ScrollBehaviorTest<T extends Router.ScrollBehaviorBase> {
|
||||
v: T;
|
||||
|
||||
updateScrollPosition() {
|
||||
var v1: void = this.v.updateScrollPosition({x: 33, y: 102}, 'scrollTop');
|
||||
}
|
||||
}
|
||||
new ScrollBehaviorTest<Router.ImitateBrowserBehavior>();
|
||||
new ScrollBehaviorTest<Router.ScrollToTopBehavior>();
|
||||
|
||||
|
||||
// Component
|
||||
class DefaultRouteTest {
|
||||
v: Router.DefaultRoute;
|
||||
|
||||
props() {
|
||||
var name: string = this.v.props.name;
|
||||
var handler: React.ComponentClass<any> = this.v.props.handler;
|
||||
}
|
||||
|
||||
createElement() {
|
||||
var Handler: React.ComponentClass<any>;
|
||||
React.createElement(Router.DefaultRoute, null);
|
||||
React.createElement(Router.DefaultRoute, {name: 'name', handler: Handler});
|
||||
}
|
||||
}
|
||||
|
||||
class LinkTest {
|
||||
v: Router.Link;
|
||||
|
||||
constructor() {
|
||||
new NavigationTest<Router.Link>();
|
||||
new StateTest<Router.Link>();
|
||||
}
|
||||
|
||||
props() {
|
||||
var activeClassName: string = this.v.props.activeClassName;
|
||||
var to: string = this.v.props.to;
|
||||
var params: {} = this.v.props.params;
|
||||
var query: {} = this.v.props.query;
|
||||
var onClick: Function = this.v.props.onClick;
|
||||
}
|
||||
|
||||
getHref() {
|
||||
var v1: string = this.v.getHref();
|
||||
}
|
||||
|
||||
getClassName() {
|
||||
var v1: string = this.v.getClassName();
|
||||
}
|
||||
|
||||
createElement() {
|
||||
React.createElement(Router.Link, null);
|
||||
React.createElement(Router.Link, {to: 'home'});
|
||||
React.createElement(Router.Link, {
|
||||
activeClassName: 'name',
|
||||
to: 'home',
|
||||
params: {},
|
||||
query: {},
|
||||
onClick: () => console.log(1)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class NotFoundRouteTest {
|
||||
v: Router.NotFoundRoute;
|
||||
|
||||
props() {
|
||||
var name: string = this.v.props.name;
|
||||
var handler: React.ComponentClass<any> = this.v.props.handler;
|
||||
}
|
||||
|
||||
createElement() {
|
||||
var Handler: React.ComponentClass<any>;
|
||||
React.createElement(Router.NotFoundRoute, null);
|
||||
React.createElement(Router.NotFoundRoute, {handler: Handler});
|
||||
React.createElement(Router.NotFoundRoute, {handler: Handler, name: "home"});
|
||||
}
|
||||
}
|
||||
|
||||
class RedirectTest {
|
||||
v: Router.Redirect;
|
||||
|
||||
props() {
|
||||
var path: string = this.v.props.path;
|
||||
var from: string = this.v.props.from;
|
||||
var to: string = this.v.props.to;
|
||||
}
|
||||
|
||||
createElement() {
|
||||
React.createElement(Router.Redirect, null);
|
||||
React.createElement(Router.Redirect, {});
|
||||
React.createElement(Router.Redirect, {path: 'a', from: 'a', to: 'b'});
|
||||
}
|
||||
}
|
||||
|
||||
class RouteTest {
|
||||
v: Router.Route;
|
||||
|
||||
props() {
|
||||
var name: string = this.v.props.name;
|
||||
var path: string = this.v.props.path;
|
||||
var handler: React.ComponentClass<any> = this.v.props.handler;
|
||||
var ignoreScrollBehavior: boolean = this.v.props.ignoreScrollBehavior;
|
||||
}
|
||||
|
||||
createElement() {
|
||||
var Handler: React.ComponentClass<any>;
|
||||
React.createElement(Router.Route, null);
|
||||
React.createElement(Router.Route, {});
|
||||
React.createElement(Router.Route, {name: "home", path: "/", handler: Handler, ignoreScrollBehavior: true});
|
||||
}
|
||||
}
|
||||
|
||||
class RouteHandlerTest {
|
||||
v: Router.RouteHandler;
|
||||
|
||||
constructor() {
|
||||
new RouteHandlerMixinTest<Router.RouteHandler>();
|
||||
}
|
||||
|
||||
createElement() {
|
||||
React.createElement(Router.RouteHandler, null);
|
||||
React.createElement(Router.RouteHandler, {});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// History
|
||||
class HistoryTest {
|
||||
v: Router.History;
|
||||
|
||||
length() {
|
||||
var v1: number = this.v.length;
|
||||
}
|
||||
|
||||
back() {
|
||||
var v1: void = this.v.back();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Router
|
||||
class CreateTest {
|
||||
v: Router.Router;
|
||||
|
||||
constructor() {
|
||||
// React.createElement() version
|
||||
this.v = Router.create({
|
||||
routes: React.createElement(Router.Route, null)
|
||||
});
|
||||
this.v = Router.create({
|
||||
routes: React.createElement(Router.Route, null),
|
||||
location: Router.HistoryLocation,
|
||||
scrollBehavior: Router.ImitateBrowserBehavior
|
||||
});
|
||||
|
||||
// React.createFactory() version
|
||||
this.v = Router.create({
|
||||
routes: React.createFactory(Router.Route)()
|
||||
});
|
||||
this.v = Router.create({
|
||||
routes: React.createFactory(Router.Route)(),
|
||||
location: Router.HistoryLocation,
|
||||
scrollBehavior: Router.ImitateBrowserBehavior
|
||||
});
|
||||
}
|
||||
|
||||
run() {
|
||||
this.v.run((Handler) => console.log(Handler));
|
||||
this.v.run((Handler, state) => console.log(Handler, state));
|
||||
}
|
||||
}
|
||||
|
||||
class RunTest {
|
||||
constructor() {
|
||||
// React.createElement() version
|
||||
var v1: Router.Router = Router.run(React.createElement(Router.Route, null), (Handler) => {
|
||||
React.render(React.createElement(Handler, null), document.body);
|
||||
});
|
||||
var v2: Router.Router = Router.run(React.createElement(Router.Route, null), Router.HistoryLocation, (Handler, state) => {
|
||||
React.render(React.createElement(Handler, null), document.body);
|
||||
});
|
||||
|
||||
// React.createFactory() version
|
||||
var v3: Router.Router = Router.run(React.createFactory(Router.Route)(), (Handler) => {
|
||||
React.render(React.createElement(Handler, null), document.body);
|
||||
});
|
||||
var v4: Router.Router = Router.run(React.createFactory(Router.Route)(), Router.HistoryLocation, (Handler, state) => {
|
||||
React.render(React.createElement(Handler, null), document.body);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Transition
|
||||
class TransitionTest {
|
||||
constructor() {
|
||||
var v1: Router.TransitionStaticLifecycle = {
|
||||
willTransitionTo: (transition, params, query, callback) => {
|
||||
transition.abort();
|
||||
transition.redirect('to');
|
||||
transition.redirect('to', {id: 1});
|
||||
transition.redirect('to', {id: 1}, {type: 'json'});
|
||||
transition.retry();
|
||||
},
|
||||
willTransitionFrom: (transition, component, callback) => {}
|
||||
};
|
||||
var v2: Router.TransitionStaticLifecycle = {
|
||||
willTransitionTo: (transition, params, query) => {},
|
||||
willTransitionFrom: (transition, component) => {}
|
||||
};
|
||||
var v3: Router.TransitionStaticLifecycle = {
|
||||
willTransitionTo: (transition, params) => {},
|
||||
willTransitionFrom: (transition) => {}
|
||||
};
|
||||
var v4: Router.TransitionStaticLifecycle = {
|
||||
willTransitionTo: (transition) => {},
|
||||
willTransitionFrom: () => {}
|
||||
};
|
||||
var v5: Router.TransitionStaticLifecycle = {
|
||||
willTransitionTo: () => {}
|
||||
};
|
||||
var v6: Router.TransitionStaticLifecycle = {
|
||||
willTransitionFrom: () => {}
|
||||
};
|
||||
}
|
||||
}
|
||||
277
react-router/legacy/react-router-0.12.d.ts
vendored
277
react-router/legacy/react-router-0.12.d.ts
vendored
@ -1,277 +0,0 @@
|
||||
// Type definitions for React Router 0.12.0
|
||||
// Project: https://github.com/rackt/react-router
|
||||
// Definitions by: Yuichi Murata <https://github.com/mrk21>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path='../../react/legacy/react-0.12.d.ts' />
|
||||
|
||||
declare module ReactRouter {
|
||||
//
|
||||
// Mixin
|
||||
// ----------------------------------------------------------------------
|
||||
interface Navigation {
|
||||
makePath(to: string, params?: {}, query?: {}): string;
|
||||
makeHref(to: string, params?: {}, query?: {}): string;
|
||||
transitionTo(to: string, params?: {}, query?: {}): void;
|
||||
replaceWith(to: string, params?: {}, query?: {}): void;
|
||||
goBack(): void;
|
||||
}
|
||||
|
||||
interface RouteHandlerMixin {
|
||||
getRouteDepth(): number;
|
||||
createChildRouteHandler(props: {}): RouteHandler;
|
||||
}
|
||||
|
||||
interface State {
|
||||
getPath(): string;
|
||||
getRoutes(): Route[];
|
||||
getPathname(): string;
|
||||
getParams(): {};
|
||||
getQuery(): {};
|
||||
isActive(to: string, params?: {}, query?: {}): boolean;
|
||||
}
|
||||
|
||||
var Navigation: Navigation;
|
||||
var State: State;
|
||||
var RouteHandlerMixin: RouteHandlerMixin;
|
||||
|
||||
|
||||
//
|
||||
// Component
|
||||
// ----------------------------------------------------------------------
|
||||
// DefaultRoute
|
||||
interface DefaultRouteProp {
|
||||
name?: string;
|
||||
handler: React.ComponentClass<any>;
|
||||
}
|
||||
interface DefaultRoute extends React.ReactElement<DefaultRouteProp> {
|
||||
__react_router_default_route__: any; // dummy
|
||||
}
|
||||
interface DefaultRouteClass extends React.ComponentClass<DefaultRouteProp> {
|
||||
__react_router_default_route__: any; // dummy
|
||||
}
|
||||
|
||||
// Link
|
||||
interface LinkProp {
|
||||
activeClassName?: string;
|
||||
to: string;
|
||||
params?: {};
|
||||
query?: {};
|
||||
onClick?: Function;
|
||||
}
|
||||
interface Link extends React.ReactElement<LinkProp>, Navigation, State {
|
||||
__react_router_link__: any; // dummy
|
||||
|
||||
getHref(): string;
|
||||
getClassName(): string;
|
||||
}
|
||||
interface LinkClass extends React.ComponentClass<LinkProp> {
|
||||
__react_router_link__: any; // dummy
|
||||
}
|
||||
|
||||
// NotFoundRoute
|
||||
interface NotFoundRouteProp {
|
||||
name?: string;
|
||||
handler: React.ComponentClass<any>;
|
||||
}
|
||||
interface NotFoundRoute extends React.ReactElement<NotFoundRouteProp> {
|
||||
__react_router_not_found_route__: any; // dummy
|
||||
}
|
||||
interface NotFoundRouteClass extends React.ComponentClass<NotFoundRouteProp> {
|
||||
__react_router_not_found_route__: any; // dummy
|
||||
}
|
||||
|
||||
// Redirect
|
||||
interface RedirectProp {
|
||||
path?: string;
|
||||
from?: string;
|
||||
to?: string;
|
||||
}
|
||||
interface Redirect extends React.ReactElement<RedirectProp> {
|
||||
__react_router_redirect__: any; // dummy
|
||||
}
|
||||
interface RedirectClass extends React.ComponentClass<RedirectProp> {
|
||||
__react_router_redirect__: any; // dummy
|
||||
}
|
||||
|
||||
// Route
|
||||
interface RouteProp {
|
||||
name?: string;
|
||||
path?: string;
|
||||
handler?: React.ComponentClass<any>;
|
||||
ignoreScrollBehavior?: boolean;
|
||||
}
|
||||
interface Route extends React.ReactElement<RouteProp> {
|
||||
__react_router_route__: any; // dummy
|
||||
}
|
||||
interface RouteClass extends React.ComponentClass<RouteProp> {
|
||||
__react_router_route__: any; // dummy
|
||||
}
|
||||
|
||||
// RouteHandler
|
||||
interface RouteHandlerProp {}
|
||||
interface RouteHandler extends React.ReactElement<RouteHandlerProp>, RouteHandlerMixin {
|
||||
__react_router_route_handler__: any; // dummy
|
||||
}
|
||||
interface RouteHandlerClass extends React.ReactElement<RouteHandlerProp> {
|
||||
__react_router_route_handler__: any; // dummy
|
||||
}
|
||||
|
||||
var DefaultRoute: DefaultRouteClass;
|
||||
var Link: LinkClass;
|
||||
var NotFoundRoute: NotFoundRouteClass;
|
||||
var Redirect: RedirectClass;
|
||||
var Route: RouteClass;
|
||||
var RouteHandler: RouteHandlerClass;
|
||||
|
||||
|
||||
//
|
||||
// Location
|
||||
// ----------------------------------------------------------------------
|
||||
interface LocationBase {
|
||||
push(path: string): void;
|
||||
replace(path: string): void;
|
||||
pop(): void;
|
||||
getCurrentPath(): void;
|
||||
}
|
||||
|
||||
interface LocationListener {
|
||||
addChangeListener(listener: Function): void;
|
||||
removeChangeListener(listener: Function): void;
|
||||
}
|
||||
|
||||
interface HashLocation extends LocationBase, LocationListener {}
|
||||
interface HistoryLocation extends LocationBase, LocationListener {}
|
||||
interface RefreshLocation extends LocationBase {}
|
||||
|
||||
var HashLocation: HashLocation;
|
||||
var HistoryLocation: HistoryLocation;
|
||||
var RefreshLocation: RefreshLocation;
|
||||
|
||||
|
||||
//
|
||||
// Behavior
|
||||
// ----------------------------------------------------------------------
|
||||
interface ScrollBehaviorBase {
|
||||
updateScrollPosition(position: {x: number; y: number;}, actionType: string): void;
|
||||
}
|
||||
interface ImitateBrowserBehavior extends ScrollBehaviorBase {}
|
||||
interface ScrollToTopBehavior extends ScrollBehaviorBase {}
|
||||
|
||||
var ImitateBrowserBehavior: ImitateBrowserBehavior;
|
||||
var ScrollToTopBehavior: ScrollToTopBehavior;
|
||||
|
||||
|
||||
//
|
||||
// Router
|
||||
// ----------------------------------------------------------------------
|
||||
interface Router extends React.ReactElement<any> {
|
||||
run(callback: RouterRunCallback): void;
|
||||
}
|
||||
|
||||
interface RouterState {
|
||||
path: string;
|
||||
action: string;
|
||||
pathname: string;
|
||||
params: {};
|
||||
query: {};
|
||||
routes : Route[];
|
||||
}
|
||||
|
||||
interface RouterCreateOption {
|
||||
routes: React.ReactElement<RouteProp>;
|
||||
location?: LocationBase;
|
||||
scrollBehavior?: ScrollBehaviorBase;
|
||||
}
|
||||
|
||||
type RouterRunCallback = (Handler: Router, state: RouterState) => void;
|
||||
|
||||
function create(options: RouterCreateOption): Router;
|
||||
function run(routes: React.ReactElement<RouteProp>, callback: RouterRunCallback): Router;
|
||||
function run(routes: React.ReactElement<RouteProp>, location: LocationBase, callback: RouterRunCallback): Router;
|
||||
|
||||
|
||||
//
|
||||
// History
|
||||
// ----------------------------------------------------------------------
|
||||
interface History {
|
||||
back(): void;
|
||||
length: number;
|
||||
}
|
||||
var History: History;
|
||||
|
||||
|
||||
//
|
||||
// Transition
|
||||
// ----------------------------------------------------------------------
|
||||
interface Transition {
|
||||
abort(): void;
|
||||
redirect(to: string, params?: {}, query?: {}): void;
|
||||
retry(): void;
|
||||
}
|
||||
|
||||
interface TransitionStaticLifecycle {
|
||||
willTransitionTo?(
|
||||
transition: Transition,
|
||||
params: {},
|
||||
query: {},
|
||||
callback: Function
|
||||
): void;
|
||||
|
||||
willTransitionFrom?(
|
||||
transition: Transition,
|
||||
component: React.ReactElement<any>,
|
||||
callback: Function
|
||||
): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'react-router' {
|
||||
export = ReactRouter;
|
||||
}
|
||||
|
||||
declare module React {
|
||||
interface TopLevelAPI {
|
||||
// for DefaultRoute
|
||||
createElement(
|
||||
type: ReactRouter.DefaultRouteClass,
|
||||
props: ReactRouter.DefaultRouteProp,
|
||||
...children: ReactNode[]
|
||||
): ReactRouter.DefaultRoute;
|
||||
|
||||
// for Link
|
||||
createElement(
|
||||
type: ReactRouter.LinkClass,
|
||||
props: ReactRouter.LinkProp,
|
||||
...children: ReactNode[]
|
||||
): ReactRouter.Link;
|
||||
|
||||
// for NotFoundRoute
|
||||
createElement(
|
||||
type: ReactRouter.NotFoundRouteClass,
|
||||
props: ReactRouter.NotFoundRouteProp,
|
||||
...children: ReactNode[]
|
||||
): ReactRouter.NotFoundRoute;
|
||||
|
||||
// for Redirect
|
||||
createElement(
|
||||
type: ReactRouter.RedirectClass,
|
||||
props: ReactRouter.RedirectProp,
|
||||
...children: ReactNode[]
|
||||
): ReactRouter.Redirect;
|
||||
|
||||
// for Route
|
||||
createElement(
|
||||
type: ReactRouter.RouteClass,
|
||||
props: ReactRouter.RouteProp,
|
||||
...children: ReactNode[]
|
||||
): ReactRouter.Route;
|
||||
|
||||
// for RouteHandler
|
||||
createElement(
|
||||
type: ReactRouter.RouteHandlerClass,
|
||||
props: ReactRouter.RouteHandlerProp,
|
||||
...children: ReactNode[]
|
||||
): ReactRouter.RouteHandler;
|
||||
}
|
||||
}
|
||||
@ -1,108 +0,0 @@
|
||||
/// <reference path="react-0.11.d.ts" />
|
||||
import React = require("react-0.11");
|
||||
|
||||
var PropTypesSpecification: React.Specification<any, any> = {
|
||||
propTypes: {
|
||||
// You can declare that a prop is a specific JS primitive. By default, these
|
||||
// are all optional.
|
||||
optionalArray: React.PropTypes.array,
|
||||
optionalBool: React.PropTypes.bool,
|
||||
optionalFunc: React.PropTypes.func,
|
||||
optionalNumber: React.PropTypes.number,
|
||||
optionalObject: React.PropTypes.object,
|
||||
optionalString: React.PropTypes.string,
|
||||
|
||||
// Anything that can be rendered: numbers, strings, components or an array
|
||||
// containing these types.
|
||||
optionalRenderable: React.PropTypes.renderable,
|
||||
|
||||
// A React component.
|
||||
optionalComponent: React.PropTypes.component,
|
||||
|
||||
// You can also declare that a prop is an instance of a class. This uses
|
||||
// JS's instanceof operator.
|
||||
optionalMessage: React.PropTypes.instanceOf(Date),
|
||||
|
||||
// You can ensure that your prop is limited to specific values by treating
|
||||
// it as an enum.
|
||||
optionalEnum: React.PropTypes.oneOf(['News', 'Photos']),
|
||||
|
||||
// An object that could be one of many types
|
||||
optionalUnion: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.number,
|
||||
React.PropTypes.instanceOf(Date)
|
||||
]),
|
||||
|
||||
// An array of a certain type
|
||||
optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number),
|
||||
|
||||
// An object with property values of a certain type
|
||||
optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number),
|
||||
|
||||
// An object taking on a particular shape
|
||||
optionalObjectWithShape: React.PropTypes.shape({
|
||||
color: React.PropTypes.string,
|
||||
fontSize: React.PropTypes.number
|
||||
}),
|
||||
|
||||
// You can chain any of the above with `isRequired` to make sure a warning
|
||||
// is shown if the prop isn't provided.
|
||||
requiredFunc: React.PropTypes.func.isRequired,
|
||||
|
||||
// A value of any data type
|
||||
requiredAny: React.PropTypes.any.isRequired,
|
||||
|
||||
// You can also specify a custom validator. It should return an Error
|
||||
// object if the validation fails. Don't `console.warn` or throw, as this
|
||||
// won't work inside `oneOfType`.
|
||||
customProp: function(props, propName, componentName) {
|
||||
if (!/matchme/.test(props[propName])) {
|
||||
return new Error('Validation failed!');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
render: (): React.Descriptor<any> => {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
React.createClass(PropTypesSpecification);
|
||||
|
||||
var mountNode: Element;
|
||||
|
||||
var HelloMessage = React.createClass({displayName: 'HelloMessage',
|
||||
render: function() {
|
||||
return React.DOM.div(null, "Hello ", (<React.Component<{name: string}, any>>this).props.name);
|
||||
}
|
||||
});
|
||||
|
||||
React.renderComponent(HelloMessage({name: "John"}), mountNode);
|
||||
|
||||
var Timer = React.createClass({displayName: 'Timer',
|
||||
getInitialState: function() {
|
||||
return {secondsElapsed: 0};
|
||||
},
|
||||
tick: function() {
|
||||
(<React.Component<any, {secondsElapsed: number}>>this).setState({
|
||||
secondsElapsed: (<React.Component<any, {secondsElapsed: number}>>this).state.secondsElapsed + 1
|
||||
});
|
||||
},
|
||||
componentDidMount: function() {
|
||||
this.interval = setInterval(this.tick, 1000);
|
||||
},
|
||||
componentWillUnmount: function() {
|
||||
clearInterval(this.interval);
|
||||
},
|
||||
render: function() {
|
||||
return React.DOM.div(
|
||||
null,
|
||||
"Seconds Elapsed: ",
|
||||
(<React.Component<any, {secondsElapsed: number}>>this).state.secondsElapsed
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.renderComponent(Timer(null), mountNode);
|
||||
553
react/legacy/react-0.11.d.ts
vendored
553
react/legacy/react-0.11.d.ts
vendored
@ -1,553 +0,0 @@
|
||||
// Type definitions for React 0.11.2
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "react-0.11" {
|
||||
export = React;
|
||||
}
|
||||
|
||||
declare module React {
|
||||
export function createClass<P, S>(specification: Specification<P, S>): Factory<P>;
|
||||
|
||||
export function renderComponent<P>(component: Descriptor<P>, container: Element, callback?: () => void): Descriptor<P>;
|
||||
|
||||
export function unmountComponentAtNode(container: Element): boolean;
|
||||
|
||||
export function renderComponentToString(component: Descriptor<any>): string;
|
||||
|
||||
export function renderComponentToStaticMarkup(component: Descriptor<any>): string;
|
||||
|
||||
export function isValidClass(factory: Factory<any>): boolean;
|
||||
|
||||
export function isValidComponent(component: Descriptor<any>): boolean;
|
||||
|
||||
export function initializeTouchEvents(shouldUseTouch: boolean): void;
|
||||
|
||||
export interface Descriptor<P> {
|
||||
props: P;
|
||||
}
|
||||
|
||||
export interface Factory<P> {
|
||||
(properties?: P, ...children: any[]): Descriptor<P>;
|
||||
}
|
||||
|
||||
export interface Mixin<P, S> {
|
||||
componentWillMount?(): void;
|
||||
componentDidMount?(): void;
|
||||
componentWillReceiveProps?(nextProps: P): void;
|
||||
shouldComponentUpdate?(nextProps: P, nextState: S): boolean;
|
||||
componentWillUpdate?(nextProps: P, nextState: S): void;
|
||||
componentDidUpdate?(prevProps: P, prevState: S): void;
|
||||
componentWillUnmount?(): void;
|
||||
}
|
||||
|
||||
export interface Specification<P, S> extends Mixin<P, S> {
|
||||
displayName?: string;
|
||||
mixins?: Mixin<P, S>[];
|
||||
statics?: {
|
||||
[key: string]: Function;
|
||||
};
|
||||
propTypes?: ValidationMap<P>;
|
||||
getDefaultProps?(): P;
|
||||
getInitialState?(): S;
|
||||
render(): Descriptor<any>;
|
||||
}
|
||||
|
||||
export interface DomReferencer {
|
||||
getDOMNode(): Element;
|
||||
}
|
||||
|
||||
export interface Component<P, S> extends DomReferencer {
|
||||
refs: {
|
||||
[key: string]: DomReferencer
|
||||
};
|
||||
props: P;
|
||||
state: S;
|
||||
setState(nextState: S, callback?: () => void): void;
|
||||
replaceState(nextState: S, callback?: () => void): void;
|
||||
forceUpdate(callback?: () => void): void;
|
||||
isMounted(): boolean;
|
||||
transferPropsTo(target: Factory<P>): Descriptor<P>;
|
||||
setProps(nextProps: P, callback?: () => void): void;
|
||||
replaceProps(nextProps: P, callback?: () => void): void;
|
||||
}
|
||||
|
||||
export interface Constructable {
|
||||
new(): any;
|
||||
}
|
||||
|
||||
export interface Validator<P> {
|
||||
(props: P, propName: string, componentName: string): Error;
|
||||
}
|
||||
|
||||
export interface Requireable<P> extends Validator<P> {
|
||||
isRequired: Validator<P>;
|
||||
}
|
||||
|
||||
export interface ValidationMap<P> {
|
||||
[key: string]: Validator<P>;
|
||||
}
|
||||
|
||||
export var PropTypes: {
|
||||
any: Requireable<any>;
|
||||
array: Requireable<any>;
|
||||
bool: Requireable<any>;
|
||||
func: Requireable<any>;
|
||||
number: Requireable<any>;
|
||||
object: Requireable<any>;
|
||||
string: Requireable<any>;
|
||||
renderable: Requireable<any>;
|
||||
component: Requireable<any>;
|
||||
instanceOf: (clazz: Constructable) => Requireable<any>;
|
||||
oneOf: (types: any[]) => Requireable<any>
|
||||
oneOfType: (types: Validator<any>[]) => Requireable<any>;
|
||||
arrayOf: (type: Validator<any>) => Requireable<any>;
|
||||
objectOf: (type: Validator<any>) => Requireable<any>;
|
||||
shape: (type: ValidationMap<any>) => Requireable<any>;
|
||||
};
|
||||
|
||||
export var Children: {
|
||||
map(children: any[], fn: (child: any) => any): any[];
|
||||
forEach(children: any[], fn: (child: any) => any): void;
|
||||
count(children: any[]): number;
|
||||
only(children: any[]): any;
|
||||
};
|
||||
|
||||
// Browser Interfaces
|
||||
// Taken from https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts
|
||||
export interface AbstractView {
|
||||
styleMedia: StyleMedia;
|
||||
document: Document;
|
||||
}
|
||||
|
||||
export interface Touch {
|
||||
identifier: number;
|
||||
target: EventTarget;
|
||||
screenX: number;
|
||||
screenY: number;
|
||||
clientX: number;
|
||||
clientY: number;
|
||||
pageX: number;
|
||||
pageY: number;
|
||||
}
|
||||
|
||||
export interface TouchList {
|
||||
[index: number]: Touch;
|
||||
length: number;
|
||||
item(index: number): Touch;
|
||||
identifiedTouch(identifier: number): Touch;
|
||||
}
|
||||
|
||||
// Events
|
||||
export interface SyntheticEvent {
|
||||
bubbles: boolean;
|
||||
cancelable: boolean;
|
||||
currentTarget: EventTarget;
|
||||
defaultPrevented: boolean;
|
||||
eventPhase: number;
|
||||
nativeEvent: Event;
|
||||
preventDefault(): void;
|
||||
stopPropagation(): void;
|
||||
target: EventTarget;
|
||||
timeStamp: Date;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface ClipboardEvent extends SyntheticEvent {
|
||||
clipboardData: DataTransfer;
|
||||
}
|
||||
|
||||
export interface KeyboardEvent extends SyntheticEvent {
|
||||
altKey: boolean;
|
||||
charCode: number;
|
||||
ctrlKey: boolean;
|
||||
getModifierState(key: string): boolean;
|
||||
key: string;
|
||||
keyCode: number;
|
||||
locale: string;
|
||||
location: number;
|
||||
metaKey: boolean;
|
||||
repeat: boolean;
|
||||
shiftKey: boolean;
|
||||
which: number;
|
||||
}
|
||||
|
||||
export interface FocusEvent extends SyntheticEvent {
|
||||
relatedTarget: EventTarget;
|
||||
}
|
||||
|
||||
export interface MouseEvent extends SyntheticEvent {
|
||||
altKey: boolean;
|
||||
button: number;
|
||||
buttons: number;
|
||||
clientX: number;
|
||||
clientY: number;
|
||||
ctrlKey: boolean;
|
||||
getModifierState(key: string): boolean;
|
||||
metaKey: boolean;
|
||||
pageX: number;
|
||||
pageY: number;
|
||||
relatedTarget: EventTarget;
|
||||
screenX: number;
|
||||
screenY: number;
|
||||
shiftKey: boolean;
|
||||
}
|
||||
|
||||
export interface TouchEvent extends SyntheticEvent {
|
||||
altKey: boolean;
|
||||
changedTouches: TouchList;
|
||||
ctrlKey: boolean;
|
||||
getModifierState(key: string): boolean;
|
||||
metaKey: boolean;
|
||||
shiftKey: boolean;
|
||||
targetTouches: TouchList;
|
||||
touches: TouchList;
|
||||
}
|
||||
|
||||
export interface UiEvent extends SyntheticEvent {
|
||||
detail: number;
|
||||
view: AbstractView;
|
||||
}
|
||||
|
||||
export interface WheelEvent extends SyntheticEvent {
|
||||
deltaMode: number;
|
||||
deltaX: number;
|
||||
deltaY: number;
|
||||
deltaZ: number;
|
||||
}
|
||||
|
||||
// Attributes
|
||||
export interface EventAttributes {
|
||||
onCopy?: (event: ClipboardEvent) => void;
|
||||
onCut?: (event: ClipboardEvent) => void;
|
||||
onPaste?: (event: ClipboardEvent) => void;
|
||||
onKeyDown?: (event: KeyboardEvent) => void;
|
||||
onKeyPress?: (event: KeyboardEvent) => void;
|
||||
onKeyUp?: (event: KeyboardEvent) => void;
|
||||
onFocus?: (event: FocusEvent) => void;
|
||||
onBlur?: (event: FocusEvent) => void;
|
||||
onChange?: (event: SyntheticEvent) => void;
|
||||
onInput?: (event: SyntheticEvent) => void;
|
||||
onSubmit?: (event: SyntheticEvent) => void;
|
||||
onClick?: (event: MouseEvent) => void;
|
||||
onDoubleClick?: (event: MouseEvent) => void;
|
||||
onDrag?: (event: MouseEvent) => void;
|
||||
onDragEnd?: (event: MouseEvent) => void;
|
||||
onDragEnter?: (event: MouseEvent) => void;
|
||||
onDragExit?: (event: MouseEvent) => void;
|
||||
onDragLeave?: (event: MouseEvent) => void;
|
||||
onDragOver?: (event: MouseEvent) => void;
|
||||
onDragStart?: (event: MouseEvent) => void;
|
||||
onDrop?: (event: MouseEvent) => void;
|
||||
onMouseDown?: (event: MouseEvent) => void;
|
||||
onMouseEnter?: (event: MouseEvent) => void;
|
||||
onMouseLeave?: (event: MouseEvent) => void;
|
||||
onMouseMove?: (event: MouseEvent) => void;
|
||||
onMouseOut?: (event: MouseEvent) => void;
|
||||
onMouseOver?: (event: MouseEvent) => void;
|
||||
onMouseUp?: (event: MouseEvent) => void;
|
||||
onTouchCancel?: (event: TouchEvent) => void;
|
||||
onTouchEnd?: (event: TouchEvent) => void;
|
||||
onTouchMove?: (event: TouchEvent) => void;
|
||||
onTouchStart?: (event: TouchEvent) => void;
|
||||
onScroll?: (event: UiEvent) => void;
|
||||
onWheel?: (event: WheelEvent) => void;
|
||||
}
|
||||
|
||||
export interface ReactAttributes {
|
||||
dangerouslySetInnerHTML?: {
|
||||
__html: string;
|
||||
};
|
||||
children?: any[];
|
||||
key?: string;
|
||||
ref?: string;
|
||||
}
|
||||
|
||||
export interface DomAttributes extends EventAttributes, ReactAttributes {
|
||||
// HTML Attributes
|
||||
accept?: any;
|
||||
accessKey?: any;
|
||||
action?: any;
|
||||
allowFullScreen?: any;
|
||||
allowTransparency?: any;
|
||||
alt?: any;
|
||||
async?: any;
|
||||
autoCapitalize?: any;
|
||||
autoComplete?: any;
|
||||
autoCorrect?: any;
|
||||
autoFocus?: any;
|
||||
autoPlay?: any;
|
||||
cellPadding?: any;
|
||||
cellSpacing?: any;
|
||||
charSet?: any;
|
||||
checked?: any;
|
||||
className?: any;
|
||||
cols?: any;
|
||||
colSpan?: any;
|
||||
content?: any;
|
||||
contentEditable?: any;
|
||||
contextMenu?: any;
|
||||
controls?: any;
|
||||
coords?: any;
|
||||
crossOrigin?: any;
|
||||
data?: any;
|
||||
dateTime?: any;
|
||||
defer?: any;
|
||||
dir?: any;
|
||||
disabled?: any;
|
||||
download?: any;
|
||||
draggable?: any;
|
||||
encType?: any;
|
||||
form?: any;
|
||||
formNoValidate?: any;
|
||||
frameBorder?: any;
|
||||
height?: any;
|
||||
hidden?: any;
|
||||
href?: any;
|
||||
hrefLang?: any;
|
||||
htmlFor?: any;
|
||||
httpEquiv?: any;
|
||||
icon?: any;
|
||||
id?: any;
|
||||
itemProp?: any;
|
||||
itemScope?: any;
|
||||
itemType?: any;
|
||||
label?: any;
|
||||
lang?: any;
|
||||
list?: any;
|
||||
loop?: any;
|
||||
max?: any;
|
||||
maxLength?: any;
|
||||
mediaGroup?: any;
|
||||
method?: any;
|
||||
min?: any;
|
||||
multiple?: any;
|
||||
muted?: any;
|
||||
name?: any;
|
||||
noValidate?: any;
|
||||
open?: any;
|
||||
pattern?: any;
|
||||
placeholder?: any;
|
||||
poster?: any;
|
||||
preload?: any;
|
||||
property?: any;
|
||||
radioGroup?: any;
|
||||
readOnly?: any;
|
||||
rel?: any;
|
||||
required?: any;
|
||||
role?: any;
|
||||
rows?: any;
|
||||
rowSpan?: any;
|
||||
sandbox?: any;
|
||||
scope?: any;
|
||||
scrollLeft?: any;
|
||||
scrolling?: any;
|
||||
scrollTop?: any;
|
||||
seamless?: any;
|
||||
selected?: any;
|
||||
shape?: any;
|
||||
size?: any;
|
||||
span?: any;
|
||||
spellCheck?: any;
|
||||
src?: any;
|
||||
srcDoc?: any;
|
||||
srcSet?: any;
|
||||
start?: any;
|
||||
step?: any;
|
||||
style?: any;
|
||||
tabIndex?: any;
|
||||
target?: any;
|
||||
title?: any;
|
||||
type?: any;
|
||||
useMap?: any;
|
||||
value?: any;
|
||||
width?: any;
|
||||
wmode?: any;
|
||||
}
|
||||
|
||||
export interface SvgAttributes extends EventAttributes, ReactAttributes {
|
||||
cx?: any;
|
||||
cy?: any;
|
||||
d?: any;
|
||||
dx?: any;
|
||||
dy?: any;
|
||||
fill?: any;
|
||||
fillOpacity?: any;
|
||||
fontFamily?: any;
|
||||
fontSize?: any;
|
||||
fx?: any;
|
||||
fy?: any;
|
||||
gradientTransform?: any;
|
||||
gradientUnits?: any;
|
||||
markerEnd?: any;
|
||||
markerMid?: any;
|
||||
markerStart?: any;
|
||||
offset?: any;
|
||||
opacity?: any;
|
||||
patternContentUnits?: any;
|
||||
patternUnits?: any;
|
||||
points?: any;
|
||||
preserveAspectRatio?: any;
|
||||
r?: any;
|
||||
rx?: any;
|
||||
ry?: any;
|
||||
spreadMethod?: any;
|
||||
stopColor?: any;
|
||||
stopOpacity?: any;
|
||||
stroke?: any;
|
||||
strokeDasharray?: any;
|
||||
strokeLinecap?: any;
|
||||
strokeOpacity?: any;
|
||||
strokeWidth?: any;
|
||||
textAnchor?: any;
|
||||
transform?: any;
|
||||
version?: any;
|
||||
viewBox?: any;
|
||||
x1?: any;
|
||||
x2?: any;
|
||||
x?: any;
|
||||
y1?: any;
|
||||
y2?: any;
|
||||
y?: any;
|
||||
}
|
||||
|
||||
export interface DomElement extends Factory<DomAttributes> {
|
||||
}
|
||||
|
||||
export interface SvgElement extends Factory<SvgAttributes> {
|
||||
}
|
||||
|
||||
export var DOM: {
|
||||
// HTML
|
||||
a: DomElement;
|
||||
abbr: DomElement;
|
||||
address: DomElement;
|
||||
area: DomElement;
|
||||
article: DomElement;
|
||||
aside: DomElement;
|
||||
audio: DomElement;
|
||||
b: DomElement;
|
||||
base: DomElement;
|
||||
bdi: DomElement;
|
||||
bdo: DomElement;
|
||||
big: DomElement;
|
||||
blockquote: DomElement;
|
||||
body: DomElement;
|
||||
br: DomElement;
|
||||
button: DomElement;
|
||||
canvas: DomElement;
|
||||
caption: DomElement;
|
||||
cite: DomElement;
|
||||
code: DomElement;
|
||||
col: DomElement;
|
||||
colgroup: DomElement;
|
||||
data: DomElement;
|
||||
datalist: DomElement;
|
||||
dd: DomElement;
|
||||
del: DomElement;
|
||||
details: DomElement;
|
||||
dfn: DomElement;
|
||||
dialog: DomElement;
|
||||
div: DomElement;
|
||||
dl: DomElement;
|
||||
dt: DomElement;
|
||||
em: DomElement;
|
||||
embed: DomElement;
|
||||
fieldset: DomElement;
|
||||
figcaption: DomElement;
|
||||
figure: DomElement;
|
||||
footer: DomElement;
|
||||
form: DomElement;
|
||||
h1: DomElement;
|
||||
h2: DomElement;
|
||||
h3: DomElement;
|
||||
h4: DomElement;
|
||||
h5: DomElement;
|
||||
h6: DomElement;
|
||||
head: DomElement;
|
||||
header: DomElement;
|
||||
hr: DomElement;
|
||||
html: DomElement;
|
||||
i: DomElement;
|
||||
iframe: DomElement;
|
||||
img: DomElement;
|
||||
input: DomElement;
|
||||
ins: DomElement;
|
||||
kbd: DomElement;
|
||||
keygen: DomElement;
|
||||
label: DomElement;
|
||||
legend: DomElement;
|
||||
li: DomElement;
|
||||
link: DomElement;
|
||||
main: DomElement;
|
||||
map: DomElement;
|
||||
mark: DomElement;
|
||||
menu: DomElement;
|
||||
menuitem: DomElement;
|
||||
meta: DomElement;
|
||||
meter: DomElement;
|
||||
nav: DomElement;
|
||||
noscript: DomElement;
|
||||
object: DomElement;
|
||||
ol: DomElement;
|
||||
optgroup: DomElement;
|
||||
option: DomElement;
|
||||
output: DomElement;
|
||||
p: DomElement;
|
||||
param: DomElement;
|
||||
pre: DomElement;
|
||||
progress: DomElement;
|
||||
q: DomElement;
|
||||
rp: DomElement;
|
||||
rt: DomElement;
|
||||
ruby: DomElement;
|
||||
s: DomElement;
|
||||
samp: DomElement;
|
||||
script: DomElement;
|
||||
section: DomElement;
|
||||
select: DomElement;
|
||||
small: DomElement;
|
||||
source: DomElement;
|
||||
span: DomElement;
|
||||
strong: DomElement;
|
||||
style: DomElement;
|
||||
sub: DomElement;
|
||||
summary: DomElement;
|
||||
sup: DomElement;
|
||||
table: DomElement;
|
||||
tbody: DomElement;
|
||||
td: DomElement;
|
||||
textarea: DomElement;
|
||||
tfoot: DomElement;
|
||||
th: DomElement;
|
||||
thead: DomElement;
|
||||
time: DomElement;
|
||||
title: DomElement;
|
||||
tr: DomElement;
|
||||
track: DomElement;
|
||||
u: DomElement;
|
||||
ul: DomElement;
|
||||
"var": DomElement;
|
||||
video: DomElement;
|
||||
wbr: DomElement;
|
||||
// SVG
|
||||
circle: SvgElement;
|
||||
defs: SvgElement;
|
||||
ellipse: SvgElement;
|
||||
g: SvgElement;
|
||||
line: SvgElement;
|
||||
linearGradient: SvgElement;
|
||||
mask: SvgElement;
|
||||
path: SvgElement;
|
||||
pattern: SvgElement;
|
||||
polygon: SvgElement;
|
||||
polyline: SvgElement;
|
||||
radialGradient: SvgElement;
|
||||
rect: SvgElement;
|
||||
stop: SvgElement;
|
||||
svg: SvgElement;
|
||||
text: SvgElement;
|
||||
tspan: SvgElement;
|
||||
};
|
||||
}
|
||||
@ -1,235 +0,0 @@
|
||||
/// <reference path="react-0.12.d.ts" />
|
||||
import React = require("react");
|
||||
|
||||
interface Props {
|
||||
hello: string;
|
||||
world?: string;
|
||||
foo: number;
|
||||
bar: boolean;
|
||||
}
|
||||
|
||||
interface State {
|
||||
inputValue?: string;
|
||||
seconds?: number;
|
||||
}
|
||||
|
||||
interface MyComponent extends React.CompositeComponent<Props, State> {
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
var props: Props = {
|
||||
key: 42,
|
||||
ref: "myComponent42",
|
||||
hello: "world",
|
||||
foo: 42,
|
||||
bar: true
|
||||
};
|
||||
|
||||
var container: Element;
|
||||
var INPUT_REF: string = "input";
|
||||
|
||||
//
|
||||
// Top-Level API
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var reactClass: React.ComponentClass<Props> = React.createClass<Props>({
|
||||
getDefaultProps: () => {
|
||||
return <Props>{
|
||||
hello: undefined,
|
||||
world: "peace",
|
||||
foo: undefined,
|
||||
bar: undefined
|
||||
};
|
||||
},
|
||||
getInitialState: () => {
|
||||
return {
|
||||
inputValue: "React.js",
|
||||
seconds: 0
|
||||
};
|
||||
},
|
||||
reset: () => {
|
||||
this.replaceState(this.getInitialState());
|
||||
},
|
||||
render: () => {
|
||||
return React.DOM.div(null,
|
||||
React.DOM.input({
|
||||
ref: INPUT_REF,
|
||||
value: this.state.inputValue
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
var reactElement: React.ReactElement<Props> =
|
||||
React.createElement<Props>(reactClass, props);
|
||||
|
||||
var reactFactory: React.ComponentFactory<Props> =
|
||||
React.createFactory<Props>(reactClass);
|
||||
|
||||
var component: React.Component<Props> =
|
||||
React.render<Props>(reactElement, container);
|
||||
|
||||
var unmounted: boolean = React.unmountComponentAtNode(container);
|
||||
var str: string = React.renderToString(reactElement);
|
||||
var markup: string = React.renderToStaticMarkup(reactElement);
|
||||
var notValid: boolean = React.isValidElement(props); // false
|
||||
var isValid = React.isValidElement(reactElement); // true
|
||||
React.initializeTouchEvents(true);
|
||||
|
||||
//
|
||||
// React Elements
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var type = reactElement.type;
|
||||
var elementProps: Props = reactElement.props;
|
||||
var key = reactElement.key;
|
||||
var ref: string = reactElement.ref;
|
||||
var factoryElement: React.ReactElement<Props> = reactFactory(elementProps);
|
||||
|
||||
//
|
||||
// React Components
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var displayName: string = reactClass.displayName;
|
||||
var defaultProps: Props = reactClass.getDefaultProps();
|
||||
var propTypes: React.ValidationMap<Props> = reactClass.propTypes;
|
||||
|
||||
//
|
||||
// Component API
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var htmlElement: Element = component.getDOMNode();
|
||||
var divElement: HTMLDivElement = component.getDOMNode<HTMLDivElement>();
|
||||
var isMounted: boolean = component.isMounted();
|
||||
component.setProps(elementProps);
|
||||
component.replaceProps(props);
|
||||
|
||||
var compComponent: React.CompositeComponent<Props, State> =
|
||||
<React.CompositeComponent<Props, State>>component;
|
||||
var initialState: State = compComponent.state;
|
||||
compComponent.setState({ inputValue: "!!!" });
|
||||
compComponent.replaceState({ inputValue: "???", seconds: 60 });
|
||||
compComponent.forceUpdate();
|
||||
|
||||
var inputRef: React.HTMLComponent =
|
||||
<React.HTMLComponent>compComponent.refs[INPUT_REF];
|
||||
var value: string = inputRef.getDOMNode<HTMLInputElement>().value;
|
||||
|
||||
var myComponent = <MyComponent>compComponent;
|
||||
myComponent.reset();
|
||||
|
||||
//
|
||||
// Attributes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var children = ["Hello world", [null], React.DOM.span(null)];
|
||||
var divStyle = { // CSSProperties
|
||||
flex: "1 1 main-size",
|
||||
backgroundImage: "url('hello.png')"
|
||||
};
|
||||
var htmlAttr: React.HTMLAttributes = {
|
||||
key: 36,
|
||||
ref: "htmlComponent",
|
||||
children: children,
|
||||
className: "test-attr",
|
||||
style: divStyle,
|
||||
onClick: (event: React.MouseEvent) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
},
|
||||
dangerouslySetInnerHTML: {
|
||||
__html: "<strong>STRONG</strong>"
|
||||
}
|
||||
};
|
||||
React.DOM.div(htmlAttr);
|
||||
React.DOM.span(htmlAttr);
|
||||
React.DOM.input(htmlAttr);
|
||||
|
||||
//
|
||||
// React.PropTypes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var PropTypesSpecification: React.ComponentSpec<any, any> = {
|
||||
propTypes: {
|
||||
optionalArray: React.PropTypes.array,
|
||||
optionalBool: React.PropTypes.bool,
|
||||
optionalFunc: React.PropTypes.func,
|
||||
optionalNumber: React.PropTypes.number,
|
||||
optionalObject: React.PropTypes.object,
|
||||
optionalString: React.PropTypes.string,
|
||||
optionalNode: React.PropTypes.node,
|
||||
optionalElement: React.PropTypes.element,
|
||||
optionalMessage: React.PropTypes.instanceOf(Date),
|
||||
optionalEnum: React.PropTypes.oneOf(["News", "Photos"]),
|
||||
optionalUnion: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.number,
|
||||
React.PropTypes.instanceOf(Date)
|
||||
]),
|
||||
optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number),
|
||||
optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number),
|
||||
optionalObjectWithShape: React.PropTypes.shape({
|
||||
color: React.PropTypes.string,
|
||||
fontSize: React.PropTypes.number
|
||||
}),
|
||||
requiredFunc: React.PropTypes.func.isRequired,
|
||||
requiredAny: React.PropTypes.any.isRequired,
|
||||
customProp: function(props: any, propName: string, componentName: string) {
|
||||
if (!/matchme/.test(props[propName])) {
|
||||
return new Error("Validation failed!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
render: (): React.ReactHTMLElement => {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// React.Children
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var childMap: { [key: string]: number } =
|
||||
React.Children.map<number>(children, (child) => { return 42; });
|
||||
React.Children.forEach(children, (child) => {});
|
||||
var nChildren: number = React.Children.count(children);
|
||||
var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]);
|
||||
|
||||
//
|
||||
// Example from http://facebook.github.io/react/
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
interface TimerState {
|
||||
secondsElapsed: number;
|
||||
}
|
||||
interface Timer extends React.CompositeComponent<{}, TimerState> {
|
||||
}
|
||||
var Timer = React.createClass({
|
||||
displayName: "Timer",
|
||||
getInitialState: () => {
|
||||
return { secondsElapsed: 0 };
|
||||
},
|
||||
tick: () => {
|
||||
var me = <Timer>this;
|
||||
me.setState({
|
||||
secondsElapsed: me.state.secondsElapsed + 1
|
||||
});
|
||||
},
|
||||
componentDidMount: () => {
|
||||
this.interval = setInterval(this.tick, 1000);
|
||||
},
|
||||
componentWillUnmount: () => {
|
||||
clearInterval(this.interval);
|
||||
},
|
||||
render: () => {
|
||||
var me = <Timer>this;
|
||||
return React.DOM.div(
|
||||
null,
|
||||
"Seconds Elapsed: ",
|
||||
me.state.secondsElapsed
|
||||
);
|
||||
}
|
||||
});
|
||||
var mountNode: Element;
|
||||
React.render(React.createElement(Timer, null), mountNode);
|
||||
|
||||
934
react/legacy/react-0.12.d.ts
vendored
934
react/legacy/react-0.12.d.ts
vendored
@ -1,934 +0,0 @@
|
||||
// Type definitions for React 0.12.1
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module React {
|
||||
//
|
||||
// React Elements
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
type ReactType = ComponentClass<any> | string;
|
||||
|
||||
interface ReactElement<P> {
|
||||
type: ComponentClass<P> | string;
|
||||
props: P;
|
||||
key: number | string;
|
||||
ref: string;
|
||||
}
|
||||
|
||||
interface ReactHTMLElement extends ReactElement<HTMLAttributes> {}
|
||||
interface ReactSVGElement extends ReactElement<SVGAttributes> {}
|
||||
|
||||
//
|
||||
// React Nodes
|
||||
// http://facebook.github.io/react/docs/glossary.html
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
type ReactText = string | number;
|
||||
type ReactChild = ReactElement<any> | ReactText;
|
||||
|
||||
// Should be Array<ReactNode> but type aliases cannot be recursive
|
||||
type ReactFragment = Array<ReactChild | any[] | boolean>;
|
||||
type ReactNode = ReactChild | ReactFragment | boolean;
|
||||
|
||||
//
|
||||
// React Components
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface ComponentStatics<P> {
|
||||
displayName?: string;
|
||||
getDefaultProps?(): P;
|
||||
propTypes?: ValidationMap<P>;
|
||||
}
|
||||
|
||||
interface ComponentClass<P> extends ComponentStatics<P> {
|
||||
// Deprecated in 0.12. See http://fb.me/react-legacyfactory
|
||||
// new(props: P): ReactElement<P>;
|
||||
// (props: P): ReactElement<P>;
|
||||
}
|
||||
|
||||
//
|
||||
// ReactElement Factories
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface ComponentFactory<P> {
|
||||
(props?: P, ...children: ReactNode[]): ReactElement<P>;
|
||||
}
|
||||
|
||||
interface HTMLFactory extends ComponentFactory<HTMLAttributes> {}
|
||||
interface SVGFactory extends ComponentFactory<SVGAttributes> {}
|
||||
|
||||
//
|
||||
// Top-Level API
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface TopLevelAPI {
|
||||
createClass<P>(spec: ComponentSpec<P, any>): ComponentClass<P>;
|
||||
createElement<P>(type: ComponentClass<P> | string, props: P, ...children: ReactNode[]): ReactElement<P>;
|
||||
createFactory<P>(componentClass: ComponentClass<P>): ComponentFactory<P>;
|
||||
render<P>(element: ReactElement<P>, container: Element, callback?: () => any): Component<P>;
|
||||
unmountComponentAtNode(container: Element): boolean;
|
||||
renderToString(element: ReactElement<any>): string;
|
||||
renderToStaticMarkup(element: ReactElement<any>): string;
|
||||
isValidElement(object: {}): boolean;
|
||||
initializeTouchEvents(shouldUseTouch: boolean): void;
|
||||
}
|
||||
|
||||
//
|
||||
// Component API
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface Component<P> {
|
||||
// Use this overload to cast the returned element to a more specific type.
|
||||
// Eg: var name = this.refs['name'].getDOMNode<HTMLInputElement>().value;
|
||||
getDOMNode<TElement extends Element>(): TElement;
|
||||
getDOMNode(): Element;
|
||||
isMounted(): boolean;
|
||||
|
||||
props: P;
|
||||
setProps(nextProps: P, callback?: () => any): void;
|
||||
replaceProps(nextProps: P, callback?: () => any): void;
|
||||
}
|
||||
|
||||
interface DOMComponent<P> extends Component<P> {
|
||||
tagName: string;
|
||||
}
|
||||
|
||||
interface HTMLComponent extends DOMComponent<HTMLAttributes> {}
|
||||
interface SVGComponent extends DOMComponent<SVGAttributes> {}
|
||||
|
||||
interface CompositeComponent<P, S> extends Component<P>, ComponentSpec<P, S> {
|
||||
state: S;
|
||||
setState(nextState: S, callback?: () => any): void;
|
||||
replaceState(nextState: S, callback?: () => any): void;
|
||||
forceUpdate(callback?: () => any): void;
|
||||
refs: {
|
||||
[key: string]: Component<any>
|
||||
};
|
||||
}
|
||||
|
||||
//
|
||||
// Component Specs and Lifecycle
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface Mixin<P, S> extends ComponentStatics<P> {
|
||||
mixins?: Mixin<P, S>;
|
||||
statics?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
// Definition methods
|
||||
getInitialState?(): S;
|
||||
|
||||
// Delegate methods
|
||||
componentWillMount?(): void;
|
||||
componentDidMount?(): void;
|
||||
componentWillReceiveProps?(nextProps: P): void;
|
||||
shouldComponentUpdate?(nextProps: P, nextState: S): boolean;
|
||||
componentWillUpdate?(nextProps: P, nextState: S): void;
|
||||
componentDidUpdate?(prevProps: P, prevState: S): void;
|
||||
componentWillUnmount?(): void;
|
||||
}
|
||||
|
||||
interface ComponentSpec<P, S> extends Mixin<P, S> {
|
||||
render(): ReactElement<any>;
|
||||
}
|
||||
|
||||
//
|
||||
// Event System
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface SyntheticEvent {
|
||||
bubbles: boolean;
|
||||
cancelable: boolean;
|
||||
currentTarget: EventTarget;
|
||||
defaultPrevented: boolean;
|
||||
eventPhase: number;
|
||||
isTrusted: boolean;
|
||||
nativeEvent: Event;
|
||||
preventDefault(): void;
|
||||
stopPropagation(): void;
|
||||
target: EventTarget;
|
||||
timeStamp: Date;
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface ClipboardEvent extends SyntheticEvent {
|
||||
clipboardData: DataTransfer;
|
||||
}
|
||||
|
||||
interface KeyboardEvent extends SyntheticEvent {
|
||||
altKey: boolean;
|
||||
charCode: number;
|
||||
ctrlKey: boolean;
|
||||
getModifierState(key: string): boolean;
|
||||
key: string;
|
||||
keyCode: number;
|
||||
locale: string;
|
||||
location: number;
|
||||
metaKey: boolean;
|
||||
repeat: boolean;
|
||||
shiftKey: boolean;
|
||||
which: number;
|
||||
}
|
||||
|
||||
interface FocusEvent extends SyntheticEvent {
|
||||
relatedTarget: EventTarget;
|
||||
}
|
||||
|
||||
interface FormEvent extends SyntheticEvent {
|
||||
}
|
||||
|
||||
interface MouseEvent extends SyntheticEvent {
|
||||
altKey: boolean;
|
||||
button: number;
|
||||
buttons: number;
|
||||
clientX: number;
|
||||
clientY: number;
|
||||
ctrlKey: boolean;
|
||||
getModifierState(key: string): boolean;
|
||||
metaKey: boolean;
|
||||
pageX: number;
|
||||
pageY: number;
|
||||
relatedTarget: EventTarget;
|
||||
screenX: number;
|
||||
screenY: number;
|
||||
shiftKey: boolean;
|
||||
}
|
||||
|
||||
interface TouchEvent extends SyntheticEvent {
|
||||
altKey: boolean;
|
||||
changedTouches: TouchList;
|
||||
ctrlKey: boolean;
|
||||
getModifierState(key: string): boolean;
|
||||
metaKey: boolean;
|
||||
shiftKey: boolean;
|
||||
targetTouches: TouchList;
|
||||
touches: TouchList;
|
||||
}
|
||||
|
||||
interface UIEvent extends SyntheticEvent {
|
||||
detail: number;
|
||||
view: AbstractView;
|
||||
}
|
||||
|
||||
interface WheelEvent extends SyntheticEvent {
|
||||
deltaMode: number;
|
||||
deltaX: number;
|
||||
deltaY: number;
|
||||
deltaZ: number;
|
||||
}
|
||||
|
||||
//
|
||||
// Event Handler Types
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface EventHandler<E extends SyntheticEvent> {
|
||||
(event: E): void;
|
||||
}
|
||||
|
||||
interface ClipboardEventHandler extends EventHandler<ClipboardEvent> {}
|
||||
interface KeyboardEventHandler extends EventHandler<KeyboardEvent> {}
|
||||
interface FocusEventHandler extends EventHandler<FocusEvent> {}
|
||||
interface FormEventHandler extends EventHandler<FormEvent> {}
|
||||
interface MouseEventHandler extends EventHandler<MouseEvent> {}
|
||||
interface TouchEventHandler extends EventHandler<TouchEvent> {}
|
||||
interface UIEventHandler extends EventHandler<UIEvent> {}
|
||||
interface WheelEventHandler extends EventHandler<WheelEvent> {}
|
||||
|
||||
//
|
||||
// Attributes
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export interface ReactAttributes {
|
||||
children?: ReactNode;
|
||||
key?: number | string;
|
||||
ref?: string;
|
||||
|
||||
// Event Attributes
|
||||
onCopy?: ClipboardEventHandler;
|
||||
onCut?: ClipboardEventHandler;
|
||||
onPaste?: ClipboardEventHandler;
|
||||
onKeyDown?: KeyboardEventHandler;
|
||||
onKeyPress?: KeyboardEventHandler;
|
||||
onKeyUp?: KeyboardEventHandler;
|
||||
onFocus?: FocusEventHandler;
|
||||
onBlur?: FocusEventHandler;
|
||||
onChange?: FormEventHandler;
|
||||
onInput?: FormEventHandler;
|
||||
onSubmit?: FormEventHandler;
|
||||
onClick?: MouseEventHandler;
|
||||
onDoubleClick?: MouseEventHandler;
|
||||
onDrag?: MouseEventHandler;
|
||||
onDragEnd?: MouseEventHandler;
|
||||
onDragEnter?: MouseEventHandler;
|
||||
onDragExit?: MouseEventHandler;
|
||||
onDragLeave?: MouseEventHandler;
|
||||
onDragOver?: MouseEventHandler;
|
||||
onDragStart?: MouseEventHandler;
|
||||
onDrop?: MouseEventHandler;
|
||||
onMouseDown?: MouseEventHandler;
|
||||
onMouseEnter?: MouseEventHandler;
|
||||
onMouseLeave?: MouseEventHandler;
|
||||
onMouseMove?: MouseEventHandler;
|
||||
onMouseOut?: MouseEventHandler;
|
||||
onMouseOver?: MouseEventHandler;
|
||||
onMouseUp?: MouseEventHandler;
|
||||
onTouchCancel?: TouchEventHandler;
|
||||
onTouchEnd?: TouchEventHandler;
|
||||
onTouchMove?: TouchEventHandler;
|
||||
onTouchStart?: TouchEventHandler;
|
||||
onScroll?: UIEventHandler;
|
||||
onWheel?: WheelEventHandler;
|
||||
|
||||
dangerouslySetInnerHTML?: {
|
||||
__html: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface CSSProperties {
|
||||
columnCount?: number;
|
||||
flex?: number | string;
|
||||
flexGrow?: number;
|
||||
flexShrink?: number;
|
||||
fontWeight?: number;
|
||||
lineClamp?: number;
|
||||
lineHeight?: number;
|
||||
opacity?: number;
|
||||
order?: number;
|
||||
orphans?: number;
|
||||
widows?: number;
|
||||
zIndex?: number;
|
||||
zoom?: number;
|
||||
|
||||
// SVG-related properties
|
||||
fillOpacity?: number;
|
||||
strokeOpacity?: number;
|
||||
}
|
||||
|
||||
interface HTMLAttributes extends ReactAttributes {
|
||||
accept?: string;
|
||||
acceptCharset?: string;
|
||||
accessKey?: string;
|
||||
action?: string;
|
||||
allowFullScreen?: boolean;
|
||||
allowTransparency?: boolean;
|
||||
alt?: string;
|
||||
async?: boolean;
|
||||
autoComplete?: boolean;
|
||||
autoFocus?: boolean;
|
||||
autoPlay?: boolean;
|
||||
cellPadding?: number | string;
|
||||
cellSpacing?: number | string;
|
||||
charSet?: string;
|
||||
checked?: boolean;
|
||||
classID?: string;
|
||||
className?: string;
|
||||
cols?: number;
|
||||
colSpan?: number;
|
||||
content?: string;
|
||||
contentEditable?: boolean;
|
||||
contextMenu?: string;
|
||||
controls?: any;
|
||||
coords?: string;
|
||||
crossOrigin?: string;
|
||||
data?: string;
|
||||
dateTime?: string;
|
||||
defer?: boolean;
|
||||
dir?: string;
|
||||
disabled?: boolean;
|
||||
download?: any;
|
||||
draggable?: boolean;
|
||||
encType?: string;
|
||||
form?: string;
|
||||
formNoValidate?: boolean;
|
||||
frameBorder?: number | string;
|
||||
height?: number | string;
|
||||
hidden?: boolean;
|
||||
href?: string;
|
||||
hrefLang?: string;
|
||||
htmlFor?: string;
|
||||
httpEquiv?: string;
|
||||
icon?: string;
|
||||
id?: string;
|
||||
label?: string;
|
||||
lang?: string;
|
||||
list?: string;
|
||||
loop?: boolean;
|
||||
manifest?: string;
|
||||
max?: number | string;
|
||||
maxLength?: number;
|
||||
media?: string;
|
||||
mediaGroup?: string;
|
||||
method?: string;
|
||||
min?: number | string;
|
||||
multiple?: boolean;
|
||||
muted?: boolean;
|
||||
name?: string;
|
||||
noValidate?: boolean;
|
||||
open?: boolean;
|
||||
pattern?: string;
|
||||
placeholder?: string;
|
||||
poster?: string;
|
||||
preload?: string;
|
||||
radioGroup?: string;
|
||||
readOnly?: boolean;
|
||||
rel?: string;
|
||||
required?: boolean;
|
||||
role?: string;
|
||||
rows?: number;
|
||||
rowSpan?: number;
|
||||
sandbox?: string;
|
||||
scope?: string;
|
||||
scrollLeft?: number;
|
||||
scrolling?: string;
|
||||
scrollTop?: number;
|
||||
seamless?: boolean;
|
||||
selected?: boolean;
|
||||
shape?: string;
|
||||
size?: number;
|
||||
sizes?: string;
|
||||
span?: number;
|
||||
spellCheck?: boolean;
|
||||
src?: string;
|
||||
srcDoc?: string;
|
||||
srcSet?: string;
|
||||
start?: number;
|
||||
step?: number | string;
|
||||
style?: CSSProperties;
|
||||
tabIndex?: number;
|
||||
target?: string;
|
||||
title?: string;
|
||||
type?: string;
|
||||
useMap?: string;
|
||||
value?: string;
|
||||
width?: number | string;
|
||||
wmode?: string;
|
||||
|
||||
// Non-standard Attributes
|
||||
autoCapitalize?: boolean;
|
||||
autoCorrect?: boolean;
|
||||
property?: string;
|
||||
itemProp?: string;
|
||||
itemScope?: boolean;
|
||||
itemType?: string;
|
||||
}
|
||||
|
||||
interface SVGAttributes extends ReactAttributes {
|
||||
cx?: SVGLength | SVGAnimatedLength;
|
||||
cy?: any;
|
||||
d?: string;
|
||||
dx?: SVGLength | SVGAnimatedLength;
|
||||
dy?: SVGLength | SVGAnimatedLength;
|
||||
fill?: any; // SVGPaint | string
|
||||
fillOpacity?: number | string;
|
||||
fontFamily?: string;
|
||||
fontSize?: number | string;
|
||||
fx?: SVGLength | SVGAnimatedLength;
|
||||
fy?: SVGLength | SVGAnimatedLength;
|
||||
gradientTransform?: SVGTransformList | SVGAnimatedTransformList;
|
||||
gradientUnits?: string;
|
||||
markerEnd?: string;
|
||||
markerMid?: string;
|
||||
markerStart?: string;
|
||||
offset?: number | string;
|
||||
opacity?: number | string;
|
||||
patternContentUnits?: string;
|
||||
patternUnits?: string;
|
||||
points?: string;
|
||||
preserveAspectRatio?: string;
|
||||
r?: SVGLength | SVGAnimatedLength;
|
||||
rx?: SVGLength | SVGAnimatedLength;
|
||||
ry?: SVGLength | SVGAnimatedLength;
|
||||
spreadMethod?: string;
|
||||
stopColor?: any; // SVGColor | string
|
||||
stopOpacity?: number | string;
|
||||
stroke?: any; // SVGPaint
|
||||
strokeDasharray?: string;
|
||||
strokeLinecap?: string;
|
||||
strokeOpacity?: number | string;
|
||||
strokeWidth?: SVGLength | SVGAnimatedLength;
|
||||
textAnchor?: string;
|
||||
transform?: SVGTransformList | SVGAnimatedTransformList;
|
||||
version?: string;
|
||||
viewBox?: string;
|
||||
x1?: SVGLength | SVGAnimatedLength;
|
||||
x2?: SVGLength | SVGAnimatedLength;
|
||||
x?: SVGLength | SVGAnimatedLength;
|
||||
y1?: SVGLength | SVGAnimatedLength;
|
||||
y2?: SVGLength | SVGAnimatedLength
|
||||
y?: SVGLength | SVGAnimatedLength;
|
||||
}
|
||||
|
||||
//
|
||||
// React.DOM
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface ReactDOM {
|
||||
// HTML
|
||||
a: HTMLFactory;
|
||||
abbr: HTMLFactory;
|
||||
address: HTMLFactory;
|
||||
area: HTMLFactory;
|
||||
article: HTMLFactory;
|
||||
aside: HTMLFactory;
|
||||
audio: HTMLFactory;
|
||||
b: HTMLFactory;
|
||||
base: HTMLFactory;
|
||||
bdi: HTMLFactory;
|
||||
bdo: HTMLFactory;
|
||||
big: HTMLFactory;
|
||||
blockquote: HTMLFactory;
|
||||
body: HTMLFactory;
|
||||
br: HTMLFactory;
|
||||
button: HTMLFactory;
|
||||
canvas: HTMLFactory;
|
||||
caption: HTMLFactory;
|
||||
cite: HTMLFactory;
|
||||
code: HTMLFactory;
|
||||
col: HTMLFactory;
|
||||
colgroup: HTMLFactory;
|
||||
data: HTMLFactory;
|
||||
datalist: HTMLFactory;
|
||||
dd: HTMLFactory;
|
||||
del: HTMLFactory;
|
||||
details: HTMLFactory;
|
||||
dfn: HTMLFactory;
|
||||
dialog: HTMLFactory;
|
||||
div: HTMLFactory;
|
||||
dl: HTMLFactory;
|
||||
dt: HTMLFactory;
|
||||
em: HTMLFactory;
|
||||
embed: HTMLFactory;
|
||||
fieldset: HTMLFactory;
|
||||
figcaption: HTMLFactory;
|
||||
figure: HTMLFactory;
|
||||
footer: HTMLFactory;
|
||||
form: HTMLFactory;
|
||||
h1: HTMLFactory;
|
||||
h2: HTMLFactory;
|
||||
h3: HTMLFactory;
|
||||
h4: HTMLFactory;
|
||||
h5: HTMLFactory;
|
||||
h6: HTMLFactory;
|
||||
head: HTMLFactory;
|
||||
header: HTMLFactory;
|
||||
hr: HTMLFactory;
|
||||
html: HTMLFactory;
|
||||
i: HTMLFactory;
|
||||
iframe: HTMLFactory;
|
||||
img: HTMLFactory;
|
||||
input: HTMLFactory;
|
||||
ins: HTMLFactory;
|
||||
kbd: HTMLFactory;
|
||||
keygen: HTMLFactory;
|
||||
label: HTMLFactory;
|
||||
legend: HTMLFactory;
|
||||
li: HTMLFactory;
|
||||
link: HTMLFactory;
|
||||
main: HTMLFactory;
|
||||
map: HTMLFactory;
|
||||
mark: HTMLFactory;
|
||||
menu: HTMLFactory;
|
||||
menuitem: HTMLFactory;
|
||||
meta: HTMLFactory;
|
||||
meter: HTMLFactory;
|
||||
nav: HTMLFactory;
|
||||
noscript: HTMLFactory;
|
||||
object: HTMLFactory;
|
||||
ol: HTMLFactory;
|
||||
optgroup: HTMLFactory;
|
||||
option: HTMLFactory;
|
||||
output: HTMLFactory;
|
||||
p: HTMLFactory;
|
||||
param: HTMLFactory;
|
||||
picture: HTMLFactory;
|
||||
pre: HTMLFactory;
|
||||
progress: HTMLFactory;
|
||||
q: HTMLFactory;
|
||||
rp: HTMLFactory;
|
||||
rt: HTMLFactory;
|
||||
ruby: HTMLFactory;
|
||||
s: HTMLFactory;
|
||||
samp: HTMLFactory;
|
||||
script: HTMLFactory;
|
||||
section: HTMLFactory;
|
||||
select: HTMLFactory;
|
||||
small: HTMLFactory;
|
||||
source: HTMLFactory;
|
||||
span: HTMLFactory;
|
||||
strong: HTMLFactory;
|
||||
style: HTMLFactory;
|
||||
sub: HTMLFactory;
|
||||
summary: HTMLFactory;
|
||||
sup: HTMLFactory;
|
||||
table: HTMLFactory;
|
||||
tbody: HTMLFactory;
|
||||
td: HTMLFactory;
|
||||
textarea: HTMLFactory;
|
||||
tfoot: HTMLFactory;
|
||||
th: HTMLFactory;
|
||||
thead: HTMLFactory;
|
||||
time: HTMLFactory;
|
||||
title: HTMLFactory;
|
||||
tr: HTMLFactory;
|
||||
track: HTMLFactory;
|
||||
u: HTMLFactory;
|
||||
ul: HTMLFactory;
|
||||
"var": HTMLFactory;
|
||||
video: HTMLFactory;
|
||||
wbr: HTMLFactory;
|
||||
|
||||
// SVG
|
||||
circle: SVGFactory;
|
||||
defs: SVGFactory;
|
||||
ellipse: SVGFactory;
|
||||
g: SVGFactory;
|
||||
line: SVGFactory;
|
||||
linearGradient: SVGFactory;
|
||||
mask: SVGFactory;
|
||||
path: SVGFactory;
|
||||
pattern: SVGFactory;
|
||||
polygon: SVGFactory;
|
||||
polyline: SVGFactory;
|
||||
radialGradient: SVGFactory;
|
||||
rect: SVGFactory;
|
||||
stop: SVGFactory;
|
||||
svg: SVGFactory;
|
||||
text: SVGFactory;
|
||||
tspan: SVGFactory;
|
||||
}
|
||||
|
||||
//
|
||||
// React.PropTypes
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface Validator<T> {
|
||||
(object: T, key: string, componentName: string): Error;
|
||||
}
|
||||
|
||||
interface Requireable<T> extends Validator<T> {
|
||||
isRequired: Validator<T>;
|
||||
}
|
||||
|
||||
interface ValidationMap<T> {
|
||||
[key: string]: Validator<T>;
|
||||
}
|
||||
|
||||
interface ReactPropTypes {
|
||||
any: Requireable<any>;
|
||||
array: Requireable<any>;
|
||||
bool: Requireable<any>;
|
||||
func: Requireable<any>;
|
||||
number: Requireable<any>;
|
||||
object: Requireable<any>;
|
||||
string: Requireable<any>;
|
||||
node: Requireable<any>;
|
||||
element: Requireable<any>;
|
||||
instanceOf(expectedClass: {}): Requireable<any>;
|
||||
oneOf(types: any[]): Requireable<any>;
|
||||
oneOfType(types: Validator<any>[]): Requireable<any>;
|
||||
arrayOf(type: Validator<any>): Requireable<any>;
|
||||
objectOf(type: Validator<any>): Requireable<any>;
|
||||
shape(type: ValidationMap<any>): Requireable<any>;
|
||||
}
|
||||
|
||||
//
|
||||
// React.Children
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface ReactChildren {
|
||||
map<T>(children: ReactNode, fn: (child: ReactChild) => T): { [key:string]: T };
|
||||
forEach(children: ReactNode, fn: (child: ReactChild) => any): void;
|
||||
count(children: ReactNode): number;
|
||||
only(children: ReactNode): ReactChild;
|
||||
}
|
||||
|
||||
//
|
||||
// React.addons
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface ClassSet {
|
||||
[key: string]: boolean;
|
||||
}
|
||||
|
||||
//
|
||||
// React.addons (Transitions)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface TransitionGroupProps {
|
||||
component?: ReactType;
|
||||
childFactory?: (child: ReactElement<any>) => ReactElement<any>;
|
||||
}
|
||||
|
||||
interface CSSTransitionGroupProps extends TransitionGroupProps {
|
||||
transitionName: string;
|
||||
transitionAppear?: boolean;
|
||||
transitionEnter?: boolean;
|
||||
transitionLeave?: boolean;
|
||||
}
|
||||
|
||||
interface CSSTransitionGroup extends ComponentClass<CSSTransitionGroupProps> {}
|
||||
interface TransitionGroup extends ComponentClass<TransitionGroupProps> {}
|
||||
|
||||
//
|
||||
// React.addons (Mixins)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface ReactLink<T> {
|
||||
value: T;
|
||||
requestChange(newValue: T): void;
|
||||
}
|
||||
|
||||
interface LinkedStateMixin extends Mixin<any, any> {
|
||||
linkState<T>(key: string): ReactLink<T>;
|
||||
}
|
||||
|
||||
interface PureRenderMixin extends Mixin<any, any> {
|
||||
}
|
||||
|
||||
//
|
||||
// Reat.addons.update
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface UpdateSpec {
|
||||
$set: any;
|
||||
$merge: {};
|
||||
$apply(value: any): any;
|
||||
// [key: string]: UpdateSpec;
|
||||
}
|
||||
|
||||
interface UpdateArraySpec extends UpdateSpec {
|
||||
$push?: any[];
|
||||
$unshift?: any[];
|
||||
$splice?: any[][];
|
||||
}
|
||||
|
||||
//
|
||||
// React.addons.Perf
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface ComponentPerfContext {
|
||||
current: string;
|
||||
owner: string;
|
||||
}
|
||||
|
||||
interface NumericPerfContext {
|
||||
[key: string]: number;
|
||||
}
|
||||
|
||||
interface Measurements {
|
||||
exclusive: NumericPerfContext;
|
||||
inclusive: NumericPerfContext;
|
||||
render: NumericPerfContext;
|
||||
counts: NumericPerfContext;
|
||||
writes: NumericPerfContext;
|
||||
displayNames: {
|
||||
[key: string]: ComponentPerfContext;
|
||||
};
|
||||
totalTime: number;
|
||||
}
|
||||
|
||||
interface ReactPerf {
|
||||
start(): void;
|
||||
stop(): void;
|
||||
printInclusive(measurements: Measurements[]): void;
|
||||
printExclusive(measurements: Measurements[]): void;
|
||||
printWasted(measurements: Measurements[]): void;
|
||||
printDOM(measurements: Measurements[]): void;
|
||||
getLastMeasurements(): Measurements[];
|
||||
}
|
||||
|
||||
//
|
||||
// React.addons.TestUtils
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface MockedComponentClass {
|
||||
new(): any;
|
||||
}
|
||||
|
||||
interface ReactTestUtils {
|
||||
Simulate: Simulate;
|
||||
|
||||
renderIntoDocument<P>(element: ReactElement<P>): Component<P>;
|
||||
renderIntoDocument<C extends Component<any>>(element: ReactElement<any>): C;
|
||||
|
||||
mockComponent(mocked: MockedComponentClass, mockTagName?: string): ReactTestUtils;
|
||||
|
||||
isElementOfType(element: ReactElement<any>, type: ReactType): boolean;
|
||||
isDOMComponent(instance: Component<any>): boolean;
|
||||
isCompositeComponent(instance: Component<any>): boolean;
|
||||
isCompositeComponentWithType(instance: Component<any>, type: ComponentClass<any>): boolean;
|
||||
isTextComponent(instance: Component<any>): boolean;
|
||||
|
||||
findAllInRenderedTree(tree: Component<any>, fn: (i: Component<any>) => boolean): Component<any>;
|
||||
|
||||
scryRenderedDOMComponentsWithClass(tree: Component<any>, className: string): DOMComponent<any>[];
|
||||
findRenderedDOMComponentWithClass(tree: Component<any>, className: string): DOMComponent<any>;
|
||||
|
||||
scryRenderedDOMComponentsWithTag(tree: Component<any>, tagName: string): DOMComponent<any>[];
|
||||
findRenderedDOMComponentWithTag(tree: Component<any>, tagName: string): DOMComponent<any>;
|
||||
|
||||
scryRenderedComponentsWithType<P, S>(
|
||||
tree: Component<any>, type: ComponentClass<P>): CompositeComponent<P, S>[];
|
||||
scryRenderedComponentsWithType<C extends CompositeComponent<any, any>>(
|
||||
tree: Component<any>, type: ComponentClass<any>): C[];
|
||||
|
||||
findRenderedComponentWithType<P, S>(
|
||||
tree: Component<any>, type: ComponentClass<P>): CompositeComponent<P, S>;
|
||||
findRenderedComponentWithType<C extends CompositeComponent<any, any>>(
|
||||
tree: Component<any>, type: ComponentClass<any>): C;
|
||||
}
|
||||
|
||||
interface SyntheticEventData {
|
||||
altKey?: boolean;
|
||||
button?: number;
|
||||
buttons?: number;
|
||||
clientX?: number;
|
||||
clientY?: number;
|
||||
changedTouches?: TouchList;
|
||||
charCode?: boolean;
|
||||
clipboardData?: DataTransfer;
|
||||
ctrlKey?: boolean;
|
||||
deltaMode?: number;
|
||||
deltaX?: number;
|
||||
deltaY?: number;
|
||||
deltaZ?: number;
|
||||
detail?: number;
|
||||
getModifierState?(key: string): boolean;
|
||||
key?: string;
|
||||
keyCode?: number;
|
||||
locale?: string;
|
||||
location?: number;
|
||||
metaKey?: boolean;
|
||||
pageX?: number;
|
||||
pageY?: number;
|
||||
relatedTarget?: EventTarget;
|
||||
repeat?: boolean;
|
||||
screenX?: number;
|
||||
screenY?: number;
|
||||
shiftKey?: boolean;
|
||||
targetTouches?: TouchList;
|
||||
touches?: TouchList;
|
||||
view?: AbstractView;
|
||||
which?: number;
|
||||
}
|
||||
|
||||
interface EventSimulator {
|
||||
(element: Element, eventData?: SyntheticEventData): void;
|
||||
(descriptor: Component<any>, eventData?: SyntheticEventData): void;
|
||||
}
|
||||
|
||||
interface Simulate {
|
||||
blur: EventSimulator;
|
||||
change: EventSimulator;
|
||||
click: EventSimulator;
|
||||
cut: EventSimulator;
|
||||
doubleClick: EventSimulator;
|
||||
drag: EventSimulator;
|
||||
dragEnd: EventSimulator;
|
||||
dragEnter: EventSimulator;
|
||||
dragExit: EventSimulator;
|
||||
dragLeave: EventSimulator;
|
||||
dragOver: EventSimulator;
|
||||
dragStart: EventSimulator;
|
||||
drop: EventSimulator;
|
||||
focus: EventSimulator;
|
||||
input: EventSimulator;
|
||||
keyDown: EventSimulator;
|
||||
keyPress: EventSimulator;
|
||||
keyUp: EventSimulator;
|
||||
mouseDown: EventSimulator;
|
||||
mouseEnter: EventSimulator;
|
||||
mouseLeave: EventSimulator;
|
||||
mouseMove: EventSimulator;
|
||||
mouseOut: EventSimulator;
|
||||
mouseOver: EventSimulator;
|
||||
mouseUp: EventSimulator;
|
||||
paste: EventSimulator;
|
||||
scroll: EventSimulator;
|
||||
submit: EventSimulator;
|
||||
touchCancel: EventSimulator;
|
||||
touchEnd: EventSimulator;
|
||||
touchMove: EventSimulator;
|
||||
touchStart: EventSimulator;
|
||||
wheel: EventSimulator;
|
||||
}
|
||||
|
||||
//
|
||||
// react Exports
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface Exports extends TopLevelAPI {
|
||||
DOM: ReactDOM;
|
||||
PropTypes: ReactPropTypes;
|
||||
Children: ReactChildren;
|
||||
}
|
||||
|
||||
//
|
||||
// react/addons Exports
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface AddonsExports extends Exports {
|
||||
addons: {
|
||||
CSSTransitionGroup: CSSTransitionGroup;
|
||||
LinkedStateMixin: LinkedStateMixin;
|
||||
PureRenderMixin: PureRenderMixin;
|
||||
TransitionGroup: TransitionGroup;
|
||||
|
||||
batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
|
||||
batchedUpdates<A>(callback: (a: A) => any, a: A): void;
|
||||
batchedUpdates(callback: () => any): void;
|
||||
|
||||
classSet(cx: ClassSet): string;
|
||||
cloneWithProps<P>(element: ReactElement<P>, props: P): ReactElement<P>;
|
||||
|
||||
update(value: any[], spec: UpdateArraySpec): any[];
|
||||
update(value: {}, spec: UpdateSpec): any;
|
||||
|
||||
// Development tools
|
||||
Perf: ReactPerf;
|
||||
TestUtils: ReactTestUtils;
|
||||
};
|
||||
}
|
||||
|
||||
//
|
||||
// Browser Interfaces
|
||||
// https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface AbstractView {
|
||||
styleMedia: StyleMedia;
|
||||
document: Document;
|
||||
}
|
||||
|
||||
interface Touch {
|
||||
identifier: number;
|
||||
target: EventTarget;
|
||||
screenX: number;
|
||||
screenY: number;
|
||||
clientX: number;
|
||||
clientY: number;
|
||||
pageX: number;
|
||||
pageY: number;
|
||||
}
|
||||
|
||||
interface TouchList {
|
||||
[index: number]: Touch;
|
||||
length: number;
|
||||
item(index: number): Touch;
|
||||
identifiedTouch(identifier: number): Touch;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "react" {
|
||||
var exports: React.Exports;
|
||||
export = exports;
|
||||
}
|
||||
|
||||
declare module "react/addons" {
|
||||
var exports: React.AddonsExports;
|
||||
export = exports;
|
||||
}
|
||||
|
||||
@ -1,133 +0,0 @@
|
||||
/// <reference path="react-addons-0.11.d.ts" />
|
||||
import React = require("react/addons-0.11");
|
||||
|
||||
var PropTypesSpecification: React.Specification<any, any> = {
|
||||
propTypes: {
|
||||
// You can declare that a prop is a specific JS primitive. By default, these
|
||||
// are all optional.
|
||||
optionalArray: React.PropTypes.array,
|
||||
optionalBool: React.PropTypes.bool,
|
||||
optionalFunc: React.PropTypes.func,
|
||||
optionalNumber: React.PropTypes.number,
|
||||
optionalObject: React.PropTypes.object,
|
||||
optionalString: React.PropTypes.string,
|
||||
|
||||
// Anything that can be rendered: numbers, strings, components or an array
|
||||
// containing these types.
|
||||
optionalRenderable: React.PropTypes.renderable,
|
||||
|
||||
// A React component.
|
||||
optionalComponent: React.PropTypes.component,
|
||||
|
||||
// You can also declare that a prop is an instance of a class. This uses
|
||||
// JS's instanceof operator.
|
||||
optionalMessage: React.PropTypes.instanceOf(Date),
|
||||
|
||||
// You can ensure that your prop is limited to specific values by treating
|
||||
// it as an enum.
|
||||
optionalEnum: React.PropTypes.oneOf(['News', 'Photos']),
|
||||
|
||||
// An object that could be one of many types
|
||||
optionalUnion: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.number,
|
||||
React.PropTypes.instanceOf(Date)
|
||||
]),
|
||||
|
||||
// An array of a certain type
|
||||
optionalArrayOf: React.PropTypes.arrayOf(React.PropTypes.number),
|
||||
|
||||
// An object with property values of a certain type
|
||||
optionalObjectOf: React.PropTypes.objectOf(React.PropTypes.number),
|
||||
|
||||
// An object taking on a particular shape
|
||||
optionalObjectWithShape: React.PropTypes.shape({
|
||||
color: React.PropTypes.string,
|
||||
fontSize: React.PropTypes.number
|
||||
}),
|
||||
|
||||
// You can chain any of the above with `isRequired` to make sure a warning
|
||||
// is shown if the prop isn't provided.
|
||||
requiredFunc: React.PropTypes.func.isRequired,
|
||||
|
||||
// A value of any data type
|
||||
requiredAny: React.PropTypes.any.isRequired,
|
||||
|
||||
// You can also specify a custom validator. It should return an Error
|
||||
// object if the validation fails. Don't `console.warn` or throw, as this
|
||||
// won't work inside `oneOfType`.
|
||||
customProp: function(props, propName, componentName) {
|
||||
if (!/matchme/.test(props[propName])) {
|
||||
return new Error('Validation failed!');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
render: (): React.Descriptor<any> => {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
React.createClass(PropTypesSpecification);
|
||||
|
||||
var mountNode: Element;
|
||||
|
||||
var HelloMessage = React.createClass({displayName: 'HelloMessage',
|
||||
render: function() {
|
||||
return React.DOM.div(null, "Hello ", (<React.Component<{name: string}, any>>this).props.name);
|
||||
}
|
||||
});
|
||||
|
||||
React.renderComponent(HelloMessage({name: "John"}), mountNode);
|
||||
|
||||
var Timer = React.createClass({displayName: 'Timer',
|
||||
getInitialState: function() {
|
||||
return {secondsElapsed: 0};
|
||||
},
|
||||
tick: function() {
|
||||
(<React.Component<any, {secondsElapsed: number}>>this).setState({
|
||||
secondsElapsed: (<React.Component<any, {secondsElapsed: number}>>this).state.secondsElapsed + 1
|
||||
});
|
||||
},
|
||||
componentDidMount: function() {
|
||||
this.interval = setInterval(this.tick, 1000);
|
||||
},
|
||||
componentWillUnmount: function() {
|
||||
clearInterval(this.interval);
|
||||
},
|
||||
render: function() {
|
||||
return React.DOM.div(
|
||||
null,
|
||||
"Seconds Elapsed: ",
|
||||
(<React.Component<any, {secondsElapsed: number}>>this).state.secondsElapsed
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
React.renderComponent(Timer(null), mountNode);
|
||||
|
||||
// TestUtils
|
||||
var that: React.Component<any, any>;
|
||||
var node = that.refs['input'].getDOMNode();
|
||||
React.addons.TestUtils.Simulate.click(node);
|
||||
React.addons.TestUtils.Simulate.change(node);
|
||||
React.addons.TestUtils.Simulate.keyDown(node, {key: "Enter"});
|
||||
|
||||
var GoodbyeMessage = React.createClass({displayName: 'GoodbyeMessage',
|
||||
render: function() {
|
||||
return React.DOM.div(null, "Goodbye ", (<React.Component<{name: string}, any>>this).props.name);
|
||||
}
|
||||
});
|
||||
React.addons.TestUtils.renderIntoDocument(GoodbyeMessage({name: "John"}));
|
||||
|
||||
var isImportant: boolean;
|
||||
var isRead: boolean;
|
||||
var cx = React.addons.classSet;
|
||||
var classes = cx({
|
||||
'message': true,
|
||||
'message-important': isImportant,
|
||||
'message-read': isRead
|
||||
});
|
||||
|
||||
|
||||
|
||||
172
react/legacy/react-addons-0.11.d.ts
vendored
172
react/legacy/react-addons-0.11.d.ts
vendored
@ -1,172 +0,0 @@
|
||||
// Type definitions for React with Addons 0.11.2
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="react-0.11.d.ts" />
|
||||
|
||||
declare module "react/addons-0.11" {
|
||||
export = React;
|
||||
}
|
||||
|
||||
declare module React {
|
||||
export var addons: {
|
||||
classSet: (classes: {[key: string]: boolean}) => string;
|
||||
cloneWithProps: CloneWithProps<any>;
|
||||
CSSTransitionGroup: Factory<CSSTransitionGroupProps>;
|
||||
LinkedStateMixin: LinkedStateMixin<any, any>;
|
||||
Perf: Perf;
|
||||
PureRenderMixin: Mixin<any, any>;
|
||||
TestUtils: TestUtils;
|
||||
TransitionGroup: Factory<any>;
|
||||
update(object: Object, changes: Object): Object;
|
||||
};
|
||||
|
||||
export interface CloneWithProps<P> {
|
||||
(instance: Descriptor<P>, extraProps?: P): Descriptor<P>;
|
||||
}
|
||||
|
||||
export interface ReactLink<T> {
|
||||
value: T;
|
||||
requestChange(newValue: T): void;
|
||||
}
|
||||
|
||||
export interface LinkedStateMixin<P, S> extends Mixin<P, S> {
|
||||
linkState<T>(key: string): ReactLink<T>;
|
||||
}
|
||||
|
||||
export interface ComponentPerfContext {
|
||||
current: string;
|
||||
owner: string;
|
||||
}
|
||||
|
||||
export interface CSSTransitionGroupProps {
|
||||
transitionName: string;
|
||||
}
|
||||
|
||||
export interface TransitionsSpecification<P, S> extends Specification<P, S> {
|
||||
componentWillEnter?(callback: () => void): void;
|
||||
componentDidEnter?(): void;
|
||||
componentWillLeave?(callback: () => void): void;
|
||||
componentDidLeave?(): void;
|
||||
}
|
||||
|
||||
export interface NumericPerfContext {
|
||||
[key: string]: number;
|
||||
}
|
||||
|
||||
export interface Measurements {
|
||||
exclusive: NumericPerfContext;
|
||||
inclusive: NumericPerfContext;
|
||||
render: NumericPerfContext;
|
||||
counts: NumericPerfContext;
|
||||
writes: NumericPerfContext;
|
||||
displayNames: {
|
||||
[key: string]: ComponentPerfContext;
|
||||
};
|
||||
totalTime: number;
|
||||
}
|
||||
|
||||
export interface Perf {
|
||||
start(): void;
|
||||
stop(): void;
|
||||
printInclusive(measurements: Measurements[]): void;
|
||||
printExclusive(measurements: Measurements[]): void;
|
||||
printWasted(measurements: Measurements[]): void;
|
||||
printDOM(measurements: Measurements[]): void;
|
||||
getLastMeasurements(): Measurements[];
|
||||
}
|
||||
|
||||
export interface TestUtils {
|
||||
Simulate: Simulate;
|
||||
renderIntoDocument(instance: Descriptor<any>): Descriptor<any>;
|
||||
mockComponent(componentClass: Factory<any>, mockTagName?: string): TestUtils;
|
||||
isDescriptorOfType(descriptor: Descriptor<any>, componentClass: Factory<any>): boolean;
|
||||
isDOMComponent(instance: Descriptor<any>): boolean;
|
||||
isCompositeComponent(instance: Descriptor<any>): boolean;
|
||||
isCompositeComponentWithType(instance: Descriptor<any>, componentClass: Function): boolean;
|
||||
isTextComponent(instance: Descriptor<any>): boolean;
|
||||
findAllInRenderedTree(tree: Descriptor<any>, test: Function): Descriptor<any>[];
|
||||
scryRenderedDOMComponentsWithClass(tree: Descriptor<any>, className: string): Descriptor<any>[];
|
||||
findRenderedDOMComponentWithClass(tree: Descriptor<any>, className: string): Descriptor<any>;
|
||||
scryRenderedDOMComponentsWithTag(tree: Descriptor<any>, className: string): Descriptor<any>[];
|
||||
findRenderedDOMComponentWithTag(tree: Descriptor<any>, tagName: string): Descriptor<any>;
|
||||
scryFindRenderedComponentsWithTag(tree: Descriptor<any>, componentClass: Function): Descriptor<any>[];
|
||||
findRenderedComponentWithType(tree: Descriptor<any>, componentClass: Function): Descriptor<any>;
|
||||
}
|
||||
|
||||
export interface SyntheticEventData {
|
||||
altKey?: boolean;
|
||||
button?: number;
|
||||
buttons?: number;
|
||||
clientX?: number;
|
||||
clientY?: number;
|
||||
changedTouches?: TouchList;
|
||||
charCode?: boolean;
|
||||
clipboardData?: DataTransfer;
|
||||
ctrlKey?: boolean;
|
||||
deltaMode?: number;
|
||||
deltaX?: number;
|
||||
deltaY?: number;
|
||||
deltaZ?: number;
|
||||
detail?: number;
|
||||
getModifierState?(key: string): boolean;
|
||||
key?: string;
|
||||
keyCode?: number;
|
||||
locale?: string;
|
||||
location?: number;
|
||||
metaKey?: boolean;
|
||||
pageX?: number;
|
||||
pageY?: number;
|
||||
relatedTarget?: EventTarget;
|
||||
repeat?: boolean;
|
||||
screenX?: number;
|
||||
screenY?: number;
|
||||
shiftKey?: boolean;
|
||||
targetTouches?: TouchList;
|
||||
touches?: TouchList;
|
||||
view?: AbstractView;
|
||||
which?: number;
|
||||
}
|
||||
|
||||
export interface EventSimulator {
|
||||
(element: Element, eventData?: SyntheticEventData): void;
|
||||
(descriptor: Descriptor<any>, eventData?: SyntheticEventData): void;
|
||||
}
|
||||
|
||||
export interface Simulate {
|
||||
blur: EventSimulator;
|
||||
change: EventSimulator;
|
||||
click: EventSimulator;
|
||||
cut: EventSimulator;
|
||||
doubleClick: EventSimulator;
|
||||
drag: EventSimulator;
|
||||
dragEnd: EventSimulator;
|
||||
dragEnter: EventSimulator;
|
||||
dragExit: EventSimulator;
|
||||
dragLeave: EventSimulator;
|
||||
dragOver: EventSimulator;
|
||||
dragStart: EventSimulator;
|
||||
drop: EventSimulator;
|
||||
focus: EventSimulator;
|
||||
input: EventSimulator;
|
||||
keyDown: EventSimulator;
|
||||
keyPress: EventSimulator;
|
||||
keyUp: EventSimulator;
|
||||
mouseDown: EventSimulator;
|
||||
mouseEnter: EventSimulator;
|
||||
mouseLeave: EventSimulator;
|
||||
mouseMove: EventSimulator;
|
||||
mouseOut: EventSimulator;
|
||||
mouseOver: EventSimulator;
|
||||
mouseUp: EventSimulator;
|
||||
paste: EventSimulator;
|
||||
scroll: EventSimulator;
|
||||
submit: EventSimulator;
|
||||
touchCancel: EventSimulator;
|
||||
touchEnd: EventSimulator;
|
||||
touchMove: EventSimulator;
|
||||
touchStart: EventSimulator;
|
||||
wheel: EventSimulator;
|
||||
}
|
||||
}
|
||||
@ -1,68 +0,0 @@
|
||||
/// <reference path="react-0.12.d.ts" />
|
||||
import React = require("react/addons");
|
||||
|
||||
var isImportant: boolean;
|
||||
var isRead: boolean;
|
||||
var classSet: React.ClassSet = {
|
||||
"message": true,
|
||||
"message-important": isImportant,
|
||||
"message-read": isRead
|
||||
};
|
||||
var cx = React.addons.classSet;
|
||||
var classes: string = cx(classSet);
|
||||
|
||||
//
|
||||
// React.addons (Transitions)
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
React.createFactory(React.addons.TransitionGroup)({ component: "div" });
|
||||
React.createFactory(React.addons.CSSTransitionGroup)({
|
||||
component: React.createClass({
|
||||
render: (): React.ReactElement<any> => null
|
||||
}),
|
||||
childFactory: (c) => c,
|
||||
transitionName: "transition",
|
||||
transitionAppear: false,
|
||||
transitionEnter: true,
|
||||
transitionLeave: true
|
||||
});
|
||||
|
||||
//
|
||||
// React.addons.TestUtils
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var that: React.CompositeComponent<any, any>;
|
||||
var node = that.refs["input"].getDOMNode();
|
||||
React.addons.TestUtils.Simulate.click(node);
|
||||
React.addons.TestUtils.Simulate.change(node);
|
||||
React.addons.TestUtils.Simulate.keyDown(node, {key: "Enter"});
|
||||
|
||||
interface GreetingProps {
|
||||
name: string;
|
||||
}
|
||||
interface GreetingState {
|
||||
morning: boolean;
|
||||
}
|
||||
interface Greeting extends React.CompositeComponent<GreetingProps, GreetingState> {
|
||||
}
|
||||
var Greeting = React.createClass({
|
||||
displayName: "Greeting",
|
||||
getInitialState: function() {
|
||||
return {morning: true};
|
||||
},
|
||||
render: function() {
|
||||
var me = <Greeting>this;
|
||||
return React.DOM.div(
|
||||
null,
|
||||
me.state.morning ? "Hello " : "Goodbye ",
|
||||
me.props.name);
|
||||
}
|
||||
});
|
||||
|
||||
var root = React.addons.TestUtils.renderIntoDocument(
|
||||
React.createElement(Greeting, {name: "John"}));
|
||||
var greeting = <Greeting>React.addons.TestUtils
|
||||
.findRenderedComponentWithType(root, Greeting);
|
||||
greeting.setState({
|
||||
morning: false
|
||||
});
|
||||
@ -203,7 +203,7 @@ myComponent.reset();
|
||||
// Attributes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var children = ["Hello world", [null], React.DOM.span(null)];
|
||||
var children: any[] = ["Hello world", [null], React.DOM.span(null)];
|
||||
var divStyle = { // CSSProperties
|
||||
flex: "1 1 main-size",
|
||||
backgroundImage: "url('hello.png')"
|
||||
|
||||
@ -201,7 +201,7 @@ myComponent.reset();
|
||||
// Attributes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var children = ["Hello world", [null], React.DOM.span(null)];
|
||||
var children: any[] = ["Hello world", [null], React.DOM.span(null)];
|
||||
var divStyle = { // CSSProperties
|
||||
flex: "1 1 main-size",
|
||||
backgroundImage: "url('hello.png')"
|
||||
|
||||
27
touch-events/touch-events.d.ts
vendored
27
touch-events/touch-events.d.ts
vendored
@ -3,29 +3,4 @@
|
||||
// Definitions by: Kevin Barabash <https://github.com/kevinb7>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface TouchEvent extends UIEvent {
|
||||
touches: TouchList;
|
||||
targetTouches: TouchList;
|
||||
changedTouches: TouchList;
|
||||
altKey: boolean;
|
||||
metaKey: boolean;
|
||||
ctrlKey: boolean;
|
||||
shiftKey: boolean;
|
||||
}
|
||||
|
||||
interface TouchList {
|
||||
length: number;
|
||||
item: (index: number) => Touch;
|
||||
[index: number]: Touch;
|
||||
}
|
||||
|
||||
interface Touch {
|
||||
identifier: number;
|
||||
target: EventTarget;
|
||||
screenX: number;
|
||||
screenY: number;
|
||||
clientX: number;
|
||||
clientY: number;
|
||||
pageX: number;
|
||||
pageY: number;
|
||||
}
|
||||
// DEPRECATED: use TypeScript 1.5.3
|
||||
|
||||
6
typescript-services/typescriptServices.d.ts
vendored
6
typescript-services/typescriptServices.d.ts
vendored
@ -592,12 +592,6 @@ declare module TypeScript.Collections {
|
||||
function createHashTable<TKey, TValue>(capacity?: number, hash?: (k: TKey) => number): HashTable<TKey, TValue>;
|
||||
function identityHashCode(value: any): number;
|
||||
}
|
||||
declare class Enumerator {
|
||||
public atEnd(): boolean;
|
||||
public moveNext(): boolean;
|
||||
public item(): any;
|
||||
constructor(o: any);
|
||||
}
|
||||
declare module TypeScript {
|
||||
var nodeMakeDirectoryTime: number;
|
||||
var nodeCreateBufferTime: number;
|
||||
|
||||
@ -534,7 +534,7 @@ describe('dest stream', function () {
|
||||
|
||||
|
||||
|
||||
// This test is from
|
||||
// This test is from
|
||||
|
||||
|
||||
var chmodSpy = spies.chmodSpy;
|
||||
@ -909,4 +909,4 @@ describe('symlink stream', function () {
|
||||
stream.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
250
webaudioapi/waa-20120802.d.ts
vendored
250
webaudioapi/waa-20120802.d.ts
vendored
@ -1,250 +0,0 @@
|
||||
// Type definitions for Web Audio API
|
||||
// Project: http://www.w3.org/TR/2012/WD-webaudio-20120802/
|
||||
// Definitions by: Baruch Berger <https://github.com/bbss>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// Conforms to the: http://www.w3.org/TR/2012/WD-webaudio-20120802/ specification
|
||||
// Currently only implemented in WebKit browsers
|
||||
|
||||
interface webkitAudioContext {
|
||||
destination: AudioDestinationNode;
|
||||
sampleRate: number;
|
||||
currentTime: number;
|
||||
listener: AudioListener;
|
||||
activeSourceCount: number;
|
||||
|
||||
createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;
|
||||
createBuffer(buffer: ArrayBuffer, mixToMono: boolean): AudioBuffer;
|
||||
|
||||
decodeAudioData(audioData: ArrayBuffer, successCallback: any, errorCallback?: any): void;
|
||||
|
||||
createBufferSource(): AudioBufferSourceNode;
|
||||
|
||||
createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;
|
||||
|
||||
createMediaStreamSource(mediaStream: any): MediaStreamAudioSourceNode;
|
||||
|
||||
createAnalyser(): RealtimeAnalyserNode;
|
||||
createGainNode(): AudioGainNode;
|
||||
createDelayNode(maxDelayTime?: number): DelayNode;
|
||||
createBiquadFilter(): BiquadFilterNode;
|
||||
createPanner():AudioPannerNode;
|
||||
createConvolver(): ConvolverNode;
|
||||
|
||||
createChannelSplitter(numberOfOutputs?: number):AudioChannelSplitter;
|
||||
createChannelMerger(numberOfInputs?: number): AudioChannelMerger;
|
||||
|
||||
createDynamicsCompressor(): DynamicsCompressorNode;
|
||||
|
||||
createOscillator(): Oscillator;
|
||||
createWaveTable(real: any,imag: any): WaveTable;
|
||||
}
|
||||
|
||||
declare var webkitAudioContext: {
|
||||
|
||||
new (): webkitAudioContext;
|
||||
|
||||
}
|
||||
|
||||
interface Oscillator extends AudioSourceNode {
|
||||
|
||||
type: number;
|
||||
playbackState: number;
|
||||
frequency: AudioParam;
|
||||
detune: AudioParam;
|
||||
noteOn(when: number): void;
|
||||
noteOff(when: number): void;
|
||||
setWaveTable(waveTable: WaveTable): void;
|
||||
|
||||
}
|
||||
|
||||
interface AudioDestinationNode extends AudioNode {
|
||||
|
||||
maxNumberOfChannels: number;
|
||||
numberOfChannels: number;
|
||||
|
||||
}
|
||||
|
||||
interface AudioNode {
|
||||
|
||||
connect(destination: AudioNode, output?: number, input?: number): void;
|
||||
connect(destination: AudioParam, output?: number): void;
|
||||
disconnect(output?: number): void;
|
||||
context: webkitAudioContext;
|
||||
numberOfInputs: number;
|
||||
numberOfOutputs: number;
|
||||
|
||||
}
|
||||
|
||||
interface AudioSourceNode extends AudioNode {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
interface AudioParam {
|
||||
|
||||
value: number;
|
||||
minValue: number;
|
||||
maxValue: number;
|
||||
defaultValue: number;
|
||||
setValueAtTime(value: number, time: number): void;
|
||||
linearRampToValueAtTime(value: number, time: number): void;
|
||||
exponentialRampToValueAtTime(value: number, time: number): void;
|
||||
setTargetValueAtTime(targetValue: number,time: number, timeConstant: number): void;
|
||||
setValueCurveAtTime(values: number[], time: number, duration: number): void;
|
||||
cancelScheduledValues(startTime: number): void;
|
||||
|
||||
}
|
||||
|
||||
interface AudioGain extends AudioParam {
|
||||
|
||||
}
|
||||
|
||||
interface AudioGainNode extends AudioNode {
|
||||
|
||||
gain: AudioGain;
|
||||
|
||||
}
|
||||
|
||||
interface DelayNode extends AudioNode {
|
||||
|
||||
delayTime: AudioParam;
|
||||
|
||||
}
|
||||
|
||||
interface AudioBuffer {
|
||||
|
||||
sampleRate: number;
|
||||
length: number;
|
||||
duration: number;
|
||||
numberOfChannels: number;
|
||||
getChannelData(channel: number): any;
|
||||
|
||||
}
|
||||
|
||||
interface AudioBufferSourceNode extends AudioSourceNode {
|
||||
|
||||
playbackState: number;
|
||||
buffer: AudioBuffer;
|
||||
playbackRate: AudioParam;
|
||||
loop: boolean;
|
||||
noteOn(when: number): void;
|
||||
noteGrainOn(when: number, grainOffset: number, grainDuration: number): void;
|
||||
noteOff(when: number): void;
|
||||
|
||||
}
|
||||
|
||||
interface MediaElementAudioSourceNode extends AudioSourceNode {
|
||||
|
||||
}
|
||||
|
||||
interface JavaScriptAudioNode extends AudioNode {
|
||||
|
||||
onaudioprocess: EventListener;
|
||||
bufferSize: number;
|
||||
|
||||
}
|
||||
|
||||
interface AudioProcessingEvent extends Event {
|
||||
|
||||
node: JavaScriptAudioNode;
|
||||
playbackTime: number;
|
||||
inputBuffer: AudioBuffer;
|
||||
outputBuffer: AudioBuffer;
|
||||
|
||||
}
|
||||
|
||||
interface AudioPannerNode extends AudioNode {
|
||||
|
||||
panningModel: number;
|
||||
setPosition(x: number, y: number, z: number): void;
|
||||
setOrientation(x: number, y: number, z: number): void;
|
||||
setVelocity(x: number, y: number, z: number): void;
|
||||
distanceModel: number;
|
||||
refDistance: number;
|
||||
maxDistance: number;
|
||||
rolloffFactor: number;
|
||||
coneInnerAngle: number;
|
||||
coneOuterAngle: number;
|
||||
coneOuterGain: number;
|
||||
distanceGain: AudioGain;
|
||||
coneGain: AudioGain;
|
||||
|
||||
}
|
||||
|
||||
interface AudioListener {
|
||||
|
||||
dopplerFactor: number;
|
||||
speedOfSound: number;
|
||||
setPosition(x: number, y: number, z: number): void;
|
||||
setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;
|
||||
setVelocity(x: number, y: number, z: number): void;
|
||||
|
||||
}
|
||||
|
||||
interface RealtimeAnalyserNode extends AudioNode {
|
||||
|
||||
getFloatFrequencyData(array: any): void;
|
||||
getByteFrequencyData(array: any): void;
|
||||
getByteTimeDomainData(array: any): void;
|
||||
fftSize: number;
|
||||
frequencyBinCount: number;
|
||||
minDecibels: number;
|
||||
maxDecibels: number;
|
||||
smoothingTimeConstant: number;
|
||||
|
||||
}
|
||||
|
||||
interface AudioChannelSplitter extends AudioNode {
|
||||
|
||||
}
|
||||
|
||||
interface AudioChannelMerger extends AudioNode {
|
||||
|
||||
}
|
||||
|
||||
interface DynamicsCompressorNode extends AudioNode {
|
||||
|
||||
threshold: AudioParam;
|
||||
knee: AudioParam;
|
||||
ratio: AudioParam;
|
||||
reduction: AudioParam;
|
||||
attack: AudioParam;
|
||||
release: AudioParam;
|
||||
|
||||
}
|
||||
|
||||
interface BiquadFilterNode extends AudioNode {
|
||||
|
||||
type: number;
|
||||
frequency: AudioParam;
|
||||
Q: AudioParam;
|
||||
gain: AudioParam;
|
||||
|
||||
getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void;
|
||||
|
||||
}
|
||||
|
||||
interface WaveShaperNode extends AudioNode {
|
||||
|
||||
curve: any;
|
||||
|
||||
}
|
||||
|
||||
interface MediaStreamAudioSourceNode extends AudioSourceNode {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
interface ConvolverNode extends AudioNode {
|
||||
|
||||
buffer: AudioBuffer;
|
||||
normalize: boolean;
|
||||
|
||||
}
|
||||
|
||||
interface WaveTable {
|
||||
|
||||
}
|
||||
253
webaudioapi/waa-nightly.d.ts
vendored
253
webaudioapi/waa-nightly.d.ts
vendored
@ -1,253 +0,0 @@
|
||||
// Type definitions for Web Audio API (nightly)
|
||||
// Project: http://www.w3.org/TR/2012/WD-webaudio-20120802/
|
||||
// Definitions by: Baruch Berger <https://github.com/bbss>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// Conforms to the: http://www.w3.org/TR/2012/WD-webaudio-20120802/ specification
|
||||
// Currently only implemented in WebKit browsers (nightly builds)
|
||||
|
||||
interface webkitAudioContext {
|
||||
|
||||
destination: AudioDestinationNode;
|
||||
sampleRate: number;
|
||||
currentTime: number;
|
||||
listener: AudioListener;
|
||||
activeSourceCount: number;
|
||||
|
||||
createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;
|
||||
|
||||
createBuffer(buffer: ArrayBuffer, mixToMono: boolean): AudioBuffer;
|
||||
|
||||
decodeAudioData(audioData: ArrayBuffer, successCallback: any, errorCallback?: any): void;
|
||||
createBufferSource(): AudioBufferSourceNode;
|
||||
|
||||
createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;
|
||||
createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode;
|
||||
createScriptProcessor(bufferSize: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;
|
||||
createAnalyser(): AnalyserNode;
|
||||
createGain(): GainNode;
|
||||
createDelay(maxDelayTime?: number): DelayNode;
|
||||
createBiquadFilter(): BiquadFilterNode;
|
||||
createWaveShaper(): WaveShaperNode;
|
||||
createPanner(): PannerNode;
|
||||
createConvolver(): ConvolverNode;
|
||||
createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode;
|
||||
createChannelMerger(numberOfInputs?: number): ChannelMergerNode;
|
||||
createDynamicsCompressor(): DynamicsCompressorNode;
|
||||
createOscillator(): OscillatorNode;
|
||||
createWaveTable(real: any, imag: any): WaveTable;
|
||||
|
||||
}
|
||||
|
||||
|
||||
declare var webkitAudioContext: {
|
||||
|
||||
new (value?: any): webkitAudioContext;
|
||||
|
||||
}
|
||||
|
||||
|
||||
interface AudioNode {
|
||||
|
||||
connect(destination: AudioNode, output?: number, input?: number): void;
|
||||
connect(destination: AudioParam, output?: number): void;
|
||||
disconnect(output?: number): void;
|
||||
context: webkitAudioContext;
|
||||
numberOfInputs: number;
|
||||
numberOfOutputs: number;
|
||||
|
||||
}
|
||||
|
||||
|
||||
interface AudioSourceNode extends AudioNode {
|
||||
|
||||
}
|
||||
|
||||
interface AudioDestinationNode extends AudioNode {
|
||||
|
||||
maxNumberOfChannels: number;
|
||||
numberOfChannels: number;
|
||||
|
||||
}
|
||||
|
||||
interface AudioParam {
|
||||
|
||||
value: number;
|
||||
computedValue: number;
|
||||
minValue: number;
|
||||
maxValue: number;
|
||||
defaultValue: number;
|
||||
setValueAtTime(value: number, startTime: number): void;
|
||||
linearRampToValueAtTime(value: number, endTime: number): void;
|
||||
exponentialRampToValueAtTime(value: number, endTime: number): void;
|
||||
setTargetAtTime(target: number, startTime: number, timeConstant: number): void;
|
||||
setValueCurveAtTime(values: any, startTime: number, duration: number): void;
|
||||
cancelScheduledValues(startTime: number): void;
|
||||
|
||||
}
|
||||
|
||||
interface GainNode extends AudioNode {
|
||||
|
||||
gain: AudioParam;
|
||||
|
||||
}
|
||||
|
||||
interface DelayNode extends AudioNode {
|
||||
|
||||
delayTime: AudioParam;
|
||||
|
||||
}
|
||||
|
||||
interface AudioBuffer {
|
||||
|
||||
sampleRate: number;
|
||||
length: number;
|
||||
duration: number;
|
||||
numberOfChannels: number;
|
||||
getChannelData(channel): any;
|
||||
|
||||
}
|
||||
|
||||
interface AudioBufferSourceNode extends AudioSourceNode {
|
||||
//actually enum
|
||||
playbackState: number;
|
||||
|
||||
buffer: AudioBuffer;
|
||||
playbackRate: AudioParam;
|
||||
loop: boolean;
|
||||
loopStart: number;
|
||||
loopEnd: number;
|
||||
start(when: number, offset?: number, duration?: number): void;
|
||||
stop(when: number): void;
|
||||
|
||||
}
|
||||
|
||||
interface MediaElementAudioSourceNode extends AudioSourceNode {
|
||||
|
||||
}
|
||||
|
||||
interface ScriptProcessorNode extends AudioNode {
|
||||
|
||||
onaudioproces: EventListener;
|
||||
bufferSize: number;
|
||||
|
||||
}
|
||||
|
||||
interface AudioProcessingEvent extends Event {
|
||||
|
||||
node: ScriptProcessorNode;
|
||||
playbackTime: number;
|
||||
inputBuffer: AudioBuffer;
|
||||
outputBuffer: AudioBuffer;
|
||||
|
||||
}
|
||||
|
||||
interface PannerNode extends AudioNode {
|
||||
//actually enum
|
||||
panningModel: number;
|
||||
distanceModel: number;
|
||||
|
||||
setPosition(x: number, y: number, z: number): void;
|
||||
setOrientation(x: number, y: number, z: number): void;
|
||||
setVelocity(x: number, y: number, z: number): void;
|
||||
refDistance: number;
|
||||
maxDistance: number;
|
||||
rolloffFactor: number;
|
||||
coneInnerAngle: number;
|
||||
coneOuterAngle: number;
|
||||
coneOuterGain: number;
|
||||
|
||||
}
|
||||
|
||||
interface AudioListener {
|
||||
|
||||
dopplerFactor: number;
|
||||
speedOfSound: number;
|
||||
setPosition(x: number, y: number, z: number): void;
|
||||
setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;
|
||||
setVelocity(x: number, y: number, z: number): void;
|
||||
|
||||
}
|
||||
|
||||
interface ConvolverNode extends AudioNode {
|
||||
|
||||
buffer: AudioBuffer;
|
||||
normalize: boolean;
|
||||
|
||||
}
|
||||
|
||||
interface AnalyserNode extends AudioNode {
|
||||
|
||||
getFloatFrequencyData(array: any): void;
|
||||
getByteFrequencyData(array: any): void;
|
||||
getByteTimeDomainData(array: any): void;
|
||||
fftSize: number;
|
||||
frequencyBinCount: number;
|
||||
minDecibels: number;
|
||||
maxDecibels: number;
|
||||
smoothingTimeConstant: number;
|
||||
|
||||
}
|
||||
|
||||
interface ChannelSplitterNode extends AudioNode {
|
||||
|
||||
}
|
||||
|
||||
interface ChannelMergerNode extends AudioNode {
|
||||
|
||||
}
|
||||
|
||||
interface DynamicsCompressorNode extends AudioNode {
|
||||
|
||||
threshold: AudioParam;
|
||||
knee: AudioParam;
|
||||
ratio: AudioParam;
|
||||
reduction: AudioParam;
|
||||
attack: AudioParam;
|
||||
release: AudioParam;
|
||||
|
||||
}
|
||||
|
||||
interface BiquadFilterNode extends AudioNode {
|
||||
|
||||
//actually enum
|
||||
type: number;
|
||||
|
||||
frequency: AudioParam;
|
||||
Q: AudioParam;
|
||||
gain: AudioParam;
|
||||
getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void;
|
||||
|
||||
}
|
||||
|
||||
interface WaveShaperNode extends AudioNode {
|
||||
|
||||
curve: any;
|
||||
|
||||
}
|
||||
|
||||
interface OscillatorNode extends AudioSourceNode {
|
||||
|
||||
//actually enums
|
||||
type: number;
|
||||
playbackState: number;
|
||||
|
||||
frequency: AudioParam;
|
||||
detune: AudioParam;
|
||||
start(when: number): void;
|
||||
stop(when: number): void;
|
||||
setWaveTable(waveTable: WaveTable): void;
|
||||
|
||||
}
|
||||
|
||||
interface WaveTable {
|
||||
|
||||
}
|
||||
|
||||
interface MediaStreamAudioSourceNode extends AudioSourceNode {
|
||||
|
||||
}
|
||||
|
||||
interface MediaStream {
|
||||
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
|
||||
1038
webaudioapi/waa.d.ts
vendored
1038
webaudioapi/waa.d.ts
vendored
File diff suppressed because it is too large
Load Diff
9
webcrypto/WebCrypto.d.ts
vendored
9
webcrypto/WebCrypto.d.ts
vendored
@ -3,11 +3,4 @@
|
||||
// Definitions by: Lucas Dixon <https://github.com/iislucas/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module crypto {
|
||||
|
||||
// A cryptographically strong pseudo-random number generator seeded with
|
||||
// truly random values. The buffer passed in is modified, and a reference to
|
||||
// argument is returned for convenience.
|
||||
function getRandomValues(array: ArrayBufferView) : ArrayBufferView
|
||||
|
||||
}
|
||||
// DEPRECATED: use TypeScript 1.5.3
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
# WebCrypto Definition Notes
|
||||
|
||||
## The WebCrypto specification
|
||||
|
||||
The WebCrypto specification is for performing basic cryptographic operations in
|
||||
web applications, such as hashing, signature generation and verification, and
|
||||
encryption and decryption. The API is also for applications to generate and/or
|
||||
manage the keying material necessary to perform these operations. Uses for this
|
||||
API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.
|
||||
|
||||
The latest version of the specification can be found at: http://www.w3.org/TR/WebCryptoAPI/
|
||||
|
||||
## Adding the reference to your project
|
||||
|
||||
```
|
||||
/// <reference path="WebCrypto.d.ts" />
|
||||
```
|
||||
Loading…
Reference in New Issue
Block a user