From c6609aff88f2c59e4df9adb93df5c7932adfd7b4 Mon Sep 17 00:00:00 2001 From: Nora Simonow Date: Mon, 2 Nov 2015 16:27:56 +0100 Subject: [PATCH 001/113] Fix typo in angular-resource.d.ts --- angularjs/angular-resource.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 5c8637059..76930196b 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -50,7 +50,7 @@ declare module angular.resource { params?: any; url?: string; isArray?: boolean; - transformRequest?: angular.IHttpResquestTransformer | angular.IHttpResquestTransformer[]; + transformRequest?: angular.IHttpRequestTransformer | angular.IHttpRequestTransformer[]; transformResponse?: angular.IHttpResponseTransformer | angular.IHttpResponseTransformer[]; headers?: any; cache?: boolean | angular.ICacheObject; From f4b4073a444a5f90c36dddcc99efdd7e23efddca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20R=C3=B8nn-Jensen?= Date: Thu, 19 Nov 2015 00:51:06 +0100 Subject: [PATCH 002/113] Add typings to mathjs MathNode class Furthermore removed all trailing whitespace --- mathjs/mathjs-tests.ts | 222 ++++++---- mathjs/mathjs.d.ts | 939 ++++++++++++++++++++++------------------- 2 files changed, 644 insertions(+), 517 deletions(-) diff --git a/mathjs/mathjs-tests.ts b/mathjs/mathjs-tests.ts index 78c9ed941..1691e03c2 100644 --- a/mathjs/mathjs-tests.ts +++ b/mathjs/mathjs-tests.ts @@ -11,20 +11,20 @@ Basic usage examples math.log(10000, 10); // 4 math.sqrt(-4); // 2i math.pow([[-1, 2], [3, 1]], 2); // [[7, 0], [0, 7]] - + // expressions math.eval('1.2 * (2 + 4.5)'); // 7.8 math.eval('5.08 cm to inch'); // 2 inch math.eval('sin(45 deg) ^ 2'); // 0.5 math.eval('9 / 3 + 2i'); // 3 + 2i math.eval('det([-1, 2; 3, 1])'); // -7 - + // chained operations var a = math.chain(3) .add(4) .multiply(2) .done(); // 14 - + // mixed use of different data types in functions console.log('mixed use of data types'); math.add(4, [5, 6]); // number + Array, [9, 10] @@ -44,22 +44,22 @@ Bignumbers examples // 'number' (default), 'bignumber', or 'fraction' precision: 20 // Number of significant digits for BigNumbers }); - + console.log('round-off errors with numbers'); math.add(0.1, 0.2); // number, 0.30000000000000004 math.divide(0.3, 0.2); // number, 1.4999999999999998 console.log(); - + console.log('no round-off errors with BigNumbers'); math.add(math.bignumber(0.1), math.bignumber(0.2)); // BigNumber, 0.3 math.divide(math.bignumber(0.3), math.bignumber(0.2)); // BigNumber, 1.5 console.log(); - + console.log('create BigNumbers from strings when exceeding the range of a number'); math.bignumber(1.2e+500); // BigNumber, Infinity WRONG math.bignumber('1.2e+500'); // BigNumber, 1.2e+500 console.log(); - + // one can work conveniently with BigNumbers using the expression parser. // note though that BigNumbers are only supported in arithmetic functions console.log('use BigNumbers in the expression parser'); @@ -80,33 +80,33 @@ Chaining examples .add(4) .multiply(2) .done(); // 14 - + // Another example, calculate square(sin(pi / 4)) var b = math.chain(math.pi) .divide(4) .sin() .square() .done(); // 0.5 - + // A chain has a few special methods: done, toString, valueOf, get, and set. // these are demonstrated in the following examples - + // toString will return a string representation of the chain's value var chain = math.chain(2).divide(3); var str = chain.toString(); // "0.6666666666666666" - + // a chain has a function .valueOf(), which returns the value hold by the chain. // This allows using it in regular operations. The function valueOf() acts the // same as function done(). chain.valueOf(); // 0.66666666666667 - - + + // the function subset can be used to get or replace sub matrices var array = [[1, 2], [3, 4]]; var v = math.chain(array) .subset(math.index(1, 0)) .done(); // 3 - + var m = math.chain(array) .subset(math.index(0, 0), 8) .multiply(3) @@ -119,38 +119,38 @@ Complex numbers examples */ (function(){ var a = math.complex(2, 3); // 2 + 3i - + // read the real and complex parts of the complex number a.re; // 2 a.im; // 3 - + // clone a complex value var clone = a.clone(); // 2 + 3i - + // adjust the complex value a.re = 5; // 5 + 3i - + // create a complex number by providing a string with real and complex parts var b = math.complex('3 - 7i'); // 3 - 7i console.log(); - + // perform operations with complex numbers console.log('perform operations'); math.add(a, b); // 8 - 4i math.multiply(a, b); // 36 - 26i math.sin(a); // -9.6541254768548 + 2.8416922956064i - + // some operations will return a complex number depending on the arguments math.sqrt(4); // 2 math.sqrt(-4); // 2i - + // create a complex number from polar coordinates console.log('create complex numbers with polar coordinates'); var c = math.complex({r: math.sqrt(2), phi: math.pi / 4}); // 1 + i - + // get polar coordinates of a complex number var d = math.complex(3, 4); - d.toPolar(); // { r: 5, phi: 0.9272952180016122 } + d.toPolar(); // { r: 5, phi: 0.9272952180016122 } }()); @@ -166,14 +166,14 @@ Expressions examples // JavaScript Object. The scope will be used to resolve symbols, and to write // assigned variables or function. console.log('1. USING FUNCTION MATH.EVAL'); - + // evaluate expressions console.log('\nevaluate expressions'); math.eval('sqrt(3^2 + 4^2)'); // 5 math.eval('sqrt(-4)'); // 2i math.eval('2 inch to cm'); // 5.08 cm math.eval('cos(45 deg)'); // 0.70711 - + // evaluate multiple expressions at once console.log('\nevaluate multiple expressions at once'); math.eval([ @@ -181,34 +181,34 @@ Expressions examples 'g = 4', 'f * g' ]); // [3, 4, 12] - + // provide a scope (just a regular JavaScript Object) console.log('\nevaluate expressions providing a scope with variables and functions'); var scope: any = { a: 3, b: 4 }; - + // variables can be read from the scope math.eval('a * b', scope); // 12 - + // variable assignments are written to the scope math.eval('c = 2.3 + 4.5', scope); // 6.8 scope.c; // 6.8 - + // scope can contain both variables and functions scope["hello"] = function (name: string) { return 'hello, ' + name + '!'; }; math.eval('hello("hero")', scope); // "hello, hero!" - + // define a function as an expression var f = math.eval('f(x) = x ^ a', scope); f(2); // 8 scope.f(2); // 8 - - - + + + // 2. using function math.parse // // Function `math.parse` parses expressions into a node tree. The syntax is @@ -219,16 +219,16 @@ Expressions examples // scope. This scope is a regular JavaScript Object. The scope will be used // to resolve symbols, and to write assigned variables or function. console.log('\n2. USING FUNCTION MATH.PARSE'); - + // parse an expression console.log('\nparse an expression into a node tree'); var node1 = math.parse('sqrt(3^2 + 4^2)'); node1.toString(); // "sqrt((3 ^ 2) + (4 ^ 2))" - + // compile and evaluate the compiled code // you could also do this in two steps: node1.compile().eval() node1.eval(); // 5 - + // provide a scope console.log('\nprovide a scope'); var node2 = math.parse('x^a'); @@ -239,12 +239,12 @@ Expressions examples a: 2 }; code2.eval(scope); // 9 - + // change a value in the scope and re-evaluate the node scope.a = 3; code2.eval(scope); // 27 - - + + // 3. using function math.compile // // Function `math.compile` compiles expressions into a node tree. The syntax is @@ -255,14 +255,14 @@ Expressions examples // be provided. This scope will be used to resolve symbols, and to write // assigned variables or function. console.log('\n3. USING FUNCTION MATH.COMPILE'); - + // parse an expression console.log('\ncompile an expression'); var code3 = math.compile('sqrt(3^2 + 4^2)'); - + // evaluate the compiled code code3.eval(); // 5 - + // provide a scope for the variable assignment console.log('\nprovide a scope'); var code2 = math.compile('a = a + 3'); @@ -271,8 +271,8 @@ Expressions examples }; code2.eval(scope); scope.a; // 10 - - + + // 4. using a parser // // In addition to the static functions `math.eval` and `math.parse`, math.js @@ -281,21 +281,21 @@ Expressions examples // some convenience methods to get, set, and remove variables from memory. console.log('\n4. USING A PARSER'); var parser = math.parser(); - + // evaluate with parser console.log('\nevaluate expressions'); parser.eval('sqrt(3^2 + 4^2)'); // 5 parser.eval('sqrt(-4)'); // 2i parser.eval('2 inch to cm'); // 5.08 cm parser.eval('cos(45 deg)'); // 0.70711 - + // define variables and functions console.log('\ndefine variables and functions'); parser.eval('x = 7 / 2'); // 3.5 parser.eval('x + 3'); // 6.5 parser.eval('f(x, y) = x^y'); // f(x, y) parser.eval('f(2, 3)'); // 8 - + // manipulate matrices // Note that matrix indexes in the expression parser are one-based with the // upper-bound included. On a JavaScript level however, math.js uses zero-based @@ -308,7 +308,7 @@ Expressions examples parser.eval('m = k * l'); // [[19, 22], [43, 50]] parser.eval('n = m[2, 1]'); // 43 parser.eval('n = m[:, 1]'); // [[19], [43]] - + // get and set variables and functions console.log('\nget and set variables and function in the scope of the parser'); var x = parser.get('x'); @@ -317,14 +317,14 @@ Expressions examples console.log('f =', math.format(f)); // f = f(x, y) var g = f(3, 3); console.log('g =', g); // g = 27 - + parser.set('h', 500); parser.eval('h / 2'); // 250 parser.set('hello', function (name: string) { return 'hello, ' + name + '!'; }); parser.eval('hello("hero")'); // "hello, hero!" - + // clear defined functions and variables parser.clear(); }()); @@ -339,7 +339,7 @@ Fractions examples number: 'fraction' // Default type of number: // 'number' (default), 'bignumber', or 'fraction' }); - + console.log('basic usage'); math.fraction(0.125); // Fraction, 1/8 math.fraction(0.32); // Fraction, 8/25 @@ -348,23 +348,23 @@ Fractions examples math.fraction(2, 3); // Fraction, 2/3 math.fraction('0.(285714)'); // Fraction, 2/7 console.log(); - + console.log('round-off errors with numbers'); math.add(0.1, 0.2); // number, 0.30000000000000004 math.divide(0.3, 0.2); // number, 1.4999999999999998 console.log(); - + console.log('no round-off errors with fractions :)'); math.add(math.fraction(0.1), math.fraction(0.2)); // Fraction, 3/10 math.divide(math.fraction(0.3), math.fraction(0.2)); // Fraction, 3/2 console.log(); - + console.log('represent an infinite number of repeating digits'); math.fraction('1/3'); // Fraction, 0.(3) math.fraction('2/7'); // Fraction, 0.(285714) math.fraction('23/11'); // Fraction, 2.(09) console.log(); - + // one can work conveniently with fractions using the expression parser. // note though that Fractions are only supported by basic arithmetic functions console.log('use fractions in the expression parser'); @@ -372,7 +372,7 @@ Fractions examples math.eval('0.3 / 0.2'); // Fraction, 3/2 math.eval('23 / 11'); // Fraction, 23/11 console.log(); - + // output formatting console.log('output formatting of fractions'); var a = math.fraction('2/3'); @@ -380,7 +380,7 @@ Fractions examples console.log(math.format(a, {fraction: 'ratio'})); // Fraction, 2/3 console.log(math.format(a, {fraction: 'decimal'})); // Fraction, 0.(6) console.log(a.toString()); // Fraction, 0.(6) - console.log(); + console.log(); }()); /* @@ -393,33 +393,33 @@ Matrices examples var a = math.matrix([1, 4, 9, 16, 25]); // [1, 4, 9, 16, 25] var b = math.matrix(math.ones([2, 3])); // [[1, 1, 1], [1, 1, 1]] b.size(); // [2, 3] - + // the Array data of a Matrix can be retrieved using valueOf() var array = a.valueOf(); // [1, 4, 9, 16, 25] - + // Matrices can be cloned var clone = a.clone(); // [1, 4, 9, 16, 25] console.log(); - + // perform operations with matrices console.log('perform operations'); math.sqrt(a); // [1, 2, 3, 4, 5] var c = [1, 2, 3, 4, 5]; math.factorial(c); // [1, 2, 6, 24, 120] console.log(); - + // create and manipulate matrices. Arrays and Matrices can be used mixed. console.log('manipulate matrices'); var d = [[1, 2], [3, 4]]; // [[1, 2], [3, 4]] var e = math.matrix([[5, 6], [1, 1]]); // [[5, 6], [1, 1]] - + // set a submatrix. // Matrix indexes are zero-based. e.subset(math.index(1, [0, 1]), [[7, 8]]); // [[5, 6], [7, 8]] var f = math.multiply(d, e); // [[19, 22], [43, 50]] var g = f.subset(math.index(1, 0)); // 43 console.log(); - + // get a sub matrix // Matrix indexes are zero-based. console.log('get a sub matrix'); @@ -428,8 +428,8 @@ Matrices examples var i = math.range(1,6); // [1, 2, 3, 4, 5] i.subset(math.index(math.range(1,4))); // [2, 3, 4] console.log(); - - + + // resize a multi dimensional matrix console.log('resizing a matrix'); var j = math.matrix(); @@ -439,20 +439,20 @@ Matrices examples j.resize([2, 2]); // [[0, 0], [0, 0]] j.size(); // [2, 2] console.log(); - + // setting a value outside the matrices range will resize the matrix. // new elements will be initialized with zero. console.log('set a value outside a matrices range'); var k = math.matrix(); k.subset(math.index(2), 6); // [0, 0, 6] console.log(); - + console.log('set a value outside a matrices range, leaving new entries uninitialized'); var m = math.matrix(); defaultValue = math.uninitialized; m.subset(math.index(2), 6, defaultValue); // [undefined, undefined, 6] console.log(); - + // create ranges console.log('create ranges'); math.range(1, 6); // [1, 2, 3, 4, 5] @@ -469,14 +469,14 @@ Sparse matrices examples // create a sparse matrix console.log('creating a 1000x1000 sparse matrix...'); var a = math.eye(1000, 1000, 'sparse'); - + // do operations with a sparse matrix console.log('doing some operations on the sparse matrix...'); var b = math.multiply(a, a); var c = math.multiply(b, math.complex(2, 2)); var d = math.transpose(c); var e = math.multiply(d, a); - + // we will not print the output, but doing the same operations // with a dense matrix are very slow, try it for yourself. console.log('already done'); @@ -493,7 +493,7 @@ Units examples var a = math.unit(45, 'cm'); // 450 mm var b = math.unit('0.1m'); // 100 mm console.log(); - + // units can be added, subtracted, and multiplied or divided by numbers and by other units console.log('perform operations'); math.add(a, b); // 0.55 m @@ -501,7 +501,7 @@ Units examples math.divide(math.unit('1 m'), math.unit('1 s')); // 1 m / s math.pow(math.unit('12 in'), 3); // 1728 in^3 console.log(); - + // units can be converted to a specific type, or to a number console.log('convert to another type or to a number'); b.to('cm'); // 10 cm Alternatively: math.to(b, 'cm') @@ -509,25 +509,25 @@ Units examples b.toNumber('cm'); // 10 math.number(b, 'cm'); // 10 console.log(); - + // the expression parser supports units too console.log('parse expressions'); math.eval('2 inch to cm'); // 5.08 cm math.eval('cos(45 deg)'); // 0.70711... math.eval('90 km/h to m/s'); // 25 m / s console.log(); - + // convert a unit to a number // A second parameter with the unit for the exported number must be provided math.eval('number(5 cm, mm)'); // number, 50 console.log(); - + // simplify units console.log('simplify units'); math.eval('100000 N / m^2'); // 100 kPa math.eval('9.81 m/s^2 * 100 kg * 40 m'); // 39.24 kJ console.log(); - + // example engineering calculations console.log('compute molar volume of ideal gas at 65 Fahrenheit, 14.7 psi in L/mol'); var Rg = math.unit('8.314 N m / (mol K)'); @@ -539,7 +539,7 @@ Units examples console.log('T = ' + format(T)); console.log('v = Rg * T / P = ' + format(math.to(v, 'L/mol'))); // 23.910... L / mol console.log(); - + console.log('compute speed of fluid flowing out of hole in a container'); var g = math.unit('9.81 m / s^2'); var h = math.unit('1 m'); @@ -548,17 +548,17 @@ Units examples console.log('h = ' + format(h)); console.log('v = (2 g h) ^ 0.5 = ' + format(v2)); // 4.429... m / s console.log(); - + console.log('electrical power consumption:'); var expr = '460 V * 20 A * 30 days to kWh'; console.log(expr + ' = ' + math.eval(expr)); // 6624 kWh console.log(); - + console.log('circuit design:'); var expr = '24 V / (6 mA)'; console.log(expr + ' = ' + math.eval(expr)); // 4 kohm console.log(); - + console.log('operations on arrays:'); var B = math.eval('[1, 0, 0] T'); var v3 = math.eval('[0, 1, 0] m/s'); @@ -568,7 +568,7 @@ Units examples console.log('v (particle velocity) = ' + format(v3)); // [0 m / s, 1 m / s, 0 m / s] console.log('q (particle charge) = ' + format(q)); // 1 C console.log('F (force) = q (v cross B) = ' + format(F)); // [0 N, 0 N, -1 N] - + /** * Helper function to format an output a value. * @param {*} value @@ -578,4 +578,62 @@ Units examples var precision = 14; return math.format(value, precision); } -}()); \ No newline at end of file +}()); + + +/* +Expression tree examples +*/ +(function(){ + + // Filter an expression tree +console.log('Filter all symbol nodes "x" in the expression "x^2 + x/4 + 3*y"'); +var node = math.parse('x^2 + x/4 + 3*y'); +var filtered = node.filter(function (node) { + return node.isSymbolNode && node.name == 'x'; +}); +// returns an array with two entries: two SymbolNodes 'x' + +filtered.forEach(function (node) { + console.log(node.type, node.toString()) +}); +// outputs: +// SymbolNode x +// SymbolNode x + + +// Traverse an expression tree +console.log(); +console.log('Traverse the expression tree of expression "3 * x + 2"'); +var node1 = math.parse('3 * x + 2'); +node1.traverse(function (node, path, parent) { + switch (node.type) { + case 'OperatorNode': console.log(node.type, node.op); break; + case 'ConstantNode': console.log(node.type, node.value); break; + case 'SymbolNode': console.log(node.type, node.name); break; + default: console.log(node.type); + } +}); +// outputs: +// OperatorNode + +// OperatorNode * +// ConstantNode 3 +// SymbolNode x +// ConstantNode 2 + + +// transform an expression tree +console.log(); +console.log('Replace all symbol nodes "x" in expression "x^2 + 5*x" with a constant 3'); +var node2 = math.parse('x^2 + 5*x'); +var transformed = node2.transform(function (node, path, parent) { + if (node.isSymbolNode && node.name == 'x') { + return new math.expression.node.ConstantNode(3); + } + else { + return node; + } +}); +console.log(transformed.toString()); +// outputs: '(3 ^ 2) + (5 * 3)' +}()); diff --git a/mathjs/mathjs.d.ts b/mathjs/mathjs.d.ts index e6fa6a877..01742bf67 100644 --- a/mathjs/mathjs.d.ts +++ b/mathjs/mathjs.d.ts @@ -6,19 +6,19 @@ declare var math: mathjs.IMathJsStatic; declare module mathjs { - + type MathArray = number[]|number[][]; type MathType = number|BigNumber|Fraction|Complex|Unit|MathArray|Matrix; type MathExpression = string|string[]|MathArray|Matrix; - + export interface IMathJsStatic { - + e: number; pi: number; uninitialized: any; - + config(options: any): void; - + /** * Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix. * @param L A N x N matrix or array (L) @@ -26,15 +26,15 @@ declare module mathjs { * @returns A column vector with the linear system solution (x) */ lsolve(L: Matrix|MathArray, b: Matrix|MathArray): Matrix|MathArray; - + /** - * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) + * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) * and a row permutation vector p where A[p,:] = L * U * @param A A two dimensional matrix or array for which to get the LUP decomposition. * @returns The lower triangular matrix, the upper triangular matrix and the permutation matrix. */ lup(A?: Matrix|MathArray): MathArray; - + /** * Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector. * @param A Invertible Matrix or the Matrix LU decomposition @@ -42,22 +42,22 @@ declare module mathjs { * @returns Column vector with the solution to the linear system A * x = b */ lusolve(A: Matrix|MathArray|Number, b: Matrix|MathArray): Matrix|MathArray; - + /** - * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in + * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in * two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U * @param A A two dimensional sparse matrix for which to get the LU decomposition. - * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is - * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic - * ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. - * This is appropriatefor LU factorization of unsymmetric matrices. 3 - Symbolic ordering and analisis is performed - * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with + * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is + * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic + * ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. + * This is appropriatefor LU factorization of unsymmetric matrices. 3 - Symbolic ordering and analisis is performed + * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with * more than 10*sqr(columns) entries. * @param threshold Partial pivoting threshold (1 for partial pivoting) * @returns The lower triangular matrix, the upper triangular matrix and the permutation vectors. */ slu(A: Matrix, order: Number, threshold: Number): any; - + /** * Solves the linear equation system by backward substitution. Matrix must be an upper triangular matrix. U * x = b * @param U A N x N matrix or array (U) @@ -65,7 +65,7 @@ declare module mathjs { * @returns A column vector with the linear system solution (x) */ usolve(U: Matrix|MathArray, b:Matrix|MathArray): Matrix|MathArray; - + /** * Calculate the absolute value of a number. For matrices, the function is evaluated element wise. * @param x A number or matrix for which to get the absolute value @@ -78,7 +78,7 @@ declare module mathjs { abs(x: MathArray): MathArray; abs(x: Matrix): Matrix; abs(x: Unit): Unit; - + /** * Add two values, x + y. For matrices, the function is evaluated element wise. * @param x First value to add @@ -86,7 +86,7 @@ declare module mathjs { * @returns Sum of x and y */ add(x: MathType, y: MathType): MathType; - + /** * Calculate the cubic root of a value. For matrices, the function is evaluated element wise. * @param x Value for which to calculate the cubic root. @@ -100,7 +100,7 @@ declare module mathjs { cbrt(x: MathArray, allRoots?: boolean): MathArray; cbrt(x: Matrix, allRoots?: boolean): Matrix; cbrt(x: Unit, allRoots?: boolean): Unit; - + /** * Round a value towards plus infinity If x is complex, both real and imaginary part are rounded towards plus infinity. For matrices, the function is evaluated element wise. * @param x Number to be rounded @@ -113,8 +113,8 @@ declare module mathjs { ceil(x: MathArray): MathArray; ceil(x: Matrix): Matrix; ceil(x: Unit): Unit; - - /** + + /** * Compute the cube of a value, x * x * x. For matrices, the function is evaluated element wise. * @param x Number for which to calculate the cube * @returns Cube of x @@ -126,7 +126,7 @@ declare module mathjs { cube(x: MathArray): MathArray; cube(x: Matrix): Matrix; cube(x: Unit): Unit; - + /** * Divide two values, x / y. To divide matrices, x is multiplied with the inverse of y: x * inv(y). * @param x Numerator @@ -136,7 +136,7 @@ declare module mathjs { divide(x: Unit, y: Unit): Unit; divide(x: number, y: number): number; divide(x:MathType, y:MathType): MathType; - + /** * Divide two matrices element wise. The function accepts both matrices and scalar values. * @param x Numerator @@ -144,7 +144,7 @@ declare module mathjs { * @returns Quotient, x ./ y */ dotDivide(x: MathType, y: MathType): MathType; - + /** * Multiply two matrices element wise. The function accepts both matrices and scalar values. * @param x Left hand value @@ -152,15 +152,15 @@ declare module mathjs { * @returns Multiplication of x and y */ dotMultiply(x: MathType, y: MathType): MathType; - - /** + + /** * Calculates the power of x to y element wise. * @param x The base * @param y The exponent * @returns The value of x to the power y */ dotPow(x: MathType, y: MathType): MathType; - + /** * Calculate the exponent of a value. For matrices, the function is evaluated element wise. * @param x A number or matrix to exponentiate @@ -172,7 +172,7 @@ declare module mathjs { exp(x: MathArray ): MathArray ; exp(x: Matrix): Matrix; - /** + /** * Round a value towards zero. For matrices, the function is evaluated element wise. * @param x Number to be rounded * @returns Rounded value @@ -183,7 +183,7 @@ declare module mathjs { fix(x: Complex ): Complex ; fix(x: MathArray ): MathArray ; fix(x: Matrix): Matrix; - + /** * Round a value towards minus infinity. For matrices, the function is evaluated element wise. * @param Number to be rounded @@ -195,7 +195,7 @@ declare module mathjs { floor(x: Complex ): Complex ; floor(x: MathArray ): MathArray ; floor(x: Matrix): Matrix; - + /** * Calculate the greatest common divisor for two or more values or arrays. For matrices, the function is evaluated element wise. */ @@ -204,7 +204,7 @@ declare module mathjs { gcd(...args: Fraction[]): Fraction ; gcd(...args: MathArray[]): MathArray ; gcd(...args: Matrix[]): Matrix; - + /** * Calculate the hypotenusa of a list with values. The hypotenusa is defined as: * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) @@ -212,7 +212,7 @@ declare module mathjs { */ hypot(...args: number[]): number; hypot(...args: BigNumber[]): BigNumber; - + /** * Calculate the least common multiple for two or more values or arrays. lcm is defined as: * lcm(a, b) = abs(a * b) / gcd(a, b) @@ -222,14 +222,14 @@ declare module mathjs { lcm(a: BigNumber , b: BigNumber ): BigNumber ; lcm(a: MathArray, b: MathArray): MathArray; lcm(a: Matrix, b: Matrix): Matrix; - + /** * Calculate the logarithm of a value. For matrices, the function is evaluated element wise. * @param x Value for which to calculate the logarithm. * @param base Optional base for the logarithm. If not provided, the natural logarithm of x is calculated. Default value: e. */ log(x: number|BigNumber|Complex|MathArray|Matrix, base?: number|BigNumber|Complex): number|BigNumber|Complex|MathArray|Matrix; - + /** * Calculate the 10-base of a value. This is the same as calculating log(x, 10). For matrices, the function is evaluated element wise. * @param x Value for which to calculate the logarithm. @@ -239,7 +239,7 @@ declare module mathjs { log10(x: Complex): Complex; log10(x: MathArray): MathArray; log10(x: Matrix): Matrix; - + /** * Calculates the modulus, the remainder of an integer division. For matrices, the function is evaluated element wise. * The modulus is defined as: @@ -249,7 +249,7 @@ declare module mathjs { * @param y Divisor */ mod(x: number|BigNumber|Fraction|MathArray|Matrix, y: number|BigNumber|Fraction|MathArray|Matrix): number|BigNumber|Fraction|MathArray|Matrix; - + /** * Multiply two values, x * y. The result is squeezed. For matrices, the matrix product is calculated. */ @@ -258,7 +258,7 @@ declare module mathjs { multiply(x: Unit, y: Unit): Unit; multiply(x: number, y: number): number; multiply(x: MathType, y: MathType): MathType; - + /** * Calculate the norm of a number, vector or matrix. The second parameter p is optional. If not provided, it defaults to 2. * @param x Value for which to calculate the norm @@ -266,7 +266,7 @@ declare module mathjs { * @returns the p-norm */ norm(x: number|BigNumber|Complex|MathArray|Matrix, p?: number|BigNumber|string): number|BigNumber; - + /** * Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation * x^root = A @@ -275,21 +275,21 @@ declare module mathjs { * @param root The root. Default value: 2. */ nthRoot(a: number|BigNumber|MathArray|Matrix|Complex, root?: number|BigNumber): number|Complex|MathArray|Matrix; - + /** * Calculates the power of x to y, x ^ y. Matrix exponentiation is supported for square matrices x, and positive integer exponents y. * @param x The base * @param y The exponent */ pow(x: number|BigNumber|Complex|MathArray|Matrix, y: number|BigNumber|Complex): number|BigNumber|Complex|MathArray|Matrix; - + /** * Round a value towards the nearest integer. For matrices, the function is evaluated element wise. * @param x Number to be rounded * @param n Number of decimals Default value: 0. */ round(x: number|BigNumber|Fraction|Complex|MathArray|Matrix, n?: number|BigNumber|MathArray): number|BigNumber|Fraction|Complex|MathArray|Matrix; - + /** * Compute the sign of a value. The sign of a value x is: * 1 when x > 1 @@ -304,7 +304,7 @@ declare module mathjs { sign(x: MathArray): MathArray; sign(x: Matrix): Matrix; sign(x: Unit): Unit; - + /** * Calculate the square root of a value. For matrices, the function is evaluated element wise. */ @@ -314,7 +314,7 @@ declare module mathjs { sqrt(x: MathArray): MathArray; sqrt(x: Matrix): Matrix; sqrt(x: Unit): Unit; - + /** * Compute the square of a value, x * x. For matrices, the function is evaluated element wise. */ @@ -325,12 +325,12 @@ declare module mathjs { square(x: MathArray): MathArray; square(x: Matrix): Matrix; square(x: Unit): Unit; - + /** * Subtract two values, x - y. For matrices, the function is evaluated element wise. */ subtract(x: MathType, y: MathType): MathType; - + /** * Inverse the sign of a value, apply a unary minus operation. * For matrices, the function is evaluated element wise. Boolean values and strings will be converted to a number. For complex numbers, both real and complex value are inverted. @@ -342,7 +342,7 @@ declare module mathjs { unaryMinus(x: MathArray): MathArray; unaryMinus(x: Matrix): Matrix; unaryMinus(x: Unit): Unit; - + /** * Unary plus operation. Boolean values and strings will be converted to a number, numeric values will be returned as is. * For matrices, the function is evaluated element wise. @@ -355,17 +355,17 @@ declare module mathjs { unaryPlus(x: MathArray): MathArray; unaryPlus(x: Matrix): Matrix; unaryPlus(x: Unit): Unit; - + /** * Calculate the extended greatest common divisor for two values. See http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. */ xgcd(a: number|BigNumber, b: number|BigNumber): MathArray; - + /** * Bitwise AND two values, x & y. For matrices, the function is evaluated element wise. */ bitAnd(x: number|BigNumber|MathArray|Matrix, y: number|BigNumber|MathArray|Matrix): number|BigNumber|MathArray|Matrix; - + /** * Bitwise NOT value, ~x. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. */ @@ -373,7 +373,7 @@ declare module mathjs { bitNot(x: BigNumber ): BigNumber ; bitNot(x: MathArray): MathArray; bitNot(x: Matrix): Matrix; - + /** * Bitwise OR two values, x | y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the lowest print base. */ @@ -381,47 +381,47 @@ declare module mathjs { bitOr(x: BigNumber ): BigNumber ; bitOr(x: MathArray): MathArray; bitOr(x: Matrix): Matrix; - + /** * Bitwise XOR two values, x ^ y. For matrices, the function is evaluated element wise. */ bitXor(x: number|BigNumber|MathArray|Matrix, y: number|BigNumber|MathArray|Matrix): number|BigNumber|MathArray|Matrix; - + /** * Bitwise left logical shift of a value x by y number of bits, x << y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ leftShift(x: number|BigNumber|MathArray|Matrix, y: number|BigNumber): number|BigNumber|MathArray|Matrix; - + /** * Bitwise right arithmetic shift of a value x by y number of bits, x >> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ rightArithShift(x: number|BigNumber|MathArray|Matrix, y: number|BigNumber): number|BigNumber|MathArray|Matrix; - + /** * Bitwise right logical shift of value x by y number of bits, x >>> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ rightLogShift(x: number|MathArray|Matrix, y: number): number|MathArray|Matrix; - + /** * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. The following condition must be enforced: n >= 0 * @param n Total number of objects in the set */ bellNumbers(n: Number): Number; bellNumbers(n: BigNumber): BigNumber; - + /** * The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0 * @pararm n nth Catalan number */ catalan(n: Number): Number; catalan(n: BigNumber): BigNumber; - + /** * The composition counts of n into k parts. Composition only takes integer arguments. The following condition must be enforced: k <= n. * @param n Total number of objects in the set @@ -429,7 +429,7 @@ declare module mathjs { * @returns Returns the composition counts of n into k parts. */ composition(n: Number|BigNumber, k: Number|BigNumber): Number|BigNumber - + /** * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. * If n = k or k = 1, then s(n,k) = 1 @@ -437,7 +437,7 @@ declare module mathjs { * @param k Number of objects in the subset */ stirlingS2(n: Number|BigNumber, k: Number|BigNumber): Number|BigNumber; - + /** * Compute the argument of a complex value. For a complex number a + bi, the argument is computed as atan2(b, a). For matrices, the function is evaluated element wise. * @param x A complex number or array with complex numbers @@ -446,15 +446,15 @@ declare module mathjs { arg(x: Complex): number; arg(x: MathArray): MathArray; arg(x: Matrix): Matrix; - + /** * Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate of x is a - bi. For matrices, the function is evaluated element wise. * @param x A complex number or array with complex numbers */ conj(x: number|BigNumber|Complex|MathArray|Matrix): number|BigNumber|Complex|MathArray|Matrix; - - /** - * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. + + /** + * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. * For matrices, the function is evaluated element wise. */ im(x: number|BigNumber|Complex|MathArray|Matrix): number|BigNumber|MathArray|Matrix; @@ -464,17 +464,17 @@ declare module mathjs { * For matrices, the function is evaluated element wise. */ re(x: number|BigNumber|Complex|MathArray|Matrix): number|BigNumber|MathArray|Matrix; - + /** * Create a BigNumber, which can store numbers with arbitrary precision. When a matrix is provided, all elements will be converted to BigNumber. */ bignumber(x?: number|string|MathArray|Matrix|boolean): BigNumber; - + /** * Create a boolean or convert a string or number to a boolean. In case of a number, true is returned for non-zero numbers, and false in case of zero. Strings can be 'true' or 'false', or can contain a number. When value is a matrix, all elements will be converted to boolean. */ boolean(x: string|number|boolean|MathArray|Matrix ): boolean|MathArray|Matrix; - + /** * Wrap any value in a chain, allowing to perform chained operations on the value. * All methods available in the math.js library can be called upon the chain, and then will be evaluated with the value itself as first argument. The chain can be closed by executing chain.done(), which returns the final value. @@ -484,7 +484,7 @@ declare module mathjs { * toString() Executes math.format() onto the chain's value, returning a string representation of the value. */ chain(value?: any): IMathJsChain; - + /** * Create a complex value or convert a value to a complex value. */ @@ -494,90 +494,90 @@ declare module mathjs { complex(arg: string): Complex; complex(array: MathArray): Complex; complex(obj: IPolarCoordinates): Complex; - + /** * Create a fraction convert a value to a fraction. */ fraction(numerator: number|string|MathArray|Matrix, denominator?: number|string|MathArray|Matrix): Fraction|MathArray|Matrix; - + /** * Create an index. An Index can store ranges having start, step, and end for multiple dimensions. Matrix.get, Matrix.set, and math.subset accept an Index as input. */ index(...ranges: any[]): Index; - + /** - * Create a Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility functions - * to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. Supported + * Create a Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility functions + * to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. Supported * storage formats are 'dense' and 'sparse'. */ matrix(format?: string): Matrix; matrix(data: MathArray|Matrix, format?: string, dataType?:string): Matrix; - + /** * Create a number or convert a string, boolean, or unit to a number. When value is a matrix, all elements will be converted to number. */ number(value?: string|number|boolean|MathArray|Matrix|Unit): number|MathArray|Matrix; number(unit: Unit, valuelessUnit: Unit|string): number|MathArray|Matrix; - + /** - * Create a Sparse Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility + * Create a Sparse Matrix. The function creates a new math.type.Matrix object from an Array. A Matrix has utility * functions to manipulate the data in the matrix, like getting the size and getting or setting values in the matrix. * @param data A two dimensional array */ sparse(data?: MathArray|Matrix, dataType?:string): Matrix; - + /** * Create a string or convert any object into a string. Elements of Arrays and Matrices are processed element wise. * @param value A value to convert to a string */ string(value: any): string|MathArray|Matrix; - + /** - * Create a unit. Depending on the passed arguments, the function will create and return a new math.type.Unit object. + * Create a unit. Depending on the passed arguments, the function will create and return a new math.type.Unit object. * When a matrix is provided, all elements will be converted to units. */ unit(unit: string): Unit; unit(value: number, unit: string): Unit; - + /** * Parse and compile an expression. Returns a an object with a function eval([scope]) to evaluate the compiled expression. */ compile(expr: MathExpression): EvalFunction; compile(exprs: MathExpression[]): EvalFunction[]; - + /** * Evaluate an expression. */ eval(expr: MathExpression, scope?: any): any; eval(exprs: MathExpression[], scope?: any): any; - + /** * Retrieve help on a function or data type. Help files are retrieved from the documentation in math.expression.docs. */ help(search: any): Help; - + /** * Parse an expression. Returns a node tree, which can be evaluated by invoking node.eval(); */ parse(expr: MathExpression, options?: any): MathNode; parse(exprs: MathExpression[], options?: any): MathNode[]; - + /** * Create a parser. The function creates a new math.expression.Parser object. */ parser(): Parser; - + /** - * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point - * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When - * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric + * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point + * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When + * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric * equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c) */ distance(x: MathArray|Matrix|any, y: MathArray|Matrix|any): Number | BigNumber; - + /** - * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in - * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions + * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in + * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions * return null if the lines do not meet. * Note: Fill the plane coefficients as x + y + z = c and not as x + y + z + c = 0. * @param w Co-ordinates of first end-point of first line @@ -587,50 +587,50 @@ declare module mathjs { * @returns Returns the point of intersection of lines/lines-planes */ intersect(w: MathArray|Matrix, x: MathArray|Matrix, y: MathArray|Matrix, z: MathArray|Matrix): MathArray; - + /** * Logical and. Test whether two values are both defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ and(x: number|BigNumber|Complex|Unit|MathArray|Matrix, y: number|BigNumber|Complex|Unit|MathArray|Matrix): boolean|MathArray|Matrix; - + /** * Logical not. Flips boolean value of a given parameter. For matrices, the function is evaluated element wise. */ not(x: number|BigNumber|Complex|Unit|MathArray|Matrix): boolean|MathArray|Matrix; - + /** * Logical or. Test if at least one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ or(x: number|BigNumber|Complex|Unit|MathArray|Matrix, y: number|BigNumber|Complex|Unit|MathArray|Matrix): boolean|MathArray|Matrix; - + /** * Logical xor. Test whether one and only one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ xor(x: number|BigNumber|Complex|Unit|MathArray|Matrix, y: number|BigNumber|Complex|Unit|MathArray|Matrix): boolean|MathArray|Matrix; - + /** * Concatenate two or more matrices. * dim: number is a zero-based dimension over which to concatenate the matrices. By default the last dimension of the matrices. */ concat(...args: (MathArray|Matrix|number)[]): MathArray|Matrix; - + /** - * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] + * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] * and B =[b1, b2, b3] is defined as: * cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 * b2 - a2 * b1 ] */ cross(x: MathArray|Matrix, y: MathArray|Matrix): Matrix; - + /** * Calculate the determinant of a matrix. */ det(x: MathArray|Matrix): number; - + /** * Create a diagonal matrix or retrieve the diagonal of a matrix. - * When x is a vector, a matrix with vector x on the diagonal will be returned. When x is a two dimensional matrix, + * When x is a vector, a matrix with vector x on the diagonal will be returned. When x is a two dimensional matrix, * the matrixes kth diagonal will be returned - * as vector. When k is positive, the values are placed on the super diagonal. When k is negative, the values are + * as vector. When k is positive, the values are placed on the super diagonal. When k is negative, the values are * placed on the sub diagonal. * @param X A two dimensional matrix or a vector * @param k The diagonal where the vector will be filled in or retrieved. Default value: 0. @@ -638,38 +638,38 @@ declare module mathjs { */ diag(X: MathArray|Matrix, format?: string): Matrix; diag(X: MathArray|Matrix, k: number|BigNumber, format?: string): Matrix; - + /** - * Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] + * Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] * is defined as: * dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn */ dot(x: MathArray|Matrix, y: MathArray|Matrix): number; - + /** * Create a 2-dimensional identity matrix with size m x n or n x n. The matrix has ones on the diagonal and zeros elsewhere. */ eye(n: number, format?: string): Matrix; eye(m: number, n: number, format?: string): Matrix; eye(size: number[], format?: string): Matrix; - + /** * Flatten a multi dimensional matrix into a single dimensional matrix. */ - flatten(x: MathArray|Matrix): MathArray|Matrix; - + flatten(x: MathArray|Matrix): MathArray|Matrix; + /** * Calculate the inverse of a square matrix. */ inv(x: number|Complex|MathArray|Matrix): number|Complex|MathArray|Matrix; - + /** * Create a matrix filled with ones. The created matrix can have one or multiple dimensions. */ ones(n: number, format?: string): MathArray|Matrix; ones(m: number, n: number, format?: string): MathArray|Matrix; ones(size: number[], format?: string): MathArray|Matrix; - + /** * Create an array from a range. By default, the range end is excluded. This can be customized by providing an extra parameter includeEnd. * @param str A string 'start:end' or 'start:step:end' @@ -681,7 +681,7 @@ declare module mathjs { range(str: string, includeEnd?: boolean): Matrix; range(start: number|BigNumber, end:number|BigNumber, includeEnd?:boolean): Matrix; range(start: number|BigNumber, end: number|BigNumber, step: number|BigNumber, includeEnd?:boolean): Matrix; - + /** * Resize a matrix * @param x Matrix to be resized @@ -689,17 +689,17 @@ declare module mathjs { * @param defaultValue Zero by default, except in case of a string, in that case defaultValue = ' ' Default value: 0. */ resize(x: MathArray|Matrix, size: MathArray|Matrix, defaultValue?: number|string): MathArray|Matrix; - + /** * Calculate the size of a matrix or scalar. */ size(x: boolean|number|Complex|Unit|string|MathArray|Matrix): MathArray|Matrix; - + /** * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix. */ squeeze(x: MathArray|Matrix): Matrix|MathArray; - + /** * Get or set a subset of a matrix or string. * @param value An array, matrix, or string @@ -708,60 +708,60 @@ declare module mathjs { * @param defaultValue Default value, filled in on new entries when the matrix is resized. If not provided, math.matrix elements will be left undefined. Default value: undefined. */ subset(value: MathArray|Matrix|string, index: Index, replacement?: any, defaultValue?: any): MathArray|Matrix|string; - + /** * Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix. */ trace(x: MathArray|Matrix): number; - + /** * Transpose a matrix. All values of the matrix are reflected over its main diagonal. Only two dimensional matrices are supported. */ transpose(x: MathArray|Matrix): MathArray|Matrix; - + /** * Create a matrix filled with zeros. The created matrix can have one or multiple dimensions. */ zeros(n: number, format?: string): MathArray|Matrix; zeros(m: number, n: number, format?: string): MathArray|Matrix; zeros(size: number[], format?: string): MathArray|Matrix; - + /** - * Compute the number of ways of picking k unordered outcomes from n possibilities. + * Compute the number of ways of picking k unordered outcomes from n possibilities. * Combinations only takes integer arguments. The following condition must be enforced: k <= n. */ combinations(n: number|BigNumber, k: number|BigNumber): number|BigNumber; - + /** * Create a distribution object with a set of random functions for given random distribution. * @param name Name of a distribution. Choose from 'uniform', 'normal'. */ distribution(name: string): Distribution; - + /** * Compute the factorial of a value * Factorial only supports an integer value as argument. For matrices, the function is evaluated element wise. */ factorial(n: number|BigNumber|MathArray|Matrix): number|BigNumber|MathArray|Matrix; - + /** - * Compute the gamma function of a value using Lanczos approximation for small values, and an extended + * Compute the gamma function of a value using Lanczos approximation for small values, and an extended * Stirling approximation for large values. * For matrices, the function is evaluated element wise. */ gamma(n: number|MathArray|Matrix): number|MathArray|Matrix; - + /** * Calculate the Kullback-Leibler (KL) divergence between two distributions */ kldivergence(x: MathArray|Matrix, y: MathArray|Matrix): number; - + /** * Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from n possibilities. * multinomial takes one array of integers as an argument. The following condition must be enforced: every ai <= 0 */ multinomial(a: number[]|BigNumber[]): number|BigNumber; - + /** * Compute the number of ways of obtaining an ordered subset of k elements from a set of n elements. * Permutations only takes integer arguments. The following condition must be enforced: k <= n. @@ -769,12 +769,12 @@ declare module mathjs { * @param k The number of objects in the subset */ permutations(n: number|BigNumber, k?:number|BigNumber): number|BigNumber; - + /** * Random pick a value from a one dimensional array. Array element is picked using a random function with uniform distribution. */ pickRandom(array: number[]): number; - + /** * Return a random number larger or equal to min and smaller than max using a uniform distribution. */ @@ -783,7 +783,7 @@ declare module mathjs { random(min: number, max: number): number; random(size: MathArray|Matrix, max?: number): MathArray|Matrix; random(size: MathArray|Matrix, min:number, max: number): MathArray|Matrix; - + /** * Return a random integer number larger or equal to min and smaller than max using a uniform distribution. */ @@ -791,166 +791,166 @@ declare module mathjs { randomInt(min: number, max: number): number; randomInt(size: MathArray|Matrix, max?: number): MathArray|Matrix; randomInt(size: MathArray|Matrix, min:number, max: number): MathArray|Matrix; - + /** * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. - * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. + * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. * For matrices, the function is evaluated element wise. */ compare(x: MathType, y: MathType): number|BigNumber|Fraction|MathArray|Matrix; - + /** * Test element wise whether two matrices are equal. The function accepts both matrices and scalar values. */ deepEqual(x: MathType, y: MathType): number|BigNumber|Fraction|Complex|Unit|MathArray|Matrix; - + /** * Test whether two values are equal. - * - * The function tests whether the relative difference between x and y is smaller than the configured epsilon. + * + * The function tests whether the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * + * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. - * + * * Values null and undefined are compared strictly, thus null is only equal to null and nothing else, and undefined is only equal to undefined and nothing else. */ equal(x: MathType, y: MathType): boolean|MathArray|Matrix; - + /** * Test whether value x is larger than y. - * - * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. + * + * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * + * * For matrices, the function is evaluated element wise. */ larger(x: MathType, y: MathType): boolean|MathArray|Matrix; - + /** * Test whether value x is larger or equal to y. - * - * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. + * + * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * + * * For matrices, the function is evaluated element wise. */ largerEq(x: MathType, y: MathType): boolean|MathArray|Matrix; - + /** * Test whether value x is smaller than y. - * - * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. + * + * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * + * * For matrices, the function is evaluated element wise. */ smaller(x: MathType, y: MathType): boolean|MathArray|Matrix; - + /** * Test whether value x is smaller or equal to y. - * - * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. + * + * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise. */ smallerEq(x: MathType, y: MathType): boolean|MathArray|Matrix; - + /** * Test whether two values are unequal. - * - * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot + * + * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot * be used to compare values smaller than approximately 2.22e-16. - * + * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. - * - * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with + * + * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with * everying except. undefined. */ unequal(x: MathType, y: MathType): boolean|MathArray|Matrix; - + /** - * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ max(...args: MathType[]): any; max(A: MathArray|Matrix, dim?: number): any; - + /** - * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be + * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be * calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ mean(...args: MathType[]): any; mean(A: MathArray|Matrix, dim?: number): any; - + /** - * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an + * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an * even number of values, the average of the two middle values is returned. Supported types of values are: Number, BigNumber, Unit - * + * * In case of a (multi dimensional) array or matrix, the median of all elements will be calculated. */ median(...args: MathType[]): any; - + /** - * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ min(...args: MathType[]): any; min(A: MathArray|Matrix, dim?: number): any; - + /** * Computes the mode of a set of numbers or a list with values(numbers or characters). If there are more than one modes, it returns a list of those values. */ mode(...args: MathType[]): any; - + /** * Compute the product of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. */ prod(...args: MathType[]): any; - + /** - * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. + * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. * Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber - * + * * In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated. */ quantileSeq(A: MathArray|Matrix, prob: Number|BigNumber|MathArray, sorted?: boolean): Number|BigNumber|Unit|MathArray; - + /** - * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the - * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will + * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the + * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will * be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following + * + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following * values: - * + * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) */ std(array: MathArray|Matrix, normalization?: string): number; - + /** * Compute the sum of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. */ sum(...args: (Number|BigNumber|Fraction)[]): any; sum(array: MathArray|Matrix): any; - + /** - * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all + * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all * elements will be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the + * + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the * following values: - * + * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) - * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) + * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) * instead of math.var(...). */ var(...args: (Number|BigNumber|Fraction)[]): any; var(array: MathArray|Matrix, normalization?: string): any; - + /** * Calculate the inverse cosine of a value. For matrices, the function is evaluated element wise. */ @@ -969,7 +969,7 @@ declare module mathjs { acosh(x: Complex): Complex; acosh(x: MathArray): MathArray; acosh(x: Matrix): Matrix; - + /** * Calculate the inverse cotangent of a value. For matrices, the function is evaluated element wise. */ @@ -977,7 +977,7 @@ declare module mathjs { acot(x: BigNumber): BigNumber; acot(x: MathArray): MathArray; acot(x: Matrix): Matrix; - + /** * Calculate the hyperbolic arccotangent of a value, defined as acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2. * For matrices, the function is evaluated element wise. @@ -994,7 +994,7 @@ declare module mathjs { acsc(x: BigNumber): BigNumber; acsc(x: MathArray): MathArray; acsc(x: Matrix): Matrix; - + /** * Calculate the hyperbolic arccosecant of a value, defined as acsch(x) = ln(1/x + sqrt(1/x^2 + 1)). * For matrices, the function is evaluated element wise. @@ -1003,7 +1003,7 @@ declare module mathjs { acsch(x: BigNumber): BigNumber; acsch(x: MathArray): MathArray; acsch(x: Matrix): Matrix; - + /** * Calculate the inverse secant of a value. For matrices, the function is evaluated element wise. */ @@ -1011,7 +1011,7 @@ declare module mathjs { asec(x: BigNumber): BigNumber; asec(x: MathArray): MathArray; asec(x: Matrix): Matrix; - + /** * Calculate the hyperbolic arcsecant of a value, defined as asech(x) = ln(sqrt(1/x^2 - 1) + 1/x). For matrices, the function is evaluated element wise. */ @@ -1019,8 +1019,8 @@ declare module mathjs { asech(x: BigNumber): BigNumber; asech(x: MathArray): MathArray; asech(x: Matrix): Matrix; - - /** + + /** * Calculate the inverse sine of a value. For matrices, the function is evaluated element wise. */ asin(x: number): number; @@ -1028,7 +1028,7 @@ declare module mathjs { asin(x: Complex): Complex; asin(x: MathArray): MathArray; asin(x: Matrix): Matrix; - + /** * Calculate the hyperbolic arcsine of a value, defined as asinh(x) = ln(x + sqrt(x^2 + 1)). For matrices, the function is evaluated element wise. */ @@ -1036,7 +1036,7 @@ declare module mathjs { asinh(x: BigNumber): BigNumber; asinh(x: MathArray): MathArray; asinh(x: Matrix): Matrix; - + /** * Calculate the inverse tangent of a value. For matrices, the function is evaluated element wise. */ @@ -1044,16 +1044,16 @@ declare module mathjs { atan(x: BigNumber): BigNumber; atan(x: MathArray): MathArray; atan(x: Matrix): Matrix; - + /** - * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the + * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the * computed angle can be determined. - * + * * For matrices, the function is evaluated element wise. */ atan2(y: number, x: number): number; atan2(y: MathArray|Matrix, x: MathArray|Matrix): MathArray|Matrix; - + /** * Calculate the hyperbolic arctangent of a value, defined as atanh(x) = ln((1 + x)/(1 - x)) / 2. * For matrices, the function is evaluated element wise. @@ -1062,7 +1062,7 @@ declare module mathjs { atanh(x: BigNumber): BigNumber; atanh(x: MathArray): MathArray; atanh(x: Matrix): Matrix; - + /** * Calculate the cosine of a value. For matrices, the function is evaluated element wise. */ @@ -1072,7 +1072,7 @@ declare module mathjs { asin(x: Unit): number; asin(x: MathArray): MathArray; asin(x: Matrix): Matrix; - + /** * Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 * (exp(x) + exp(-x)). For matrices, the function is evaluated element wise. */ @@ -1082,7 +1082,7 @@ declare module mathjs { cosh(x: Unit): number; cosh(x: MathArray): MathArray; cosh(x: Matrix): Matrix; - + /** * Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). For matrices, the function is evaluated element wise. */ @@ -1091,7 +1091,7 @@ declare module mathjs { cot(x: Unit): number; cot(x: MathArray): MathArray; cot(x: Matrix): Matrix; - + /** * Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x). For matrices, the function is evaluated element wise. */ @@ -1100,7 +1100,7 @@ declare module mathjs { coth(x: Unit): number; coth(x: MathArray): MathArray; coth(x: Matrix): Matrix; - + /** * Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For matrices, the function is evaluated element wise. */ @@ -1109,7 +1109,7 @@ declare module mathjs { csc(x: Unit): number; csc(x: MathArray): MathArray; csc(x: Matrix): Matrix; - + /** * Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x). For matrices, the function is evaluated element wise. */ @@ -1118,7 +1118,7 @@ declare module mathjs { csch(x: Unit): number; csch(x: MathArray): MathArray; csch(x: Matrix): Matrix; - + /** * Calculate the secant of a value, defined as sec(x) = 1/cos(x). For matrices, the function is evaluated element wise. */ @@ -1127,7 +1127,7 @@ declare module mathjs { sec(x: Unit): number; sec(x: MathArray): MathArray; sec(x: Matrix): Matrix; - + /** * Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x). For matrices, the function is evaluated element wise. */ @@ -1136,7 +1136,7 @@ declare module mathjs { sech(x: Unit): number; sech(x: MathArray): MathArray; sech(x: Matrix): Matrix; - + /** * Calculate the sine of a value. For matrices, the function is evaluated element wise. */ @@ -1146,7 +1146,7 @@ declare module mathjs { sin(x: Unit): number; sin(x: MathArray): MathArray; sin(x: Matrix): Matrix; - + /** * Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)). For matrices, the function is evaluated element wise. */ @@ -1156,7 +1156,7 @@ declare module mathjs { sinh(x: Unit): number; sinh(x: MathArray): MathArray; sinh(x: Matrix): Matrix; - + /** * Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). For matrices, the function is evaluated element wise. */ @@ -1166,7 +1166,7 @@ declare module mathjs { tan(x: Unit): number; tan(x: MathArray): MathArray; tan(x: Matrix): Matrix; - + /** * Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1). For matrices, the function is evaluated element wise. */ @@ -1176,75 +1176,75 @@ declare module mathjs { tanh(x: Unit): number; tanh(x: MathArray): MathArray; tanh(x: Matrix): Matrix; - + /** * Change the unit of a value. For matrices, the function is evaluated element wise. * @param x The unit to be converted. * @param unit New unit. Can be a string like "cm" or a unit without value. */ to(x: Unit|MathArray|Matrix, unit: Unit|string): Unit|MathArray|Matrix - + /** * Clone an object. */ clone(x: any): any; - + /** * Filter the items in an array or one dimensional matrix. * @param x A one dimensional matrix or array to filter - * @param test + * @param test */ filter(x: MathArray|Matrix, test: RegExp|((item: any)=>boolean)): MathArray|Matrix; - + /** * Iterate over all elements of a matrix/array, and executes the given callback function. * @param x The matrix to iterate on. * @param callback The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix/array being traversed. */ forEach(x: MathArray|Matrix, callback: (item: any)=>any): void; - + /** * Format a value of any type into a string. * @param value The value to be formatted */ format(value: any, options?: IFormatOptions|number|((item: any)=>string)): string; - + /** - * Test whether a value is an integer number. The function supports number, BigNumber, and Fraction. + * Test whether a value is an integer number. The function supports number, BigNumber, and Fraction. * The function is evaluated element-wise in case of Array or Matrix input. */ isInteger(x: any): boolean; - + /** * Test whether a value is negative: smaller than zero. The function supports types number, BigNumber, Fraction, and Unit. * The function is evaluated element-wise in case of Array or Matrix input. */ isNegative(x: any): boolean; - + /** * Test whether a value is an numeric value. The function is evaluated element-wise in case of Array or Matrix input. */ isNumeric(x: any): boolean; - + /** * Test whether a value is positive: larger than zero. The function supports types number, BigNumber, Fraction, and Unit. * The function is evaluated element-wise in case of Array or Matrix input. */ isPositive(x: any): boolean; - + /** * Test whether a value is zero. The function can check for zero for types number, BigNumber, Fraction, Complex, and Unit. * The function is evaluated element-wise in case of Array or Matrix input. */ isZero(x: any): boolean; - + /** * Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array. * @param x The matrix to iterate on. * @param callback The callback method is invoked with three parameters: the value of the element, the index of the element, and the matrix being traversed. */ map(x: MathArray|Matrix, callback: (item: any)=>any): MathArray|Matrix; - + /** * Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect. * @param x A one dimensional matrix or array to sort @@ -1253,7 +1253,7 @@ declare module mathjs { * @returns Returns the kth lowest value. */ partitionSelect(x: MathArray|Matrix, k: number, compare?: string|((a: any, b: any)=>number)): any; - + /** * Interpolate values into a string template. * @param template A string containing variable placeholders. @@ -1261,225 +1261,294 @@ declare module mathjs { * @param precision Number of digits to format numbers. If not provided, the value will not be rounded. */ print(template:string, values: any, precision?: number): void; - + /** * Sort the items in a matrix. * @param x A one dimensional matrix or array to sort * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. */ sort(x: MathArray|Matrix, compare?: string|((a: any, b: any)=>number)): MathArray|Matrix; - + /** * Determine the type of a variable. */ typeof(x: any): string; } - + export interface Matrix { size(): number[]; subset(index: Index, replacement?: any, defaultValue?: any): Matrix; resize(size: MathArray|Matrix, defaultValue?: number|string): Matrix; clone(): Matrix; } - + export interface BigNumber { - + } - + export interface Fraction { - + } - + export interface Complex { re: number; im: number; toPolar(): IPolarCoordinates; clone(): Complex; } - + export interface IPolarCoordinates { - r: number; + r: number; phi: number; - } - + } + export interface Unit { to(unit: string): Unit; toNumber(unit: string): number; } - + export interface Index { - + } - + export interface EvalFunction { eval(scope?: any): any; } - + export interface MathNode { + isNode: boolean; + isSymbolNode: boolean; + type: string; + name: string; + compile(): EvalFunction; eval(): any; + eval(expr: string): any; + /** + * + * Filter nodes in an expression tree. The callback function is called as callback(node: Node, path: string, parent: Node) : boolean for every node in the tree, + * and must return a boolean. The function filter returns an array with nodes for which the test returned true. + * Parameter path is a string containing a relative JSON Path. + * + * Example: + * + * ``` + * var node = math.parse('x^2 + x/4 + 3*y'); + * var filtered = node.filter(function (node) { + * return node.isSymbolNode && node.name == 'x'; + * }); + * // returns an array with two entries: two SymbolNodes 'x' + * ``` + * + * @param The callback function is called as callback(node: Node, path: string, parent: Node) : boolean for every node in the tree, and must return a boolean. The function filter returns an array with nodes for which the test returned true. Parameter path is a string containing a relative JSON Path. + * @param {Function} callback(node [description] + * @return {[Mathnode]} Returns an array with nodes for which test returned true + */ + filter(callback: (node: MathNode, path: string, parent: MathNode)=>any ): MathNode[]; + + + /** + * [forEach description] + * @param {MathNode} callback(node [description] + * @return {[type]} [description] + */ + forEach(callback: (node: MathNode, path: string, parent: MathNode)=>boolean): MathNode[]; + + + /** + * `traverse(callback)` + * + * Recursively traverse all nodes in a node tree. Executes given callback for this node and each of its child nodes. Similar to Array.forEach, except recursive. The callback function is a mapping function accepting a node, and returning a replacement for the node or the original node. Function callback is called as callback(node: Node, path: string, parent: Node) for every node in the tree. Parameter path is a string containing a relative JSON Path. Example: + * + * ``` + * var node = math.parse('3 * x + 2'); + * node.traverse(function (node, path, parent) { + * switch (node.type) { + * case 'OperatorNode': console.log(node.type, node.op); break; + * case 'ConstantNode': console.log(node.type, node.value); break; + * case 'SymbolNode': console.log(node.type, node.name); break; + * default: console.log(node.type); + * } + * }); + * // outputs: + * // OperatorNode + + * // OperatorNode * + * // ConstantNode 3 + * // SymbolNode x + * // ConstantNode 2 + * ``` + * + * @param {MathNode} callback=(node [description] + * @return {[type]} [description] + */ + traverse(callback: (node: MathNode, path: string, parent: MathNode)=> void): any; +//addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any); + + transform(callback: (node: MathNode, path: string, parent: MathNode)=>boolean): MathNode[]; + } - + + export interface Parser { eval(expr: string): any; get(variable: string): any; set(variable: string, value: any): void; clear(): void; } - + export interface Distribution { random(size: any, min?: any, max?: any): any; randomInt(min: any, max?: any): any; pickRandom(array: any): any; } - + export interface IFormatOptions { /** * Number notation. Choose from: * 'fixed' Always use regular number notation. For example '123.40' and '14000000' * 'exponential' Always use exponential notation. For example '1.234e+2' and '1.4e+7' - * 'auto' (default) Regular number notation for numbers having an absolute value between lower and upper bounds, and + * 'auto' (default) Regular number notation for numbers having an absolute value between lower and upper bounds, and * uses exponential notation elsewhere. Lower bound is included, upper bound is excluded. For example '123.4' and '1.4e7'. */ notation?: string; - + /** - * A number between 0 and 16 to round the digits of the number. In case of notations 'exponential' and 'auto', - * precision defines the total number of significant digits returned and is undefined by default. In case of notation 'fixed', + * A number between 0 and 16 to round the digits of the number. In case of notations 'exponential' and 'auto', + * precision defines the total number of significant digits returned and is undefined by default. In case of notation 'fixed', * precision defines the number of significant digits after the decimal point, and is 0 by default. */ precision?: number; - + /** - * An object containing two parameters, {number} lower and {number} upper, used by notation 'auto' to determine + * An object containing two parameters, {number} lower and {number} upper, used by notation 'auto' to determine * when to return exponential notation. Default values are lower=1e-3 and upper=1e5. Only applicable for notation auto. */ exponential?: {lower: number; upper: number}; - + /** - * Available values: 'ratio' (default) or 'decimal'. For example format(fraction(1, 3)) will output '1/3' when 'ratio' + * Available values: 'ratio' (default) or 'decimal'. For example format(fraction(1, 3)) will output '1/3' when 'ratio' * is configured, and will output 0.(3) when 'decimal' is configured. */ fraction?: string; - - /** - * A custom formatting function. Can be used to override the built-in notations. Function fn is called with - * value as parameter and must return a string. Is useful for example to format all values inside a matrix in a particular way. + + /** + * A custom formatting function. Can be used to override the built-in notations. Function fn is called with + * value as parameter and must return a string. Is useful for example to format all values inside a matrix in a particular way. * */ fn?: (item: any)=>string; } - + export interface Help { toString(): string; toJSON(): string; - } - - export interface IMathJsChain { + } + + export interface IMathJsChain { /** * Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix. * @param b A column vector with the b values */ lsolve(b: Matrix|MathArray): IMathJsChain; - + /** - * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) + * Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in two matrices (L, U) * and a row permutation vector p where A[p,:] = L * U */ lup(): IMathJsChain; - + /** * Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector. * @param b Column Vector */ lusolve(b: Matrix|MathArray): IMathJsChain; - + /** - * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in + * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix A is decomposed in * two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U - * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is - * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic - * ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. - * This is appropriatefor LU factorization of unsymmetric matrices. 3 - Symbolic ordering and analisis is performed - * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with + * @param order The Symbolic Ordering and Analysis order: 0 - Natural ordering, no permutation vector q is + * returned 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A' 2 - Symbolic + * ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'. + * This is appropriatefor LU factorization of unsymmetric matrices. 3 - Symbolic ordering and analisis is performed + * on M = A' * A. This is best used for LU factorization is matrix M has no dense rows. A dense row is a row with * more than 10*sqr(columns) entries. * @param threshold Partial pivoting threshold (1 for partial pivoting) * @returns The lower triangular matrix, the upper triangular matrix and the permutation vectors. */ slu(order: Number, threshold: Number): IMathJsChain; - + /** * Solves the linear equation system by backward substitution. Matrix must be an upper triangular matrix. U * x = b * @param b A column vector with the b values * @returns A column vector with the linear system solution (x) */ usolve(b:Matrix|MathArray): IMathJsChain; - + /** * Calculate the absolute value of a number. For matrices, the function is evaluated element wise. */ abs(): IMathJsChain; - + /** * Add two values, x + y. For matrices, the function is evaluated element wise. * @param y Second value to add */ add(y: MathType): IMathJsChain; - + /** * Calculate the cubic root of a value. For matrices, the function is evaluated element wise. * @param allRoots Optional, false by default. Only applicable when x is a number or complex number. If true, all complex roots are returned, if false (default) the principal root is returned. */ cbrt(allRoots?: boolean): IMathJsChain; - + /** * Round a value towards plus infinity If x is complex, both real and imaginary part are rounded towards plus infinity. For matrices, the function is evaluated element wise. */ ceil(): IMathJsChain; - - /** + + /** * Compute the cube of a value, x * x * x. For matrices, the function is evaluated element wise. */ cube(): IMathJsChain; - + /** * Divide two values, x / y. To divide matrices, x is multiplied with the inverse of y: x * inv(y). * @param y Denominator */ divide(y:MathType): IMathJsChain; - + /** * Divide two matrices element wise. The function accepts both matrices and scalar values. * @param y Denominator */ dotDivide(y: MathType): IMathJsChain; - + /** * Multiply two matrices element wise. The function accepts both matrices and scalar values. * @param y Right hand value */ dotMultiply(y: MathType): IMathJsChain; - - /** + + /** * Calculates the power of x to y element wise. * @param y The exponent */ dotPow(y: MathType): IMathJsChain; - + /** * Calculate the exponent of a value. For matrices, the function is evaluated element wise. */ exp(): IMathJsChain; - /** + /** * Round a value towards zero. For matrices, the function is evaluated element wise. */ fix(): IMathJsChain; - + /** * Round a value towards minus infinity. For matrices, the function is evaluated element wise. */ floor(): IMathJsChain; - + /** * Calculate the greatest common divisor for two or more values or arrays. For matrices, the function is evaluated element wise. */ @@ -1488,7 +1557,7 @@ declare module mathjs { gcd(...args: Fraction[]): IMathJsChain ; gcd(...args: MathArray[]): IMathJsChain ; gcd(...args: Matrix[]): IMathJsChain; - + /** * Calculate the hypotenusa of a list with values. The hypotenusa is defined as: * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...) @@ -1496,7 +1565,7 @@ declare module mathjs { */ hypot(...args: number[]): IMathJsChain; hypot(...args: BigNumber[]): IMathJsChain; - + /** * Calculate the least common multiple for two or more values or arrays. lcm is defined as: * lcm(a, b) = abs(a * b) / gcd(a, b) @@ -1506,18 +1575,18 @@ declare module mathjs { lcm(b: BigNumber ): IMathJsChain ; lcm(b: MathArray): IMathJsChain; lcm(b: Matrix): IMathJsChain; - + /** * Calculate the logarithm of a value. For matrices, the function is evaluated element wise. * @param base Optional base for the logarithm. If not provided, the natural logarithm of x is calculated. Default value: e. */ log(base?: number|BigNumber|Complex): IMathJsChain; - + /** * Calculate the 10-base of a value. This is the same as calculating log(x, 10). For matrices, the function is evaluated element wise. */ log10(): IMathJsChain; - + /** * Calculates the modulus, the remainder of an integer division. For matrices, the function is evaluated element wise. * The modulus is defined as: @@ -1526,18 +1595,18 @@ declare module mathjs { * @param y Divisor */ mod(y: number|BigNumber|Fraction|MathArray|Matrix): IMathJsChain; - + /** * Multiply two values, x * y. The result is squeezed. For matrices, the matrix product is calculated. */ multiply(y: MathType): IMathJsChain; - + /** * Calculate the norm of a number, vector or matrix. The second parameter p is optional. If not provided, it defaults to 2. * @param p Vector space. Supported numbers include Infinity and -Infinity. Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm) Default value: 2. */ norm(p?: number|BigNumber|string): IMathJsChain; - + /** * Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation * x^root = A @@ -1545,19 +1614,19 @@ declare module mathjs { * @param root The root. Default value: 2. */ nthRoot(root?: number|BigNumber): IMathJsChain; - + /** * Calculates the power of x to y, x ^ y. Matrix exponentiation is supported for square matrices x, and positive integer exponents y. * @param y The exponent */ pow(y: number|BigNumber|Complex): IMathJsChain; - + /** * Round a value towards the nearest integer. For matrices, the function is evaluated element wise. * @param n Number of decimals Default value: 0. */ round(n?: number|BigNumber|MathArray): IMathJsChain; - + /** * Compute the sign of a value. The sign of a value x is: * 1 when x > 1 @@ -1566,92 +1635,92 @@ declare module mathjs { * For matrices, the function is evaluated element wise. */ sign(): IMathJsChain; - + /** * Calculate the square root of a value. For matrices, the function is evaluated element wise. */ sqrt(): IMathJsChain; - + /** * Compute the square of a value, x * x. For matrices, the function is evaluated element wise. */ square(): IMathJsChain; - + /** * Subtract two values, x - y. For matrices, the function is evaluated element wise. */ subtract(y: MathType): IMathJsChain; - + /** * Inverse the sign of a value, apply a unary minus operation. * For matrices, the function is evaluated element wise. Boolean values and strings will be converted to a number. For complex numbers, both real and complex value are inverted. */ unaryMinus(): IMathJsChain; - + /** * Unary plus operation. Boolean values and strings will be converted to a number, numeric values will be returned as is. * For matrices, the function is evaluated element wise. */ unaryPlus(): IMathJsChain; - + /** * Calculate the extended greatest common divisor for two values. See http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm. */ xgcd(b: number|BigNumber): IMathJsChain; - + /** * Bitwise AND two values, x & y. For matrices, the function is evaluated element wise. */ bitAnd(y: number|BigNumber|MathArray|Matrix): IMathJsChain; - + /** * Bitwise NOT value, ~x. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. */ bitNot(): IMathJsChain; - + /** * Bitwise OR two values, x | y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the lowest print base. */ bitOr(): IMathJsChain; - + /** * Bitwise XOR two values, x ^ y. For matrices, the function is evaluated element wise. */ bitXor(y: number|BigNumber|MathArray|Matrix): IMathJsChain; - + /** * Bitwise left logical shift of a value x by y number of bits, x << y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ leftShift(y: number|BigNumber): IMathJsChain; - + /** * Bitwise right arithmetic shift of a value x by y number of bits, x >> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ rightArithShift(y: number|BigNumber): IMathJsChain; - + /** * Bitwise right logical shift of value x by y number of bits, x >>> y. For matrices, the function is evaluated element wise. For units, the function is evaluated on the best prefix base. * @param x Value to be shifted * @param y Amount of shifts */ rightLogShift(y: number): IMathJsChain; - + /** * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. bellNumbers only takes integer arguments. The following condition must be enforced: n >= 0 * @param n Total number of objects in the set */ bellNumbers(): IMathJsChain; - + /** * The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0 * @pararm n nth Catalan number */ catalan(): IMathJsChain; - + /** * The composition counts of n into k parts. Composition only takes integer arguments. The following condition must be enforced: k <= n. * @param n Total number of objects in the set @@ -1659,7 +1728,7 @@ declare module mathjs { * @returns Returns the composition counts of n into k parts. */ composition(k: Number|BigNumber): IMathJsChain; - + /** * The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n. * If n = k or k = 1, then s(n,k) = 1 @@ -1667,21 +1736,21 @@ declare module mathjs { * @param k Number of objects in the subset */ stirlingS2(k: Number|BigNumber): IMathJsChain; - + /** * Compute the argument of a complex value. For a complex number a + bi, the argument is computed as atan2(b, a). For matrices, the function is evaluated element wise. * @param x A complex number or array with complex numbers */ arg(): IMathJsChain; - + /** * Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate of x is a - bi. For matrices, the function is evaluated element wise. * @param x A complex number or array with complex numbers */ conj(): IMathJsChain; - - /** - * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. + + /** + * Get the imaginary part of a complex number. For a complex number a + bi, the function returns b. * For matrices, the function is evaluated element wise. */ im(): IMathJsChain; @@ -1691,18 +1760,18 @@ declare module mathjs { * For matrices, the function is evaluated element wise. */ re(): IMathJsChain; - + /** - * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point - * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When - * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric + * Calculates: The eucledian distance between two points in 2 and 3 dimensional spaces. Distance between point + * and a line in 2 and 3 dimensional spaces. Pairwise distance between a set of 2D or 3D points NOTE: When + * substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c For parametric * equation of a 3D line, x0, y0, z0, a, b, c are from: (x−x0, y−y0, z−z0) = t(a, b, c) */ distance(y: MathArray|Matrix|any): IMathJsChain; - + /** - * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in - * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions + * Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in + * three dimensions. The inputs are in the form of arrays or 1 dimensional matrices. The line intersection functions * return null if the lines do not meet. * Note: Fill the plane coefficients as x + y + z = c and not as x + y + z + c = 0. * @param w Co-ordinates of first end-point of first line @@ -1712,39 +1781,39 @@ declare module mathjs { * @returns Returns the point of intersection of lines/lines-planes */ intersect(x: MathArray|Matrix, y: MathArray|Matrix, z: MathArray|Matrix): IMathJsChain; - + /** * Logical and. Test whether two values are both defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ and(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; - + /** * Logical not. Flips boolean value of a given parameter. For matrices, the function is evaluated element wise. */ not(): IMathJsChain; - + /** * Logical or. Test if at least one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ or(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; - + /** * Logical xor. Test whether one and only one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise. */ xor(y: number|BigNumber|Complex|Unit|MathArray|Matrix): IMathJsChain; - + /** - * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] + * Calculate the cross product for two vectors in three dimensional space. The cross product of A = [a1, a2, a3] * and B =[b1, b2, b3] is defined as: * cross(A, B) = [ a2 * b3 - a3 * b2, a3 * b1 - a1 * b3, a1 * b2 - a2 * b1 ] */ cross(y: MathArray|Matrix): IMathJsChain; - + /** * Calculate the determinant of a matrix. */ det(): IMathJsChain; - + /** * Resize a matrix * @param x Matrix to be resized @@ -1752,17 +1821,17 @@ declare module mathjs { * @param defaultValue Zero by default, except in case of a string, in that case defaultValue = ' ' Default value: 0. */ resize(size: MathArray|Matrix, defaultValue?: number|string): IMathJsChain; - + /** * Calculate the size of a matrix or scalar. */ size(): IMathJsChain; - + /** * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix. */ squeeze(): IMathJsChain; - + /** * Get or set a subset of a matrix or string. * @param value An array, matrix, or string @@ -1771,189 +1840,189 @@ declare module mathjs { * @param defaultValue Default value, filled in on new entries when the matrix is resized. If not provided, math.matrix elements will be left undefined. Default value: undefined. */ subset(index: Index, replacement?: any, defaultValue?: any): IMathJsChain; - + /** * Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix. */ trace(): IMathJsChain; - + /** * Transpose a matrix. All values of the matrix are reflected over its main diagonal. Only two dimensional matrices are supported. */ transpose(): IMathJsChain; - + /** * Random pick a value from a one dimensional array. Array element is picked using a random function with uniform distribution. */ pickRandom(): IMathJsChain; - + /** * Return a random number larger or equal to min and smaller than max using a uniform distribution. */ random(): IMathJsChain; random(max?: number): IMathJsChain; random(min:number, max: number): IMathJsChain; - + /** * Return a random integer number larger or equal to min and smaller than max using a uniform distribution. */ randomInt(max?: number): IMathJsChain; randomInt(min:number, max: number): IMathJsChain; - + /** * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y. - * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. + * x and y are considered equal when the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. * For matrices, the function is evaluated element wise. */ compare(y: MathType): IMathJsChain; - + /** * Test element wise whether two matrices are equal. The function accepts both matrices and scalar values. */ deepEqual(y: MathType): IMathJsChain; - + /** * Test whether two values are equal. - * - * The function tests whether the relative difference between x and y is smaller than the configured epsilon. + * + * The function tests whether the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * + * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must equal y.re, and x.im must equal y.im. - * + * * Values null and undefined are compared strictly, thus null is only equal to null and nothing else, and undefined is only equal to undefined and nothing else. */ equal(y: MathType): IMathJsChain; - + /** * Test whether value x is larger than y. - * - * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. + * + * The function returns true when x is larger than y and the relative difference between x and y is larger than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * + * * For matrices, the function is evaluated element wise. */ larger(y: MathType): IMathJsChain; - + /** * Test whether value x is larger or equal to y. - * - * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. + * + * The function returns true when x is larger than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * + * * For matrices, the function is evaluated element wise. */ largerEq(y: MathType): IMathJsChain; - + /** * Test whether value x is smaller than y. - * - * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. + * + * The function returns true when x is smaller than y and the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. - * + * * For matrices, the function is evaluated element wise. */ smaller(IMathJsChainy: MathType): IMathJsChain; - + /** * Test whether value x is smaller or equal to y. - * - * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. + * + * The function returns true when x is smaller than y or the relative difference between x and y is smaller than the configured epsilon. * The function cannot be used to compare values smaller than approximately 2.22e-16. For matrices, the function is evaluated element wise. */ smallerEq(IMathJsChainy: MathType): IMathJsChain; - + /** * Test whether two values are unequal. - * - * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot + * + * The function tests whether the relative difference between x and y is larger than the configured epsilon. The function cannot * be used to compare values smaller than approximately 2.22e-16. - * + * * For matrices, the function is evaluated element wise. In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im. - * - * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with + * + * Values null and undefined are compared strictly, thus null is unequal with everything except null, and undefined is unequal with * everying except. undefined. */ unequal(IMathJsChainy: MathType): IMathJsChain; - + /** - * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list with values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ max(dim?: number): IMathJsChain; - + /** - * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be + * Compute the mean value of matrix or a list with values. In case of a multi dimensional array, the mean of the flattened array will be * calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ mean(dim?: number): IMathJsChain; - + /** - * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an + * Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an * even number of values, the average of the two middle values is returned. Supported types of values are: Number, BigNumber, Unit - * + * * In case of a (multi dimensional) array or matrix, the median of all elements will be calculated. */ median(): IMathJsChain; - + /** - * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened + * Compute the maximum value of a matrix or a list of values. In case of a multi dimensional array, the maximum of the flattened * array will be calculated. When dim is provided, the maximum over the selected dimension will be calculated. Parameter dim is zero-based. */ min(dim?: number): IMathJsChain; - + /** * Computes the mode of a set of numbers or a list with values(numbers or characters). If there are more than one modes, it returns a list of those values. */ mode(): IMathJsChain; - + /** * Compute the product of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. */ prod(): IMathJsChain; - + /** - * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. + * Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. * Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber - * + * * In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated. */ quantileSeq(prob: Number|BigNumber|MathArray, sorted?: boolean): IMathJsChain; - + /** - * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the - * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will + * Compute the standard deviation of a matrix or a list with values. The standard deviations is defined as the square root of the + * variance: std(A) = sqrt(var(A)). In case of a (multi dimensional) array or matrix, the standard deviation over all elements will * be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following + * + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the following * values: - * + * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) */ std(normalization?: string): IMathJsChain; - + /** * Compute the sum of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the sum of all elements will be calculated. */ sum(): IMathJsChain; - + /** - * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all + * Compute the variance of a matrix or a list with values. In case of a (multi dimensional) array or matrix, the variance over all * elements will be calculated. - * - * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the + * + * Optionally, the type of normalization can be specified as second parameter. The parameter normalization can be one of the * following values: - * + * * 'unbiased' (default) The sum of squared errors is divided by (n - 1) * 'uncorrected' The sum of squared errors is divided by n * 'biased' The sum of squared errors is divided by (n + 1) - * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) + * Note that older browser may not like the variable name var. In that case, the function can be called as math['var'](...) * instead of math.var(...). */ var(normalization?: string): IMathJsChain; - + /** * Calculate the inverse cosine of a value. For matrices, the function is evaluated element wise. */ @@ -1964,12 +2033,12 @@ declare module mathjs { * For matrices, the function is evaluated element wise. */ acosh(): IMathJsChain; - + /** * Calculate the inverse cotangent of a value. For matrices, the function is evaluated element wise. */ acot(): IMathJsChain; - + /** * Calculate the hyperbolic arccotangent of a value, defined as acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2. * For matrices, the function is evaluated element wise. @@ -1980,143 +2049,143 @@ declare module mathjs { * Calculate the inverse cosecant of a value. For matrices, the function is evaluated element wise. */ acsc(): IMathJsChain; - + /** * Calculate the hyperbolic arccosecant of a value, defined as acsch(x) = ln(1/x + sqrt(1/x^2 + 1)). * For matrices, the function is evaluated element wise. */ acsch(): IMathJsChain; - + /** * Calculate the inverse secant of a value. For matrices, the function is evaluated element wise. */ asec(): IMathJsChain; - + /** * Calculate the hyperbolic arcsecant of a value, defined as asech(x) = ln(sqrt(1/x^2 - 1) + 1/x). For matrices, the function is evaluated element wise. */ asech(): IMathJsChain; - - /** + + /** * Calculate the inverse sine of a value. For matrices, the function is evaluated element wise. */ asin(): IMathJsChain; - + /** * Calculate the hyperbolic arcsine of a value, defined as asinh(x) = ln(x + sqrt(x^2 + 1)). For matrices, the function is evaluated element wise. */ asinh(): IMathJsChain; - + /** * Calculate the inverse tangent of a value. For matrices, the function is evaluated element wise. */ atan(): IMathJsChain; - + /** - * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the + * Calculate the inverse tangent function with two arguments, y/x. By providing two arguments, the right quadrant of the * computed angle can be determined. - * + * * For matrices, the function is evaluated element wise. */ atan2(x: number): IMathJsChain; atan2(x: MathArray|Matrix): IMathJsChain; - + /** * Calculate the hyperbolic arctangent of a value, defined as atanh(x) = ln((1 + x)/(1 - x)) / 2. * For matrices, the function is evaluated element wise. */ atanh(): IMathJsChain; - + /** * Calculate the cosine of a value. For matrices, the function is evaluated element wise. */ asin(): IMathJsChain; - + /** * Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 * (exp(x) + exp(-x)). For matrices, the function is evaluated element wise. */ cosh(): IMathJsChain; - + /** * Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x). For matrices, the function is evaluated element wise. */ cot(): IMathJsChain; - + /** * Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x). For matrices, the function is evaluated element wise. */ coth(): IMathJsChain; - + /** * Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). For matrices, the function is evaluated element wise. */ csc(): IMathJsChain; - + /** * Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x). For matrices, the function is evaluated element wise. */ csch(): IMathJsChain; - + /** * Calculate the secant of a value, defined as sec(x) = 1/cos(x). For matrices, the function is evaluated element wise. */ sec(): IMathJsChain; - + /** * Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x). For matrices, the function is evaluated element wise. */ sech(): IMathJsChain; - + /** * Calculate the sine of a value. For matrices, the function is evaluated element wise. */ sin(): IMathJsChain; - + /** * Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)). For matrices, the function is evaluated element wise. */ sinh(): IMathJsChain; - + /** * Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x). For matrices, the function is evaluated element wise. */ tan(): IMathJsChain; - + /** * Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1). For matrices, the function is evaluated element wise. */ tanh(): IMathJsChain; - + /** * Change the unit of a value. For matrices, the function is evaluated element wise. * @param x The unit to be converted. * @param unit New unit. Can be a string like "cm" or a unit without value. */ to(unit: Unit|string): IMathJsChain; - + /** * Clone an object. */ clone(): IMathJsChain; - + /** * Filter the items in an array or one dimensional matrix. * @param x A one dimensional matrix or array to filter - * @param test + * @param test */ filter(test: RegExp|((item: any)=>boolean)): IMathJsChain; - + /** * Format a value of any type into a string. */ format(options?: IFormatOptions|number|((item: any)=>string)): IMathJsChain; - + /** * Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array. * @param callback The callback method is invoked with three parameters: the value of the element, the index of the element, and the matrix being traversed. */ map(callback: (item: any)=>any): IMathJsChain; - + /** * Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect. * @param k The kth smallest value to be retrieved; zero-based index @@ -2124,15 +2193,15 @@ declare module mathjs { * @returns Returns the kth lowest value. */ partitionSelect(k: number, compare?: string|((a: any, b: any)=>number)): IMathJsChain; - + /** * Sort the items in a matrix. * @param compare An optional comparator function. The function is called as compare(a, b), and must return 1 when a > b, -1 when a < b, and 0 when a == b. Default value: 'asc'. */ sort(compare?: string|((a: any, b: any)=>number)): IMathJsChain; - + done(): any; valueOf(): any; toString(): string; } -} \ No newline at end of file +} From 79c2ead09a395f5273d55e104e1293586a4b7914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20R=C3=B8nn-Jensen?= Date: Thu, 19 Nov 2015 10:58:57 +0100 Subject: [PATCH 003/113] Fixing last errors, but had to comment out an example from mathjs the example is mathjs.expression.node I couldnt find any explanation in examples --- mathjs/mathjs-tests.ts | 27 ++++++++++++++------------- mathjs/mathjs.d.ts | 7 +++++-- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/mathjs/mathjs-tests.ts b/mathjs/mathjs-tests.ts index 1691e03c2..0545ca9d0 100644 --- a/mathjs/mathjs-tests.ts +++ b/mathjs/mathjs-tests.ts @@ -608,7 +608,8 @@ console.log('Traverse the expression tree of expression "3 * x + 2"'); var node1 = math.parse('3 * x + 2'); node1.traverse(function (node, path, parent) { switch (node.type) { - case 'OperatorNode': console.log(node.type, node.op); break; + // case 'OperatorNode': console.log(node.type, node.op); break; + case 'OperatorNode': console.log(node.type); break;//for now removing .op case 'ConstantNode': console.log(node.type, node.value); break; case 'SymbolNode': console.log(node.type, node.name); break; default: console.log(node.type); @@ -623,17 +624,17 @@ node1.traverse(function (node, path, parent) { // transform an expression tree -console.log(); -console.log('Replace all symbol nodes "x" in expression "x^2 + 5*x" with a constant 3'); -var node2 = math.parse('x^2 + 5*x'); -var transformed = node2.transform(function (node, path, parent) { - if (node.isSymbolNode && node.name == 'x') { - return new math.expression.node.ConstantNode(3); - } - else { - return node; - } -}); -console.log(transformed.toString()); +// console.log(); +// console.log('Replace all symbol nodes "x" in expression "x^2 + 5*x" with a constant 3'); +// var node2 = math.parse('x^2 + 5*x'); +// var transformed = node2.transform(function (node, path, parent) { +// if (node.isSymbolNode && node.name == 'x') { +// return new math.expression.node.ConstantNode(3); +// } +// else { +// return node; +// } +// }); +// console.log(transformed.toString()); // outputs: '(3 ^ 2) + (5 * 3)' }()); diff --git a/mathjs/mathjs.d.ts b/mathjs/mathjs.d.ts index 01742bf67..9652117c5 100644 --- a/mathjs/mathjs.d.ts +++ b/mathjs/mathjs.d.ts @@ -19,6 +19,8 @@ declare module mathjs { config(options: any): void; + expression: MathNode; + /** * Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix. * @param L A N x N matrix or array (L) @@ -1320,9 +1322,10 @@ declare module mathjs { isSymbolNode: boolean; type: string; name: string; + value: any; - compile(): EvalFunction; - eval(): any; + compile(): EvalFunction; + eval(): any; eval(expr: string): any; /** * From de36bab90b8d23ae1bf562d8ea8579dca8d5d208 Mon Sep 17 00:00:00 2001 From: aba Date: Mon, 11 Jan 2016 08:07:53 +0100 Subject: [PATCH 004/113] I made some changes according to the version 3.12.1. I add some methods that I currently use. Of course it miss a lot of work to be exaustive but I will continue to work on it during the next monthes. --- openlayers/openlayers.d.ts | 271 +++++++++++++++++++++++++++++++------ 1 file changed, 229 insertions(+), 42 deletions(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index c81a42084..09a6e3397 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -129,15 +129,30 @@ declare module olx { interface TileWMSOptions { + attributions?: Array; + + /**WMS request parameters. At least a LAYERS param is required. STYLES is '' by default. VERSION is 1.3.0 by default. WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically. Required.*/ + params: Object; + /**The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.*/ + crossOrigin?: string; + /** The size in pixels of the gutter around image tiles to ignore. By setting this property to a non-zero value, images will be requested that are wider and taller than the tile size by a value of 2 x gutter. Defaults to zero. Using a non-zero value allows artifacts of rendering at tile edges to be ignored. If you control the WMS service it is recommended to address "artifacts at tile edges" issues by properly configuring the WMS service. For example, MapServer has a tile_map_edge_buffer configuration parameter for this. See http://mapserver.org/output/tile_mode.html. */ gutter?: number; + /** Use the ol.Map#pixelRatio value when requesting the image from the remote server. Default is true.*/ + hidpi?: boolean; + + logo?: string | olx.LogoOptions; + /** Tile grid. Base this on the resolutions, tilesize and extent supported by the server. If this is not defined, a default grid will be used: if there is a projection extent, the grid will be based on that; if not, a grid based on a global extent with origin at 0,0 will be used. */ tileGrid?: ol.tilegrid.TileGrid; /** experimental Maximum zoom. */ maxZoom?: number; + projection?: ol.proj.ProjectionLike; + reprojectionErrorThreshold?: number; + /** experimental Optional function to load a tile given a URL. */ tileLoadFunction?: ol.TileLoadFunctionType; @@ -515,37 +530,47 @@ declare module olx { zoomDelta?: number; zoomDuration?: number; } + interface ModifyOptions { + deleteCondition?: ol.events.ConditionType; + pixelTolerance?: number; + style?: ol.style.Style | Array | ol.style.StyleFunction; + features: ol.Collection; + wrapX?: boolean; + } + interface DrawOptions { + clickTolerance?: number; + features?: ol.Collection; + source?: ol.source.Vector; + snapTolerance?: number; + type: ol.geom.GeometryType; + maxPoints?: number; + minPoints?: number; + style?: ol.style.Style | Array | ol.style.StyleFunction; + geometryFunction?: ol.interaction.DrawGeometryFunctionType; + wrapX?: boolean; + } + interface SelectOptions{ + addCondition?: ol.events.ConditionType; + condition?: ol.events.ConditionType; + layers?: Array; + style?: ol.style.Style | Array | ol.style.StyleFunction; + removeCondition?: ol.events.ConditionType; + toggleCondition?: ol.events.ConditionType; + multi?: boolean; + features?: ol.Collection + filter?: ol.interaction.SelectFilterFunction; + wrapX?: boolean; + } } module layer { interface BaseOptions { - - /** - * Brightness. Default is 0. - */ - brightness?: number; - - /** - * Contrast. Default is 1. - */ - contrast?: number; - - /** - * Hue. Default is 0. - */ - hue?: number; - /** * Opacity (0, 1). Default is 1. */ opacity?: number; - /** - * Saturation. Default is 1. - */ - saturation?: number; - /** * Visibility. Default is true. */ @@ -555,7 +580,8 @@ declare module olx { * The bounding extent for layer rendering. The layer will not be rendered outside of this extent. */ extent?: ol.Extent; - + + zIndex?: number; /** * The minimum resolution (inclusive) at which this layer will be visible. */ @@ -722,6 +748,28 @@ declare module olx { */ wrapX?: boolean; } + interface WMTSOptions{ + attributions?: Array; + crossOrigin?: string; + logo?: string | olx.LogoOptions; + tileGrid: ol.tilegrid.WMTS; // REQUIRED ! + projection?: ol.proj.ProjectionLike; + reprojectionErrorThreshold?: number; + requestEncoding?: ol.source.WMTSRequestEncoding; + layer: string; //REQUIRED + style: string; //REQUIRED + tileClass?: Function; + tilePixelRatio?: number; + version?: string; + format?: string; + matrixSet: string; //REQUIRED + dimensions?: Object; + url?: string; + maxZoom?: number; + tileLoadFunction?: ol.TileLoadFunctionType; + urls?: Array; + wrapX: boolean; + } } module style { @@ -751,6 +799,38 @@ declare module olx { fill?: ol.style.Fill; stroke?: ol.style.Stroke; } + interface StrokeOptions { + color?: ol.Color | string; + lineCap?: string; + lineJoin?: string; + lineDash?: Array; + miterLimit?: number; + width?: number; + } + interface IconOptions { + anchor?: Array; + anchorOrigin?: string; + anchorXUnits?: string; + anchorYUnits?: string; + crossOrigin?: string; + img?: ol.Image | HTMLCanvasElement; + offset?: Array; + offsetOrigin?: string; + opacity?: number; + scale?: number; + snapToPixel?: boolean; + rotateWithView?: boolean; + rotation?: number; + size?: ol.Size; + imgSize?: ol.Size; + src?: string; + } + interface CircleOptions { + fill?: ol.style.Fill; + radius: number; + snapToPixel?: boolean; + stroke?: ol.style.Stroke; + } } module tilegrid { @@ -1197,18 +1277,12 @@ declare module ol { * @param name The property name of the default geometry. */ setGeometryName(name: string): void; - + /** * Set the feature id. The feature id is considered stable and may be used when requesting features or comparing identifiers returned from a remote source. The feature id can be used with the ol.source.Vector#getFeatureById method. * @param id The feature id. */ - setId(id: number): void; - - /** - * Set the feature id. The feature id is considered stable and may be used when requesting features or comparing identifiers returned from a remote source. The feature id can be used with the ol.source.Vector#getFeatureById method. - * @param id The feature id. - */ - setId(id: string): void; + setId(id: string|number): void; /** * Set the style for the feature. This can be a single style object, an array of styles, or a function that takes a resolution and returns an array of styles. If it is null the feature has no style (a null style). @@ -2399,7 +2473,21 @@ declare module ol { module events { module condition { + function altKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function altShiftKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function always(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function click(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function doubleClick(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function mouseOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function never(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function noModifierKeys(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function platformModifierKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function pointerMove(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function shiftKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function singleClick(mapBrowserEvent: ol.MapBrowserEvent): boolean; + function targetNotEditable(mapBrowserEvent: ol.MapBrowserEvent): boolean; } + interface ConditionType { (mapBrowseEvent: ol.MapBrowserEvent): boolean; } } module extent { @@ -2711,6 +2799,7 @@ declare module ol { } class WFS { + readFeatures(source: Document | Node | Object | string, option?: olx.format.ReadOptions): Array; } class WKT { @@ -2789,6 +2878,17 @@ declare module ol { * @returns Extent */ getExtent(extent?: ol.Extent): ol.Extent; + + /** + * Transform each coordinate of the geometry from one coordinate reference system to another. + * The geometry is modified in place. For example, a line will be transformed to a line and a + * circle to a circle. If you do not want the geometry modified in place, first clone() it and + * then use this function on the clone. + * @param source The current projection. Can be a string identifier or a ol.proj.Projection object. + * @param destination The desired projection. Can be a string identifier or a ol.proj.Projection object. + * @return This geometry. Note that original geometry is modified in place. + */ + transform(source: ol.proj.ProjectionLike, destination: ol.proj.ProjectionLike); } /** @@ -3407,13 +3507,14 @@ declare module ol { class DragZoom { } - class Draw { + class Draw extends ol.interaction.Pointer { + constructor(opt_options?: olx.interaction.DrawOptions) } class DrawEvent { } - class Interaction { + class Interaction extends ol.Object { } class KeyboardPan { @@ -3422,7 +3523,8 @@ declare module ol { class KeyboardZoom { } - class Modify { + class Modify extends ol.interaction.Pointer { + constructor(opt_options?: olx.interaction.ModifyOptions) } class MouseWheelZoom { @@ -3434,16 +3536,21 @@ declare module ol { class PinchZoom { } - class Pointer { + class Pointer extends ol.interaction.Interaction { } - class Select { + class Select extends ol.interaction.Interaction { + constructor(opt_options?: olx.interaction.SelectOptions); + getLayer(): ol.layer.Layer; + getFeatures(): ol.Collection; } class Snap { } function defaults(opts: olx.interaction.DefaultsOptions): ol.Collection; + interface DrawGeometryFunctionType { (coordinates: ol.Coordinate, geom?: ol.geom.Geometry): ol.geom.Geometry;} + interface SelectFilterFunction { (feature: ol.Feature | ol.render.Feature, layer: ol.layer.Layer):boolean;} } module layer { @@ -3774,6 +3881,15 @@ declare module ol { * @param Layer style */ setStyle(style: ol.style.StyleFunction): void; + + /** + * Sets the layer to be rendered on top of other layers on a map. The map will not manage this layer + * in its layers collection, and the callback in ol.Map#forEachLayerAtPixel will receive null as + * layer. This is useful for temporary layers. To remove an unmanaged layer from the map, use #setMap(null). + * To add the layer to a map and have it managed by the map, use ol.Map#addLayer instead. + * @argument map. + */ + setMap(map: ol.Map): void; } } @@ -3898,7 +4014,13 @@ declare module ol { class VectorContext { } - + class Feature{ + get(key: string): any; + getExtent(): ol.Extent; + getGeometry(): ol.geom.Geometry; + getProperties: Object[]; + getType(): ol.geom.GeometryType; + } module canvas { class Immediate { } @@ -3978,19 +4100,45 @@ declare module ol { class Vector { constructor(opts: olx.source.VectorOptions) - + /** + * Add a single feature to the source. If you want to add a batch of features at once, + * call source.addFeatures() instead. + */ + addFeature(feature: ol.Feature); + + /** + * Add a batch of features to the source. + */ + addFeatures(features: ol.Feature[]); + + /** + * Remove all features from the source. + * @param Skip dispatching of removefeature events. + */ + clear(fast?: boolean); /** * Get the extent of the features currently in the source. */ getExtent(): ol.Extent; - + + /** + * Get all features in the provided extent. Note that this returns all features whose bounding boxes + * intersect the given extent (so it may include features whose geometries do not intersect the extent). + * This method is not available when the source is configured with useSpatialIndex set to false. + */ getFeaturesInExtent(extent: ol.Extent): ol.Feature[]; + + /** + * Get all features on the source + */ + getFeatures(): ol.Feature[]; } class VectorEvent { } class WMTS { + constructor(options: olx.source.WMTSOptions); } class XYZ { @@ -4014,7 +4162,8 @@ declare module ol { class AtlasManager { } - class Circle { + class Circle extends Image{ + constructor(opt_options?: olx.style.CircleOptions); } /** @@ -4034,10 +4183,20 @@ declare module ol { getChecksum(): string; } - class Icon { + class Icon extends Image { + constructor(option: olx.style.IconOptions) } class Image { + getOpacity(): number; + getRotateWithView(): boolean; + getRotation(): number; + getScale(): number; + getSnapToPiexl(): boolean; + + setOpacity(opacity: number); + setRotation(rotation: number); + setScale(scale: number); } interface GeometryFunction { @@ -4048,7 +4207,19 @@ declare module ol { } class Stroke { - constructor(); + constructor(opts?: olx.style.StrokeOptions); + getColor(): ol.Color|string; + getLineCap(): string; + getLineDash(): number[]; + getLineJoin(): string; + getMitterLimit(): number; + getWidth(): number; + setColor(color: ol.Color|string); + setLineCap(lineCap: string); + setLineDash(lineDash: number[]); + setLineJoin(lineJoin: string); + setMiterLimit(miterLimit: number); + setWidth(width: number); } /** @@ -4058,6 +4229,22 @@ declare module ol { */ class Style { constructor(opts: olx.style.StyleOptions); + + getFill(): ol.style.Fill; + /*** + * Get the geometry to be rendered. + * @return Feature property or geometry or function that returns the geometry that will + * be rendered with this style. + */ + getGeometry(): string | ol.geom.Geometry | ol.style.GeometryFunction; + getGeometryFunction(): ol.style.GeometryFunction; + getImage(): ol.style.Image; + getStroke(): ol.style.Stroke; + getText(): ol.style.Text; + getZIndex(): number; + + setGeometry(geometry: string | ol.geom.Geometry | ol.style.GeometryFunction); + setZIndex( zIndex: number); } /** @@ -4346,7 +4533,7 @@ declare module ol { /** * Implementation based on the code of OpenLayers, no documentation available (yet). If it is incorrect, please create an issue and I will change it. */ - interface FeatureLoader { (extent: ol.Extent, number: number, projection: ol.proj.Projection): Array } + interface FeatureLoader { (extent: ol.Extent, number: number, projection: ol.proj.Projection): string } /** * A function that returns a style given a resolution. The this keyword inside the function references the ol.Feature to be styled. From b779873b3f98b30e42d68d837a6533f4c4a7a882 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Tue, 12 Jan 2016 16:24:28 -0500 Subject: [PATCH 005/113] Expanding Chartist Type Definitions --- chartist/chartist-tests.ts | 19 +++++++++++++++++++ chartist/chartist.d.ts | 26 ++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/chartist/chartist-tests.ts b/chartist/chartist-tests.ts index 0a5072c6a..6d44922ac 100644 --- a/chartist/chartist-tests.ts +++ b/chartist/chartist-tests.ts @@ -168,3 +168,22 @@ new Chartist.Bar('.ct-chart', { seriesBarDistance: 15 }] ]); + +new Chartist.Pie('.ct-chart', { + series: [{ + value: 20, + name: 'Series 1', + className: 'my-custom-class-one', + meta: 'Meta One' + }, { + value: 10, + name: 'Series 2', + className: 'my-custom-class-two', + meta: 'Meta Two' + }, { + value: 70, + name: 'Series 3', + className: 'my-custom-class-three', + meta: 'Meta Three' + }] +}); \ No newline at end of file diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index 9381aaff0..4c0e787b8 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -18,9 +18,25 @@ declare module Chartist { 1: T; } + // data formats are not well documented on all the ways they can be passed to the constructors + // this definition gives some intellisense, but does not protect the user from misuse + // TODO: come in and tidy this up and make it fit better + interface IChartistData { + labels?: Array; + series: Array | Array | Array>; + } + + interface IChartistSeriesData { + name: string; + value?: number; + data?: Array; + className?: string; + meta?: string; // I assume this could probably be a number as well? + } + interface IChartistBase { container: any; - data: Object; + data: IChartistData; defaultOptions: T; options: T; responsiveOptions: Array>; @@ -55,15 +71,15 @@ declare module Chartist { } interface IChartistPieChart extends IChartistBase { - new (target: any, data: Object, options?: IPieChartOptions, responsiveOptions?: Array>): IChartistPieChart; + new (target: any, data: IChartistData, options?: IPieChartOptions, responsiveOptions?: Array>): IChartistPieChart; } interface IChartistLineChart extends IChartistBase { - new (target: any, data: Object, options?: ILineChartOptions, responsiveOptions?: Array>): IChartistLineChart; + new (target: any, data: IChartistData, options?: ILineChartOptions, responsiveOptions?: Array>): IChartistLineChart; } interface IChartistBarChart extends IChartistBase { - new (target: any, data: Object, options?: IBarChartOptions, responsiveOptions?: Array>): IChartistBarChart; + new (target: any, data: IChartistData, options?: IBarChartOptions, responsiveOptions?: Array>): IChartistBarChart; } interface IChartOptions { @@ -163,6 +179,7 @@ declare module Chartist { height?: number | string; high?: number; low?: number; + ticks?: Array; onlyInteger?: boolean; chartPadding?: IChartPadding; seriesBarDistance?: number; @@ -217,6 +234,7 @@ declare module Chartist { lineSmooth?: boolean; low?: number; high?: number; + ticks?: Array; chartPadding?: IChartPadding; fullWidth?: boolean; reverseData?: boolean; From 9867eb1aa42f4ec603fd4bf208ff785c9fe23a28 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Thu, 14 Jan 2016 11:13:35 -0500 Subject: [PATCH 006/113] Updating Chartist Axis types There are three different types of Axes for line charts that project their properties onto the axis type. I am trying to emulate that here. If you specifically declare a LineChartAxis, then you MUST attach the axis type. The library lets you play a little fast and loose with this, but because we're going for some compile-time checks, the typing file is going to enforce being specific. --- chartist/chartist-tests.ts | 231 ++++++++++++++++++++++++------------- chartist/chartist.d.ts | 43 +++++-- 2 files changed, 187 insertions(+), 87 deletions(-) diff --git a/chartist/chartist-tests.ts b/chartist/chartist-tests.ts index 6d44922ac..797dc8bd5 100644 --- a/chartist/chartist-tests.ts +++ b/chartist/chartist-tests.ts @@ -8,26 +8,26 @@ new Chartist.Line('.ct-chart', { [1, 3, 4, 5, 6] ] }, { - fullWidth: true, - chartPadding: { - right: 40 - } -}); + fullWidth: true, + chartPadding: { + right: 40 + } + }); var lineChart = new Chartist.Line('.ct-chart', { labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], series: [ [5, 5, 10, 8, 7, 5, 4, null, null, null, 10, 10, 7, 8, 6, 9], [10, 15, null, 12, null, 10, 12, 15, null, null, 12, null, 14, null, null, null], - [null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null] + [null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null] ] }, { - fullWidth: true, - chartPadding: { - right: 10 - }, - low: 0 -}); + fullWidth: true, + chartPadding: { + right: 10 + }, + low: 0 + }); new Chartist.Line('.ct-chart', { labels: ['1', '2', '3', '4', '5', '6'], @@ -47,10 +47,10 @@ var data = { series: [5, 3, 4] }; -var sum = function(a: number, b: number) { return a + b }; +var sum = (a: number, b: number) => { return a + b }; new Chartist.Pie('.ct-chart', data, { - labelInterpolationFnc: function(value: number) { + labelInterpolationFnc: (value: number) => { return Math.round(value / data.series.reduce(sum) * 100) + '%'; } }); @@ -58,26 +58,24 @@ new Chartist.Pie('.ct-chart', data, { new Chartist.Pie('.ct-chart', { series: [20, 10, 30, 40] }, { - donut: true, - donutWidth: 60, - startAngle: 270, - total: 200, - showLabel: false -}); - + donut: true, + donutWidth: 60, + startAngle: 270, + total: 200, + showLabel: false + }); // Animation Donut example - var chart = new Chartist.Pie('.ct-chart', { series: [10, 20, 50, 20, 5, 50, 15], labels: [1, 2, 3, 4, 5, 6, 7] }, { - donut: true, - showLabel: false -}); + donut: true, + showLabel: false + }); chart.on('draw', function(data: any) { - if(data.type === 'slice') { + if (data.type === 'slice') { // Get the total path length in order to use for dash array animation var pathLength = data.element._node.getTotalLength(); @@ -92,7 +90,7 @@ chart.on('draw', function(data: any) { id: 'anim' + data.index, dur: 1000, from: -pathLength + 'px', - to: '0px', + to: '0px', easing: Chartist.Svg.Easing.easeOutQuint, // We need to use `fill: 'freeze'` otherwise our animation will fall back to initial (not visible) fill: 'freeze' @@ -100,7 +98,7 @@ chart.on('draw', function(data: any) { }; // If this was not the first slice, we need to time the animation so that it uses the end sync event of the previous animation - if(data.index !== 0) { + if (data.index !== 0) { animationDefinition['stroke-dashoffset'].begin = 'anim' + (data.index - 1) + '.end'; } @@ -119,8 +117,8 @@ new Chartist.Bar('.ct-chart', { labels: ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'], series: [20, 60, 120, 200, 180, 20, 10] }, { - distributeSeries: true -}); + distributeSeries: true + }); new Chartist.Bar('.ct-chart', { labels: ['Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'], @@ -132,58 +130,135 @@ new Chartist.Bar('.ct-chart', { [4, 1, 2, 1] ] }, { - // Default mobile configuration - stackBars: true, - axisX: { - labelInterpolationFnc: function(value: string) { - return value.split(/\s+/).map(function(word: string) { - return word[0]; - }).join(''); - } - }, - axisY: { - offset: 20 - } -}, [ - // Options override for media > 400px - ['screen and (min-width: 400px)', { - reverseData: true, - horizontalBars: true, + // Default mobile configuration + stackBars: true, axisX: { - labelInterpolationFnc: Chartist.noop + labelInterpolationFnc: function(value: string) { + return value.split(/\s+/).map(function(word: string) { + return word[0]; + }).join(''); + } }, axisY: { - offset: 60 + offset: 20 } - }], - // Options override for media > 800px - ['screen and (min-width: 800px)', { - stackBars: false, - seriesBarDistance: 10 - }], - // Options override for media > 1000px - ['screen and (min-width: 1000px)', { - reverseData: false, - horizontalBars: false, - seriesBarDistance: 15 - }] -]); + }, [ + // Options override for media > 400px + ['screen and (min-width: 400px)', { + reverseData: true, + horizontalBars: true, + axisX: { + labelInterpolationFnc: Chartist.noop + }, + axisY: { + offset: 60 + } + }], + // Options override for media > 800px + ['screen and (min-width: 800px)', { + stackBars: false, + seriesBarDistance: 10 + }], + // Options override for media > 1000px + ['screen and (min-width: 1000px)', { + reverseData: false, + horizontalBars: false, + seriesBarDistance: 15 + }] + ]); new Chartist.Pie('.ct-chart', { - series: [{ - value: 20, - name: 'Series 1', - className: 'my-custom-class-one', - meta: 'Meta One' + series: [{ + value: 20, + name: 'Series 1', + className: 'my-custom-class-one', + meta: 'Meta One' + }, { + value: 10, + name: 'Series 2', + className: 'my-custom-class-two', + meta: 'Meta Two' }, { - value: 10, - name: 'Series 2', - className: 'my-custom-class-two', - meta: 'Meta Two' - }, { - value: 70, - name: 'Series 3', - className: 'my-custom-class-three', - meta: 'Meta Three' - }] -}); \ No newline at end of file + value: 70, + name: 'Series 3', + className: 'my-custom-class-three', + meta: 'Meta Three' + }] +}); + +new Chartist.Bar('.bar-chart', { + labels: ['foo', 'bar', 'foobar'], + series: [ + { + data: [1], + className: 'graph-foo', + }, + { + data: [10], + className: 'graph-foo', + }, + { + data: [12], + className: 'graph-foo', + }] +  }, { + seriesBarDistance: 30, + reverseData: true, + horizontalBars: true, + height: '115px', + axisY: { + offset: 70, + showGrid: false, + }, + axisX: { + scaleMinSpace: 200 + } + }); + +new Chartist.Line('.ct-chart', { + labels: [1, 2, 3, 4, 5, 6, 7, 8], + series: [ + [5, 9, 7, 8, 5, 3, 5, 4] + ] +}, { + ticks: [0, 4], + low: 0, + showArea: true, + axisY: { + showLabel: true, + showGrid: false, + ticks: [1, 4], + type: Chartist.FixedScaleAxis + } + }); + +var chart2 = new Chartist.Line('.ct-chart', { + labels: [1, 2, 3, 4, 5], + series: [ + [12, 9, 7, 8, 5] + ] +}); + +// Listening for draw events that get emitted by the Chartist chart +chart2.on('draw', (data: any) => { + // If the draw event was triggered from drawing a point on the line chart + if (data.type === 'point') { + // We are creating a new path SVG element that draws a triangle around the point coordinates + var triangle = new Chartist.Svg('path', { + d: ['M', + data.x, + data.y - 15, + 'L', + data.x - 15, + data.y + 8, + 'L', + data.x + 15, + data.y + 8, + 'z'].join(' '), + style: 'fill-opacity: 1' + }, 'ct-area'); + + // With data.element we get the Chartist SVG wrapper and we can replace the original point drawn by Chartist with our newly created triangle + data.element.replace(triangle); + } +}); diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index 4c0e787b8..089e87cde 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -9,6 +9,10 @@ declare module Chartist { Bar: IChartistBarChart; Line: IChartistLineChart; + FixedScaleAxis: IFixedScaleAxisStatic; + AutoScaleAxis: IAutoScaleAxisStatic; + StepAxis: IStepAxisStatic; + Svg: any; noop: Function; } @@ -18,16 +22,24 @@ declare module Chartist { 1: T; } + // these have no other purpose than to help define the types that can be placed on + // a line chart axisX + // in the actual chartist library these are classes that project their options onto + // the parent class + interface IFixedScaleAxisStatic { } + interface IAutoScaleAxisStatic { } + interface IStepAxisStatic { } + // data formats are not well documented on all the ways they can be passed to the constructors // this definition gives some intellisense, but does not protect the user from misuse // TODO: come in and tidy this up and make it fit better interface IChartistData { - labels?: Array; - series: Array | Array | Array>; + labels?: Array | Array; + series: Array | Array | Array>; } interface IChartistSeriesData { - name: string; + name?: string; value?: number; data?: Array; className?: string; @@ -223,8 +235,8 @@ declare module Chartist { } interface ILineChartOptions extends IChartOptions { - axisX?: ILineChartXAxis; - axisY?: ILineChartYAxis; + axisX?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis; + axisY?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis; width?: number | string; height?: number | string; showLine?: boolean; @@ -237,7 +249,6 @@ declare module Chartist { ticks?: Array; chartPadding?: IChartPadding; fullWidth?: boolean; - reverseData?: boolean; classNames?: ILineChartClasses; } @@ -251,15 +262,29 @@ declare module Chartist { showLabel?: boolean; showGrid?: boolean; labelInterpolationFnc?: Function; - type?: any; } - interface ILineChartXAxis extends ILineChartAxis { + interface IChartistStepAxis extends ILineChartAxis { + type: IStepAxisStatic; + ticks?: Array | Array; + stretch?: boolean; } - interface ILineChartYAxis extends ILineChartAxis { + interface IChartistFixedScaleAxis extends ILineChartAxis { + type: IFixedScaleAxisStatic; + high?: number; + low?: number; + divisor?: number; + ticks?: Array | Array; + } + + interface IChartistAutoScaleAxis extends ILineChartAxis { + high?: number; + low?: number; scaleMinSpace?: number; onlyInteger?: boolean; + referenceValue?: number; + type: IAutoScaleAxisStatic; } // TODO: Finish documenting all of the defaults From fe08f93533910692fad602cc60c9bb39332779c1 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Thu, 14 Jan 2016 14:52:05 -0500 Subject: [PATCH 007/113] Further expanding Chartist type definitions. --- chartist/chartist-tests.ts | 56 ++++++++++ chartist/chartist.d.ts | 216 +++++++++++++++++++++++++++++++++++-- 2 files changed, 263 insertions(+), 9 deletions(-) diff --git a/chartist/chartist-tests.ts b/chartist/chartist-tests.ts index 797dc8bd5..5c76754f2 100644 --- a/chartist/chartist-tests.ts +++ b/chartist/chartist-tests.ts @@ -1,5 +1,15 @@ /// +Chartist.escapingMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''', +}; + +Chartist.precision = 8; + new Chartist.Line('.ct-chart', { labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], series: [ @@ -262,3 +272,49 @@ chart2.on('draw', (data: any) => { data.element.replace(triangle); } }); + +// Create a simple bi-polar bar chart +var biPolarChart = new Chartist.Bar('.ct-chart', { + labels: ['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10'], + series: [ + [1, 2, 4, 8, 6, -2, -1, -4, -6, -2] + ] +}, { + high: 10, + low: -10, + axisX: { + labelInterpolationFnc: (value: any, index: number) => { + return index % 2 === 0 ? value : null; + } + } + }); + +// Listen for draw events on the bar chart +biPolarChart.on('draw', (data: any) => { + // If this draw event is of type bar we can use the data to create additional content + if (data.type === 'bar') { + // We use the group element of the current series to append a simple circle with the bar peek coordinates and a circle radius that is depending on the value + data.group.append(new Chartist.Svg('circle', { + cx: data.x2, + cy: data.y2, + r: Math.abs(Chartist.getMultiValue(data.value)) * 2 + 5 + }, 'ct-slice-pie')); + } +}); + +new Chartist.Bar('.ct-chart', { + labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], + series: [ + [5, 4, 3, 7, 5, 10, 3], + [3, 2, 9, 5, 4, 6, 4] + ] +}, { + axisX: { + // On the x-axis start means top and end means bottom + position: 'start' + }, + axisY: { + // On the y-axis start means left and end means right + position: 'end' + } + }); diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index 089e87cde..a510032c2 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -4,7 +4,19 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module Chartist { + interface ChartistStatic { + + /** + * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number. + */ + precision: number; + + /** + * A map with characters to escape for strings to be safely used as attribute values. + */ + escapingMap: IChartistEscapeMap; + Pie: IChartistPieChart; Bar: IChartistBarChart; Line: IChartistLineChart; @@ -13,8 +25,34 @@ declare module Chartist { AutoScaleAxis: IAutoScaleAxisStatic; StepAxis: IStepAxisStatic; - Svg: any; + Svg: ChartistSvgStatic; noop: Function; + + alphaNumerate(n: number): string; + extend(target: Object, sources: Object): Object; + + replaceAll(str: string, subStr: string, newSubStr: string): string; + ensureUnit(value: number, unit: string): string; + quantity(input: string | number): Object; + + query(query: Node | string): Node; + times(length: number): Array; + sum(previous: number, current: number): number; + mapMultiply(factor: number): (num: number) => number; + mapAdd(addend: number): (num: number) => number; + serialMap(arr: Array, cb: Function): Array; + roundWithPrecision(value: number, digits?: number): number; + + getMultiValue(value: any, dimension?: any): number; // this method is not documented, but it is used in the examples + + serialize(data: Object | string | number): string; + deserialize(data: string): Object | string | number; + + createSvg(container: Node, width: string, height: string, className: string): Object; // TODO: Figure out if this is returning a ChartistSVGWrapper or an actual SVGElement + } + + interface IChartistEscapeMap { + [Key: string]: string; } interface IResponsiveOptionTuple extends Array { @@ -34,16 +72,16 @@ declare module Chartist { // this definition gives some intellisense, but does not protect the user from misuse // TODO: come in and tidy this up and make it fit better interface IChartistData { - labels?: Array | Array; - series: Array | Array | Array>; + labels?: Array | Array; + series: Array | Array | Array>; } interface IChartistSeriesData { - name?: string; - value?: number; - data?: Array; - className?: string; - meta?: string; // I assume this could probably be a number as well? + name?: string; + value?: number; + data?: Array; + className?: string; + meta?: string; // I assume this could probably be a number as well? } interface IChartistBase { @@ -287,7 +325,6 @@ declare module Chartist { type: IAutoScaleAxisStatic; } - // TODO: Finish documenting all of the defaults interface ILineChartClasses { /** * Default is 'ct-chart-line' @@ -306,6 +343,167 @@ declare module Chartist { start?: string; end?: string; } + + interface ChartistSvgStatic { + new (name: HTMLElement | string, attributes: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg; + + Easing: ChartistEasingStatic; + + /** + * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list. + */ + isSupported(feature: string): boolean; + } + + interface IChartistSvg { + + /** + * Set attributes on the current SVG element of the wrapper you're currently working on. + */ + attr(attributes: Object | string, ns: string): Object | string; + + /** + * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily. + */ + elem(name: string, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg; + + /** + * Returns the parent Chartist.SVG wrapper object + */ + parent(): IChartistSvg; + + /** + * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree. + */ + root(): IChartistSvg; + + /** + * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper. + */ + querySelector(selector: string): IChartistSvg; + + /** + * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper. + */ + querySelectorAll(selector: string): any; // this returns an svg wrapper list in the docs, need to see if that's just an array or a special list + + /** + * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM. + */ + foreignObject(content: any, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg; + + /** + * This method adds a new text element to the current Chartist.Svg wrapper. + */ + text(t: string): IChartistSvg; + + /** + * This method will clear all child nodes of the current wrapper object. + */ + empty(): IChartistSvg; + + /** + * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure. + */ + remove(): IChartistSvg; + + /** + * This method will replace the element with a new element that can be created outside of the current DOM. + */ + replace(): IChartistSvg; + + /** + * This method will append an element to the current element as a child. + */ + append(): IChartistSvg; + + /** + * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. + */ + classes(): Array; + + /** + * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once. + * + * @method addClass + * @param names {string} A white space separated list of class names + */ + addClass(names: string): IChartistSvg; + + /** + * Removes one or a space separated list of classes from the current element. + * + * @method removeClass + * @param names {string} A white space separated list of class names + */ + removeClass(names: string): IChartistSvg; + + /** + * Removes all classes from the current element. + */ + removeAllClasses(): IChartistSvg; + + /** + * Get element height with fallback to svg BoundingBox or parent container dimensions + */ + height(): number; + + /** + * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. + */ + animate(animations: IChartistAnimations, guided: boolean, eventEmitter: Object): IChartistSvg; + + /** + * "Safe" way to get property value from svg BoundingBox. This is a workaround. Firefox throws an NS_ERROR_FAILURE error if getBBox() is called on an invisible node. + * THIS IS A WORKAROUND + */ + getBBoxProperty(node: SVGElement, prop: string): string; // TODO: find a good example of this and add it to the tests, it might belong to static + } + + interface IChartistAnimations { + [Key: string]: IChartistAnimationOptions; + } + + interface IChartistAnimationOptions { + dur: String | number; + from: number; + to: number; + easing?: IChartistEasingDefinition | string; + } + + interface IChartistEasingDefinition { + 0: number; + 1: number; + 2: number; + 3: number; + } + + interface ChartistEasingStatic { + easeInSine: IChartistEasingDefinition; + easeOutSine: IChartistEasingDefinition; + easeInOutSine: IChartistEasingDefinition; + easeInQuad: IChartistEasingDefinition; + easeOutQuad: IChartistEasingDefinition; + easeInOutQuad: IChartistEasingDefinition; + easeInCubic: IChartistEasingDefinition; + easeOutCubic: IChartistEasingDefinition; + easeInOutCubic: IChartistEasingDefinition; + easeInQuart: IChartistEasingDefinition; + easeOutQuart: IChartistEasingDefinition; + easeInOutQuart: IChartistEasingDefinition; + easeInQuint: IChartistEasingDefinition; + easeOutQuint: IChartistEasingDefinition; + easeInOutQuint: IChartistEasingDefinition; + easeInExpo: IChartistEasingDefinition; + easeOutExpo: IChartistEasingDefinition; + easeInOutExpo: IChartistEasingDefinition; + easeInCirc: IChartistEasingDefinition; + easeOutCirc: IChartistEasingDefinition; + easeInOutCirc: IChartistEasingDefinition; + easeInBack: IChartistEasingDefinition; + easeOutBack: IChartistEasingDefinition; + easeInOutBack: IChartistEasingDefinition; + } } declare var Chartist: Chartist.ChartistStatic; From 2e5f3e2db48a41a1578c15c2685dba7b5c424978 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Thu, 14 Jan 2016 15:10:55 -0500 Subject: [PATCH 008/113] Added Interpolation definitions and tests --- chartist/chartist-tests.ts | 39 ++++++++++++++++++++++++++++++++++++++ chartist/chartist.d.ts | 27 +++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/chartist/chartist-tests.ts b/chartist/chartist-tests.ts index 5c76754f2..36e5a38e1 100644 --- a/chartist/chartist-tests.ts +++ b/chartist/chartist-tests.ts @@ -318,3 +318,42 @@ new Chartist.Bar('.ct-chart', { position: 'end' } }); + +new Chartist.Line('.ct-chart', { + labels: [1, 2, 3, 4, 5], + series: [[1, 2, 8, 1, 7]] +}, { + lineSmooth: Chartist.Interpolation.none({ + fillHoles: false + }) + }); + +new Chartist.Line('.ct-chart', { + labels: [1, 2, 3, 4, 5], + series: [[1, 2, 8, 1, 7]] +}, { + lineSmooth: Chartist.Interpolation.simple({ + divisor: 2, + fillHoles: false + }) + }); + +new Chartist.Line('.ct-chart', { + labels: [1, 2, 3, 4, 5], + series: [[1, 2, 8, 1, 7]] +}, { + lineSmooth: Chartist.Interpolation.cardinal({ + tension: 1, + fillHoles: false + }) + }); + +new Chartist.Line('.ct-chart', { + labels: [1, 2, 3, 4, 5], + series: [[1, 2, 8, 1, 7]] +}, { + lineSmooth: Chartist.Interpolation.step({ + postpone: true, + fillHoles: false + }) + }); diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index a510032c2..6c18e9c96 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -26,6 +26,8 @@ declare module Chartist { StepAxis: IStepAxisStatic; Svg: ChartistSvgStatic; + Interpolation: ChartistInterpolationStatic; + noop: Function; alphaNumerate(n: number): string; @@ -281,7 +283,7 @@ declare module Chartist { showPoint?: boolean; showArea?: boolean; areaBase?: number; - lineSmooth?: boolean; + lineSmooth?: Function | boolean; low?: number; high?: number; ticks?: Array; @@ -504,6 +506,29 @@ declare module Chartist { easeOutBack: IChartistEasingDefinition; easeInOutBack: IChartistEasingDefinition; } + + interface ChartistInterpolationStatic { + + /** + * This interpolation function does not smooth the path and the result is only containing lines and no curves. + */ + none(options?: Object): Function; + + /** + * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing. + */ + simple(options?: Object): Function; + + /** + * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results. + */ + cardinal(options?: Object): Function; + + /** + * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the showPoint option is enabled. + */ + step(options?: Object): Function; + } } declare var Chartist: Chartist.ChartistStatic; From 8bf574716d401491d4b678f1d1a65f24663a3019 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Thu, 14 Jan 2016 15:13:26 -0500 Subject: [PATCH 009/113] Bumping chartist version to 0.9.5 --- chartist/chartist.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index 6c18e9c96..9878e9f70 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chartist v0.9.4 +// Type definitions for Chartist v0.9.5 // Project: https://github.com/gionkunz/chartist-js // Definitions by: Matt Gibbs // Definitions: https://github.com/borisyankov/DefinitelyTyped From 21f5129d25ee0994b7bd0b68cb22ca30c983a9c8 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Thu, 14 Jan 2016 15:20:43 -0500 Subject: [PATCH 010/113] Adding more tests for bar charts --- chartist/chartist-tests.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/chartist/chartist-tests.ts b/chartist/chartist-tests.ts index 36e5a38e1..f62f0a2c5 100644 --- a/chartist/chartist-tests.ts +++ b/chartist/chartist-tests.ts @@ -357,3 +357,28 @@ new Chartist.Line('.ct-chart', { fillHoles: false }) }); + +var overlappingBarsData: Chartist.IChartistData = { + labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + series: [ + [5, 4, 3, 7, 5, 10, 3, 4, 8, 10, 6, 8], + [3, 2, 9, 5, 4, 6, 4, 6, 7, 8, 7, 4] + ] +}; + +var overlappingBarsOptions: Chartist.IBarChartOptions = { + seriesBarDistance: 10 +}; + +var overlappingBarsResponsiveOptions: Array> = [ + ['screen and (max-width: 640px)', { + seriesBarDistance: 5, + axisX: { + labelInterpolationFnc: (value: any) => { + return value[0]; + } + } + }] +]; + +new Chartist.Bar('.ct-chart', overlappingBarsData, overlappingBarsOptions, overlappingBarsResponsiveOptions); From 059319a0338d744146dc91595c63aecafc228910 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Thu, 14 Jan 2016 15:46:42 -0500 Subject: [PATCH 011/113] Defining Chartist Interpolation Options --- chartist/chartist-tests.ts | 8 ++++---- chartist/chartist.d.ts | 33 ++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/chartist/chartist-tests.ts b/chartist/chartist-tests.ts index f62f0a2c5..f4ec32f2a 100644 --- a/chartist/chartist-tests.ts +++ b/chartist/chartist-tests.ts @@ -84,7 +84,7 @@ var chart = new Chartist.Pie('.ct-chart', { showLabel: false }); -chart.on('draw', function(data: any) { +chart.on('draw', (data: any) => { if (data.type === 'slice') { // Get the total path length in order to use for dash array animation var pathLength = data.element._node.getTotalLength(); @@ -95,7 +95,7 @@ chart.on('draw', function(data: any) { }); // Create animation definition while also assigning an ID to the animation for later sync usage - var animationDefinition: any = { + var animationDefinition: Chartist.IChartistAnimations = { 'stroke-dashoffset': { id: 'anim' + data.index, dur: 1000, @@ -143,8 +143,8 @@ new Chartist.Bar('.ct-chart', { // Default mobile configuration stackBars: true, axisX: { - labelInterpolationFnc: function(value: string) { - return value.split(/\s+/).map(function(word: string) { + labelInterpolationFnc: (value: string) => { + return value.split(/\s+/).map((word: string) => { return word[0]; }).join(''); } diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index 9878e9f70..bb0042f4b 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -467,10 +467,13 @@ declare module Chartist { } interface IChartistAnimationOptions { - dur: String | number; - from: number; - to: number; + id?: string; + dur: string | number; + from: string | number; + to: string | number; easing?: IChartistEasingDefinition | string; + fill?: string; + begin?: string; } interface IChartistEasingDefinition { @@ -512,22 +515,38 @@ declare module Chartist { /** * This interpolation function does not smooth the path and the result is only containing lines and no curves. */ - none(options?: Object): Function; + none(options?: IChartistInterpolationOptions): Function; /** * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing. */ - simple(options?: Object): Function; + simple(options?: IChartistSimpleInterpolationOptions): Function; /** * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results. */ - cardinal(options?: Object): Function; + cardinal(options?: IChartistCardinalInterpolationOptions): Function; /** * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the showPoint option is enabled. */ - step(options?: Object): Function; + step(options?: IChartistStepInterpolationOptions): Function; + } + + interface IChartistInterpolationOptions { + fillHoles?: boolean; + } + + interface IChartistSimpleInterpolationOptions extends IChartistInterpolationOptions { + divisor?: number; + } + + interface IChartistCardinalInterpolationOptions extends IChartistInterpolationOptions { + tension?: number; + } + + interface IChartistStepInterpolationOptions extends IChartistInterpolationOptions { + postpone?: boolean; } } From 7edc447a5f1890b2d197ca843c5603c0fec50f0b Mon Sep 17 00:00:00 2001 From: Forrest Peterson Date: Tue, 19 Jan 2016 13:16:43 -0500 Subject: [PATCH 012/113] Change to IChartistData interface in Chartist --- chartist/chartist.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index bb0042f4b..8d63696f6 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -74,7 +74,7 @@ declare module Chartist { // this definition gives some intellisense, but does not protect the user from misuse // TODO: come in and tidy this up and make it fit better interface IChartistData { - labels?: Array | Array; + labels?: Array | Array | Array; series: Array | Array | Array>; } From f9b189a87343fb0e05f2d06d09f9cab11a44cf41 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Tue, 19 Jan 2016 15:32:11 -0500 Subject: [PATCH 013/113] Made 'type' optional to avoid problems with Chartist defaults When forced to define the type, Chartist won't default to all of the other options. So if you just want to do something like not show the grid, you'll end up having to define all of the axis options because of the strict typing that was there before. --- chartist/chartist-tests.ts | 20 ++++++++++++++++++++ chartist/chartist.d.ts | 6 +++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/chartist/chartist-tests.ts b/chartist/chartist-tests.ts index f4ec32f2a..22b10e8b0 100644 --- a/chartist/chartist-tests.ts +++ b/chartist/chartist-tests.ts @@ -242,6 +242,26 @@ new Chartist.Line('.ct-chart', { } }); +new Chartist.Line('.ct-chart', { + labels: [1, 2, 3, 4, 5, 6, 7, 8], + series: [ + [5, 9, 7, 8, 5, 3, 5, 4] + ] +}, { + ticks: [0, 4], + low: 0, + showArea: true, + axisX: { + showGrid: false + }, + axisY: { + showLabel: true, + showGrid: false, + ticks: [1, 4], + type: Chartist.FixedScaleAxis + } + }); + var chart2 = new Chartist.Line('.ct-chart', { labels: [1, 2, 3, 4, 5], series: [ diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index 8d63696f6..a38aa4ce7 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -305,13 +305,13 @@ declare module Chartist { } interface IChartistStepAxis extends ILineChartAxis { - type: IStepAxisStatic; + type?: IStepAxisStatic; ticks?: Array | Array; stretch?: boolean; } interface IChartistFixedScaleAxis extends ILineChartAxis { - type: IFixedScaleAxisStatic; + type?: IFixedScaleAxisStatic; high?: number; low?: number; divisor?: number; @@ -324,7 +324,7 @@ declare module Chartist { scaleMinSpace?: number; onlyInteger?: boolean; referenceValue?: number; - type: IAutoScaleAxisStatic; + type?: IAutoScaleAxisStatic; } interface ILineChartClasses { From e58251a8d3c55dfb12276efea0a3d3eb9238737d Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Tue, 19 Jan 2016 15:42:43 -0500 Subject: [PATCH 014/113] Added an optional member for plugins Just set to Array for now until I have a better understanding of all the possibilities for plugins. --- chartist/chartist.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index a38aa4ce7..d89a0e3bb 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -100,6 +100,8 @@ declare module Chartist { supportsAnimations: boolean; resizeListener: any; + plugins?: Array; // all of these plugins seem to be functions with options, but keeping type any for now + update(data: Object, options?: T, override?: boolean): void; detatch(): void; From 4d99796247d33bc4f287b77f2a280f2cce2cf78c Mon Sep 17 00:00:00 2001 From: Forrest Peterson Date: Thu, 21 Jan 2016 15:45:33 -0500 Subject: [PATCH 015/113] Change to where plugins is --- chartist/chartist.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index d89a0e3bb..169d361db 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -51,6 +51,8 @@ declare module Chartist { deserialize(data: string): Object | string | number; createSvg(container: Node, width: string, height: string, className: string): Object; // TODO: Figure out if this is returning a ChartistSVGWrapper or an actual SVGElement + + plugins: any; } interface IChartistEscapeMap { @@ -141,6 +143,8 @@ declare module Chartist { * If true the whole data is reversed including labels, the series order as well as the whole series data arrays. */ reverseData?: boolean; + + plugins?: Array; } interface IPieChartOptions extends IChartOptions { From 924fabc272bae25af7ebe3bbaa678973580b9029 Mon Sep 17 00:00:00 2001 From: matgr1 Date: Sat, 23 Jan 2016 14:04:34 -0500 Subject: [PATCH 016/113] Update three.d.ts fixed Object3D.modelViewMatrix and Object3D.normalMatrix property definitions --- threejs/three.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index 37804860e..a2323c001 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -1410,9 +1410,9 @@ declare module THREE { */ scale: Vector3; - modelViewMatrix: { value: Matrix4 }; + modelViewMatrix: Matrix4; - normalMatrix: { value: Matrix3 }; + normalMatrix: Matrix3; /** * When this is set, then the rotationMatrix gets calculated every frame. From 3556e7e896b57323b5d1bbd8ba3c824ea7c1fbdb Mon Sep 17 00:00:00 2001 From: Rom Grk Date: Wed, 13 Jan 2016 03:48:28 -0500 Subject: [PATCH 017/113] Update github-electron.d.ts BrowserWindowOptions, WebPreferences, from the doc: https://github.com/atom/electron/blob/master/docs/api/browser-window.md Version is now 0.36.3 Update github-electron.d.ts fix: code style update with: https://github.com/atom/electron/commit/8433d94cacfe251f6351deae893250cbbf4fea9e https://github.com/atom/electron/commit/5567baf33500b5cd7d4026553dc7b26dc1800146 --- github-electron/github-electron.d.ts | 39 ++++++++++++++++------------ 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index a02a1edb6..45160fb02 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1,11 +1,11 @@ -// Type definitions for Electron v0.35.0 +// Type definitions for Electron v0.36.3 // Project: http://electron.atom.io/ // Definitions by: jedmao , rhysd // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare module Electron { +declare module GithubElectron { /** * This class is used to represent an image. */ @@ -51,6 +51,10 @@ declare module Electron { * Marks the image as template image. */ setTemplateImage(option: boolean): void; + /** + * Returns a boolean whether the image is a template image. + */ + isTemplateImage(): boolean; } module Clipboard { @@ -479,6 +483,7 @@ declare module Electron { interface WebPreferences { nodeIntegration?: boolean; preload?: string; + session?: Session; partition?: string; zoomFactor?: number; javascript?: boolean; @@ -492,16 +497,11 @@ declare module Electron { plugins?: boolean; experimentalFeatures?: boolean; experimentalCanvasFeatures?: boolean; - overlayScrollbars?: boolean; - sharedWorker?: boolean; directWrite?: boolean; - pageVisibility?: boolean; + blinkFeatures?: string; } - // Includes all options BrowserWindow can take as of this writing - // http://electron.atom.io/docs/v0.29.0/api/browser-window/ interface BrowserWindowOptions extends Rectangle { - show?: boolean; useContentSize?: boolean; center?: boolean; minWidth?: number; @@ -512,28 +512,23 @@ declare module Electron { alwaysOnTop?: boolean; fullscreen?: boolean; skipTaskbar?: boolean; - zoomFactor?: number; kiosk?: boolean; title?: string; icon?: NativeImage|string; + show?: boolean; frame?: boolean; acceptFirstMouse?: boolean; disableAutoHideCursor?: boolean; autoHideMenuBar?: boolean; enableLargerThanScreen?: boolean; + backgroundColor?: string; darkTheme?: boolean; preload?: string; transparent?: boolean; type?: string; - standardWindow?: boolean; - webPreferences?: WebPreferences; - java?: boolean; - textAreasAreResizable?: boolean; - extraPluginDirs?: string[]; - subpixelFontScaling?: boolean; - overlayFullscreenVideo?: boolean; titleBarStyle?: string; backgroundColor?: string; + webPreferences?: WebPreferences; } interface Rectangle { @@ -1576,6 +1571,17 @@ declare module Electron { * corrupted by active network attackers. */ registerURLSchemeAsSecure(scheme: string): void; + /** + * Inserts text to the focused element. + */ + insertText(text: string): void; + /** + * Evaluates `code` in page. + * In the browser window some HTML APIs like `requestFullScreen` can only be + * invoked by a gesture from the user. Setting `userGesture` to `true` will remove + * this limitation. + */ + executeJavaScript(code: string, userGesture?: boolean): void; } // Type definitions for main process @@ -1798,6 +1804,7 @@ declare module Electron { clearCache(callback: Function): void; clearStorageData(callback: Function): void; clearStorageData(options: ClearStorageDataOptions, callback: Function): void; + flushStorageData(): void; setProxy(config: string, callback: Function): void; resolveProxy(url: URL, callback: (proxy: any) => any): void; setDownloadPath(path: string): void; From fa051132c8617f6d670c22917ad5d14204768058 Mon Sep 17 00:00:00 2001 From: Rom Grk Date: Sat, 23 Jan 2016 17:44:51 -0500 Subject: [PATCH 018/113] Update github-electron.d.ts module GithubElectron > Electron remove duplicate backgroundColor --- github-electron/github-electron.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 45160fb02..899df7a9f 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -5,7 +5,7 @@ /// -declare module GithubElectron { +declare module Electron { /** * This class is used to represent an image. */ @@ -527,7 +527,6 @@ declare module GithubElectron { transparent?: boolean; type?: string; titleBarStyle?: string; - backgroundColor?: string; webPreferences?: WebPreferences; } From 6a64f209b28acd01f94864e23f3ce53cdce71a31 Mon Sep 17 00:00:00 2001 From: Levi Baker Date: Tue, 26 Jan 2016 13:14:06 -0800 Subject: [PATCH 019/113] kendo-ui: Added missing optional parameter to Layout. --- kendo-ui/kendo-ui.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index a39438d6b..89f8d30c8 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -301,7 +301,7 @@ declare module kendo { class Layout extends View { containers: { [selector: string]: ViewContainer; }; - showIn(selector: string, view: View): void; + showIn(selector: string, view: View, transitionClass?: string): void; } class History extends Observable { From 1bc3eb9e71567f1b13ba884a37c7ee525dd20391 Mon Sep 17 00:00:00 2001 From: Levi Baker Date: Tue, 26 Jan 2016 13:25:36 -0800 Subject: [PATCH 020/113] kendo-ui: fix for issue with Typescript 1.7. Allow model schemas to be defined with custom params on the model. ie, kendo.data.Model.define({ foo: function() {} }); --- kendo-ui/kendo-ui.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 89f8d30c8..c11ced16b 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -932,6 +932,7 @@ declare module kendo.data { interface DataSourceSchemaModel { id?: string; fields?: any; + [index: string]: any; } interface DataSourceSchemaModelWithFieldsArray extends DataSourceSchemaModel { From d3a6ef7f6405a51af979720e2b8e9bcb70bc5899 Mon Sep 17 00:00:00 2001 From: Levi Baker Date: Wed, 27 Jan 2016 15:01:00 -0800 Subject: [PATCH 021/113] kendo-ui: parameters in RouterOptions were all incorrect - fixed now. --- kendo-ui/kendo-ui.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index c11ced16b..82a454b22 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -316,9 +316,10 @@ declare module kendo { var history: History; interface RouterOptions { - init?: (e: RouterEvent) => void; - routeMissing?: (e: RouterEvent) => void; - change?: (e: RouterEvent) => void; + pushState?: boolean; + hashBang?: boolean; + root?: string; + ignoreCase?: boolean; } interface RouterEvent { From b64f1c99760f1c37057cb66abc2de0a9c6aaaef0 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Thu, 28 Jan 2016 11:18:36 +0100 Subject: [PATCH 022/113] Removed 2 classes that wasn't mentioned anywhere else. --- threejs/three.d.ts | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index ac211561e..f87356dd5 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -312,18 +312,6 @@ declare module THREE { parse( json: any ): BooleanKeyframeTrack; } - export class ColorKeyframeTrack extends KeyframeTrack { - constructor(name: string, keys: any[]); - - result: any; - - setResult( value: any ): void; - lerpValues( value0: any, value1: any, alpha: number ): any; - compareValues( value0: any, value1: any ): boolean; - clone(): ColorKeyframeTrack; - parse( json: any ): ColorKeyframeTrack; - } - export class NumberKeyframeTrack { constructor(); @@ -1910,15 +1898,6 @@ declare module THREE { get(file: string):Loader; } - export class AnimationLoader { - constructor(manager?: LoadingManager); - - manager: LoadingManager; - load(url: string, onLoad: (animations: AnimationClip[]) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): void; - setCrossOrigin(crossOrigin: string): void; - parse(json: any, onLoad: (animations: AnimationClip[])=>void): void; - } - export class BinaryTextureLoader { constructor(manager?: LoadingManager); @@ -4618,7 +4597,7 @@ declare module THREE { getMaxAnisotropy(): number; getPixelRatio(): number; setPixelRatio(value: number): void; - + getSize(): { width: number; height: number; }; /** @@ -4960,7 +4939,7 @@ declare module THREE { export class WebGLProgram{ constructor(renderer: WebGLRenderer, code: string, material: ShaderMaterial, parameters: WebGLRendererParameters); - + getUniforms(): any; getAttributes(): any; From 6c9f104705dab40bc425d35a629bae971f92451f Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Thu, 28 Jan 2016 13:17:42 +0100 Subject: [PATCH 023/113] Added the DefaultLoadingManager to the declaration file. --- threejs/three.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index ac211561e..c1efa871e 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -2030,6 +2030,8 @@ declare module THREE { itemError(url: string): void; } + export var DefaultLoadingManager: LoadingManager; + export class MaterialLoader { constructor(manager?: LoadingManager); @@ -4618,7 +4620,7 @@ declare module THREE { getMaxAnisotropy(): number; getPixelRatio(): number; setPixelRatio(value: number): void; - + getSize(): { width: number; height: number; }; /** @@ -4960,7 +4962,7 @@ declare module THREE { export class WebGLProgram{ constructor(renderer: WebGLRenderer, code: string, material: ShaderMaterial, parameters: WebGLRendererParameters); - + getUniforms(): any; getAttributes(): any; From 495ca98636b5ccb49644c0c264a0fe9e883e589b Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Thu, 28 Jan 2016 14:14:45 +0100 Subject: [PATCH 024/113] WorldUVGenerator is a static field --- threejs/three.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index ac211561e..16aec7961 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -5718,7 +5718,7 @@ declare module THREE { constructor(shape?: Shape, options?: any); constructor(shapes?: Shape[], options?: any); - WorldUVGenerator: { + static WorldUVGenerator: { generateTopUV(geometry: Geometry, indexA: number, indexB: number, indexC: number): Vector2[]; generateSideWallUV(geometry: Geometry, indexA: number, indexB: number, indexC: number, indexD: number): Vector2[]; }; From 8b39d26623cf1b6be70287ee43789a0e5bf26d7b Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Thu, 28 Jan 2016 14:02:33 -0500 Subject: [PATCH 025/113] Fixed Chartist.extend definition to support multiple parameters. --- chartist/chartist.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index 169d361db..49e9838e3 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -31,7 +31,7 @@ declare module Chartist { noop: Function; alphaNumerate(n: number): string; - extend(target: Object, sources: Object): Object; + extend(target: Object, ...sources: Object): Object; replaceAll(str: string, subStr: string, newSubStr: string): string; ensureUnit(value: number, unit: string): string; From 9a9021d738dc906529bb3c28c77d86973f3a29f6 Mon Sep 17 00:00:00 2001 From: Matt Gibbs Date: Thu, 28 Jan 2016 14:41:48 -0500 Subject: [PATCH 026/113] Forgot the [] on Object for extend() --- chartist/chartist.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index 49e9838e3..496b92237 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -31,7 +31,7 @@ declare module Chartist { noop: Function; alphaNumerate(n: number): string; - extend(target: Object, ...sources: Object): Object; + extend(target: Object, ...sources: Object[]): Object; replaceAll(str: string, subStr: string, newSubStr: string): string; ensureUnit(value: number, unit: string): string; From e219e9f1b86b5cc963e7f4266a0d1a344cbc1cb8 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Fri, 29 Jan 2016 15:53:29 +0100 Subject: [PATCH 027/113] Fixed some function being declared without "new". And instances of classes doesn't have a constructor. --- threejs/three.d.ts | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index ac211561e..54c1e2593 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -4618,7 +4618,7 @@ declare module THREE { getMaxAnisotropy(): number; getPixelRatio(): number; setPixelRatio(value: number): void; - + getSize(): { width: number; height: number; }; /** @@ -4925,42 +4925,39 @@ declare module THREE { } interface WebGLGeometriesInstance { - new (gl: any, properties: any, info: any): void; get( object: any ): any; } interface WebGLGeometriesStatic{ - (_gl: any, extensions: any, _infoRender: any): WebGLGeometriesInstance; + new (gl: any, properties: any, info: any): WebGLGeometriesInstance; } export var WebGLGeometries: WebGLGeometriesStatic; interface WebGLIndexedBufferRendererInstance { - new (gl: any, properties: any, info: any): void; setMode( value: any ): void; setIndex( index: any ): void; render( start: any, count: any ): void; renderInstances( geometry: any ): void; } interface WebGLIndexedBufferRendererStatic{ - (_gl: any, extensions: any, _infoRender: any): WebGLIndexedBufferRendererInstance; + new (gl: any, properties: any, info: any): WebGLIndexedBufferRendererInstance; } export var WebGLIndexedBufferRenderer: WebGLIndexedBufferRendererStatic; interface WebGLObjectsInstance { - new (gl: any, properties: any, info: any): void; getAttributeBuffer( attribute: any ): any; getWireframeAttribute(geometry: any): any; update(object: any): void; } interface WebGLObjectsStatic{ - (gl: any, properties: any, info: any): WebGLObjectsInstance; + new (gl: any, properties: any, info: any): WebGLObjectsInstance; } export var WebGLObjects: WebGLObjectsStatic; export class WebGLProgram{ constructor(renderer: WebGLRenderer, code: string, material: ShaderMaterial, parameters: WebGLRendererParameters); - + getUniforms(): any; getAttributes(): any; @@ -4978,27 +4975,23 @@ declare module THREE { } interface WebGLProgramsInstance { - new (renderer: WebGLRenderer, capabilities: any): void; - getParameters( material: any, lights: any, fog: any, object: any ): any[]; getProgramCode( material: any, parameters: any ): any; acquireProgram( material: any, parameters: any, code: any ): any; releaseProgram( program: any ): void; } interface WebGLProgramsStatic{ - (): WebGLProgramsInstance; + new (renderer: WebGLRenderer, capabilities: any): WebGLProgramsInstance; } export var WebGLPrograms: WebGLProgramsStatic; interface WebGLPropertiesInstance { - new (): void; - get(object: any): any; delete(object: any): void; clear(): void; } interface WebGLPropertiesStatic{ - (): WebGLPropertiesInstance; + new (): WebGLPropertiesInstance; } export var WebGLProperties: WebGLPropertiesStatic; From 95882537d4ea4b3cec1004aa83a1faf010e57366 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Fri, 29 Jan 2016 15:59:49 +0100 Subject: [PATCH 028/113] 2 more interfaces with wrong functions. --- threejs/three.d.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index 54c1e2593..c0bc0d801 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -5000,8 +5000,6 @@ declare module THREE { } interface WebGLShadowMapInstance{ - new ( _renderer: Renderer, _lights: any[], _objects: any[] ): void; - enabled: boolean; autoUpdate: boolean; needsUpdate: boolean; @@ -5011,12 +5009,11 @@ declare module THREE { render( scene: Scene ): void; } interface WebGLShadowMapStatic{ - ( _renderer: Renderer, _lights: any[], _objects: any[] ): WebGLStateInstance; + new ( _renderer: Renderer, _lights: any[], _objects: any[] ): WebGLStateInstance; } export var WebGLShadowMap: WebGLShadowMapStatic; interface WebGLStateInstance{ - new ( gl: any, extensions: any, paramThreeToGL: Function ): void; init(): void; initAttributes(): void; enableAttribute(attribute: string): void; @@ -5041,7 +5038,7 @@ declare module THREE { reset(): void; } interface WebGLStateStatic{ - ( gl: any, extensions: any, paramThreeToGL: Function ): WebGLStateInstance; + new ( gl: any, extensions: any, paramThreeToGL: Function ): WebGLStateInstance; } export var WebGLState: WebGLStateStatic; From c75fa679ea67203532dac2df0b7e400e891b546c Mon Sep 17 00:00:00 2001 From: gu Date: Fri, 29 Jan 2016 17:14:40 +0100 Subject: [PATCH 029/113] Added definition for random-js --- random-js/random-js.d.ts | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 random-js/random-js.d.ts diff --git a/random-js/random-js.d.ts b/random-js/random-js.d.ts new file mode 100644 index 000000000..9b903a6bf --- /dev/null +++ b/random-js/random-js.d.ts @@ -0,0 +1,61 @@ +// Type definitions for random-js 1.0.8 +// Project: https://github.com/ckknight/random-js +// Definitions by: Gustavo Di Pietro + +declare module random { + export function Engine(): number; + export interface Engine { + + } + + export function MT19937 (): number; + export interface MT19937 extends Engine{ + seed (value: number): Engine; + seedWithArray(array: Array): Engine + autoSeed(): Engine; + discard(count: number): Engine; + getUseCount(): Engine; + } + + export class Random { + constructor (engine?: Engine); + + static engines: { + nativeMath: Engine, + browserCrypto: Engine, + mt19937: () => MT19937 + } + + static integer(min: number, max: number): (engine: Engine) => number; + static real(min: number, max: number, inclusive: boolean): (engine: Engine) => number; + static bool(percentage?: number): (engine: Engine) => boolean; + static bool(numerator: number, denominator: number): (engine: Engine) => boolean; + static pick(engine: Engine, array: Array, begin?: number, end?: number): T; + static picker(array: Array, begin?: number, end?: number): (engine: Engine) => T; + static shuffle(engine: Engine, array: Array): Array; + static sample(engine: Engine, population: Array, sampleSize: number): Array; + static die(sideCount: number): (engine: Engine) => number; + static dice(sideCount: number, dieCount: number): (engine: Engine) => number; + static uuid4(engine: Engine): string; + static string(engine: Engine, length: number): string; + static string(pool: string, length: number): (engine: Engine, length: number) => string; + static hex(upperCase?: boolean): (engine: Engine, length: number) => string; + static date(start: Date, end: Date): (engine: Engine) => Date; + + integer(min: number, max: number): number; + real(min: number, max: number, inclusive: boolean): number; + bool(percentage?: number): (engine: Engine) => boolean; + bool(numerator: number, denominator: number): boolean; + pick(engine: Engine, array: Array, begin?: number, end?: number): T; + picker(array: Array, begin?: number, end?: number): (engine: Engine) => T; + shuffle(engine: Engine, array: Array): Array; + sample(engine: Engine, population: Array, sampleSize: number): Array; + die(sideCount: number): (engine: Engine) => number; + dice(sideCount: number, dieCount: number): number; + uuid4(engine: Engine): string; + string(engine: Engine, length: number): string; + string(pool: string, length: number): string; + hex(upperCase?: boolean): string; + date(start: Date, end: Date): Date; + } +} From 6cbfed02a3f8214673eb3cc4a69e5c32adff0cf2 Mon Sep 17 00:00:00 2001 From: gu Date: Fri, 29 Jan 2016 17:19:55 +0100 Subject: [PATCH 030/113] Added definition comment in header --- random-js/random-js.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/random-js/random-js.d.ts b/random-js/random-js.d.ts index 9b903a6bf..c03d6af0f 100644 --- a/random-js/random-js.d.ts +++ b/random-js/random-js.d.ts @@ -1,6 +1,7 @@ // Type definitions for random-js 1.0.8 // Project: https://github.com/ckknight/random-js // Definitions by: Gustavo Di Pietro +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module random { export function Engine(): number; From 8cf308d12db45f327f72e6953566f0b42569a83f Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Fri, 29 Jan 2016 13:37:41 -0500 Subject: [PATCH 031/113] Enable LF normalization CRLF on Windows checkout; LF on Mac & Linux checkout; always LF in the repository --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index c6b70b78d..412eeda78 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ # Auto detect text files and perform LF normalization -* text=none +* text=auto # Custom for Visual Studio *.cs diff=csharp From 4e16d42d8f6184f284f8acae4137f7cddc350b2a Mon Sep 17 00:00:00 2001 From: Amaury Bzc Date: Sat, 30 Jan 2016 10:17:31 +0100 Subject: [PATCH 032/113] Added phantomCSS definitions --- phantomcss/phantomcss-tests.ts | 77 ++++++++++++++++++ phantomcss/phantomcss.d.ts | 143 +++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+) create mode 100644 phantomcss/phantomcss-tests.ts create mode 100644 phantomcss/phantomcss.d.ts diff --git a/phantomcss/phantomcss-tests.ts b/phantomcss/phantomcss-tests.ts new file mode 100644 index 000000000..9b23ae911 --- /dev/null +++ b/phantomcss/phantomcss-tests.ts @@ -0,0 +1,77 @@ +/// +/// +/// + +// phantomCSS 0.11.1 is based on resemblejs 1.2.1, phantomJS 1.9.2 , casperJS 1.1.0-DEV + +var options: PhantomCSSOptions = { + libraryRoot: './modules/PhantomCSS', + + screenshotRoot: './screenshots', + + failedComparisonsRoot: './failures', + + cleanupComparisonImages: true, + + casper: null, + + comparisonResultRoot: './results', + + addIteratorToImage: false, + + addLabelToFailedImage: false, + + mismatchTolerance: 0.05, + + onFail: function(test){ console.log(test.filename, test.mismatch); }, + + onPass: function(test){ console.log(test.filename); }, + + onNewImage: function(test){ console.log(test.filename); }, + + onTimeout: function(test){ console.log(test.filename); }, + + onComplete: function(allTests, noOfFails, noOfErrors){ + allTests.forEach(function(test){ + if(test.fail){ + console.log(test.filename, test.mismatch); + } + }); + }, + + fileNameGetter: function(root,filename){ + + }, + + prefixCount: true, + + outputSettings: { + errorColor: { + red: 255, + green: 0, + blue: 255 + }, + errorType: 'movement', + transparency: 0.3, + largeImageThreshold: 1200 + }, + + rebase: null//casper.cli.get("rebase") +} + + +phantomcss.turnOffAnimations(); +phantomcss.init(options); + +phantomcss.compareAll('exclude.test'); +phantomcss.compareMatched('include.test', 'exclude.test'); +phantomcss.compareMatched( new RegExp('include.test'), new RegExp('exclude.test')); +phantomcss.compareSession(); +phantomcss.compareExplicit(['/dialog.diff.png', '/header.diff.png']); +phantomcss.getCreatedDiffFiles(); +phantomcss.compareFiles("baseFile", "diffFile"); +phantomcss.waitForTests([{error:false, fail:false, failFile: "failFile", filename: "filename", mismatch: null/* mismatch */ }]); + +phantomcss.screenshot("#feedback-form"); + +phantomcss.screenshot("#feedback-form", undefined, 'input[type=file]'); \ No newline at end of file diff --git a/phantomcss/phantomcss.d.ts b/phantomcss/phantomcss.d.ts new file mode 100644 index 000000000..d52f50426 --- /dev/null +++ b/phantomcss/phantomcss.d.ts @@ -0,0 +1,143 @@ +// Type definitions for PhantomCSS 0.11.1 +// Project: https://github.com/Huddle/PhantomCSS +// Definitions by: Amaury Bauzac +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +interface PhantomCSS{ + + init(options:PhantomCSSOptions):void; + update( options:PhantomCSSOptions):void; + + /** + * Take a screenshot of the targeted HTML element + * FileName is required if addIteratorToImage option is set to false + */ + screenshot(target:string, fileName?:string ):void; + + /** + * Take a screenshot of the targeted HTML element + * FileName is required if addIteratorToImage option is set to false + */ + screenshot(target:ClipRect, fileName?:string):void; + /** + * Take a screenshot of the targeted HTML element + * FileName is required if addIteratorToImage option is set to false + */ + screenshot( target:string, timeToWait:number, hideSelector:string, fileName?:string ):void; + + compareAll( exclude ):void; + compareAll( exclude, diffList, include ):void; + compareMatched( match, exclude ):void; + /** + * Explicitly define what files you want to compare + */ + compareExplicit( list:string[] ):void; + /** + * Compare image diffs generated in this test run only + */ + compareSession( list? ):void; + compareFiles( fileName, file ):PhantomCSSTest; + waitForTests( tests:PhantomCSSTest[] ); + done():void; + /** + * Turn off CSS transitions and jQuery animations + */ + turnOffAnimations():void; + getExitStatus():number; + /** + * Get a list of image diffs generated in this test run + */ + getCreatedDiffFiles():Array; +} + +interface PhantomCSSTest{ + filename : string; + error: boolean; + fail:boolean; + failFile:string; + mismatch:any; +} + +interface PhantomCSSOptions{ + /** + Rebase is useful when you want to create new baseline + images without manually deleting the files + casperjs demo/test.js --rebase + */ + rebase?: any; + /** + A reference to a particular Casper instance. Required for SlimerJS. + */ + casper?: Casper; + /** + libraryRoot is relative to this file and must point to your phantomcss folder (not lib or node_modules). If you are using NPM, this will be './node_modules/phantomcss'. + */ + libraryRoot?: string; + + screenshotRoot?:string; + /** + By default, failure images are put in the './failures' folder. + If failedComparisonsRoot is set to false a separate folder will + not be created but failure images can still be found alongside + the original and new images. + */ + failedComparisonsRoot?:string; + + /** + You might want to keep master/baseline images in a completely + different folder to the diffs/failures. Useful when working + with version control systems. By default this resolves to the + screenshotRoot folder. + */ + comparisonResultRoot?: string; + + /** + Don't add count number to images. If set to false (default), a filename is + required when capturing screenshots. + */ + addIteratorToImage: boolean; + + /** + Remove results directory tree after run. Use in conjunction + with failedComparisonsRoot to see failed comparisons. + */ + cleanupComparisonImages?: boolean; + + /** + * Don't add label to generated failure image + */ + addLabelToFailedImage?:boolean; + /** + * Change the output screenshot filenames for your specific + * integration + */ + fileNameGetter?: Function; + + /** + Mismatch tolerance defaults to 0.05%. Increasing this value + will decrease test coverage + */ + mismatchTolerance?: number; + + onPass?: (test) => void; + onFail?: (test) => void; + onTimeout?: (test) => void; + onComplete?:( tests:PhantomCSSTest[], noOfFails:number, noOfErrors:number ) => void; + /** + Called when creating new baseline images + */ + onNewImage?: (test:PhantomCSSTest) => void; + + /** + Prefix the screenshot number to the filename, instead of suffixing it + */ + prefixCount?: boolean; + + hideElements?: string; + outputSettings?: Resemble.OutputSettings; +} + +declare var phantomcss:PhantomCSS; \ No newline at end of file From f44827f22e4a792063b86b263da9f96722ae532d Mon Sep 17 00:00:00 2001 From: Amaury Bzc Date: Sat, 30 Jan 2016 10:42:25 +0100 Subject: [PATCH 033/113] Added phantomCSS - fix travis errors --- phantomcss/phantomcss-tests.ts | 3 ++- phantomcss/phantomcss.d.ts | 32 +++++++++++++++++--------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/phantomcss/phantomcss-tests.ts b/phantomcss/phantomcss-tests.ts index 9b23ae911..e3c066c6a 100644 --- a/phantomcss/phantomcss-tests.ts +++ b/phantomcss/phantomcss-tests.ts @@ -39,8 +39,9 @@ var options: PhantomCSSOptions = { }); }, - fileNameGetter: function(root,filename){ + fileNameGetter: function(root:string,filename:string){ + return root+filename; }, prefixCount: true, diff --git a/phantomcss/phantomcss.d.ts b/phantomcss/phantomcss.d.ts index d52f50426..3afd4b7fd 100644 --- a/phantomcss/phantomcss.d.ts +++ b/phantomcss/phantomcss.d.ts @@ -28,9 +28,10 @@ interface PhantomCSS{ */ screenshot( target:string, timeToWait:number, hideSelector:string, fileName?:string ):void; - compareAll( exclude ):void; - compareAll( exclude, diffList, include ):void; - compareMatched( match, exclude ):void; + compareAll( exclude:string ):void; + compareAll( exclude:string, diffList:string[], include:string ):void; + compareMatched( match:string, exclude:string ):void; + compareMatched( match:RegExp, exclude:RegExp ):void; /** * Explicitly define what files you want to compare */ @@ -38,9 +39,9 @@ interface PhantomCSS{ /** * Compare image diffs generated in this test run only */ - compareSession( list? ):void; - compareFiles( fileName, file ):PhantomCSSTest; - waitForTests( tests:PhantomCSSTest[] ); + compareSession( list?:any[] ):void; + compareFiles( baseFile:string, diffFiles:string ):PhantomCSSTest; + waitForTests( tests:PhantomCSSTest[] ):void; done():void; /** * Turn off CSS transitions and jQuery animations @@ -54,11 +55,12 @@ interface PhantomCSS{ } interface PhantomCSSTest{ - filename : string; - error: boolean; - fail:boolean; - failFile:string; - mismatch:any; + filename? : string; + error?: boolean; + fail?:boolean; + success?:boolean; + failFile?:string; + mismatch?:any; } interface PhantomCSSOptions{ @@ -114,7 +116,7 @@ interface PhantomCSSOptions{ * Change the output screenshot filenames for your specific * integration */ - fileNameGetter?: Function; + fileNameGetter?: (rootPath:string, fileName?:string) => string; /** Mismatch tolerance defaults to 0.05%. Increasing this value @@ -122,9 +124,9 @@ interface PhantomCSSOptions{ */ mismatchTolerance?: number; - onPass?: (test) => void; - onFail?: (test) => void; - onTimeout?: (test) => void; + onPass?: (test:PhantomCSSTest) => void; + onFail?: (test:PhantomCSSTest) => void; + onTimeout?: (test:PhantomCSSTest) => void; onComplete?:( tests:PhantomCSSTest[], noOfFails:number, noOfErrors:number ) => void; /** Called when creating new baseline images From 07798ba68f30ee71411209bace810bd82c98840d Mon Sep 17 00:00:00 2001 From: John Hasselkus Date: Sun, 31 Jan 2016 10:37:20 -0600 Subject: [PATCH 034/113] Update KnockoutMappingUpdateOptions to add the missing target field Also makes the observable field optional as it's only present if target is a writable observable. --- knockout.mapping/knockout.mapping-tests.ts | 13 +++++++++++++ knockout.mapping/knockout.mapping.d.ts | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/knockout.mapping/knockout.mapping-tests.ts b/knockout.mapping/knockout.mapping-tests.ts index 41ba2e9bc..85e37a4a5 100644 --- a/knockout.mapping/knockout.mapping-tests.ts +++ b/knockout.mapping/knockout.mapping-tests.ts @@ -15,6 +15,7 @@ var createOptions = { var updateOptions = { data: inputData, parent: parent, + target: inputModel, observable: ko.observable(7) } @@ -49,6 +50,18 @@ mapping.fromJSON(inputJSON); mapping.fromJSON(inputJSON, targetOptions); mapping.fromJSON(inputJSON, inputOptions, inputModel); +mapping.fromJS(inputJSON, { + fieldNeedingCustomOptions: { + key: (data: any) => data.id, + create: (options: KnockoutMappingCreateOptions) => { + return mapping.fromJS(options.data); + }, + update: (options: KnockoutMappingUpdateOptions) => { + return mapping.fromJS(options.data, options.target); + } + } +}); + // toJS function mapping.toJS(inputModel); mapping.toJS(inputModel, mappingOptions); diff --git a/knockout.mapping/knockout.mapping.d.ts b/knockout.mapping/knockout.mapping.d.ts index 715190d82..d1a35d3ee 100644 --- a/knockout.mapping/knockout.mapping.d.ts +++ b/knockout.mapping/knockout.mapping.d.ts @@ -13,7 +13,8 @@ interface KnockoutMappingCreateOptions { interface KnockoutMappingUpdateOptions { data: any; parent: any; - observable: KnockoutObservable; + target: any; + observable?: KnockoutObservable; } interface KnockoutMappingOptions { From 777e7d1b1d6c6250d6fba52ea9e6841f7a6b5e9d Mon Sep 17 00:00:00 2001 From: Tom Peres Date: Sun, 31 Jan 2016 20:40:15 +0200 Subject: [PATCH 035/113] updated SpyAnd return values --- jasmine/jasmine.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index b17c68d8b..e94cc262e 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -423,11 +423,11 @@ declare module jasmine { /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */ callThrough(): Spy; /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ - returnValue(val: any): void; + returnValue(val: any): Spy; /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ callFake(fn: Function): Spy; /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ - throwError(msg: string): void; + throwError(msg: string): Spy; /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */ stub(): Spy; } From 44d672fd37ffe1ffabf9cec3bbadfbecedf39006 Mon Sep 17 00:00:00 2001 From: Ali Malekpour Date: Sun, 31 Jan 2016 17:58:14 -0500 Subject: [PATCH 036/113] Add SvgIcons --- material-ui/material-ui.d.ts | 922 +++++++++++++++++++++++++++++++++++ 1 file changed, 922 insertions(+) diff --git a/material-ui/material-ui.d.ts b/material-ui/material-ui.d.ts index e727107cd..09d43bb86 100644 --- a/material-ui/material-ui.d.ts +++ b/material-ui/material-ui.d.ts @@ -2359,3 +2359,925 @@ declare namespace __MaterialUI.Styles { } export var Colors: Colors; } + +declare module "material-ui/lib/svg-icons" { + export var ActionAccessibility: __MaterialUI.SvgIcon; + export var ActionAccessible: __MaterialUI.SvgIcon; + export var ActionAccountBalanceWallet: __MaterialUI.SvgIcon; + export var ActionAccountBalance: __MaterialUI.SvgIcon; + export var ActionAccountBox: __MaterialUI.SvgIcon; + export var ActionAccountCircle: __MaterialUI.SvgIcon; + export var ActionAddShoppingCart: __MaterialUI.SvgIcon; + export var ActionAlarmAdd: __MaterialUI.SvgIcon; + export var ActionAlarmOff: __MaterialUI.SvgIcon; + export var ActionAlarmOn: __MaterialUI.SvgIcon; + export var ActionAlarm: __MaterialUI.SvgIcon; + export var ActionAllOut: __MaterialUI.SvgIcon; + export var ActionAndroid: __MaterialUI.SvgIcon; + export var ActionAnnouncement: __MaterialUI.SvgIcon; + export var ActionAspectRatio: __MaterialUI.SvgIcon; + export var ActionAssessment: __MaterialUI.SvgIcon; + export var ActionAssignmentInd: __MaterialUI.SvgIcon; + export var ActionAssignmentLate: __MaterialUI.SvgIcon; + export var ActionAssignmentReturn: __MaterialUI.SvgIcon; + export var ActionAssignmentReturned: __MaterialUI.SvgIcon; + export var ActionAssignmentTurnedIn: __MaterialUI.SvgIcon; + export var ActionAssignment: __MaterialUI.SvgIcon; + export var ActionAutorenew: __MaterialUI.SvgIcon; + export var ActionBackup: __MaterialUI.SvgIcon; + export var ActionBook: __MaterialUI.SvgIcon; + export var ActionBookmarkBorder: __MaterialUI.SvgIcon; + export var ActionBookmark: __MaterialUI.SvgIcon; + export var ActionBugReport: __MaterialUI.SvgIcon; + export var ActionBuild: __MaterialUI.SvgIcon; + export var ActionCached: __MaterialUI.SvgIcon; + export var ActionCameraEnhance: __MaterialUI.SvgIcon; + export var ActionCardGiftcard: __MaterialUI.SvgIcon; + export var ActionCardMembership: __MaterialUI.SvgIcon; + export var ActionCardTravel: __MaterialUI.SvgIcon; + export var ActionChangeHistory: __MaterialUI.SvgIcon; + export var ActionCheckCircle: __MaterialUI.SvgIcon; + export var ActionChromeReaderMode: __MaterialUI.SvgIcon; + export var ActionClass: __MaterialUI.SvgIcon; + export var ActionCode: __MaterialUI.SvgIcon; + export var ActionCompareArrows: __MaterialUI.SvgIcon; + export var ActionCopyright: __MaterialUI.SvgIcon; + export var ActionCreditCard: __MaterialUI.SvgIcon; + export var ActionDashboard: __MaterialUI.SvgIcon; + export var ActionDateRange: __MaterialUI.SvgIcon; + export var ActionDelete: __MaterialUI.SvgIcon; + export var ActionDescription: __MaterialUI.SvgIcon; + export var ActionDns: __MaterialUI.SvgIcon; + export var ActionDoneAll: __MaterialUI.SvgIcon; + export var ActionDone: __MaterialUI.SvgIcon; + export var ActionDonutLarge: __MaterialUI.SvgIcon; + export var ActionDonutSmall: __MaterialUI.SvgIcon; + export var ActionEject: __MaterialUI.SvgIcon; + export var ActionEventSeat: __MaterialUI.SvgIcon; + export var ActionEvent: __MaterialUI.SvgIcon; + export var ActionExitToApp: __MaterialUI.SvgIcon; + export var ActionExplore: __MaterialUI.SvgIcon; + export var ActionExtension: __MaterialUI.SvgIcon; + export var ActionFace: __MaterialUI.SvgIcon; + export var ActionFavoriteBorder: __MaterialUI.SvgIcon; + export var ActionFavorite: __MaterialUI.SvgIcon; + export var ActionFeedback: __MaterialUI.SvgIcon; + export var ActionFindInPage: __MaterialUI.SvgIcon; + export var ActionFindReplace: __MaterialUI.SvgIcon; + export var ActionFingerprint: __MaterialUI.SvgIcon; + export var ActionFlightLand: __MaterialUI.SvgIcon; + export var ActionFlightTakeoff: __MaterialUI.SvgIcon; + export var ActionFlipToBack: __MaterialUI.SvgIcon; + export var ActionFlipToFront: __MaterialUI.SvgIcon; + export var ActionGavel: __MaterialUI.SvgIcon; + export var ActionGetApp: __MaterialUI.SvgIcon; + export var ActionGif: __MaterialUI.SvgIcon; + export var ActionGrade: __MaterialUI.SvgIcon; + export var ActionGroupWork: __MaterialUI.SvgIcon; + export var ActionHelpOutline: __MaterialUI.SvgIcon; + export var ActionHelp: __MaterialUI.SvgIcon; + export var ActionHighlightOff: __MaterialUI.SvgIcon; + export var ActionHistory: __MaterialUI.SvgIcon; + export var ActionHome: __MaterialUI.SvgIcon; + export var ActionHourglassEmpty: __MaterialUI.SvgIcon; + export var ActionHourglassFull: __MaterialUI.SvgIcon; + export var ActionHttp: __MaterialUI.SvgIcon; + export var ActionHttps: __MaterialUI.SvgIcon; + export var ActionImportantDevices: __MaterialUI.SvgIcon; + export var ActionInfoOutline: __MaterialUI.SvgIcon; + export var ActionInfo: __MaterialUI.SvgIcon; + export var ActionInput: __MaterialUI.SvgIcon; + export var ActionInvertColors: __MaterialUI.SvgIcon; + export var ActionLabelOutline: __MaterialUI.SvgIcon; + export var ActionLabel: __MaterialUI.SvgIcon; + export var ActionLanguage: __MaterialUI.SvgIcon; + export var ActionLaunch: __MaterialUI.SvgIcon; + export var ActionLightbulbOutline: __MaterialUI.SvgIcon; + export var ActionLineStyle: __MaterialUI.SvgIcon; + export var ActionLineWeight: __MaterialUI.SvgIcon; + export var ActionList: __MaterialUI.SvgIcon; + export var ActionLockOpen: __MaterialUI.SvgIcon; + export var ActionLockOutline: __MaterialUI.SvgIcon; + export var ActionLock: __MaterialUI.SvgIcon; + export var ActionLoyalty: __MaterialUI.SvgIcon; + export var ActionMarkunreadMailbox: __MaterialUI.SvgIcon; + export var ActionMotorcycle: __MaterialUI.SvgIcon; + export var ActionNoteAdd: __MaterialUI.SvgIcon; + export var ActionOfflinePin: __MaterialUI.SvgIcon; + export var ActionOpacity: __MaterialUI.SvgIcon; + export var ActionOpenInBrowser: __MaterialUI.SvgIcon; + export var ActionOpenInNew: __MaterialUI.SvgIcon; + export var ActionOpenWith: __MaterialUI.SvgIcon; + export var ActionPageview: __MaterialUI.SvgIcon; + export var ActionPanTool: __MaterialUI.SvgIcon; + export var ActionPayment: __MaterialUI.SvgIcon; + export var ActionPermCameraMic: __MaterialUI.SvgIcon; + export var ActionPermContactCalendar: __MaterialUI.SvgIcon; + export var ActionPermDataSetting: __MaterialUI.SvgIcon; + export var ActionPermDeviceInformation: __MaterialUI.SvgIcon; + export var ActionPermIdentity: __MaterialUI.SvgIcon; + export var ActionPermMedia: __MaterialUI.SvgIcon; + export var ActionPermPhoneMsg: __MaterialUI.SvgIcon; + export var ActionPermScanWifi: __MaterialUI.SvgIcon; + export var ActionPets: __MaterialUI.SvgIcon; + export var ActionPictureInPictureAlt: __MaterialUI.SvgIcon; + export var ActionPictureInPicture: __MaterialUI.SvgIcon; + export var ActionPlayForWork: __MaterialUI.SvgIcon; + export var ActionPolymer: __MaterialUI.SvgIcon; + export var ActionPowerSettingsNew: __MaterialUI.SvgIcon; + export var ActionPregnantWoman: __MaterialUI.SvgIcon; + export var ActionPrint: __MaterialUI.SvgIcon; + export var ActionQueryBuilder: __MaterialUI.SvgIcon; + export var ActionQuestionAnswer: __MaterialUI.SvgIcon; + export var ActionReceipt: __MaterialUI.SvgIcon; + export var ActionRecordVoiceOver: __MaterialUI.SvgIcon; + export var ActionRedeem: __MaterialUI.SvgIcon; + export var ActionReorder: __MaterialUI.SvgIcon; + export var ActionReportProblem: __MaterialUI.SvgIcon; + export var ActionRestore: __MaterialUI.SvgIcon; + export var ActionRoom: __MaterialUI.SvgIcon; + export var ActionRoundedCorner: __MaterialUI.SvgIcon; + export var ActionRowing: __MaterialUI.SvgIcon; + export var ActionSchedule: __MaterialUI.SvgIcon; + export var ActionSearch: __MaterialUI.SvgIcon; + export var ActionSettingsApplications: __MaterialUI.SvgIcon; + export var ActionSettingsBackupRestore: __MaterialUI.SvgIcon; + export var ActionSettingsBluetooth: __MaterialUI.SvgIcon; + export var ActionSettingsBrightness: __MaterialUI.SvgIcon; + export var ActionSettingsCell: __MaterialUI.SvgIcon; + export var ActionSettingsEthernet: __MaterialUI.SvgIcon; + export var ActionSettingsInputAntenna: __MaterialUI.SvgIcon; + export var ActionSettingsInputComponent: __MaterialUI.SvgIcon; + export var ActionSettingsInputComposite: __MaterialUI.SvgIcon; + export var ActionSettingsInputHdmi: __MaterialUI.SvgIcon; + export var ActionSettingsInputSvideo: __MaterialUI.SvgIcon; + export var ActionSettingsOverscan: __MaterialUI.SvgIcon; + export var ActionSettingsPhone: __MaterialUI.SvgIcon; + export var ActionSettingsPower: __MaterialUI.SvgIcon; + export var ActionSettingsRemote: __MaterialUI.SvgIcon; + export var ActionSettingsVoice: __MaterialUI.SvgIcon; + export var ActionSettings: __MaterialUI.SvgIcon; + export var ActionShopTwo: __MaterialUI.SvgIcon; + export var ActionShop: __MaterialUI.SvgIcon; + export var ActionShoppingBasket: __MaterialUI.SvgIcon; + export var ActionShoppingCart: __MaterialUI.SvgIcon; + export var ActionSpeakerNotes: __MaterialUI.SvgIcon; + export var ActionSpellcheck: __MaterialUI.SvgIcon; + export var ActionStars: __MaterialUI.SvgIcon; + export var ActionStore: __MaterialUI.SvgIcon; + export var ActionSubject: __MaterialUI.SvgIcon; + export var ActionSupervisorAccount: __MaterialUI.SvgIcon; + export var ActionSwapHoriz: __MaterialUI.SvgIcon; + export var ActionSwapVert: __MaterialUI.SvgIcon; + export var ActionSwapVerticalCircle: __MaterialUI.SvgIcon; + export var ActionSystemUpdateAlt: __MaterialUI.SvgIcon; + export var ActionTabUnselected: __MaterialUI.SvgIcon; + export var ActionTab: __MaterialUI.SvgIcon; + export var ActionTheaters: __MaterialUI.SvgIcon; + export var ActionThreeDRotation: __MaterialUI.SvgIcon; + export var ActionThumbDown: __MaterialUI.SvgIcon; + export var ActionThumbUp: __MaterialUI.SvgIcon; + export var ActionThumbsUpDown: __MaterialUI.SvgIcon; + export var ActionTimeline: __MaterialUI.SvgIcon; + export var ActionToc: __MaterialUI.SvgIcon; + export var ActionToday: __MaterialUI.SvgIcon; + export var ActionToll: __MaterialUI.SvgIcon; + export var ActionTouchApp: __MaterialUI.SvgIcon; + export var ActionTrackChanges: __MaterialUI.SvgIcon; + export var ActionTranslate: __MaterialUI.SvgIcon; + export var ActionTrendingDown: __MaterialUI.SvgIcon; + export var ActionTrendingFlat: __MaterialUI.SvgIcon; + export var ActionTrendingUp: __MaterialUI.SvgIcon; + export var ActionTurnedInNot: __MaterialUI.SvgIcon; + export var ActionTurnedIn: __MaterialUI.SvgIcon; + export var ActionUpdate: __MaterialUI.SvgIcon; + export var ActionVerifiedUser: __MaterialUI.SvgIcon; + export var ActionViewAgenda: __MaterialUI.SvgIcon; + export var ActionViewArray: __MaterialUI.SvgIcon; + export var ActionViewCarousel: __MaterialUI.SvgIcon; + export var ActionViewColumn: __MaterialUI.SvgIcon; + export var ActionViewDay: __MaterialUI.SvgIcon; + export var ActionViewHeadline: __MaterialUI.SvgIcon; + export var ActionViewList: __MaterialUI.SvgIcon; + export var ActionViewModule: __MaterialUI.SvgIcon; + export var ActionViewQuilt: __MaterialUI.SvgIcon; + export var ActionViewStream: __MaterialUI.SvgIcon; + export var ActionViewWeek: __MaterialUI.SvgIcon; + export var ActionVisibilityOff: __MaterialUI.SvgIcon; + export var ActionVisibility: __MaterialUI.SvgIcon; + export var ActionWatchLater: __MaterialUI.SvgIcon; + export var ActionWork: __MaterialUI.SvgIcon; + export var ActionYoutubeSearchedFor: __MaterialUI.SvgIcon; + export var ActionZoomIn: __MaterialUI.SvgIcon; + export var ActionZoomOut: __MaterialUI.SvgIcon; + export var AlertAddAlert: __MaterialUI.SvgIcon; + export var AlertErrorOutline: __MaterialUI.SvgIcon; + export var AlertError: __MaterialUI.SvgIcon; + export var AlertWarning: __MaterialUI.SvgIcon; + export var AvAddToQueue: __MaterialUI.SvgIcon; + export var AvAirplay: __MaterialUI.SvgIcon; + export var AvAlbum: __MaterialUI.SvgIcon; + export var AvArtTrack: __MaterialUI.SvgIcon; + export var AvAvTimer: __MaterialUI.SvgIcon; + export var AvClosedCaption: __MaterialUI.SvgIcon; + export var AvEqualizer: __MaterialUI.SvgIcon; + export var AvExplicit: __MaterialUI.SvgIcon; + export var AvFastForward: __MaterialUI.SvgIcon; + export var AvFastRewind: __MaterialUI.SvgIcon; + export var AvFiberDvr: __MaterialUI.SvgIcon; + export var AvFiberManualRecord: __MaterialUI.SvgIcon; + export var AvFiberNew: __MaterialUI.SvgIcon; + export var AvFiberPin: __MaterialUI.SvgIcon; + export var AvFiberSmartRecord: __MaterialUI.SvgIcon; + export var AvForward10: __MaterialUI.SvgIcon; + export var AvForward30: __MaterialUI.SvgIcon; + export var AvForward5: __MaterialUI.SvgIcon; + export var AvGames: __MaterialUI.SvgIcon; + export var AvHd: __MaterialUI.SvgIcon; + export var AvHearing: __MaterialUI.SvgIcon; + export var AvHighQuality: __MaterialUI.SvgIcon; + export var AvLibraryAdd: __MaterialUI.SvgIcon; + export var AvLibraryBooks: __MaterialUI.SvgIcon; + export var AvLibraryMusic: __MaterialUI.SvgIcon; + export var AvLoop: __MaterialUI.SvgIcon; + export var AvMicNone: __MaterialUI.SvgIcon; + export var AvMicOff: __MaterialUI.SvgIcon; + export var AvMic: __MaterialUI.SvgIcon; + export var AvMovie: __MaterialUI.SvgIcon; + export var AvMusicVideo: __MaterialUI.SvgIcon; + export var AvNewReleases: __MaterialUI.SvgIcon; + export var AvNotInterested: __MaterialUI.SvgIcon; + export var AvPauseCircleFilled: __MaterialUI.SvgIcon; + export var AvPauseCircleOutline: __MaterialUI.SvgIcon; + export var AvPause: __MaterialUI.SvgIcon; + export var AvPlayArrow: __MaterialUI.SvgIcon; + export var AvPlayCircleFilled: __MaterialUI.SvgIcon; + export var AvPlayCircleOutline: __MaterialUI.SvgIcon; + export var AvPlaylistAddCheck: __MaterialUI.SvgIcon; + export var AvPlaylistAdd: __MaterialUI.SvgIcon; + export var AvPlaylistPlay: __MaterialUI.SvgIcon; + export var AvQueueMusic: __MaterialUI.SvgIcon; + export var AvQueuePlayNext: __MaterialUI.SvgIcon; + export var AvQueue: __MaterialUI.SvgIcon; + export var AvRadio: __MaterialUI.SvgIcon; + export var AvRecentActors: __MaterialUI.SvgIcon; + export var AvRemoveFromQueue: __MaterialUI.SvgIcon; + export var AvRepeatOne: __MaterialUI.SvgIcon; + export var AvRepeat: __MaterialUI.SvgIcon; + export var AvReplay10: __MaterialUI.SvgIcon; + export var AvReplay30: __MaterialUI.SvgIcon; + export var AvReplay5: __MaterialUI.SvgIcon; + export var AvReplay: __MaterialUI.SvgIcon; + export var AvShuffle: __MaterialUI.SvgIcon; + export var AvSkipNext: __MaterialUI.SvgIcon; + export var AvSkipPrevious: __MaterialUI.SvgIcon; + export var AvSlowMotionVideo: __MaterialUI.SvgIcon; + export var AvSnooze: __MaterialUI.SvgIcon; + export var AvSortByAlpha: __MaterialUI.SvgIcon; + export var AvStop: __MaterialUI.SvgIcon; + export var AvSubscriptions: __MaterialUI.SvgIcon; + export var AvSubtitles: __MaterialUI.SvgIcon; + export var AvSurroundSound: __MaterialUI.SvgIcon; + export var AvVideoLibrary: __MaterialUI.SvgIcon; + export var AvVideocamOff: __MaterialUI.SvgIcon; + export var AvVideocam: __MaterialUI.SvgIcon; + export var AvVolumeDown: __MaterialUI.SvgIcon; + export var AvVolumeMute: __MaterialUI.SvgIcon; + export var AvVolumeOff: __MaterialUI.SvgIcon; + export var AvVolumeUp: __MaterialUI.SvgIcon; + export var AvWebAsset: __MaterialUI.SvgIcon; + export var AvWeb: __MaterialUI.SvgIcon; + export var CommunicationBusiness: __MaterialUI.SvgIcon; + export var CommunicationCallEnd: __MaterialUI.SvgIcon; + export var CommunicationCallMade: __MaterialUI.SvgIcon; + export var CommunicationCallMerge: __MaterialUI.SvgIcon; + export var CommunicationCallMissedOutgoing: __MaterialUI.SvgIcon; + export var CommunicationCallMissed: __MaterialUI.SvgIcon; + export var CommunicationCallReceived: __MaterialUI.SvgIcon; + export var CommunicationCallSplit: __MaterialUI.SvgIcon; + export var CommunicationCall: __MaterialUI.SvgIcon; + export var CommunicationChatBubbleOutline: __MaterialUI.SvgIcon; + export var CommunicationChatBubble: __MaterialUI.SvgIcon; + export var CommunicationChat: __MaterialUI.SvgIcon; + export var CommunicationClearAll: __MaterialUI.SvgIcon; + export var CommunicationComment: __MaterialUI.SvgIcon; + export var CommunicationContactMail: __MaterialUI.SvgIcon; + export var CommunicationContactPhone: __MaterialUI.SvgIcon; + export var CommunicationContacts: __MaterialUI.SvgIcon; + export var CommunicationDialerSip: __MaterialUI.SvgIcon; + export var CommunicationDialpad: __MaterialUI.SvgIcon; + export var CommunicationEmail: __MaterialUI.SvgIcon; + export var CommunicationForum: __MaterialUI.SvgIcon; + export var CommunicationImportContacts: __MaterialUI.SvgIcon; + export var CommunicationImportExport: __MaterialUI.SvgIcon; + export var CommunicationInvertColorsOff: __MaterialUI.SvgIcon; + export var CommunicationLiveHelp: __MaterialUI.SvgIcon; + export var CommunicationLocationOff: __MaterialUI.SvgIcon; + export var CommunicationLocationOn: __MaterialUI.SvgIcon; + export var CommunicationMailOutline: __MaterialUI.SvgIcon; + export var CommunicationMessage: __MaterialUI.SvgIcon; + export var CommunicationNoSim: __MaterialUI.SvgIcon; + export var CommunicationPhone: __MaterialUI.SvgIcon; + export var CommunicationPhonelinkErase: __MaterialUI.SvgIcon; + export var CommunicationPhonelinkLock: __MaterialUI.SvgIcon; + export var CommunicationPhonelinkRing: __MaterialUI.SvgIcon; + export var CommunicationPhonelinkSetup: __MaterialUI.SvgIcon; + export var CommunicationPortableWifiOff: __MaterialUI.SvgIcon; + export var CommunicationPresentToAll: __MaterialUI.SvgIcon; + export var CommunicationRingVolume: __MaterialUI.SvgIcon; + export var CommunicationScreenShare: __MaterialUI.SvgIcon; + export var CommunicationSpeakerPhone: __MaterialUI.SvgIcon; + export var CommunicationStayCurrentLandscape: __MaterialUI.SvgIcon; + export var CommunicationStayCurrentPortrait: __MaterialUI.SvgIcon; + export var CommunicationStayPrimaryLandscape: __MaterialUI.SvgIcon; + export var CommunicationStayPrimaryPortrait: __MaterialUI.SvgIcon; + export var CommunicationStopScreenShare: __MaterialUI.SvgIcon; + export var CommunicationSwapCalls: __MaterialUI.SvgIcon; + export var CommunicationTextsms: __MaterialUI.SvgIcon; + export var CommunicationVoicemail: __MaterialUI.SvgIcon; + export var CommunicationVpnKey: __MaterialUI.SvgIcon; + export var ContentAddBox: __MaterialUI.SvgIcon; + export var ContentAddCircleOutline: __MaterialUI.SvgIcon; + export var ContentAddCircle: __MaterialUI.SvgIcon; + export var ContentAdd: __MaterialUI.SvgIcon; + export var ContentArchive: __MaterialUI.SvgIcon; + export var ContentBackspace: __MaterialUI.SvgIcon; + export var ContentBlock: __MaterialUI.SvgIcon; + export var ContentClear: __MaterialUI.SvgIcon; + export var ContentContentCopy: __MaterialUI.SvgIcon; + export var ContentContentCut: __MaterialUI.SvgIcon; + export var ContentContentPaste: __MaterialUI.SvgIcon; + export var ContentCreate: __MaterialUI.SvgIcon; + export var ContentDrafts: __MaterialUI.SvgIcon; + export var ContentFilterList: __MaterialUI.SvgIcon; + export var ContentFlag: __MaterialUI.SvgIcon; + export var ContentFontDownload: __MaterialUI.SvgIcon; + export var ContentForward: __MaterialUI.SvgIcon; + export var ContentGesture: __MaterialUI.SvgIcon; + export var ContentInbox: __MaterialUI.SvgIcon; + export var ContentLink: __MaterialUI.SvgIcon; + export var ContentMail: __MaterialUI.SvgIcon; + export var ContentMarkunread: __MaterialUI.SvgIcon; + export var ContentMoveToInbox: __MaterialUI.SvgIcon; + export var ContentNextWeek: __MaterialUI.SvgIcon; + export var ContentRedo: __MaterialUI.SvgIcon; + export var ContentRemoveCircleOutline: __MaterialUI.SvgIcon; + export var ContentRemoveCircle: __MaterialUI.SvgIcon; + export var ContentRemove: __MaterialUI.SvgIcon; + export var ContentReplyAll: __MaterialUI.SvgIcon; + export var ContentReply: __MaterialUI.SvgIcon; + export var ContentReport: __MaterialUI.SvgIcon; + export var ContentSave: __MaterialUI.SvgIcon; + export var ContentSelectAll: __MaterialUI.SvgIcon; + export var ContentSend: __MaterialUI.SvgIcon; + export var ContentSort: __MaterialUI.SvgIcon; + export var ContentTextFormat: __MaterialUI.SvgIcon; + export var ContentUnarchive: __MaterialUI.SvgIcon; + export var ContentUndo: __MaterialUI.SvgIcon; + export var ContentWeekend: __MaterialUI.SvgIcon; + export var DeviceAccessAlarm: __MaterialUI.SvgIcon; + export var DeviceAccessAlarms: __MaterialUI.SvgIcon; + export var DeviceAccessTime: __MaterialUI.SvgIcon; + export var DeviceAddAlarm: __MaterialUI.SvgIcon; + export var DeviceAirplanemodeActive: __MaterialUI.SvgIcon; + export var DeviceAirplanemodeInactive: __MaterialUI.SvgIcon; + export var DeviceBattery20: __MaterialUI.SvgIcon; + export var DeviceBattery30: __MaterialUI.SvgIcon; + export var DeviceBattery50: __MaterialUI.SvgIcon; + export var DeviceBattery60: __MaterialUI.SvgIcon; + export var DeviceBattery80: __MaterialUI.SvgIcon; + export var DeviceBattery90: __MaterialUI.SvgIcon; + export var DeviceBatteryAlert: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging20: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging30: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging50: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging60: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging80: __MaterialUI.SvgIcon; + export var DeviceBatteryCharging90: __MaterialUI.SvgIcon; + export var DeviceBatteryChargingFull: __MaterialUI.SvgIcon; + export var DeviceBatteryFull: __MaterialUI.SvgIcon; + export var DeviceBatteryStd: __MaterialUI.SvgIcon; + export var DeviceBatteryUnknown: __MaterialUI.SvgIcon; + export var DeviceBluetoothConnected: __MaterialUI.SvgIcon; + export var DeviceBluetoothDisabled: __MaterialUI.SvgIcon; + export var DeviceBluetoothSearching: __MaterialUI.SvgIcon; + export var DeviceBluetooth: __MaterialUI.SvgIcon; + export var DeviceBrightnessAuto: __MaterialUI.SvgIcon; + export var DeviceBrightnessHigh: __MaterialUI.SvgIcon; + export var DeviceBrightnessLow: __MaterialUI.SvgIcon; + export var DeviceBrightnessMedium: __MaterialUI.SvgIcon; + export var DeviceDataUsage: __MaterialUI.SvgIcon; + export var DeviceDeveloperMode: __MaterialUI.SvgIcon; + export var DeviceDevices: __MaterialUI.SvgIcon; + export var DeviceDvr: __MaterialUI.SvgIcon; + export var DeviceGpsFixed: __MaterialUI.SvgIcon; + export var DeviceGpsNotFixed: __MaterialUI.SvgIcon; + export var DeviceGpsOff: __MaterialUI.SvgIcon; + export var DeviceGraphicEq: __MaterialUI.SvgIcon; + export var DeviceLocationDisabled: __MaterialUI.SvgIcon; + export var DeviceLocationSearching: __MaterialUI.SvgIcon; + export var DeviceNetworkCell: __MaterialUI.SvgIcon; + export var DeviceNetworkWifi: __MaterialUI.SvgIcon; + export var DeviceNfc: __MaterialUI.SvgIcon; + export var DeviceScreenLockLandscape: __MaterialUI.SvgIcon; + export var DeviceScreenLockPortrait: __MaterialUI.SvgIcon; + export var DeviceScreenLockRotation: __MaterialUI.SvgIcon; + export var DeviceScreenRotation: __MaterialUI.SvgIcon; + export var DeviceSdStorage: __MaterialUI.SvgIcon; + export var DeviceSettingsSystemDaydream: __MaterialUI.SvgIcon; + export var DeviceSignalCellular0Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellular1Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellular2Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellular3Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellular4Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularConnectedNoInternet0Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularConnectedNoInternet1Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularConnectedNoInternet2Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularConnectedNoInternet3Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularConnectedNoInternet4Bar: __MaterialUI.SvgIcon; + export var DeviceSignalCellularNoSim: __MaterialUI.SvgIcon; + export var DeviceSignalCellularNull: __MaterialUI.SvgIcon; + export var DeviceSignalCellularOff: __MaterialUI.SvgIcon; + export var DeviceSignalWifi0Bar: __MaterialUI.SvgIcon; + export var DeviceSignalWifi1BarLock: __MaterialUI.SvgIcon; + export var DeviceSignalWifi1Bar: __MaterialUI.SvgIcon; + export var DeviceSignalWifi2BarLock: __MaterialUI.SvgIcon; + export var DeviceSignalWifi2Bar: __MaterialUI.SvgIcon; + export var DeviceSignalWifi3BarLock: __MaterialUI.SvgIcon; + export var DeviceSignalWifi3Bar: __MaterialUI.SvgIcon; + export var DeviceSignalWifi4BarLock: __MaterialUI.SvgIcon; + export var DeviceSignalWifi4Bar: __MaterialUI.SvgIcon; + export var DeviceSignalWifiOff: __MaterialUI.SvgIcon; + export var DeviceStorage: __MaterialUI.SvgIcon; + export var DeviceUsb: __MaterialUI.SvgIcon; + export var DeviceWallpaper: __MaterialUI.SvgIcon; + export var DeviceWidgets: __MaterialUI.SvgIcon; + export var DeviceWifiLock: __MaterialUI.SvgIcon; + export var DeviceWifiTethering: __MaterialUI.SvgIcon; + export var EditorAttachFile: __MaterialUI.SvgIcon; + export var EditorAttachMoney: __MaterialUI.SvgIcon; + export var EditorBorderAll: __MaterialUI.SvgIcon; + export var EditorBorderBottom: __MaterialUI.SvgIcon; + export var EditorBorderClear: __MaterialUI.SvgIcon; + export var EditorBorderColor: __MaterialUI.SvgIcon; + export var EditorBorderHorizontal: __MaterialUI.SvgIcon; + export var EditorBorderInner: __MaterialUI.SvgIcon; + export var EditorBorderLeft: __MaterialUI.SvgIcon; + export var EditorBorderOuter: __MaterialUI.SvgIcon; + export var EditorBorderRight: __MaterialUI.SvgIcon; + export var EditorBorderStyle: __MaterialUI.SvgIcon; + export var EditorBorderTop: __MaterialUI.SvgIcon; + export var EditorBorderVertical: __MaterialUI.SvgIcon; + export var EditorDragHandle: __MaterialUI.SvgIcon; + export var EditorFormatAlignCenter: __MaterialUI.SvgIcon; + export var EditorFormatAlignJustify: __MaterialUI.SvgIcon; + export var EditorFormatAlignLeft: __MaterialUI.SvgIcon; + export var EditorFormatAlignRight: __MaterialUI.SvgIcon; + export var EditorFormatBold: __MaterialUI.SvgIcon; + export var EditorFormatClear: __MaterialUI.SvgIcon; + export var EditorFormatColorFill: __MaterialUI.SvgIcon; + export var EditorFormatColorReset: __MaterialUI.SvgIcon; + export var EditorFormatColorText: __MaterialUI.SvgIcon; + export var EditorFormatIndentDecrease: __MaterialUI.SvgIcon; + export var EditorFormatIndentIncrease: __MaterialUI.SvgIcon; + export var EditorFormatItalic: __MaterialUI.SvgIcon; + export var EditorFormatLineSpacing: __MaterialUI.SvgIcon; + export var EditorFormatListBulleted: __MaterialUI.SvgIcon; + export var EditorFormatListNumbered: __MaterialUI.SvgIcon; + export var EditorFormatPaint: __MaterialUI.SvgIcon; + export var EditorFormatQuote: __MaterialUI.SvgIcon; + export var EditorFormatShapes: __MaterialUI.SvgIcon; + export var EditorFormatSize: __MaterialUI.SvgIcon; + export var EditorFormatStrikethrough: __MaterialUI.SvgIcon; + export var EditorFormatTextdirectionLToR: __MaterialUI.SvgIcon; + export var EditorFormatTextdirectionRToL: __MaterialUI.SvgIcon; + export var EditorFormatUnderlined: __MaterialUI.SvgIcon; + export var EditorFunctions: __MaterialUI.SvgIcon; + export var EditorHighlight: __MaterialUI.SvgIcon; + export var EditorInsertChart: __MaterialUI.SvgIcon; + export var EditorInsertComment: __MaterialUI.SvgIcon; + export var EditorInsertDriveFile: __MaterialUI.SvgIcon; + export var EditorInsertEmoticon: __MaterialUI.SvgIcon; + export var EditorInsertInvitation: __MaterialUI.SvgIcon; + export var EditorInsertLink: __MaterialUI.SvgIcon; + export var EditorInsertPhoto: __MaterialUI.SvgIcon; + export var EditorLinearScale: __MaterialUI.SvgIcon; + export var EditorMergeType: __MaterialUI.SvgIcon; + export var EditorModeComment: __MaterialUI.SvgIcon; + export var EditorModeEdit: __MaterialUI.SvgIcon; + export var EditorMoneyOff: __MaterialUI.SvgIcon; + export var EditorPublish: __MaterialUI.SvgIcon; + export var EditorShortText: __MaterialUI.SvgIcon; + export var EditorSpaceBar: __MaterialUI.SvgIcon; + export var EditorStrikethroughS: __MaterialUI.SvgIcon; + export var EditorTextFields: __MaterialUI.SvgIcon; + export var EditorVerticalAlignBottom: __MaterialUI.SvgIcon; + export var EditorVerticalAlignCenter: __MaterialUI.SvgIcon; + export var EditorVerticalAlignTop: __MaterialUI.SvgIcon; + export var EditorWrapText: __MaterialUI.SvgIcon; + export var FileAttachment: __MaterialUI.SvgIcon; + export var FileCloudCircle: __MaterialUI.SvgIcon; + export var FileCloudDone: __MaterialUI.SvgIcon; + export var FileCloudDownload: __MaterialUI.SvgIcon; + export var FileCloudOff: __MaterialUI.SvgIcon; + export var FileCloudQueue: __MaterialUI.SvgIcon; + export var FileCloudUpload: __MaterialUI.SvgIcon; + export var FileCloud: __MaterialUI.SvgIcon; + export var FileCreateNewFolder: __MaterialUI.SvgIcon; + export var FileFileDownload: __MaterialUI.SvgIcon; + export var FileFileUpload: __MaterialUI.SvgIcon; + export var FileFolderOpen: __MaterialUI.SvgIcon; + export var FileFolderShared: __MaterialUI.SvgIcon; + export var FileFolder: __MaterialUI.SvgIcon; + export var HardwareCastConnected: __MaterialUI.SvgIcon; + export var HardwareCast: __MaterialUI.SvgIcon; + export var HardwareComputer: __MaterialUI.SvgIcon; + export var HardwareDesktopMac: __MaterialUI.SvgIcon; + export var HardwareDesktopWindows: __MaterialUI.SvgIcon; + export var HardwareDeveloperBoard: __MaterialUI.SvgIcon; + export var HardwareDeviceHub: __MaterialUI.SvgIcon; + export var HardwareDevicesOther: __MaterialUI.SvgIcon; + export var HardwareDock: __MaterialUI.SvgIcon; + export var HardwareGamepad: __MaterialUI.SvgIcon; + export var HardwareHeadsetMic: __MaterialUI.SvgIcon; + export var HardwareHeadset: __MaterialUI.SvgIcon; + export var HardwareKeyboardArrowDown: __MaterialUI.SvgIcon; + export var HardwareKeyboardArrowLeft: __MaterialUI.SvgIcon; + export var HardwareKeyboardArrowRight: __MaterialUI.SvgIcon; + export var HardwareKeyboardArrowUp: __MaterialUI.SvgIcon; + export var HardwareKeyboardBackspace: __MaterialUI.SvgIcon; + export var HardwareKeyboardCapslock: __MaterialUI.SvgIcon; + export var HardwareKeyboardHide: __MaterialUI.SvgIcon; + export var HardwareKeyboardReturn: __MaterialUI.SvgIcon; + export var HardwareKeyboardTab: __MaterialUI.SvgIcon; + export var HardwareKeyboardVoice: __MaterialUI.SvgIcon; + export var HardwareKeyboard: __MaterialUI.SvgIcon; + export var HardwareLaptopChromebook: __MaterialUI.SvgIcon; + export var HardwareLaptopMac: __MaterialUI.SvgIcon; + export var HardwareLaptopWindows: __MaterialUI.SvgIcon; + export var HardwareLaptop: __MaterialUI.SvgIcon; + export var HardwareMemory: __MaterialUI.SvgIcon; + export var HardwareMouse: __MaterialUI.SvgIcon; + export var HardwarePhoneAndroid: __MaterialUI.SvgIcon; + export var HardwarePhoneIphone: __MaterialUI.SvgIcon; + export var HardwarePhonelinkOff: __MaterialUI.SvgIcon; + export var HardwarePhonelink: __MaterialUI.SvgIcon; + export var HardwarePowerInput: __MaterialUI.SvgIcon; + export var HardwareRouter: __MaterialUI.SvgIcon; + export var HardwareScanner: __MaterialUI.SvgIcon; + export var HardwareSecurity: __MaterialUI.SvgIcon; + export var HardwareSimCard: __MaterialUI.SvgIcon; + export var HardwareSmartphone: __MaterialUI.SvgIcon; + export var HardwareSpeakerGroup: __MaterialUI.SvgIcon; + export var HardwareSpeaker: __MaterialUI.SvgIcon; + export var HardwareTabletAndroid: __MaterialUI.SvgIcon; + export var HardwareTabletMac: __MaterialUI.SvgIcon; + export var HardwareTablet: __MaterialUI.SvgIcon; + export var HardwareToys: __MaterialUI.SvgIcon; + export var HardwareTv: __MaterialUI.SvgIcon; + export var HardwareVideogameAsset: __MaterialUI.SvgIcon; + export var HardwareWatch: __MaterialUI.SvgIcon; + export var ImageAddAPhoto: __MaterialUI.SvgIcon; + export var ImageAddToPhotos: __MaterialUI.SvgIcon; + export var ImageAdjust: __MaterialUI.SvgIcon; + export var ImageAssistantPhoto: __MaterialUI.SvgIcon; + export var ImageAssistant: __MaterialUI.SvgIcon; + export var ImageAudiotrack: __MaterialUI.SvgIcon; + export var ImageBlurCircular: __MaterialUI.SvgIcon; + export var ImageBlurLinear: __MaterialUI.SvgIcon; + export var ImageBlurOff: __MaterialUI.SvgIcon; + export var ImageBlurOn: __MaterialUI.SvgIcon; + export var ImageBrightness1: __MaterialUI.SvgIcon; + export var ImageBrightness2: __MaterialUI.SvgIcon; + export var ImageBrightness3: __MaterialUI.SvgIcon; + export var ImageBrightness4: __MaterialUI.SvgIcon; + export var ImageBrightness5: __MaterialUI.SvgIcon; + export var ImageBrightness6: __MaterialUI.SvgIcon; + export var ImageBrightness7: __MaterialUI.SvgIcon; + export var ImageBrokenImage: __MaterialUI.SvgIcon; + export var ImageBrush: __MaterialUI.SvgIcon; + export var ImageCameraAlt: __MaterialUI.SvgIcon; + export var ImageCameraFront: __MaterialUI.SvgIcon; + export var ImageCameraRear: __MaterialUI.SvgIcon; + export var ImageCameraRoll: __MaterialUI.SvgIcon; + export var ImageCamera: __MaterialUI.SvgIcon; + export var ImageCenterFocusStrong: __MaterialUI.SvgIcon; + export var ImageCenterFocusWeak: __MaterialUI.SvgIcon; + export var ImageCollectionsBookmark: __MaterialUI.SvgIcon; + export var ImageCollections: __MaterialUI.SvgIcon; + export var ImageColorLens: __MaterialUI.SvgIcon; + export var ImageColorize: __MaterialUI.SvgIcon; + export var ImageCompare: __MaterialUI.SvgIcon; + export var ImageControlPointDuplicate: __MaterialUI.SvgIcon; + export var ImageControlPoint: __MaterialUI.SvgIcon; + export var ImageCrop169: __MaterialUI.SvgIcon; + export var ImageCrop32: __MaterialUI.SvgIcon; + export var ImageCrop54: __MaterialUI.SvgIcon; + export var ImageCrop75: __MaterialUI.SvgIcon; + export var ImageCropDin: __MaterialUI.SvgIcon; + export var ImageCropFree: __MaterialUI.SvgIcon; + export var ImageCropLandscape: __MaterialUI.SvgIcon; + export var ImageCropOriginal: __MaterialUI.SvgIcon; + export var ImageCropPortrait: __MaterialUI.SvgIcon; + export var ImageCropRotate: __MaterialUI.SvgIcon; + export var ImageCropSquare: __MaterialUI.SvgIcon; + export var ImageCrop: __MaterialUI.SvgIcon; + export var ImageDehaze: __MaterialUI.SvgIcon; + export var ImageDetails: __MaterialUI.SvgIcon; + export var ImageEdit: __MaterialUI.SvgIcon; + export var ImageExposureNeg1: __MaterialUI.SvgIcon; + export var ImageExposureNeg2: __MaterialUI.SvgIcon; + export var ImageExposurePlus1: __MaterialUI.SvgIcon; + export var ImageExposurePlus2: __MaterialUI.SvgIcon; + export var ImageExposureZero: __MaterialUI.SvgIcon; + export var ImageExposure: __MaterialUI.SvgIcon; + export var ImageFilter1: __MaterialUI.SvgIcon; + export var ImageFilter2: __MaterialUI.SvgIcon; + export var ImageFilter3: __MaterialUI.SvgIcon; + export var ImageFilter4: __MaterialUI.SvgIcon; + export var ImageFilter5: __MaterialUI.SvgIcon; + export var ImageFilter6: __MaterialUI.SvgIcon; + export var ImageFilter7: __MaterialUI.SvgIcon; + export var ImageFilter8: __MaterialUI.SvgIcon; + export var ImageFilter9Plus: __MaterialUI.SvgIcon; + export var ImageFilter9: __MaterialUI.SvgIcon; + export var ImageFilterBAndW: __MaterialUI.SvgIcon; + export var ImageFilterCenterFocus: __MaterialUI.SvgIcon; + export var ImageFilterDrama: __MaterialUI.SvgIcon; + export var ImageFilterFrames: __MaterialUI.SvgIcon; + export var ImageFilterHdr: __MaterialUI.SvgIcon; + export var ImageFilterNone: __MaterialUI.SvgIcon; + export var ImageFilterTiltShift: __MaterialUI.SvgIcon; + export var ImageFilterVintage: __MaterialUI.SvgIcon; + export var ImageFilter: __MaterialUI.SvgIcon; + export var ImageFlare: __MaterialUI.SvgIcon; + export var ImageFlashAuto: __MaterialUI.SvgIcon; + export var ImageFlashOff: __MaterialUI.SvgIcon; + export var ImageFlashOn: __MaterialUI.SvgIcon; + export var ImageFlip: __MaterialUI.SvgIcon; + export var ImageGradient: __MaterialUI.SvgIcon; + export var ImageGrain: __MaterialUI.SvgIcon; + export var ImageGridOff: __MaterialUI.SvgIcon; + export var ImageGridOn: __MaterialUI.SvgIcon; + export var ImageHdrOff: __MaterialUI.SvgIcon; + export var ImageHdrOn: __MaterialUI.SvgIcon; + export var ImageHdrStrong: __MaterialUI.SvgIcon; + export var ImageHdrWeak: __MaterialUI.SvgIcon; + export var ImageHealing: __MaterialUI.SvgIcon; + export var ImageImageAspectRatio: __MaterialUI.SvgIcon; + export var ImageImage: __MaterialUI.SvgIcon; + export var ImageIso: __MaterialUI.SvgIcon; + export var ImageLandscape: __MaterialUI.SvgIcon; + export var ImageLeakAdd: __MaterialUI.SvgIcon; + export var ImageLeakRemove: __MaterialUI.SvgIcon; + export var ImageLens: __MaterialUI.SvgIcon; + export var ImageLinkedCamera: __MaterialUI.SvgIcon; + export var ImageLooks3: __MaterialUI.SvgIcon; + export var ImageLooks4: __MaterialUI.SvgIcon; + export var ImageLooks5: __MaterialUI.SvgIcon; + export var ImageLooks6: __MaterialUI.SvgIcon; + export var ImageLooksOne: __MaterialUI.SvgIcon; + export var ImageLooksTwo: __MaterialUI.SvgIcon; + export var ImageLooks: __MaterialUI.SvgIcon; + export var ImageLoupe: __MaterialUI.SvgIcon; + export var ImageMonochromePhotos: __MaterialUI.SvgIcon; + export var ImageMovieCreation: __MaterialUI.SvgIcon; + export var ImageMovieFilter: __MaterialUI.SvgIcon; + export var ImageMusicNote: __MaterialUI.SvgIcon; + export var ImageNaturePeople: __MaterialUI.SvgIcon; + export var ImageNature: __MaterialUI.SvgIcon; + export var ImageNavigateBefore: __MaterialUI.SvgIcon; + export var ImageNavigateNext: __MaterialUI.SvgIcon; + export var ImagePalette: __MaterialUI.SvgIcon; + export var ImagePanoramaFishEye: __MaterialUI.SvgIcon; + export var ImagePanoramaHorizontal: __MaterialUI.SvgIcon; + export var ImagePanoramaVertical: __MaterialUI.SvgIcon; + export var ImagePanoramaWideAngle: __MaterialUI.SvgIcon; + export var ImagePanorama: __MaterialUI.SvgIcon; + export var ImagePhotoAlbum: __MaterialUI.SvgIcon; + export var ImagePhotoCamera: __MaterialUI.SvgIcon; + export var ImagePhotoFilter: __MaterialUI.SvgIcon; + export var ImagePhotoLibrary: __MaterialUI.SvgIcon; + export var ImagePhotoSizeSelectActual: __MaterialUI.SvgIcon; + export var ImagePhotoSizeSelectLarge: __MaterialUI.SvgIcon; + export var ImagePhotoSizeSelectSmall: __MaterialUI.SvgIcon; + export var ImagePhoto: __MaterialUI.SvgIcon; + export var ImagePictureAsPdf: __MaterialUI.SvgIcon; + export var ImagePortrait: __MaterialUI.SvgIcon; + export var ImageRemoveRedEye: __MaterialUI.SvgIcon; + export var ImageRotate90DegreesCcw: __MaterialUI.SvgIcon; + export var ImageRotateLeft: __MaterialUI.SvgIcon; + export var ImageRotateRight: __MaterialUI.SvgIcon; + export var ImageSlideshow: __MaterialUI.SvgIcon; + export var ImageStraighten: __MaterialUI.SvgIcon; + export var ImageStyle: __MaterialUI.SvgIcon; + export var ImageSwitchCamera: __MaterialUI.SvgIcon; + export var ImageSwitchVideo: __MaterialUI.SvgIcon; + export var ImageTagFaces: __MaterialUI.SvgIcon; + export var ImageTexture: __MaterialUI.SvgIcon; + export var ImageTimelapse: __MaterialUI.SvgIcon; + export var ImageTimer10: __MaterialUI.SvgIcon; + export var ImageTimer3: __MaterialUI.SvgIcon; + export var ImageTimerOff: __MaterialUI.SvgIcon; + export var ImageTimer: __MaterialUI.SvgIcon; + export var ImageTonality: __MaterialUI.SvgIcon; + export var ImageTransform: __MaterialUI.SvgIcon; + export var ImageTune: __MaterialUI.SvgIcon; + export var ImageViewComfy: __MaterialUI.SvgIcon; + export var ImageViewCompact: __MaterialUI.SvgIcon; + export var ImageVignette: __MaterialUI.SvgIcon; + export var ImageWbAuto: __MaterialUI.SvgIcon; + export var ImageWbCloudy: __MaterialUI.SvgIcon; + export var ImageWbIncandescent: __MaterialUI.SvgIcon; + export var ImageWbIridescent: __MaterialUI.SvgIcon; + export var ImageWbSunny: __MaterialUI.SvgIcon; + export var MapsAddLocation: __MaterialUI.SvgIcon; + export var MapsBeenhere: __MaterialUI.SvgIcon; + export var MapsDirectionsBike: __MaterialUI.SvgIcon; + export var MapsDirectionsBoat: __MaterialUI.SvgIcon; + export var MapsDirectionsBus: __MaterialUI.SvgIcon; + export var MapsDirectionsCar: __MaterialUI.SvgIcon; + export var MapsDirectionsRailway: __MaterialUI.SvgIcon; + export var MapsDirectionsRun: __MaterialUI.SvgIcon; + export var MapsDirectionsSubway: __MaterialUI.SvgIcon; + export var MapsDirectionsTransit: __MaterialUI.SvgIcon; + export var MapsDirectionsWalk: __MaterialUI.SvgIcon; + export var MapsDirections: __MaterialUI.SvgIcon; + export var MapsEditLocation: __MaterialUI.SvgIcon; + export var MapsFlight: __MaterialUI.SvgIcon; + export var MapsHotel: __MaterialUI.SvgIcon; + export var MapsLayersClear: __MaterialUI.SvgIcon; + export var MapsLayers: __MaterialUI.SvgIcon; + export var MapsLocalActivity: __MaterialUI.SvgIcon; + export var MapsLocalAirport: __MaterialUI.SvgIcon; + export var MapsLocalAtm: __MaterialUI.SvgIcon; + export var MapsLocalBar: __MaterialUI.SvgIcon; + export var MapsLocalCafe: __MaterialUI.SvgIcon; + export var MapsLocalCarWash: __MaterialUI.SvgIcon; + export var MapsLocalConvenienceStore: __MaterialUI.SvgIcon; + export var MapsLocalDining: __MaterialUI.SvgIcon; + export var MapsLocalDrink: __MaterialUI.SvgIcon; + export var MapsLocalFlorist: __MaterialUI.SvgIcon; + export var MapsLocalGasStation: __MaterialUI.SvgIcon; + export var MapsLocalGroceryStore: __MaterialUI.SvgIcon; + export var MapsLocalHospital: __MaterialUI.SvgIcon; + export var MapsLocalHotel: __MaterialUI.SvgIcon; + export var MapsLocalLaundryService: __MaterialUI.SvgIcon; + export var MapsLocalLibrary: __MaterialUI.SvgIcon; + export var MapsLocalMall: __MaterialUI.SvgIcon; + export var MapsLocalMovies: __MaterialUI.SvgIcon; + export var MapsLocalOffer: __MaterialUI.SvgIcon; + export var MapsLocalParking: __MaterialUI.SvgIcon; + export var MapsLocalPharmacy: __MaterialUI.SvgIcon; + export var MapsLocalPhone: __MaterialUI.SvgIcon; + export var MapsLocalPizza: __MaterialUI.SvgIcon; + export var MapsLocalPlay: __MaterialUI.SvgIcon; + export var MapsLocalPostOffice: __MaterialUI.SvgIcon; + export var MapsLocalPrintshop: __MaterialUI.SvgIcon; + export var MapsLocalSee: __MaterialUI.SvgIcon; + export var MapsLocalShipping: __MaterialUI.SvgIcon; + export var MapsLocalTaxi: __MaterialUI.SvgIcon; + export var MapsMap: __MaterialUI.SvgIcon; + export var MapsMyLocation: __MaterialUI.SvgIcon; + export var MapsNavigation: __MaterialUI.SvgIcon; + export var MapsNearMe: __MaterialUI.SvgIcon; + export var MapsPersonPinCircle: __MaterialUI.SvgIcon; + export var MapsPersonPin: __MaterialUI.SvgIcon; + export var MapsPinDrop: __MaterialUI.SvgIcon; + export var MapsPlace: __MaterialUI.SvgIcon; + export var MapsRateReview: __MaterialUI.SvgIcon; + export var MapsRestaurantMenu: __MaterialUI.SvgIcon; + export var MapsSatellite: __MaterialUI.SvgIcon; + export var MapsStoreMallDirectory: __MaterialUI.SvgIcon; + export var MapsTerrain: __MaterialUI.SvgIcon; + export var MapsTraffic: __MaterialUI.SvgIcon; + export var MapsZoomOutMap: __MaterialUI.SvgIcon; + export var NavigationApps: __MaterialUI.SvgIcon; + export var NavigationArrowBack: __MaterialUI.SvgIcon; + export var NavigationArrowDownward: __MaterialUI.SvgIcon; + export var NavigationArrowDropDownCircle: __MaterialUI.SvgIcon; + export var NavigationArrowDropDown: __MaterialUI.SvgIcon; + export var NavigationArrowDropUp: __MaterialUI.SvgIcon; + export var NavigationArrowForward: __MaterialUI.SvgIcon; + export var NavigationArrowUpward: __MaterialUI.SvgIcon; + export var NavigationCancel: __MaterialUI.SvgIcon; + export var NavigationCheck: __MaterialUI.SvgIcon; + export var NavigationChevronLeft: __MaterialUI.SvgIcon; + export var NavigationChevronRight: __MaterialUI.SvgIcon; + export var NavigationClose: __MaterialUI.SvgIcon; + export var NavigationExpandLess: __MaterialUI.SvgIcon; + export var NavigationExpandMore: __MaterialUI.SvgIcon; + export var NavigationFullscreenExit: __MaterialUI.SvgIcon; + export var NavigationFullscreen: __MaterialUI.SvgIcon; + export var NavigationMenu: __MaterialUI.SvgIcon; + export var NavigationMoreHoriz: __MaterialUI.SvgIcon; + export var NavigationMoreVert: __MaterialUI.SvgIcon; + export var NavigationRefresh: __MaterialUI.SvgIcon; + export var NavigationSubdirectoryArrowLeft: __MaterialUI.SvgIcon; + export var NavigationSubdirectoryArrowRight: __MaterialUI.SvgIcon; + export var NavigationUnfoldLess: __MaterialUI.SvgIcon; + export var NavigationUnfoldMore: __MaterialUI.SvgIcon; + export var NavigationArrowDropRight: __MaterialUI.SvgIcon; + export var NotificationAdb: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatFlatAngled: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatFlat: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatIndividualSuite: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatLegroomExtra: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatLegroomNormal: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatLegroomReduced: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatReclineExtra: __MaterialUI.SvgIcon; + export var NotificationAirlineSeatReclineNormal: __MaterialUI.SvgIcon; + export var NotificationBluetoothAudio: __MaterialUI.SvgIcon; + export var NotificationConfirmationNumber: __MaterialUI.SvgIcon; + export var NotificationDiscFull: __MaterialUI.SvgIcon; + export var NotificationDoNotDisturbAlt: __MaterialUI.SvgIcon; + export var NotificationDoNotDisturb: __MaterialUI.SvgIcon; + export var NotificationDriveEta: __MaterialUI.SvgIcon; + export var NotificationEnhancedEncryption: __MaterialUI.SvgIcon; + export var NotificationEventAvailable: __MaterialUI.SvgIcon; + export var NotificationEventBusy: __MaterialUI.SvgIcon; + export var NotificationEventNote: __MaterialUI.SvgIcon; + export var NotificationFolderSpecial: __MaterialUI.SvgIcon; + export var NotificationLiveTv: __MaterialUI.SvgIcon; + export var NotificationMms: __MaterialUI.SvgIcon; + export var NotificationMore: __MaterialUI.SvgIcon; + export var NotificationNetworkCheck: __MaterialUI.SvgIcon; + export var NotificationNetworkLocked: __MaterialUI.SvgIcon; + export var NotificationNoEncryption: __MaterialUI.SvgIcon; + export var NotificationOndemandVideo: __MaterialUI.SvgIcon; + export var NotificationPersonalVideo: __MaterialUI.SvgIcon; + export var NotificationPhoneBluetoothSpeaker: __MaterialUI.SvgIcon; + export var NotificationPhoneForwarded: __MaterialUI.SvgIcon; + export var NotificationPhoneInTalk: __MaterialUI.SvgIcon; + export var NotificationPhoneLocked: __MaterialUI.SvgIcon; + export var NotificationPhoneMissed: __MaterialUI.SvgIcon; + export var NotificationPhonePaused: __MaterialUI.SvgIcon; + export var NotificationPower: __MaterialUI.SvgIcon; + export var NotificationRvHookup: __MaterialUI.SvgIcon; + export var NotificationSdCard: __MaterialUI.SvgIcon; + export var NotificationSimCardAlert: __MaterialUI.SvgIcon; + export var NotificationSmsFailed: __MaterialUI.SvgIcon; + export var NotificationSms: __MaterialUI.SvgIcon; + export var NotificationSyncDisabled: __MaterialUI.SvgIcon; + export var NotificationSyncProblem: __MaterialUI.SvgIcon; + export var NotificationSync: __MaterialUI.SvgIcon; + export var NotificationSystemUpdate: __MaterialUI.SvgIcon; + export var NotificationTapAndPlay: __MaterialUI.SvgIcon; + export var NotificationTimeToLeave: __MaterialUI.SvgIcon; + export var NotificationVibration: __MaterialUI.SvgIcon; + export var NotificationVoiceChat: __MaterialUI.SvgIcon; + export var NotificationVpnLock: __MaterialUI.SvgIcon; + export var NotificationWc: __MaterialUI.SvgIcon; + export var NotificationWifi: __MaterialUI.SvgIcon; + export var PlacesAcUnit: __MaterialUI.SvgIcon; + export var PlacesAirportShuttle: __MaterialUI.SvgIcon; + export var PlacesAllInclusive: __MaterialUI.SvgIcon; + export var PlacesBeachAccess: __MaterialUI.SvgIcon; + export var PlacesBusinessCenter: __MaterialUI.SvgIcon; + export var PlacesCasino: __MaterialUI.SvgIcon; + export var PlacesChildCare: __MaterialUI.SvgIcon; + export var PlacesChildFriendly: __MaterialUI.SvgIcon; + export var PlacesFitnessCenter: __MaterialUI.SvgIcon; + export var PlacesFreeBreakfast: __MaterialUI.SvgIcon; + export var PlacesGolfCourse: __MaterialUI.SvgIcon; + export var PlacesHotTub: __MaterialUI.SvgIcon; + export var PlacesKitchen: __MaterialUI.SvgIcon; + export var PlacesPool: __MaterialUI.SvgIcon; + export var PlacesRoomService: __MaterialUI.SvgIcon; + export var PlacesSmokeFree: __MaterialUI.SvgIcon; + export var PlacesSmokingRooms: __MaterialUI.SvgIcon; + export var PlacesSpa: __MaterialUI.SvgIcon; + export var SocialCake: __MaterialUI.SvgIcon; + export var SocialDomain: __MaterialUI.SvgIcon; + export var SocialGroupAdd: __MaterialUI.SvgIcon; + export var SocialGroup: __MaterialUI.SvgIcon; + export var SocialLocationCity: __MaterialUI.SvgIcon; + export var SocialMoodBad: __MaterialUI.SvgIcon; + export var SocialMood: __MaterialUI.SvgIcon; + export var SocialNotificationsActive: __MaterialUI.SvgIcon; + export var SocialNotificationsNone: __MaterialUI.SvgIcon; + export var SocialNotificationsOff: __MaterialUI.SvgIcon; + export var SocialNotificationsPaused: __MaterialUI.SvgIcon; + export var SocialNotifications: __MaterialUI.SvgIcon; + export var SocialPages: __MaterialUI.SvgIcon; + export var SocialPartyMode: __MaterialUI.SvgIcon; + export var SocialPeopleOutline: __MaterialUI.SvgIcon; + export var SocialPeople: __MaterialUI.SvgIcon; + export var SocialPersonAdd: __MaterialUI.SvgIcon; + export var SocialPersonOutline: __MaterialUI.SvgIcon; + export var SocialPerson: __MaterialUI.SvgIcon; + export var SocialPlusOne: __MaterialUI.SvgIcon; + export var SocialPoll: __MaterialUI.SvgIcon; + export var SocialPublic: __MaterialUI.SvgIcon; + export var SocialSchool: __MaterialUI.SvgIcon; + export var SocialShare: __MaterialUI.SvgIcon; + export var SocialWhatshot: __MaterialUI.SvgIcon; + export var ToggleCheckBoxOutlineBlank: __MaterialUI.SvgIcon; + export var ToggleCheckBox: __MaterialUI.SvgIcon; + export var ToggleIndeterminateCheckBox: __MaterialUI.SvgIcon; + export var ToggleRadioButtonChecked: __MaterialUI.SvgIcon; + export var ToggleRadioButtonUnchecked: __MaterialUI.SvgIcon; + export var ToggleStarBorder: __MaterialUI.SvgIcon; + export var ToggleStarHalf: __MaterialUI.SvgIcon; + export var ToggleStar: __MaterialUI.SvgIcon; +} \ No newline at end of file From f3e78999f2264401cb7f633a9d4aa67503281324 Mon Sep 17 00:00:00 2001 From: Benjamin Pannell Date: Mon, 1 Feb 2016 09:55:44 +0200 Subject: [PATCH 037/113] Update ravenjs definition to match latest API More details about the latest API can be found at --- ravenjs/ravenjs.d.ts | 65 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/ravenjs/ravenjs.d.ts b/ravenjs/ravenjs.d.ts index c88aabc58..434d804ab 100644 --- a/ravenjs/ravenjs.d.ts +++ b/ravenjs/ravenjs.d.ts @@ -1,14 +1,22 @@ // Type definitions for Raven.js // Project: https://github.com/getsentry/raven-js -// Definitions by: Santi Albo +// Definitions by: Santi Albo , Benjamin Pannell // Definitions: https://github.com/borisyankov/DefinitelyTyped declare var Raven: RavenStatic; interface RavenOptions { + /** The log level associated with this event. Default: error */ + level?: string; /** The name of the logger used by Sentry. Default: javascript */ logger?: string; + + /** The release version of the application you are monitoring with Sentry */ + release?: string; + + /** The name of the server or device that the client is running on */ + serverName?: string; /** List of messages to be fitlered out before being sent to Sentry. */ ignoreErrors?: string[]; @@ -23,9 +31,26 @@ interface RavenOptions { includePaths?: RegExp[]; /** Additional data to be tagged onto the error. */ - tags?: any; + tags?: { + [id: string]: string; + }; extra?: any; + + /** In some cases you may see issues where Sentry groups multiple events together when they should be separate entities. In other cases, Sentry simply doesn’t group events together because they’re so sporadic that they never look the same. */ + fingerprint?: string[]; + + /** A function which allows mutation of the data payload right before being sent to Sentry */ + dataCallback?: (data: any) => any; + + /** A callback function that allows you to apply your own filters to determine if the message should be sent to Sentry. */ + shouldSendCallback?: (data: any) => boolean; + + /** By default, Raven does not truncate messages. If you need to truncate characters for whatever reason, you may set this to limit the length. */ + maxMessageLength?: number; + + /** Override the default HTTP data transport handler. */ + transport?: (options: RavenTransportOptions) => void; } interface RavenStatic { @@ -88,6 +113,8 @@ interface RavenStatic { */ wrap(func: Function): Function; wrap(options: RavenOptions, func: Function): Function; + wrap(func: T): T; + wrap(options: RavenOptions, func: T): T; /* * Uninstalls the global error handler. @@ -114,11 +141,41 @@ interface RavenStatic { */ captureMessage(msg: string, options?: RavenOptions): RavenStatic; + /** + * Clear the user context, removing the user data that would be sent to Sentry. + */ + setUserContext(): RavenStatic; + /* - * Set/clear a user to be sent along with the payload. + * Set a user to be sent along with the payload. * * @param {object} user An object representing user data [optional] * @return {Raven} */ - setUser(user?: any): RavenStatic; + setUserContext(user: { + id?: string; + username?: string; + email?: string; + }): RavenStatic; + + /** Override the default HTTP data transport handler. */ + setTransport(transportFunction: (options: RavenTransportOptions) => void); + + /** An event id is a globally unique id for the event that was just sent. This event id can be used to find the exact event from within Sentry. */ + lastEventId(): string; + + /** If you need to conditionally check if raven needs to be initialized or not, you can use the isSetup function. It will return true if Raven is already initialized. */ + isSetup(): boolean; +} + +interface RavenTransportOptions { + url: string; + data: any; + auth: { + sentry_version: string; + sentry_client: string; + sentry_key: string; + }; + onSuccess: () => void; + onFailure: () => void; } From 803fd62a1005b3afe0c9922643b1c58feb64ffd6 Mon Sep 17 00:00:00 2001 From: Benjamin Pannell Date: Mon, 1 Feb 2016 10:01:00 +0200 Subject: [PATCH 038/113] fix: Correctly specify generic inheritance Bit of my C# sneaking in there... --- ravenjs/ravenjs.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ravenjs/ravenjs.d.ts b/ravenjs/ravenjs.d.ts index 434d804ab..cc06a4dfc 100644 --- a/ravenjs/ravenjs.d.ts +++ b/ravenjs/ravenjs.d.ts @@ -113,8 +113,8 @@ interface RavenStatic { */ wrap(func: Function): Function; wrap(options: RavenOptions, func: Function): Function; - wrap(func: T): T; - wrap(options: RavenOptions, func: T): T; + wrap(func: T): T; + wrap(options: RavenOptions, func: T): T; /* * Uninstalls the global error handler. From 8dafd4189a7693a722fc52c194ba339cdbc5d7fa Mon Sep 17 00:00:00 2001 From: Benjamin Pannell Date: Mon, 1 Feb 2016 10:02:44 +0200 Subject: [PATCH 039/113] fix: Have setTransport return RavenStatic interface --- ravenjs/ravenjs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ravenjs/ravenjs.d.ts b/ravenjs/ravenjs.d.ts index cc06a4dfc..629140d8b 100644 --- a/ravenjs/ravenjs.d.ts +++ b/ravenjs/ravenjs.d.ts @@ -159,7 +159,7 @@ interface RavenStatic { }): RavenStatic; /** Override the default HTTP data transport handler. */ - setTransport(transportFunction: (options: RavenTransportOptions) => void); + setTransport(transportFunction: (options: RavenTransportOptions) => void): RavenStatic; /** An event id is a globally unique id for the event that was just sent. This event id can be used to find the exact event from within Sentry. */ lastEventId(): string; From 03aeef911ff3b195c65c64e0ebf6bf493f8c45f8 Mon Sep 17 00:00:00 2001 From: Benjamin Pannell Date: Mon, 1 Feb 2016 10:03:18 +0200 Subject: [PATCH 040/113] test: Update ravenjs tests to reflect new API --- ravenjs/ravenjs-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ravenjs/ravenjs-tests.ts b/ravenjs/ravenjs-tests.ts index d767308f7..f83cc527b 100644 --- a/ravenjs/ravenjs-tests.ts +++ b/ravenjs/ravenjs-tests.ts @@ -33,7 +33,7 @@ Raven.context({tags: { key: "value" }}, throwsError); setTimeout(Raven.wrap(throwsError), 1000); Raven.wrap({logger: "my.module"}, throwsError)(); -Raven.setUser({ +Raven.setUserContext({ email: 'matt@example.com', id: '123' }); From 3d46732540857d6ec155413301513920067cffaf Mon Sep 17 00:00:00 2001 From: Ke Peng Date: Mon, 1 Feb 2016 15:56:06 +0800 Subject: [PATCH 041/113] add type define for traverse --- traverse/traverse-tests.ts | 40 ++++++++++++++++++++++++++++++++++++++ traverse/traverse.d.ts | 22 +++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 traverse/traverse-tests.ts create mode 100644 traverse/traverse.d.ts diff --git a/traverse/traverse-tests.ts b/traverse/traverse-tests.ts new file mode 100644 index 000000000..bc5bfa87c --- /dev/null +++ b/traverse/traverse-tests.ts @@ -0,0 +1,40 @@ +/// + +import traverse = require('traverse'); + +function testForEach(){ + var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + + traverse(obj).forEach(function (x) { + if (x < 0) this.update(x + 128); + }); + + console.dir(obj); +} + +function testReduce(){ + var obj = { + a : [1,2,3], + b : 4, + c : [5,6], + d : { e : [7,8], f : 9 }, + }; + + var leaves = traverse(obj).reduce(function (acc, x) { + if (this.isLeaf) acc.push(x); + return acc; + }, []); + + console.dir(leaves); +} + +function testMap(){ + var c: any[] = [3, 4]; + var obj = { a : 1, b : 2, c : c }; + obj.c.push(obj); + + var scrubbed = traverse(obj).map(function (x) { + if (this.circular) this.remove() + }); + console.dir(scrubbed); +} diff --git a/traverse/traverse.d.ts b/traverse/traverse.d.ts new file mode 100644 index 000000000..c45c3db03 --- /dev/null +++ b/traverse/traverse.d.ts @@ -0,0 +1,22 @@ +// Type definitions for traverse 0.6.6 +// Project: https://github.com/substack/js-traverse +// Definitions by: newclear +// Definitions: https://github.com/newclear/DefinitelyTyped + +declare module "traverse" { + interface Traverse { + get(paths: string[]): any; + has(paths: string[]): boolean; + set(paths: string[], value: any): any; + map(cb: (v: any) => void): any; + forEach(cb: (v: any) => void): any; + reduce(cb: (acc: any, v: any) => void, init?: any): any; + paths(): string[]; + nodes(): any[]; + clone(): any; + } + + function traverse(obj: any): Traverse; + + export = traverse; +} From 14700203a4c18ec5f7739dc7478e7508069ad9fb Mon Sep 17 00:00:00 2001 From: Daniel Lytkin Date: Mon, 1 Feb 2016 15:00:00 +0600 Subject: [PATCH 042/113] Add type definitions for redux-saga --- redux-saga/redux-saga-tests.ts | 172 +++++++++++++++++++++++ redux-saga/redux-saga-tests.ts.tscparams | 1 + redux-saga/redux-saga.d.ts | 110 +++++++++++++++ redux-saga/redux-saga.d.ts.tscparams | 1 + 4 files changed, 284 insertions(+) create mode 100644 redux-saga/redux-saga-tests.ts create mode 100644 redux-saga/redux-saga-tests.ts.tscparams create mode 100644 redux-saga/redux-saga.d.ts create mode 100644 redux-saga/redux-saga.d.ts.tscparams diff --git a/redux-saga/redux-saga-tests.ts b/redux-saga/redux-saga-tests.ts new file mode 100644 index 000000000..933a397b1 --- /dev/null +++ b/redux-saga/redux-saga-tests.ts @@ -0,0 +1,172 @@ +/// + + +import sagaMiddleware, { + take, + put, + race, + call, + fork, + cancel, + storeIO, + runSaga, + Saga, + SagaCancellationException +} from 'redux-saga' +import {applyMiddleware, createStore} from 'redux'; + +declare const delay: (ms: number) => Promise; +declare const fetchApi: (url: string) => Promise; + +namespace GettingStarted { + + const incrementAsync:Saga = function* incrementAsync() { + + while(true) { + + // wait for each INCREMENT_ASYNC action + const nextAction = yield take('INCREMENT_ASYNC') + + // delay is a sample function + // return a Promise that resolves after (ms) milliseconds + yield delay(1000) + + // dispatch INCREMENT_COUNTER + yield put( {type: 'INCREMENT_COUNTER'} ) + } + + } + + const createStoreWithSaga = applyMiddleware( + // ..., + sagaMiddleware(incrementAsync) + )(createStore) + + export default function configureStore(initialState) { + return createStoreWithSaga((state: any) => state, initialState) + } +} + + +namespace EffectCombinators { + const fetchPostsWithTimeout:Saga = function* fetchPostsWithTimeout() { + while( yield take('FETCH_POSTS') ) { + // starts a race between 2 effects + const {posts, timeout} = yield race({ + posts : call(fetchApi, '/posts'), + timeout : call(delay, 1000) + }) + + if(posts) + put( {type: 'RECEIVE_POSTS', posts} ) + else + put( {type: 'TIMEOUT_ERROR'} ) + } + } +} + + +namespace SequencingSagasViaYield { + function showScore(score) { + return { + type: 'SHOW_SCORE', score + } + } + + function* playLevelOne(getState) { yield 1 } + + function* playLevelTwo(getState) { yield 2 } + + function* playLevelThree(getState) { yield 3 } + + const game: Saga = function* game(getState) { + + const score1 = yield* playLevelOne(getState) + yield put(showScore(score1)) + + const score2 = yield* playLevelTwo(getState) + yield put(showScore(score2)) + + const score3 = yield* playLevelThree(getState) + yield put(showScore(score3)) + + } +} + + +namespace ComposingSagas { + function* fetchProducts() { + yield put( {type: 'REQUEST_PRODUCTS'} ) + const products = yield call(fetchApi, '/products') + yield put( {type: 'RECEIVE_PRODUCTS', products } ) + } + + function* watchFetch() { + while ( yield take('FETCH_PRODUCTS') ) { + yield call(fetchProducts) // waits for the fetchProducts task to + // terminate + } + } +} + + +namespace NonBlockingCallsWithForkJoin { + function* fetchPosts() { + yield put( {type: 'REQUEST_POSTS'} ) + const posts = yield call(fetchApi, '/posts') + yield put( {type: 'RECEIVE_POSTS', posts} ) + } + + function* watchFetch() { + while ( yield take('FETCH_POSTS') ) { + yield fork(fetchPosts) // non blocking call + } + } +} + + +namespace TaskCancellation { + declare const someApi: () => any; + + function* bgSync() { + try { + while(true) { + yield put({type: 'REQUEST_START'}) + const result = yield call(someApi) + yield put({type: 'REQUEST_SUCCESS', result}) + yield call(delay, 5000) + } + } catch(error) { + if(error instanceof SagaCancellationException) + yield put({type: 'REQUEST_FAILURE', message: 'Sync cancelled!'}) + } + } + + function* main() { + while( yield take('START_BACKGROUND_SYNC') ) { + // starts the task in the background + const bgSyncTask = yield fork(bgSync) + + // wait for the user stop action + yield take('STOP_BACKGROUND_SYNC') + // user clicked stop. cancel the background task + // this will throw a SagaCancellationException into the forked bgSync + // task + yield cancel(bgSyncTask) + } + } +} + + +namespace DynamicallyStartingSagasWithRunSaga { + const store = createStore((state: any, action: any) => state); + + function* serverSaga(getState) { + yield getState() + } + + runSaga( + serverSaga(store.getState), + storeIO(store) + ) +} diff --git a/redux-saga/redux-saga-tests.ts.tscparams b/redux-saga/redux-saga-tests.ts.tscparams new file mode 100644 index 000000000..14fce22a5 --- /dev/null +++ b/redux-saga/redux-saga-tests.ts.tscparams @@ -0,0 +1 @@ +--target ES6 diff --git a/redux-saga/redux-saga.d.ts b/redux-saga/redux-saga.d.ts new file mode 100644 index 000000000..6573f1245 --- /dev/null +++ b/redux-saga/redux-saga.d.ts @@ -0,0 +1,110 @@ +// Type definitions for redux-saga 0.6.0 +// Project: https://github.com/yelouafi/redux-saga +// Definitions by: Daniel Lytkin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'redux-saga' { + export class SagaCancellationException { + } + + export type Effect = {}; + + export type Saga = (getState?: () => T) => Iterable; + + type Predicate = (action: any) => boolean; + + export function take(pattern?: string|string[]|Predicate): Effect; + + export function put(action: any): Effect; + + export function race(effects: {[key:string]: any}): Effect; + + export function call(fn: (arg1?: T1, arg2?: T2, arg3?: T3, ...rest: any[]) => any, + arg1?: T1, arg2?: T2, arg3?: T3, ...rest: any[]): Effect; + + + export interface Task { + name:string; + isRunning():boolean; + result():T; + error():any; + } + + export function fork(effect: Effect): Effect; + export function fork(fn: (arg1?: T1, arg2?: T2, arg3?: T3, ...rest: any[]) => + Promise|Iterable, + arg1?: T1, arg2?: T2, arg3?: T3, ...rest: any[]): Effect; + + export function join(task: Task): Effect; + + export function cancel(task: Task): Effect; + + + import {Middleware} from 'redux'; + export default function (...sagas: Saga[]): Middleware; + + export { + CANCEL, + RACE_AUTO_CANCEL, + PARALLEL_AUTO_CANCEL, + MANUAL_CANCEL + } from 'redux-saga/lib/proc'; + + import * as monitorActions from 'redux-saga/lib/monitorActions'; + export {monitorActions} + + export {runSaga, storeIO} from 'redux-saga/lib/runSaga' + +} + + +declare module 'redux-saga/lib/proc' { + import {Task} from 'redux-saga'; + + export const CANCEL: symbol; + export const NOT_ITERATOR_ERROR: string; + export const PARALLEL_AUTO_CANCEL: string; + export const RACE_AUTO_CANCEL: string; + export const MANUAL_CANCEL: string; + + export default function proc(iterator: Iterable, + subscribe?: (cb: Function) => Function, + dispatch?: (action: any) => any, + monitor?: (action: any) => void, + parentEffectId?: any, + name?: string): Task; +} + + +declare module 'redux-saga/lib/runSaga' { + import {Store} from 'redux'; + import {Task} from 'redux-saga'; + + interface IO { + dispatch: (action: any) => any; + subscribe: (cb: Function) => Function; + } + + export function storeIO(store: Store): IO; + + export function runSaga(iterator: Iterable, + io: IO, + monitor?: (action: any) => void): Task; +} + + +declare module 'redux-saga/lib/emitter' { + export default function emitter(): { + subscribe(cb: Function):Function; + emit(item: any):void; + } +} + +declare module 'redux-saga/lib/monitorActions' { + export const MONITOR_ACTION: string; + export const EFFECT_TRIGGERED: string; + export const EFFECT_RESOLVED: string; + export const EFFECT_REJECTED: string; +} diff --git a/redux-saga/redux-saga.d.ts.tscparams b/redux-saga/redux-saga.d.ts.tscparams new file mode 100644 index 000000000..14fce22a5 --- /dev/null +++ b/redux-saga/redux-saga.d.ts.tscparams @@ -0,0 +1 @@ +--target ES6 From 3989a3b67f84a2ee90fdf567a7cca24b8778bd75 Mon Sep 17 00:00:00 2001 From: Daniel Lytkin Date: Mon, 1 Feb 2016 15:05:41 +0600 Subject: [PATCH 043/113] Update type definitions for redux-form Add `onSubmit` signature Remove reference to `es6-promise` --- redux-form/redux-form-tests.tsx.tscparams | 1 + redux-form/redux-form.d.ts | 5 ++--- redux-form/redux-form.d.ts.tscparams | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 redux-form/redux-form-tests.tsx.tscparams create mode 100644 redux-form/redux-form.d.ts.tscparams diff --git a/redux-form/redux-form-tests.tsx.tscparams b/redux-form/redux-form-tests.tsx.tscparams new file mode 100644 index 000000000..14fce22a5 --- /dev/null +++ b/redux-form/redux-form-tests.tsx.tscparams @@ -0,0 +1 @@ +--target ES6 diff --git a/redux-form/redux-form.d.ts b/redux-form/redux-form.d.ts index d3356d48d..1e631ceac 100644 --- a/redux-form/redux-form.d.ts +++ b/redux-form/redux-form.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// /// /// @@ -326,7 +325,7 @@ declare module 'redux-form' { * * See Asynchronous Blur Validation Example for more details. */ - asyncValidate?(values:Object, dispatch:Dispatch, props:Object): + asyncValidate?(values:FormData, dispatch:Dispatch, props:Object): Promise; /** @@ -366,7 +365,7 @@ declare module 'redux-form' { * you must pass it as a parameter to handleSubmit() inside your form * component. */ - onSubmit?: Function; + onSubmit?(values:FormData, dispatch?:Dispatch):any; /** * If specified, all the props normally passed into your decorated diff --git a/redux-form/redux-form.d.ts.tscparams b/redux-form/redux-form.d.ts.tscparams new file mode 100644 index 000000000..14fce22a5 --- /dev/null +++ b/redux-form/redux-form.d.ts.tscparams @@ -0,0 +1 @@ +--target ES6 From e0dbfeeb395c8cb2f4df9d660f4118e99ec1dcc8 Mon Sep 17 00:00:00 2001 From: gu Date: Mon, 1 Feb 2016 10:29:36 +0100 Subject: [PATCH 044/113] added test --- random-js/random-js-tests.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 random-js/random-js-tests.ts diff --git a/random-js/random-js-tests.ts b/random-js/random-js-tests.ts new file mode 100644 index 000000000..0d4d82b7f --- /dev/null +++ b/random-js/random-js-tests.ts @@ -0,0 +1,29 @@ +/// +/// + +// Examples taken from the documentation at https://github.com/ckknight/random-js + +import Random = require("random-js"); + +// create a Mersenne Twister-19937 that is auto-seeded based on time and other random values +var engine: Engine = Random.engines.mt19937().autoSeed(); +// create a distribution that will consistently produce integers within inclusive range [0, 99]. +var distribution: Function = Random.integer(0, 99); +// generate a number that is guaranteed to be within [0, 99] without any particular bias. +function generateNaturalLessThan100(): number { + return distribution(engine); +} + +// using essentially Math.random() +var engine2: Engine = Random.engines.nativeMath; +// lower-case Hex string distribution +var distribution2: Function = Random.hex(false); +// generate a 40-character hex string +function generateSHA1(): string { + return distribution(40); +} + +var r: Random = new Random(Random.engines.mt19937().seedWithArray([0x12345678, 0x90abcdef])); +var value = r.integer(0, 99); + +r = new Random(); // same as new Random(Random.engines.nativeMath) From a5665d15abad47b44f1b1924bff8697e5d401c90 Mon Sep 17 00:00:00 2001 From: gu Date: Mon, 1 Feb 2016 10:39:50 +0100 Subject: [PATCH 045/113] fix --- random-js/random-js-tests.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/random-js/random-js-tests.ts b/random-js/random-js-tests.ts index 0d4d82b7f..9ee80883b 100644 --- a/random-js/random-js-tests.ts +++ b/random-js/random-js-tests.ts @@ -1,11 +1,11 @@ /// -/// +/// // Examples taken from the documentation at https://github.com/ckknight/random-js - -import Random = require("random-js"); - // create a Mersenne Twister-19937 that is auto-seeded based on time and other random values +import Engine = random.Engine; +import Random = random.Random; + var engine: Engine = Random.engines.mt19937().autoSeed(); // create a distribution that will consistently produce integers within inclusive range [0, 99]. var distribution: Function = Random.integer(0, 99); From 009d2996f2be9b1b810dce7177ddde3b0fb14602 Mon Sep 17 00:00:00 2001 From: sclausen Date: Mon, 1 Feb 2016 12:59:24 +0100 Subject: [PATCH 046/113] updated typings --- js-yaml/js-yaml-tests.ts | 25 +++++++++++++++++++++++++ js-yaml/js-yaml.d.ts | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/js-yaml/js-yaml-tests.ts b/js-yaml/js-yaml-tests.ts index 91596b756..82ef790a0 100644 --- a/js-yaml/js-yaml-tests.ts +++ b/js-yaml/js-yaml-tests.ts @@ -3,12 +3,31 @@ import yaml = require('js-yaml'); import LoadOptions = yaml.LoadOptions; import DumpOptions = yaml.DumpOptions; +import TypeConstructorOptions = yaml.TypeConstructorOptions; +import SchemaDefinition = yaml.SchemaDefinition; var bool: boolean; var num: number; var str: string; var obj: Object; var value: any; +var array: any[]; +var fn: Function; +var schemaDefinition: SchemaDefinition = { + implicit: array, + explicit: array, + include: array +}; +var typeConstructorOptions: TypeConstructorOptions = { + kind: str, + resolve: fn, + construct: fn, + instanceOf: obj, + predicate: str, + represent: fn, + defaultStyle: str, + styleAliases: obj +}; var loadOpts: LoadOptions; var dumpOpts: DumpOptions; @@ -20,6 +39,8 @@ yaml.JSON_SCHEMA; yaml.CORE_SCHEMA; yaml.DEFAULT_SAFE_SCHEMA; yaml.DEFAULT_FULL_SCHEMA; +yaml.MINIMAL_SCHEMA; +yaml.SAFE_SCHEMA; // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- @@ -82,3 +103,7 @@ value = yaml.safeDump(str, dumpOpts); value = yaml.dump(str); value = yaml.dump(str, dumpOpts); + +value = new yaml.YAMLException(); +value = new yaml.Type(str, typeConstructorOptions); +value = yaml.Schema.create(schemaDefinition); diff --git a/js-yaml/js-yaml.d.ts b/js-yaml/js-yaml.d.ts index 0de5a8f6b..78f18ec09 100644 --- a/js-yaml/js-yaml.d.ts +++ b/js-yaml/js-yaml.d.ts @@ -1,3 +1,5 @@ +// Compiled using typings@0.6.4 +// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/52318243888c4aa02b3c0b5e68631577728ffcf8/js-yaml/js-yaml.d.ts // Type definitions for js-yaml 3.0.2 // Project: https://github.com/nodeca/js-yaml // Definitions by: Bart van der Schoor @@ -7,11 +9,20 @@ declare module jsyaml { export function safeLoad(str: string, opts?: LoadOptions): any; export function load(str: string, opts?: LoadOptions): any; + export class Type implements TypeConstructorOptions { + constructor(tag: string, opts?: TypeConstructorOptions); + tag: string; + } + export class Schema { + constructor(definition: SchemaDefinition); + public static create(... any): Schema; + } + export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any; export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any; export function safeDump(obj: any, opts?: DumpOptions): string; - export function dump(obj: any, opts?: DumpOptions): string + export function dump(obj: any, opts?: DumpOptions): string; export interface LoadOptions { // string to be used as a file path in error/warning messages. @@ -29,12 +40,29 @@ declare module jsyaml { skipInvalid?: boolean; // specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere flowLevel?: number; - // Each tag may have own set of styles. - "tag" => "style" map. + // Each tag may have own set of styles. - "tag" => "style" map. styles?: Object; // specifies a schema to use. schema?: any; } + export interface TypeConstructorOptions { + kind?: string; + resolve?: Function; + construct?: Function; + instanceOf?: Object; + predicate?: string; + represent?: Function; + defaultStyle?: string; + styleAliases?: Object; + } + + export interface SchemaDefinition { + implicit?: any[]; + explicit?: any[]; + include?: any[]; + } + // only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 export var FAILSAFE_SCHEMA: any; // only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 @@ -45,6 +73,13 @@ declare module jsyaml { export var DEFAULT_SAFE_SCHEMA: any; // all supported YAML types. export var DEFAULT_FULL_SCHEMA: any; + export var MINIMAL_SCHEMA: any; + export var SAFE_SCHEMA: any; + + export class YAMLException extends Error { + constructor(reason?: any, mark?: any); + toString(compact?: boolean): string; + } } declare module 'js-yaml' { From d475c0d61172fa78c0f458dc5944ecac15e00b29 Mon Sep 17 00:00:00 2001 From: Marcin Porebski Date: Mon, 1 Feb 2016 13:04:41 +0100 Subject: [PATCH 047/113] js-schema patterns definitions --- js-schema/js-schema-tests.ts | 19 ++++++++++++++ js-schema/js-schema.d.ts | 50 ++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 js-schema/js-schema-tests.ts create mode 100644 js-schema/js-schema.d.ts diff --git a/js-schema/js-schema-tests.ts b/js-schema/js-schema-tests.ts new file mode 100644 index 000000000..4a9a33e58 --- /dev/null +++ b/js-schema/js-schema-tests.ts @@ -0,0 +1,19 @@ +/// + +import {default as schema} from 'js-schema'; + +var Duck = schema({ // A duck + swim : Function, // - can swim + quack : Function, // - can quack + age : Number.min(0).max(5), // - is 0 to 5 years old + color : ['yellow', 'brown'] // - has either yellow or brown color +}); + +// Some animals +var myDuck = { swim : function() {}, quack : function() {}, age : 2, color : 'yellow' }, + myCat = { walk : function() {}, purr : function() {}, age : 3, color : 'black' }, + animals = [ myDuck, myCat, {}, /*...*/ ]; + +// Simple checks +console.log( Duck(myDuck) ); // true +console.log( Duck(myCat) ); // false diff --git a/js-schema/js-schema.d.ts b/js-schema/js-schema.d.ts new file mode 100644 index 000000000..5b9e35d6b --- /dev/null +++ b/js-schema/js-schema.d.ts @@ -0,0 +1,50 @@ +// Type definitions for js-schema +// Project: https://github.com/molnarg/js-schema +// Definitions by: Marcin Porębski https://github.com/marcinporebski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +declare module 'js-schema' +{ + export interface Schema + { + (obj: any): boolean; // test obj against the schema + } + + export default function schema(definition: any): Schema +} + +interface NumberConstructor +{ + min(n: number): NumberConstructor; + max(n: number): NumberConstructor; + below(n: number): NumberConstructor; + above(n: number): NumberConstructor; + step(n: number): NumberConstructor; +} + +interface StringConstructor +{ + of(charset: string): StringConstructor; + of(length: number, charset: string): StringConstructor; + of(minLength: number, maxLength: number, charset: string): StringConstructor; +} + +interface ArrayConstructor +{ + like(arr: Array): ArrayConstructor; + of(pattern: any): ArrayConstructor; + of(length: number, pattern: any): ArrayConstructor; + of(minLength: number, maxLength: number, pattern: any): ArrayConstructor; +} + +interface ObjectConstructor +{ + like(obj: any): ObjectConstructor; + reference(obj: any): ObjectConstructor; +} + +interface FunctionConstructor +{ + reference(func: Function): FunctionConstructor; +} \ No newline at end of file From 7e9ed1aedc86bea452bd72bb50f8420146fc6e8e Mon Sep 17 00:00:00 2001 From: Marcin Porebski Date: Mon, 1 Feb 2016 13:08:05 +0100 Subject: [PATCH 048/113] js-schema patterns definitions (doc-header fix?) --- js-schema/js-schema.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js-schema/js-schema.d.ts b/js-schema/js-schema.d.ts index 5b9e35d6b..10c1460f0 100644 --- a/js-schema/js-schema.d.ts +++ b/js-schema/js-schema.d.ts @@ -1,6 +1,6 @@ // Type definitions for js-schema // Project: https://github.com/molnarg/js-schema -// Definitions by: Marcin Porębski https://github.com/marcinporebski +// Definitions by: Marcin Porebski // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -47,4 +47,4 @@ interface ObjectConstructor interface FunctionConstructor { reference(func: Function): FunctionConstructor; -} \ No newline at end of file +} From 2d0a1b1502610025bd55ce8eaa48069da8a16c82 Mon Sep 17 00:00:00 2001 From: Nora Simonow Date: Mon, 1 Feb 2016 14:33:56 +0100 Subject: [PATCH 049/113] Updated IDialogOptions and created IMenuService --- angular-material/angular-material.d.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 4ce3fe103..25ac6b830 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -63,7 +63,10 @@ declare module angular.material { interface IDialogOptions { templateUrl?: string; template?: string; + autoWrap?: boolean; // default: true targetEvent?: MouseEvent; + openFrom?: any; + closeTo?: any; scope?: angular.IScope; // default: new child scope preserveScope?: boolean; // default: false disableParentScroll?: boolean; // default: true @@ -77,8 +80,10 @@ declare module angular.material { resolve?: {[index: string]: angular.IPromise} controllerAs?: string; parent?: string|Element|JQuery; // default: root node - fullscreen?: boolean; + onShowing?: Function; onComplete?: Function; + onRemoving?: Function; + fullscreen?: boolean; } interface IDialogService { @@ -224,7 +229,7 @@ declare module angular.material { setDefaultTheme(theme: string): void; alwaysWatchTheme(alwaysWatch: boolean): void; } - + interface IDateLocaleProvider { months: string[]; shortMonths: string[]; @@ -239,4 +244,8 @@ declare module angular.material { msgCalendar: string; msgOpenCalendar: string; } + + interface IMenuService { + hide(response?: any, options?: any): angular.IPromise; + } } From 7a5d7b12cd838f5fe6382fabd5a701dc26122414 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 1 Feb 2016 15:29:04 +0100 Subject: [PATCH 050/113] Leaflet: MultiPolygon was misspelled as MultiPolylgon. --- leaflet/leaflet.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 94e6ab51c..f5c9acaaf 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -2442,7 +2442,7 @@ declare namespace L { options: Map.MapOptions; /** - * Iterates over the layers of the map, optionally specifying context + * Iterates over the layers of the map, optionally specifying context * of the iterator function. */ eachLayer(fn: (layer: ILayer) => void, context?: any): Map; @@ -3058,7 +3058,7 @@ declare namespace L { */ function multiPolygon(latlngs: LatLng[][], options?: PolylineOptions): MultiPolygon; - export interface MultiPolylgonStatic extends ClassStatic { + export interface MultiPolygonStatic extends ClassStatic { /** * Instantiates a multi-polyline object given an array of latlngs arrays (one * for each individual polygon) and optionally an options object (the same @@ -3066,7 +3066,7 @@ declare namespace L { */ new(latlngs: LatLng[][], options?: PolylineOptions): MultiPolygon; } - export var MultiPolylgon: MultiPolylgonStatic; + export var MultiPolygon: MultiPolygonStatic; export interface MultiPolygon extends FeatureGroup { /** @@ -4182,7 +4182,7 @@ declare namespace L { * When this option is set, the TileLayer only loads tiles that are in the given geographical bounds. */ bounds?: LatLngBounds; - + /** * Custom keys may be specified in TileLayerOptions so they can be used in a provided URL template. */ From 4d7c434b6bb704cb9cac242dbe6bb4a64cd2d183 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 1 Feb 2016 15:37:44 +0100 Subject: [PATCH 051/113] Leaflet: Removed a function that doesn't exist. --- leaflet/leaflet.d.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 94e6ab51c..bd2f28148 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -805,13 +805,6 @@ declare namespace L { } declare namespace L { - - /** - * Creates a Draggable object for moving the given element when you start dragging - * the dragHandle element (equals the element itself by default). - */ - function draggable(element: HTMLElement, dragHandle?: HTMLElement): Draggable; - export interface DraggableStatic extends ClassStatic { /** * Creates a Draggable object for moving the given element when you start dragging From dca2ec14fe45727ce71257701c2addd253920bed Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Mon, 1 Feb 2016 19:36:47 +0500 Subject: [PATCH 052/113] lodash: changed _.unionBy --- lodash/lodash-tests.ts | 163 +++++++++++++ lodash/lodash.d.ts | 541 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 676 insertions(+), 28 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 66f0bf2ca..80e4ebce1 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1747,6 +1747,169 @@ module TestUnion { } } +// _.unionBy +namespace TestUnionBy { + let array: TResult[]; + let list: _.List; + let iteratee: (value: TResult) => any; + + { + let result: TResult[]; + + result = _.unionBy(array, array); + result = _.unionBy(array, list, array); + result = _.unionBy(array, array, list, array); + result = _.unionBy(array, list, array, list, array); + result = _.unionBy(array, array, list, array, list, array); + + result = _.unionBy(array, array, iteratee); + result = _.unionBy(array, list, array, iteratee); + result = _.unionBy(array, array, list, array, iteratee); + result = _.unionBy(array, list, array, list, array, iteratee); + result = _.unionBy(array, array, list, array, list, array, iteratee); + + result = _.unionBy(array, array, 'a'); + result = _.unionBy(array, list, array, 'a'); + result = _.unionBy(array, array, list, array, 'a'); + result = _.unionBy(array, list, array, list, array, 'a'); + result = _.unionBy(array, array, list, array, list, array, 'a'); + + result = _.unionBy(array, array, {a: 1}); + result = _.unionBy(array, list, array, {a: 1}); + result = _.unionBy(array, array, list, array, {a: 1}); + result = _.unionBy(array, list, array, list, array, {a: 1}); + result = _.unionBy(array, list, array, list, array, list, {a: 1}); + + result = _.unionBy(list, list); + result = _.unionBy(list, array, list); + result = _.unionBy(list, list, array, list); + result = _.unionBy(list, array, list, array, list); + result = _.unionBy(list, list, array, list, array, list); + + result = _.unionBy(list, list, iteratee); + result = _.unionBy(list, array, list, iteratee); + result = _.unionBy(list, list, array, list, iteratee); + result = _.unionBy(list, array, list, array, list, iteratee); + result = _.unionBy(list, list, array, list, array, list, iteratee); + + result = _.unionBy(list, list, 'a'); + result = _.unionBy(list, array, list, 'a'); + result = _.unionBy(list, list, array, list, 'a'); + result = _.unionBy(list, array, list, array, list, 'a'); + result = _.unionBy(list, list, array, list, array, list, 'a'); + + result = _.unionBy(list, list, {a: 1}); + result = _.unionBy(list, array, list, {a: 1}); + result = _.unionBy(list, list, array, list, {a: 1}); + result = _.unionBy(list, array, list, array, list, {a: 1}); + result = _.unionBy(list, array, list, array, list, array, {a: 1}); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).unionBy(array); + result = _(array).unionBy(list, array); + result = _(array).unionBy(array, list, array); + result = _(array).unionBy(list, array, list, array); + result = _(array).unionBy(array, list, array, list, array); + + result = _(array).unionBy(array, iteratee); + result = _(array).unionBy(list, array, iteratee); + result = _(array).unionBy(array, list, array, iteratee); + result = _(array).unionBy(list, array, list, array, iteratee); + result = _(array).unionBy(array, list, array, list, array, iteratee); + + result = _(array).unionBy(array, 'a'); + result = _(array).unionBy(list, array, 'a'); + result = _(array).unionBy(array, list, array, 'a'); + result = _(array).unionBy(list, array, list, array, 'a'); + result = _(array).unionBy(array, list, array, list, array, 'a'); + + result = _(array).unionBy(array, {a: 1}); + result = _(array).unionBy(list, array, {a: 1}); + result = _(array).unionBy(array, list, array, {a: 1}); + result = _(array).unionBy(list, array, list, array, {a: 1}); + result = _(array).unionBy(list, array, list, array, list, {a: 1}); + + result = _(list).unionBy(list); + result = _(list).unionBy(array, list); + result = _(list).unionBy(list, array, list); + result = _(list).unionBy(array, list, array, list); + result = _(list).unionBy(list, array, list, array, list); + + result = _(list).unionBy(list, iteratee); + result = _(list).unionBy(array, list, iteratee); + result = _(list).unionBy(list, array, list, iteratee); + result = _(list).unionBy(array, list, array, list, iteratee); + result = _(list).unionBy(list, array, list, array, list, iteratee); + + result = _(list).unionBy(list, 'a'); + result = _(list).unionBy(array, list, 'a'); + result = _(list).unionBy(list, array, list, 'a'); + result = _(list).unionBy(array, list, array, list, 'a'); + result = _(list).unionBy(list, array, list, array, list, 'a'); + + result = _(list).unionBy(list, {a: 1}); + result = _(list).unionBy(array, list, {a: 1}); + result = _(list).unionBy(list, array, list, {a: 1}); + result = _(list).unionBy(array, list, array, list, {a: 1}); + result = _(list).unionBy(array, list, array, list, array, {a: 1}); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().unionBy(array); + result = _(array).chain().unionBy(list, array); + result = _(array).chain().unionBy(array, list, array); + result = _(array).chain().unionBy(list, array, list, array); + result = _(array).chain().unionBy(array, list, array, list, array); + + result = _(array).chain().unionBy(array, iteratee); + result = _(array).chain().unionBy(list, array, iteratee); + result = _(array).chain().unionBy(array, list, array, iteratee); + result = _(array).chain().unionBy(list, array, list, array, iteratee); + result = _(array).chain().unionBy(array, list, array, list, array, iteratee); + + result = _(array).chain().unionBy(array, 'a'); + result = _(array).chain().unionBy(list, array, 'a'); + result = _(array).chain().unionBy(array, list, array, 'a'); + result = _(array).chain().unionBy(list, array, list, array, 'a'); + result = _(array).chain().unionBy(array, list, array, list, array, 'a'); + + result = _(array).chain().unionBy(array, {a: 1}); + result = _(array).chain().unionBy(list, array, {a: 1}); + result = _(array).chain().unionBy(array, list, array, {a: 1}); + result = _(array).chain().unionBy(list, array, list, array, {a: 1}); + result = _(array).chain().unionBy(list, array, list, array, list, {a: 1}); + + result = _(list).chain().unionBy(list); + result = _(list).chain().unionBy(array, list); + result = _(list).chain().unionBy(list, array, list); + result = _(list).chain().unionBy(array, list, array, list); + result = _(list).chain().unionBy(list, array, list, array, list); + + result = _(list).chain().unionBy(list, iteratee); + result = _(list).chain().unionBy(array, list, iteratee); + result = _(list).chain().unionBy(list, array, list, iteratee); + result = _(list).chain().unionBy(array, list, array, list, iteratee); + result = _(list).chain().unionBy(list, array, list, array, list, iteratee); + + result = _(list).chain().unionBy(list, 'a'); + result = _(list).chain().unionBy(array, list, 'a'); + result = _(list).chain().unionBy(list, array, list, 'a'); + result = _(list).chain().unionBy(array, list, array, list, 'a'); + result = _(list).chain().unionBy(list, array, list, array, list, 'a'); + + result = _(list).chain().unionBy(list, {a: 1}); + result = _(list).chain().unionBy(array, list, {a: 1}); + result = _(list).chain().unionBy(list, array, list, {a: 1}); + result = _(list).chain().unionBy(array, list, array, list, {a: 1}); + result = _(list).chain().unionBy(array, list, array, list, array, {a: 1}); + } +} + // _.uniq module TestUniq { type SampleObject = {a: number; b: string; c: boolean}; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index aaa8dc7e3..16f8543e6 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -3622,6 +3622,519 @@ declare module _ { union(...arrays: List[]): LoDashExplicitArrayWrapper; } + //_.unionBy + interface LoDashStatic { + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @param arrays The arrays to inspect. + * @param iteratee The iteratee invoked per element. + * @return Returns the new array of combined values. + */ + unionBy( + arrays: T[]|List, + iteratee?: (value: T) => any + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + iteratee?: (value: T) => any + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: (value: T) => any + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: (value: T) => any + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: (value: T) => any + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays: T[]|List, + ...iteratee: any[] + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.unionBy + */ + unionBy( + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + ...iteratee: any[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.unionBy + */ + unionBy( + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + ...iteratee: any[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.unionBy + */ + unionBy( + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + ...iteratee: any[] + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.unionBy + */ + unionBy( + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + ...iteratee: any[] + ): LoDashExplicitArrayWrapper; + } + //_.uniq interface LoDashStatic { /** @@ -4189,34 +4702,6 @@ declare module _ { ): LoDashExplicitArrayWrapper; } - //_.unionBy DUMMY - interface LoDashStatic { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1, 1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - unionBy( - array: any[]|List, - ...values: any[] - ): any[]; - } - //_.unionWith DUMMY interface LoDashStatic { /** From 7c9e75f7c0e967930b3d03a09ab85ecb2feebd32 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 1 Feb 2016 16:42:19 +0100 Subject: [PATCH 053/113] Not every class constructor inherits fields from the default ClassStatic. --- leaflet/leaflet.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 94e6ab51c..12cf1ae95 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -41,7 +41,7 @@ declare module L { export function bounds(points: Point[]): Bounds; - export interface BoundsStatic extends ClassStatic { + export interface BoundsStatic { /** * Creates a Bounds object from two coordinates (usually top-left and bottom-right * corners). @@ -1453,7 +1453,7 @@ declare namespace L { */ function latLng(coords: LatLngExpression): LatLng; - export interface LatLngStatic extends ClassStatic { + export interface LatLngStatic { /** * Creates an object representing a geographical point with the given latitude * and longitude. @@ -1539,7 +1539,7 @@ declare namespace L { */ function latLngBounds(latlngs: LatLngBoundsExpression): LatLngBounds; - export interface LatLngBoundsStatic extends ClassStatic { + export interface LatLngBoundsStatic { /** * Creates a LatLngBounds object by defining south-west and north-east corners * of the rectangle. @@ -2442,7 +2442,7 @@ declare namespace L { options: Map.MapOptions; /** - * Iterates over the layers of the map, optionally specifying context + * Iterates over the layers of the map, optionally specifying context * of the iterator function. */ eachLayer(fn: (layer: ILayer) => void, context?: any): Map; @@ -3401,7 +3401,7 @@ declare namespace L { */ function point(x: number, y: number, round?: boolean): Point; - export interface PointStatic extends ClassStatic { + export interface PointStatic { /** * Creates a Point object with the given x and y coordinates. If optional round * is set to true, rounds the x and y values. @@ -4182,7 +4182,7 @@ declare namespace L { * When this option is set, the TileLayer only loads tiles that are in the given geographical bounds. */ bounds?: LatLngBounds; - + /** * Custom keys may be specified in TileLayerOptions so they can be used in a provided URL template. */ @@ -4191,7 +4191,7 @@ declare namespace L { } declare namespace L { - export interface TransformationStatic extends ClassStatic { + export interface TransformationStatic { /** * Creates a transformation object with the given coefficients. */ From 9e2b6c0c0c20cbac09a74e6873cf5f35d9819633 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Mon, 1 Feb 2016 16:51:40 +0100 Subject: [PATCH 054/113] Fixed copy paste typo --- mongodb/mongodb.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongodb/mongodb.d.ts b/mongodb/mongodb.d.ts index b96c43522..2efe834e2 100644 --- a/mongodb/mongodb.d.ts +++ b/mongodb/mongodb.d.ts @@ -642,7 +642,7 @@ declare module "mongodb" { //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#initializeOrderedBulkOp initializeOrderedBulkOp(options: CollectionOptions): OrderedBulkOperation; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#initializeUnorderedBulkOp - initializeOrderedBulkOp(options: CollectionOptions): OrderedBulkOperation; + initializeUnorderedBulkOp(options: CollectionOptions): OrderedBulkOperation; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#insertMany insertMany(docs: Object[], callback: MongoCallback): void insertMany(docs: Object[], options?: CollectionInsertManyOptions): Promise; From 5c5e202bceef2d09a438c970375879510a595ead Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 1 Feb 2016 17:03:20 +0100 Subject: [PATCH 055/113] Leaflet: Wrong syntax. --- leaflet/leaflet.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 94e6ab51c..19532831a 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -513,7 +513,7 @@ declare module L { /** * Creates a control with the given options. */ - function (options?: ControlOptions): Control; + (options?: ControlOptions): Control; } export namespace control { @@ -2442,7 +2442,7 @@ declare namespace L { options: Map.MapOptions; /** - * Iterates over the layers of the map, optionally specifying context + * Iterates over the layers of the map, optionally specifying context * of the iterator function. */ eachLayer(fn: (layer: ILayer) => void, context?: any): Map; @@ -4182,7 +4182,7 @@ declare namespace L { * When this option is set, the TileLayer only loads tiles that are in the given geographical bounds. */ bounds?: LatLngBounds; - + /** * Custom keys may be specified in TileLayerOptions so they can be used in a provided URL template. */ From 66189746241fd5014d3acbdeadf4b2b75b2772d9 Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Mon, 1 Feb 2016 22:28:32 +0300 Subject: [PATCH 056/113] added enhancer param for create store. see [redux docs](http://rackt.org/redux/docs/api/createStore.html) --- redux/redux.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redux/redux.d.ts b/redux/redux.d.ts index 669ab6b99..6d854f50c 100644 --- a/redux/redux.d.ts +++ b/redux/redux.d.ts @@ -40,7 +40,7 @@ declare module Redux { subscribe(listener: Function): Function; } - function createStore(reducer: Reducer, initialState?: any): Store; + function createStore(reducer: Reducer, initialState?: any, enhancer?: (any)=>any): Store; function bindActionCreators(actionCreators: T, dispatch: Dispatch): T; function combineReducers(reducers: any): Reducer; function applyMiddleware(...middlewares: Middleware[]): Function; From a820bbdead70913f0c750802b367ed54cb99b442 Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Mon, 1 Feb 2016 22:54:50 +0300 Subject: [PATCH 057/113] minor fix --- redux/redux.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redux/redux.d.ts b/redux/redux.d.ts index 6d854f50c..44cb297c1 100644 --- a/redux/redux.d.ts +++ b/redux/redux.d.ts @@ -40,7 +40,7 @@ declare module Redux { subscribe(listener: Function): Function; } - function createStore(reducer: Reducer, initialState?: any, enhancer?: (any)=>any): Store; + function createStore(reducer: Reducer, initialState?: any, enhancer?: ()=>any): Store; function bindActionCreators(actionCreators: T, dispatch: Dispatch): T; function combineReducers(reducers: any): Reducer; function applyMiddleware(...middlewares: Middleware[]): Function; From 0a57e7a1c2b03b39fbb89025146d18ec10cb0307 Mon Sep 17 00:00:00 2001 From: Jared Klopper Date: Tue, 2 Feb 2016 08:57:03 +1300 Subject: [PATCH 058/113] Add template interceptor type definition --- rest/rest-tests.ts | 2 ++ rest/rest.d.ts | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/rest/rest-tests.ts b/rest/rest-tests.ts index cedc11b00..00ce6b3db 100644 --- a/rest/rest-tests.ts +++ b/rest/rest-tests.ts @@ -13,6 +13,7 @@ import oAuth = require('rest/interceptor/oAuth'); import csrf = require('rest/interceptor/csrf'); import errorCode = require('rest/interceptor/errorCode'); import retry = require('rest/interceptor/retry'); +import template = require('rest/interceptor/template'); import timeout = require('rest/interceptor/timeout'); import jsonp = require('rest/interceptor/jsonp'); import xdomain = require('rest/interceptor/ie/xdomain'); @@ -127,6 +128,7 @@ client = rest .wrap(csrf) .wrap(errorCode) .wrap(retry) + .wrap(template, { template: 'auth={token}', params: { token: 'hunter2' } }) .wrap(timeout) .wrap(jsonp) .wrap(xdomain) diff --git a/rest/rest.d.ts b/rest/rest.d.ts index a96e0822a..ac2f2ef0b 100644 --- a/rest/rest.d.ts +++ b/rest/rest.d.ts @@ -1,4 +1,4 @@ -// Type definitions for rest.js v1.2.0 +// Type definitions for rest.js v1.3.1 // Project: https://github.com/cujojs/rest // Definitions by: Wim Looman // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -255,6 +255,21 @@ declare module "rest/interceptor/retry" { export = retry; } +declare module "rest/interceptor/template" { + import rest = require("rest"); + + var hateoas: rest.Interceptor; + + module template { + interface Config { + template?: string; + params?: {}; + } + } + + export = hateoas; +} + declare module "rest/interceptor/timeout" { import rest = require("rest"); From fa66ca5821f8d129152cdaa6d97248b3b3796486 Mon Sep 17 00:00:00 2001 From: Jared Klopper Date: Tue, 2 Feb 2016 09:03:41 +1300 Subject: [PATCH 059/113] Correct naming --- rest/rest.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest/rest.d.ts b/rest/rest.d.ts index ac2f2ef0b..49428d534 100644 --- a/rest/rest.d.ts +++ b/rest/rest.d.ts @@ -258,7 +258,7 @@ declare module "rest/interceptor/retry" { declare module "rest/interceptor/template" { import rest = require("rest"); - var hateoas: rest.Interceptor; + var template: rest.Interceptor; module template { interface Config { @@ -267,7 +267,7 @@ declare module "rest/interceptor/template" { } } - export = hateoas; + export = template; } declare module "rest/interceptor/timeout" { From 0c825d7d55643739ce75203c3d5063c2d71cdeb0 Mon Sep 17 00:00:00 2001 From: RX14 Date: Mon, 1 Feb 2016 20:41:41 +0000 Subject: [PATCH 060/113] Update to winreg 0.0.16 --- winreg/winreg.d.ts | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/winreg/winreg.d.ts b/winreg/winreg.d.ts index 459a6e780..0b23f6981 100644 --- a/winreg/winreg.d.ts +++ b/winreg/winreg.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Winreg v0.0.15 +// Type definitions for Winreg v0.0.16 // Project: https://github.com/fresc81/node-winreg/ // Definitions by: RX14 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -122,6 +122,12 @@ interface Winreg { */ path: string; + /** + * Architecture this key belongs to. + * @readonly + */ + arch: string; + /** * A new Winreg instance of the parent key. * @readonly @@ -198,7 +204,12 @@ declare namespace Winreg { /** * Optional key, default is the root key. */ - key?: String; + key?: string; + + /** + * Optional architecture of the registry. + */ + arch?: string; } /** @@ -240,6 +251,12 @@ declare namespace Winreg { * @readonly */ value: string; + + /** + * Architecture this value belongs to. + * @readonly + */ + arch: string; } } From cdf27e4034dc29435267a85c65b0a0809c5b9efa Mon Sep 17 00:00:00 2001 From: Jared Klopper Date: Tue, 2 Feb 2016 13:12:02 +1300 Subject: [PATCH 061/113] Fix up definition and use inference in tests where possible --- rest/rest-tests.ts | 38 +++++++++++++++++++------------------- rest/rest.d.ts | 4 +++- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/rest/rest-tests.ts b/rest/rest-tests.ts index 00ce6b3db..813a06785 100644 --- a/rest/rest-tests.ts +++ b/rest/rest-tests.ts @@ -118,25 +118,25 @@ var promiseOrResponse = interceptor({ }); client = rest - .wrap(defaultRequest) - .wrap(hateoas) - .wrap(location) - .wrap(mime) - .wrap(pathPrefix) - .wrap(basicAuth) - .wrap(oAuth) - .wrap(csrf) - .wrap(errorCode) - .wrap(retry) - .wrap(template, { template: 'auth={token}', params: { token: 'hunter2' } }) - .wrap(timeout) - .wrap(jsonp) - .wrap(xdomain) - .wrap(xhr) - .wrap(noop) - .wrap(fail) - .wrap(knownConfig, { prop: 'value' }) - .wrap(transformedConfig, { prop: 'value' }); + .wrap(defaultRequest) + .wrap(hateoas) + .wrap(location) + .wrap(mime) + .wrap(pathPrefix) + .wrap(basicAuth) + .wrap(oAuth) + .wrap(csrf) + .wrap(errorCode) + .wrap(retry) + .wrap(template, { template: 'auth={token}', params: { token: 'hunter2' } }) + .wrap(timeout) + .wrap(jsonp) + .wrap(xdomain) + .wrap(xhr) + .wrap(noop) + .wrap(fail) + .wrap(knownConfig, { prop: 'value' }) + .wrap(transformedConfig, { prop: 'value' }); import xhrClient = require('rest/client/xhr'); import nodeClient = require('rest/client/node'); diff --git a/rest/rest.d.ts b/rest/rest.d.ts index 49428d534..e000e1e93 100644 --- a/rest/rest.d.ts +++ b/rest/rest.d.ts @@ -263,7 +263,9 @@ declare module "rest/interceptor/template" { module template { interface Config { template?: string; - params?: {}; + params?: { + [name: string]: any; + }; } } From e5059193ce8a188880b106d71e31799ef8f71640 Mon Sep 17 00:00:00 2001 From: sclausen Date: Tue, 2 Feb 2016 09:27:04 +0100 Subject: [PATCH 062/113] fixed wrong argument type of Schema.create --- js-yaml/js-yaml.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js-yaml/js-yaml.d.ts b/js-yaml/js-yaml.d.ts index 78f18ec09..a075171f9 100644 --- a/js-yaml/js-yaml.d.ts +++ b/js-yaml/js-yaml.d.ts @@ -15,7 +15,7 @@ declare module jsyaml { } export class Schema { constructor(definition: SchemaDefinition); - public static create(... any): Schema; + public static create(args: any[]): Schema; } export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any; From b6d3f2111341118ba74bceb9b88faf5459d86b5c Mon Sep 17 00:00:00 2001 From: sclausen Date: Tue, 2 Feb 2016 09:30:05 +0100 Subject: [PATCH 063/113] fixed wrong argument usage in test --- js-yaml/js-yaml-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js-yaml/js-yaml-tests.ts b/js-yaml/js-yaml-tests.ts index 82ef790a0..cd5f63c49 100644 --- a/js-yaml/js-yaml-tests.ts +++ b/js-yaml/js-yaml-tests.ts @@ -106,4 +106,4 @@ value = yaml.dump(str, dumpOpts); value = new yaml.YAMLException(); value = new yaml.Type(str, typeConstructorOptions); -value = yaml.Schema.create(schemaDefinition); +value = yaml.Schema.create([schemaDefinition]); From c7a3689e14e9b8041186292d4e930cb0ca1936a6 Mon Sep 17 00:00:00 2001 From: sclausen Date: Tue, 2 Feb 2016 09:32:41 +0100 Subject: [PATCH 064/113] fixed wrong header format --- js-yaml/js-yaml.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js-yaml/js-yaml.d.ts b/js-yaml/js-yaml.d.ts index a075171f9..bb33779a8 100644 --- a/js-yaml/js-yaml.d.ts +++ b/js-yaml/js-yaml.d.ts @@ -1,6 +1,6 @@ +// Type definitions for js-yaml 3.0.2 // Compiled using typings@0.6.4 // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/52318243888c4aa02b3c0b5e68631577728ffcf8/js-yaml/js-yaml.d.ts -// Type definitions for js-yaml 3.0.2 // Project: https://github.com/nodeca/js-yaml // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped From 21466fa7c400e67b9af02a0e43e094a6df853fe4 Mon Sep 17 00:00:00 2001 From: sclausen Date: Tue, 2 Feb 2016 09:34:51 +0100 Subject: [PATCH 065/113] fixed wrong header format --- js-yaml/js-yaml.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/js-yaml/js-yaml.d.ts b/js-yaml/js-yaml.d.ts index bb33779a8..8476b000e 100644 --- a/js-yaml/js-yaml.d.ts +++ b/js-yaml/js-yaml.d.ts @@ -1,6 +1,4 @@ // Type definitions for js-yaml 3.0.2 -// Compiled using typings@0.6.4 -// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/52318243888c4aa02b3c0b5e68631577728ffcf8/js-yaml/js-yaml.d.ts // Project: https://github.com/nodeca/js-yaml // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped From 1ff6156a58d0e9002df8a2178c00d39b4886a691 Mon Sep 17 00:00:00 2001 From: sclausen Date: Tue, 2 Feb 2016 09:35:55 +0100 Subject: [PATCH 066/113] added contributor --- js-yaml/js-yaml.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js-yaml/js-yaml.d.ts b/js-yaml/js-yaml.d.ts index 8476b000e..85d9579cf 100644 --- a/js-yaml/js-yaml.d.ts +++ b/js-yaml/js-yaml.d.ts @@ -1,7 +1,7 @@ -// Type definitions for js-yaml 3.0.2 +// Type definitions for js-yaml 3.5.2 // Project: https://github.com/nodeca/js-yaml -// Definitions by: Bart van der Schoor -// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions by: Bart van der Schoor , Sebastian Clausen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module jsyaml { export function safeLoad(str: string, opts?: LoadOptions): any; From 89ce6d4f4976e87f86a3393dd9dd9283a646168c Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 2 Feb 2016 16:22:50 +0100 Subject: [PATCH 067/113] updated module with ClassicComponentClass --- react-notification-system/react-notification-system.d.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/react-notification-system/react-notification-system.d.ts b/react-notification-system/react-notification-system.d.ts index 04e6313a2..7eb9e3a06 100644 --- a/react-notification-system/react-notification-system.d.ts +++ b/react-notification-system/react-notification-system.d.ts @@ -75,15 +75,10 @@ declare module NotificationSystem { ref?: string; style?: Style | boolean; } - - - export interface Component { - (): React.ReactElement; - } } declare module 'react-notification-system' { - var component: NotificationSystem.Component; + var component: __React.ClassicComponentClass; export = component; -} +} \ No newline at end of file From 902571a26276a3e08986e921317b74657cff6669 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 2 Feb 2016 16:33:55 +0100 Subject: [PATCH 068/113] updated module with ClassicComponentClass --- react-notification-system/react-notification-system.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-notification-system/react-notification-system.d.ts b/react-notification-system/react-notification-system.d.ts index 7eb9e3a06..84f479690 100644 --- a/react-notification-system/react-notification-system.d.ts +++ b/react-notification-system/react-notification-system.d.ts @@ -81,4 +81,4 @@ declare module NotificationSystem { declare module 'react-notification-system' { var component: __React.ClassicComponentClass; export = component; -} \ No newline at end of file +} From fc6d5aca413f1abe1d0dd764ea3eb7595b43fc19 Mon Sep 17 00:00:00 2001 From: Igor Kriklivetc Date: Tue, 2 Feb 2016 18:46:02 +0300 Subject: [PATCH 069/113] Update to 15.2.5 --- devextreme/devextreme-15.2.4.d.ts | 7325 +++++++++++++++++++++++++++++ devextreme/devextreme.d.ts | 128 +- 2 files changed, 7418 insertions(+), 35 deletions(-) create mode 100644 devextreme/devextreme-15.2.4.d.ts diff --git a/devextreme/devextreme-15.2.4.d.ts b/devextreme/devextreme-15.2.4.d.ts new file mode 100644 index 000000000..e0777077c --- /dev/null +++ b/devextreme/devextreme-15.2.4.d.ts @@ -0,0 +1,7325 @@ +// Type definitions for DevExtreme 15.2.4 +// Project: http://js.devexpress.com/ +// Definitions by: DevExpress Inc. +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module DevExpress { + /** A mixin that provides a capability to fire and subscribe to events. */ + export interface EventsMixin { + /** Subscribes to a specified event. */ + on(eventName: string, eventHandler: Function): T; + /** Subscribes to the specified events. */ + on(events: { [eventName: string]: Function; }): T; + /** Detaches all event handlers from the specified event. */ + off(eventName: string): Object; + /** Detaches a particular event handler from the specified event. */ + off(eventName: string, eventHandler: Function): T; + } + /** An object that serves as a namespace for the methods required to perform validation. */ + export module validationEngine { + export interface IValidator { + validate(): ValidatorValidationResult; + reset(): void; + } + export interface ValidatorValidationResult { + isValid: boolean; + name?: string; + value: any; + brokenRule: any; + validationRules: any[]; + } + export interface ValidationGroupValidationResult { + isValid: boolean; + brokenRules: any[]; + validators: IValidator[]; + } + export interface GroupConfig extends EventsMixin { + group: any; + validators: IValidator[]; + validate(): ValidationGroupValidationResult; + reset(): void; + } + /** Provides access to the object that represents the specified validation group. */ + export function getGroupConfig(group: any): GroupConfig + /** Provides access to the object that represents the default validation group. */ + export function getGroupConfig(): GroupConfig + /** Validates rules of the validators that belong to the specified validation group. */ + export function validateGroup(group: any): ValidationGroupValidationResult; + /** Validates rules of the validators that belong to the default validation group. */ + export function validateGroup(): ValidationGroupValidationResult; + /** Resets the values and validation result of the editors that belong to the specified validation group. */ + export function resetGroup(group: any): void; + /** Resets the values and validation result of the editors that belong to the default validation group. */ + export function resetGroup(): void; + /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ + export function validateModel(model: Object): ValidationGroupValidationResult; + /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ + export function registerModelForValidation(model: Object): void; + } + export var hardwareBackButton: JQueryCallback; + /** Processes the hardware back button click. */ + export function processHardwareBackButton(): void; + /** Hides the last displayed overlay widget. */ + export function hideTopOverlay(): boolean; + /** Specifies whether or not the entire application/site supports right-to-left representation. */ + export var rtlEnabled: boolean; + /** Registers a new component in the DevExpress.ui namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, componentClass: Object): void; + /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ + export function registerComponent(name: string, namespace: Object, componentClass: Object): void; + export function requestAnimationFrame(callback: Function): number; + export function cancelAnimationFrame(requestID: number): void; + /** Custom Knockout binding that links an HTML element with a specific action. */ + export class Action { } + /** Used to get URLs that vary in a locally running application and the application running on production. */ + export class EndpointSelector { + constructor(options: { + [key: string]: { + local?: string; + production?: string; + } + }); + /** Returns a local or a productional URL depending on how the application is currently running. */ + urlFor(key: string): string; + } + /** An object that serves as a namespace for the methods that are used to animate UI elements. */ + export module fx { + /** Defines animation options. */ + export interface AnimationOptions { + /** A function called after animation is completed. */ + complete?: (element: JQuery, config: AnimationOptions) => void; + /** A number specifying wait time before animation execution. */ + delay?: number; + /** A number specifying the time period to wait before the animation of the next stagger item starts. */ + staggerDelay?: number; + /** A number specifying the time in milliseconds spent on animation. */ + duration?: number; + /** A string specifying the type of an easing function used for animation. */ + easing?: string; + /** Specifies the initial animation state. */ + from?: any; + /** A function called before animation is started. */ + start?: (element: JQuery, config: AnimationOptions) => void; + /** Specifies a final animation state. */ + to?: any; + /** A string value specifying the animation type. */ + type?: string; + /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ + direction?: string; + } + /** Animates the specified element. */ + export function animate(element: HTMLElement, config: AnimationOptions): Object; + /** Returns a value indicating whether the specified element is being animated. */ + export function isAnimating(element: HTMLElement): boolean; + /** Stops the animation. */ + export function stop(element: HTMLElement, jumpToEnd: boolean): void; + } + /** The manager that performs several specified animations at a time. */ + export class TransitionExecutor { + /** Deletes all the animations registered in the Transition Executor by using the enter(elements, animation) and leave(elements, animation) methods. */ + reset(): void; + /** Registers a set of elements that should be animated as "entering" using the specified animation configuration. */ + enter(elements: JQuery, animation: any): void; + /** Registers a set of elements that should be animated as "leaving" using the specified animation configuration. */ + leave(elements: JQuery, animation: any): void; + /** Starts all the animations registered using the enter(elements, animation) and leave(elements, animation) methods beforehand. */ + start(config: Object): JQueryPromise; + /** Stops all started animations. */ + stop(): void; + } + export class AnimationPresetCollection { + /** Resets all the changes made in the animation repository. */ + resetToDefaults(): void; + /** Deletes the specified animation or clears all the animation repository, if an animation name is not passed. */ + clear(name: string): void; + /** Adds the specified animation preset to the animation repository by the specified name. */ + registerPreset(name: string, config: any): void; + /** Applies the changes made in the animation repository. */ + applyChanges(): void; + /** Returns the configuration of the animation found in the animation repository by the specified name for the current device. */ + getPreset(name: string): void; + /** Registers predefined animations in the animation repository. */ + registerDefaultPresets(): void; + } + /** A repository of animations. */ + export var animationPresets: AnimationPresetCollection; + /** The device object defines the device on which the application is running. */ + export interface Device { + /** Indicates whether or not the device platform is Android. */ + android?: boolean; + /** Specifies the type of the device on which the application is running. */ + deviceType?: string; + /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ + generic?: boolean; + /** Indicates whether or not the device platform is iOS. */ + ios?: boolean; + /** Indicates whether or not the device type is 'phone'. */ + phone?: boolean; + /** Specifies the platform of the device on which the application is running. */ + platform?: string; + /** Indicates whether or not the device type is 'tablet'. */ + tablet?: boolean; + /** Specifies an array with the major and minor versions of the device platform. */ + version?: Array; + /** Indicates whether or not the device platform is Windows. */ + win?: boolean; + /** Specifies a performance grade of the current device. */ + grade?: string; + } + export class Devices implements EventsMixin { + constructor(options: { window: Window }); + /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ + current(deviceName: any): void; + /** Returns information about the current device. */ + current(): Device; + orientationChanged: JQueryCallback; + /** Returns the current device orientation. */ + orientation(): string; + /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ + real(): Device; + on(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + on(eventName: string, eventHandler: Function): Devices; + on(events: { [eventName: string]: Function; }): Devices; + off(eventName: "orientationChanged"): Devices; + off(eventName: string): Devices; + off(eventName: "orientationChanged", eventHandler: (e: { orientation: string }) => void): Devices; + off(eventName: string, eventHandler: Function): Devices; + } + /** An object that serves as a namespace for the methods and events specifying information on the current device. */ + export var devices: Devices; + /** The position object specifies the widget positioning options. */ + export interface PositionOptions { + /** The target element position that the widget is positioned against. */ + at?: string; + /** The element within which the widget is positioned. */ + boundary?: Element; + /** A string value holding horizontal and vertical offset from the window's boundaries. */ + boundaryOffset?: string; + /** Specifies how to move the widget if it overflows the screen. */ + collision?: any; + /** The position of the widget to align against the target element. */ + my?: string; + /** The target element that the widget is positioned against. */ + of?: HTMLElement; + /** A string value holding horizontal and vertical offset in pixels, separated by a space (e.g., "5 -10"). */ + offset?: string; + } + export interface ComponentOptions { + /** A handler for the initialized event. */ + onInitialized?: Function; + /** A handler for the optionChanged event. */ + onOptionChanged?: Function; + /** A handler for the disposing event. */ + onDisposing?: Function; + } + /** A base class for all components and widgets. */ + export class Component { + constructor(options?: ComponentOptions) + /** Prevents the component from refreshing until the endUpdate method is called. */ + beginUpdate(): void; + /** Enables the component to refresh after the beginUpdate method call. */ + endUpdate(): void; + /** Returns an instance of this component class. */ + instance(): Component; + /** Returns the configuration options of this component. */ + option(): { + [optionKey: string]: any; + }; + /** Sets one or more options of this component. */ + option(options: { + [optionKey: string]: any; + }): void; + /** Gets the value of the specified configuration option of this component. */ + option(optionName: string): any; + /** Sets a value to the specified configuration option of this component. */ + option(optionName: string, optionValue: any): void; + } + export interface DOMComponentOptions extends ComponentOptions { + /** Specifies whether or not the current component supports a right-to-left representation. */ + rtlEnabled?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A base class for all components. */ + export class DOMComponent extends Component { + constructor(element: JQuery, options?: DOMComponentOptions); + constructor(element: HTMLElement, options?: DOMComponentOptions); + /** Returns the root HTML element of the widget. */ + element(): JQuery; + /** Specifies the device-dependent default configuration options for this component. */ + static defaultOptions(rule: { + device?: any; + options?: any; + }): void; + } + export module data { + export interface ODataError extends Error { + httpStatus?: number; + errorDetails?: any; + } + export interface StoreOptions { + /** A handler for the modified event. */ + onModified?: () => void; + /** A handler for the modifying event. */ + onModifying?: () => void; + /** A handler for the removed event. */ + onRemoved?: (key: any) => void; + /** A handler for the removing event. */ + onRemoving?: (key: any) => void; + /** A handler for the updated event. */ + onUpdated?: (key: any, values: Object) => void; + /** A handler for the updating event. */ + onUpdating?: (key: any, values: Object) => void; + /** A handler for the loaded event. */ + onLoaded?: (result: Array) => void; + /** A handler for the loading event. */ + onLoading?: (loadOptions: LoadOptions) => void; + /** A handler for the inserted event. */ + onInserted?: (values: Object, key: any) => void; + /** A handler for the inserting event. */ + onInserting?: (values: Object) => void; + /** Specifies the function called when the Store causes an error. */ + errorHandler?: (e: Error) => void; + /** Specifies the key properties within the data associated with the Store. */ + key?: any; + } + export interface LoadOptions { + filter?: Object; + sort?: Object; + select?: Object; + expand?: Object; + group?: Object; + skip?: number; + take?: number; + userData?: Object; + requireTotalCount?: boolean; + } + /** The base class for all Stores. */ + export class Store implements EventsMixin { + constructor(options?: StoreOptions); + /** Returns the data item specified by the key. */ + byKey(key: any): JQueryPromise; + /** Adds an item to the data associated with this Store. */ + insert(values: Object): JQueryPromise; + /** Returns the key expression specified via the key configuration option. */ + key(): any; + /** Returns the key of the Store item that matches the specified object. */ + keyOf(obj: Object): any; + /** Starts loading data. */ + load(obj?: LoadOptions): JQueryPromise; + /** Removes the data item specified by the key. */ + remove(key: any): JQueryPromise; + /** Obtains the total count of items that will be returned by the load() function. */ + totalCount(options?: { + filter?: Object; + group?: Object; + }): JQueryPromise; + /** Updates the data item specified by the key. */ + update(key: any, values: Object): JQueryPromise; + on(eventName: "removing", eventHandler: (key: any) => void): Store; + on(eventName: "removed", eventHandler: (key: any) => void): Store; + on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + on(eventName: "inserting", eventHandler: (values: Object) => void): Store; + on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + on(eventName: "modifying", eventHandler: () => void): Store; + on(eventName: "modified", eventHandler: () => void): Store; + on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + on(eventName: "loaded", eventHandler: (result: Array) => void): Store; + on(eventName: string, eventHandler: Function): Store; + on(events: { [eventName: string]: Function; }): Store; + off(eventName: "removing"): Store; + off(eventName: "removed"): Store; + off(eventName: "updating"): Store; + off(eventName: "updated"): Store; + off(eventName: "inserting"): Store; + off(eventName: "inserted"): Store; + off(eventName: "modifying"): Store; + off(eventName: "modified"): Store; + off(eventName: "loading"): Store; + off(eventName: "loaded"): Store; + off(eventName: string): Store; + off(eventName: "removing", eventHandler: (key: any) => void): Store; + off(eventName: "removed", eventHandler: (key: any) => void): Store; + off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; + off(eventName: "inserting", eventHandler: (values: Object) => void): Store; + off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; + off(eventName: "modifying", eventHandler: () => void): Store; + off(eventName: "modified", eventHandler: () => void): Store; + off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; + off(eventName: "loaded", eventHandler: (result: Array) => void): Store; + off(eventName: string, eventHandler: Function): Store; + } + export interface ArrayStoreOptions extends StoreOptions { + /** Specifies the array associated with this Store. */ + data?: Array; + } + /** A Store accessing an in-memory array. */ + export class ArrayStore extends Store { + constructor(options?: ArrayStoreOptions); + /** Clears all data associated with the current ArrayStore. */ + clear(): void; + /** Creates the Query object for the underlying array. */ + createQuery(): Query; + } + interface Promise { + then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; + } + export interface CustomStoreOptions extends StoreOptions { + /** The user implementation of the byKey(key, extraOptions) method. */ + byKey?: (key: any) => Promise; + /** The user implementation of the insert(values) method. */ + insert?: (values: Object) => Promise; + /** The user implementation of the load(options) method. */ + load?: (options?: LoadOptions) => Promise; + /** The user implementation of the remove(key) method. */ + remove?: (key: any) => Promise; + /** The user implementation of the totalCount(options) method. */ + totalCount?: (options?: { + filter?: Object; + group?: Object; + }) => Promise; + /** The user implementation of the update(key, values) method. */ + update?: (key: any, values: Object) => Promise; + } + /** A Store object that enables you to implement your own data access logic. */ + export class CustomStore extends Store { + constructor(options: CustomStoreOptions); + } + export interface DataSourceOptions { + /** Specifies data filtering conditions. */ + filter?: Object; + /** Specifies data grouping conditions. */ + group?: Object; + /** The item mapping function. */ + map?: (record: any) => any; + /** Specifies the maximum number of items the page can contain. */ + pageSize?: number; + /** Specifies whether a DataSource loads data by pages, or all items at once. */ + paginate?: boolean; + /** The data post processing function. */ + postProcess?: (data: any[]) => any[]; + /** Specifies a value by which the required items are searched. */ + searchExpr?: Object; + /** Specifies the comparison operation used to search for the required items. */ + searchOperation?: string; + /** Specifies the value to which the search expression is compared. */ + searchValue?: Object; + /** Specifies the initial select option value. */ + select?: Object; + /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ + expand?: Object; + /** Specifies whether or not the DataSource instance requests the total count of items available in the storage. */ + requireTotalCount?: boolean; + /** Specifies the initial sort option value. */ + sort?: Object; + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Error) => void; + } + /** An object that provides access to a data web service or local data storage for collection container widgets. */ + export class DataSource implements EventsMixin { + constructor(options?: DataSourceOptions); + /** Disposes all resources associated with this DataSource. */ + dispose(): void; + /** Returns the current filter option value. */ + filter(): Object; + /** Sets the filter option value. */ + filter(filterExpr: Object): void; + /** Returns the current group option value. */ + group(): Object; + /** Sets the group option value. */ + group(groupExpr: Object): void; + /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ + isLastPage(): boolean; + /** Indicates whether or not at least one load() method execution has successfully finished. */ + isLoaded(): boolean; + /** Indicates whether or not the DataSource is currently being loaded. */ + isLoading(): boolean; + /** Returns the array of items currently operated by the DataSource. */ + items(): Array; + /** Returns the key expression. */ + key(): any; + /** Starts loading data. */ + load(): JQueryPromise>; + /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ + loadOptions(): Object; + /** Returns the current pageSize option value. */ + pageSize(): number; + /** Sets the pageSize option value. */ + pageSize(value: number): void; + /** Specifies the index of the currently loaded page. */ + pageIndex(): number; + /** Specifies the index of the page to be loaded during the next load() method execution. */ + pageIndex(newIndex: number): void; + /** Returns the current paginate option value. */ + paginate(): boolean; + /** Sets the paginate option value. */ + paginate(value: boolean): void; + /** Returns the searchExpr option value. */ + searchExpr(): Object; + /** Sets the searchExpr option value. */ + searchExpr(expr: Object): void; + /** Returns the currently specified search operation. */ + searchOperation(): string; + /** Sets the current search operation. */ + searchOperation(op: string): void; + /** Returns the searchValue option value. */ + searchValue(): Object; + /** Sets the searchValue option value. */ + searchValue(value: Object): void; + /** Returns the current select option value. */ + select(): Object; + /** Sets the select option value. */ + select(expr: Object): void; + /** Returns the current requireTotalCount option value. */ + requireTotalCount(): boolean; + /** Sets the requireTotalCount option value. */ + requireTotalCount(value: boolean): void; + /** Returns the current sort option value. */ + sort(): Object; + /** Sets the sort option value. */ + sort(sortExpr: Object): void; + /** Returns the underlying Store instance. */ + store(): Store; + /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ + totalCount(): number; + on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + on(eventName: "changed", eventHandler: () => void): DataSource; + on(eventName: string, eventHandler: Function): DataSource; + on(events: { [eventName: string]: Function; }): DataSource; + off(eventName: "loadingChanged"): DataSource; + off(eventName: "loadError"): DataSource; + off(eventName: "changed"): DataSource; + off(eventName: string): DataSource; + off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; + off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; + off(eventName: "changed", eventHandler: () => void): DataSource; + off(eventName: string, eventHandler: Function): DataSource; + } + /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ + export class EdmLiteral { + /** Creates an EdmLiteral instance and assigns the specified value to it. */ + constructor(value: string); + /** Returns a string representation of the value associated with this EdmLiteral object. */ + valueOf(): string; + } + /** An object used to generate and hold the GUID. */ + export class Guid { + /** Creates a new Guid instance that holds the specified GUID. */ + constructor(value: string); + /** Creates a new Guid instance holding the generated GUID. */ + constructor(); + /** Returns a string representation of the Guid instance. */ + toString(): string; + /** Returns a string representation of the Guid instance. */ + valueOf(): string; + } + export interface LocalStoreOptions extends ArrayStoreOptions { + /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ + flushInterval?: number; + /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ + immediate?: boolean; + /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ + name?: string; + } + /** A Store providing access to the HTML5 Web Storage. */ + export class LocalStore extends ArrayStore { + constructor(options?: LocalStoreOptions); + /** Removes all data associated with this Store. */ + clear(): void; + } + export interface ODataContextOptions extends ODataStoreOptions { + /** Specifies the list of entities to be accessed via the ODataContext. */ + entities?: Object; + /** Specifies the function called if the ODataContext causes an error. */ + errorHandler?: (e: Error) => void; + } + /** Provides access to the entire OData service. */ + export class ODataContext { + constructor(options?: ODataContextOptions); + /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ + get(operationName: string, params: Object): JQueryPromise; + /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ + invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; + /** Return a special proxy object to describe the entity link. */ + objectLink(entityAlias: string, key: any): Object; + } + export interface ODataStoreOptions extends StoreOptions { + /** A function used to customize a web request before it is sent. */ + beforeSend?: (request: { + url: string; + async: boolean; + method: string; + timeout: number; + params: Object; + payload: Object; + headers: Object; + }) => void; + /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ + jsonp?: boolean; + /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ + keyType?: any; + /** Specifies whether or not dates found in the response are deserialized. */ + deserializeDates?: boolean; + /** Specifies the URL of the data service being accessed via the current ODataContext. */ + url?: string; + /** Specifies the version of the OData protocol used to interact with the data service. */ + version?: number; + /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ + withCredentials?: boolean; + } + /** A Store providing access to a separate OData web service entity. */ + export class ODataStore extends Store { + constructor(options?: ODataStoreOptions); + /** Creates the Query object for the OData endpoint. */ + createQuery(loadOptions: Object): Object; + /** Returns the data item specified by the key. */ + byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; + } + /** An universal chainable data query interface object. */ + export interface Query { + /** Calculates a custom summary for the items in the current Query. */ + aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; + /** Calculates a custom summary for the items in the current Query. */ + aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; + /** Calculates the average item value for the current Query. */ + avg(getter: Object): JQueryPromise; + /** Finds the item with the maximum getter value. */ + max(getter: Object): JQueryPromise; + /** Finds the item with the maximum value in the Query. */ + max(): JQueryPromise; + /** Finds the item with the minimum value in the Query. */ + min(): JQueryPromise; + /** Finds the item with the minimum getter value. */ + min(getter: Object): JQueryPromise; + /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ + avg(): JQueryPromise; + /** Returns the total count of items in the current Query. */ + count(): JQueryPromise; + /** Executes the Query. */ + enumerate(): JQueryPromise; + /** Filters the current Query data. */ + filter(criteria: Array): Query; + /** Groups the current Query data. */ + groupBy(getter: Object): Query; + /** Applies the specified transformation to each item. */ + select(getter: Object): Query; + /** Limits the data item count. */ + slice(skip: number, take?: number): Query; + /** Sorts current Query data. */ + sortBy(getter: Object, desc: boolean): Query; + /** Sorts current Query data. */ + sortBy(getter: Object): Query; + /** Calculates the sum of item getter values in the current Query. */ + sum(getter: Object): JQueryPromise; + /** Calculates the sum of item values in the current Query. */ + sum(): JQueryPromise; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object): Query; + /** Adds one more sorting condition to the current Query. */ + thenBy(getter: Object, desc: boolean): Query; + /** Returns the array of current Query items. */ + toArray(): Array; + } + /** The global data layer error handler. */ + export var errorHandler: (e: Error) => void; + /** Encodes the specified string or array of bytes to base64 encoding. */ + export function base64_encode(input: any): string; + /** Creates a Query instance. */ + export function query(array: Array): Query; + /** Creates a Query instance for accessing the remote service specified by a URL. */ + export function query(url: string, queryOptions: Object): Query; + /** This section describes the utility objects provided by the DevExtreme data layer. */ + export var utils: { + /** Compiles a getter function from the getter expression. */ + compileGetter(expr: any): Function; + /** Compiles a setter function from the setter expression. */ + compileSetter(expr: any): Function; + odata: { + /** Holds key value converters for OData. */ + keyConverters: { + String(value: any): string; + Int32(value: any): number; + Int64(value: any): EdmLiteral; + Guid(value: any): Guid; + Boolean(value: any): boolean; + Single(value: any): EdmLiteral; + Decimal(value: any): EdmLiteral; + }; + } + } + } + /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ + export module ui { + export interface WidgetOptions extends DOMComponentOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ + hoverStateEnabled?: boolean; + /** Specifies whether or not the widget can be focused. */ + focusStateEnabled?: boolean; + /** Specifies a shortcut key that sets focus on the widget element. */ + accessKey?: string; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** Specifies the widget tab index. */ + tabIndex?: number; + /** Specifies the text of the hint displayed for the widget. */ + hint?: string; + } + /** The base class for widgets. */ + export class Widget extends DOMComponent { + constructor(options?: WidgetOptions); + /** Redraws the widget. */ + repaint(): void; + /** Sets focus on the widget. */ + focus(): void; + /** Registers a handler when a specified key is pressed. */ + registerKeyHandler(key: string, handler: Function): void; + } + export interface CollectionWidgetOptions extends WidgetOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** The time period in milliseconds before the onItemHold event is raised. */ + itemHoldTimeout?: number; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + loopItemFocus?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + onContentReady?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemContextMenu event. */ + onItemContextMenu?: Function; + /** A handler for the itemHold event. */ + onItemHold?: Function; + /** A handler for the itemRendered event. */ + onItemRendered?: Function; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** The index of the currently selected widget item. */ + selectedIndex?: number; + /** The selected item object. */ + selectedItem?: Object; + /** An array of currently selected item objects. */ + selectedItems?: Array; + /** A handler for the itemDeleting event. */ + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + } + /** The base class for widgets containing an item collection. */ + export class CollectionWidget extends Widget { + constructor(element: JQuery, options?: CollectionWidgetOptions); + constructor(element: HTMLElement, options?: CollectionWidgetOptions); + selectItem(itemElement: any): void; + unselectItem(itemElement: any): void; + deleteItem(itemElement: any): JQueryPromise; + isItemSelected(itemElement: any): boolean; + reorderItem(itemElement: any, toItemElement: any): JQueryPromise; + } + export interface DataExpressionMixinOptions { + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of a data source item field whose value is held in the value configuration option. */ + valueExpr?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** The currently selected value in the widget. */ + value?: Object; + } + export interface EditorOptions extends WidgetOptions { + /** The currently specified value. */ + value?: Object; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A Boolean value specifying whether or not the widget is read-only. */ + readOnly?: boolean; + /** Holds the object that defines the error that occurred during validation. */ + validationError?: Object; + /** Specifies whether the editor's value is valid. */ + isValid?: boolean; + /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ + validationMessageMode?: string; + } + /** A base class for editors. */ + export class Editor extends Widget { + /** Resets the editor's value to undefined. */ + reset(): void; + } + /** An object that serves as a namespace for methods displaying a message in an application/site. */ + export var dialog: { + /** Creates an alert dialog message containing a single "OK" button. */ + alert(message: string, title: string): JQueryPromise; + /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ + confirm(message: string, title: string): JQueryPromise; + /** Creates a custom dialog using the options specified by the passed configuration object. */ + custom(options: { title?: string; message?: string; buttons?: Array; }): { + show(): JQueryPromise; + hide(): void; + hide(value: any): void; + }; + }; + /** Creates a toast message. */ + export function notify(message: any, type: string, displayTime: number): void; + /** Creates a toast message. */ + export function notify(options: Object): void; + /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ + export var themes: { + /** Returns the name of the currently applied theme. */ + current(): string; + /** Changes the current theme to the specified one. */ + current(themeName: string): void; + }; + /** Sets a specified template engine. */ + export function setTemplateEngine(name: string): void; + /** Sets a custom template engine defined via custom compile and render functions. */ + export function setTemplateEngine(options: Object): void; + } + /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ + export var utils: { + /** Sets parameters for the viewport meta tag. */ + initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; + /** Requests that the browser call a specified function to update animation before the next repaint. */ + requestAnimationFrame(callback: Function): number; + /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ + cancelAnimationFrame(requestID: number): void; + }; + /** An object that serves as a namespace for DevExtreme Data Visualization Widgets. */ + export module viz { + /** Applies a theme for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(theme: string): void; + /** Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. */ + export function currentTheme(platform: string, colorScheme: string): void; + /** Registers a new theme based on the existing one. */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** Applies a predefined or registered custom palette to all visualization widgets at once. */ + export function currentPalette(paletteName: string): void; + /** Obtains the color sets of a predefined or registered palette. */ + export function getPalette(paletteName: string): Object; + /** Registers a new palette. */ + export function registerPalette(paletteName: string, palette: Object): void; + } +} +declare module DevExpress.ui { + export interface dxValidatorOptions extends DOMComponentOptions { + /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ + validationRules?: Array; + /** Specifies the editor name to be used in the validation default messages. */ + name?: string; + /** An object that specifies what and when to validate and how to apply the validation result. */ + adapter?: Object; + /** Specifies the validation group the editor will be related to. */ + validationGroup?: string; + /** A handler for the validated event. */ + onValidated?: (params: validationEngine.ValidatorValidationResult) => void; + } + /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ + export class dxValidator extends DOMComponent implements validationEngine.IValidator { + constructor(element: JQuery, options?: dxValidatorOptions); + constructor(element: Element, options?: dxValidatorOptions); + /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ + validate(): validationEngine.ValidatorValidationResult; + /** Resets the value and validation result of the editor associated with the current dxValidator object. */ + reset(): void; + } + /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ + export class dxValidationGroup extends DOMComponent { + constructor(element: JQuery); + constructor(element: Element); + /** Validates rules of the validators that belong to the current validation group. */ + validate(): validationEngine.ValidationGroupValidationResult; + /** Resets the value and validation result of the editors that are included to the current validation group. */ + reset(): void; + } + export interface dxValidationSummaryOptions extends CollectionWidgetOptions { + /** Specifies the validation group for which summary should be generated. */ + validationGroup?: string; + } + /** A widget for displaying the result of checking validation rules for editors. */ + export class dxValidationSummary extends CollectionWidget { + constructor(element: JQuery, options?: dxValidationSummaryOptions); + constructor(element: Element, options?: dxValidationSummaryOptions); + } + export interface dxResizableOptions extends DOMComponentOptions { + /** Specifies which borders of the widget element are used as a handle. */ + handles?: string; + /** Specifies the lower width boundary for resizing. */ + minWidth?: number; + /** Specifies the upper width boundary for resizing. */ + maxWidth?: number; + /** Specifies the lower height boundary for resizing. */ + minHeight?: number; + /** Specifies the upper height boundary for resizing. */ + maxHeight?: number; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + } + /** A widget that displays required content in a resizable element. */ + export class dxResizable extends DOMComponent { + constructor(element: JQuery, options?: dxResizableOptions); + constructor(element: Element, options?: dxResizableOptions); + } + export interface dxTooltipOptions extends dxPopoverOptions { + } + /** A tooltip widget. */ + export class dxTooltip extends dxPopover { + constructor(element: JQuery, options?: dxTooltipOptions); + constructor(element: Element, options?: dxTooltipOptions); + } + export interface dxDropDownListOptions extends dxDropDownEditorOptions, DataExpressionMixinOptions { + /** Returns the value currently displayed by the widget. */ + displayValue?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ + showDataBeforeSearch?: boolean; + /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ + searchExpr?: Object; + /** Specifies the binary operation used to filter data. */ + searchMode?: string; + /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ + searchTimeout?: number; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget supports searching. */ + searchEnabled?: boolean; + /** + * Specifies whether or not the widget displays items by pages. + * @deprecated dataSource.paginate.md + */ + pagingEnabled?: boolean; + /** The text or HTML markup displayed by the widget if the item collection is empty. */ + noDataText?: string; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: Function; + /** A handler for the itemClick event. */ + onItemClick?: Function; + onContentReady?: Function; + } + /** A base class for drop-down list widgets. */ + export class dxDropDownList extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDropDownListOptions); + constructor(element: Element, options?: dxDropDownListOptions); + } + export interface dxToolbarOptions extends CollectionWidgetOptions { + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** Informs the widget about its location in a view HTML markup. */ + renderAs?: string; + } + /** A toolbar widget. */ + export class dxToolbar extends CollectionWidget { + constructor(element: JQuery, options?: dxToolbarOptions); + constructor(element: Element, options?: dxToolbarOptions); + } + export interface dxToastOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** The time span in milliseconds during which the dxToast widget is visible. */ + displayTime?: number; + height?: any; + /** The dxToast message text. */ + message?: string; + position?: PositionOptions; + shading?: boolean; + /** Specifies the dxToast widget type. */ + type?: string; + width?: any; + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user swipes it out of the screen boundaries. */ + closeOnSwipe?: boolean; + /** A Boolean value specifying whether or not the toast is closed if a user clicks it. */ + closeOnClick?: boolean; + } + /** The toast message widget. */ + export class dxToast extends dxOverlay { + constructor(element: JQuery, options?: dxToastOptions); + constructor(element: Element, options?: dxToastOptions); + } + export interface dxTextEditorOptions extends EditorOptions { + /** A handler for the change event. */ + onChange?: Function; + /** A handler for the copy event. */ + onCopy?: Function; + /** A handler for the cut event. */ + onCut?: Function; + /** A handler for the enterKey event. */ + onEnterKey?: Function; + /** A handler for the focusIn event. */ + onFocusIn?: Function; + /** A handler for the focusOut event. */ + onFocusOut?: Function; + /** A handler for the input event. */ + onInput?: Function; + /** A handler for the keyDown event. */ + onKeyDown?: Function; + /** A handler for the keyPress event. */ + onKeyPress?: Function; + /** A handler for the keyUp event. */ + onKeyUp?: Function; + /** A handler for the paste event. */ + onPaste?: Function; + /** The text displayed by the widget when the widget value is empty. */ + placeholder?: string; + /** Specifies whether to display the Clear button in the widget. */ + showClearButton?: boolean; + /** Specifies the current value displayed by the widget. */ + value?: any; + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + /** Specifies HTML attributes applied to the inner input element of the widget. */ + attr?: Object; + /** The read-only option that holds the text displayed by the widget input element. */ + text?: string; + focusStateEnabled?: boolean; + hoverStateEnabled?: boolean; + /** The editor mask that specifies the format of the entered string. */ + mask?: string; + /** Specifies a mask placeholder character. */ + maskChar?: string; + /** Specifies custom mask rules. */ + maskRules?: Object; + /** A message displayed when the entered text does not match the specified pattern. */ + maskInvalidMessage?: string; + /** Specifies whether the value option holds only characters entered by a user or prompt characters as well. */ + useMaskedValue?: boolean; + } + /** A base class for text editing widgets. */ + export class dxTextEditor extends Editor { + constructor(element: JQuery, options?: dxTextEditorOptions); + constructor(element: Element, options?: dxTextEditorOptions); + /** Removes focus from the input element. */ + blur(): void; + /** Sets focus to the input element representing the widget. */ + focus(): void; + } + export interface dxTextBoxOptions extends dxTextEditorOptions { + /** Specifies the maximum number of characters you can enter into the textbox. */ + maxLength?: any; + /** The "mode" attribute value of the actual HTML input element representing the text box. */ + mode?: string; + } + /** A single-line text box widget. */ + export class dxTextBox extends dxTextEditor { + constructor(element: JQuery, options?: dxTextBoxOptions); + constructor(element: Element, options?: dxTextBoxOptions); + } + export interface dxTextAreaOptions extends dxTextBoxOptions { + /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ + spellcheck?: boolean; + } + /** A widget used to display and edit multi-line text. */ + export class dxTextArea extends dxTextBox { + constructor(element: JQuery, options?: dxTextAreaOptions); + constructor(element: Element, options?: dxTextAreaOptions); + } + export interface dxTabsOptions extends CollectionWidgetOptions { + /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ + selectionMode?: string; + /** Specifies whether or not an end-user can scroll tabs by swiping. */ + scrollByContent?: boolean; + /** Specifies whether or not an end-user can scroll tabs. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A tab strip used to switch between pages. */ + export class dxTabs extends CollectionWidget { + constructor(element: JQuery, options?: dxTabsOptions); + constructor(element: Element, options?: dxTabsOptions); + } + export interface dxTabPanelOptions extends dxMultiViewOptions { + /** A handler for the titleClick event. */ + onTitleClick?: any; + /** A handler for the titleHold event. */ + onTitleHold?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether to enable or disable scrolling. */ + scrollingEnabled?: boolean; + /** A Boolean value that specifies the availability of navigation buttons. */ + showNavButtons?: boolean; + } + /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ + export class dxTabPanel extends dxMultiView { + constructor(element: JQuery, options?: dxTabPanelOptions); + constructor(element: Element, options?: dxTabPanelOptions); + } + export interface dxSelectBoxOptions extends dxDropDownListOptions { + /** Specifies DOM event names that update a widget's value. */ + valueChangeEvent?: string; + /** The template to be used for rendering the widget text field. */ + fieldTemplate?: any; + /** The text that is provided as a hint in the select box editor. */ + placeholder?: string; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + } + /** A widget that allows you to select an item in a dropdown list. */ + export class dxSelectBox extends dxDropDownList { + constructor(element: JQuery, options?: dxSelectBoxOptions); + constructor(element: Element, options?: dxSelectBoxOptions); + } + export interface dxTagBoxOptions extends dxSelectBoxOptions { + /** Holds the list of selected values. */ + values?: Array; + /** A read-only option that holds the last selected value. */ + value?: Object; + } + /** A widget that allows you to select multiple items from a dropdown list. */ + export class dxTagBox extends dxSelectBox { + constructor(element: JQuery, options?: dxTagBoxOptions); + constructor(element: Element, options?: dxTagBoxOptions); + } + export interface dxScrollViewOptions extends dxScrollableOptions { + /** A handler for the pullDown event. */ + onPullDown?: Function; + /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the reachBottom event. */ + onReachBottom?: Function; + /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ + reachBottomText?: string; + /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ + refreshingText?: string; + /** Returns a value indicating if the scrollView content is larger then the widget container. */ + isFull(): boolean; + /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ + refresh(): void; + /** Notifies the scroll view that data loading is finished. */ + release(preventScrollBottom: boolean): JQueryPromise; + /** Toggles the loading state of the widget. */ + toggleLoading(showOrHide: boolean): void; + } + /** A widget used to display scrollable content. */ + export class dxScrollView extends dxScrollable { + constructor(element: JQuery, options?: dxScrollViewOptions); + constructor(element: Element, options?: dxScrollViewOptions); + } + export interface dxScrollableLocation { + top?: number; + left?: number; + } + export interface dxScrollableOptions extends DOMComponentOptions { + /** A string value specifying the available scrolling directions. */ + direction?: string; + /** A Boolean value specifying whether or not the widget can respond to user interaction. */ + disabled?: boolean; + /** A handler for the scroll event. */ + onScroll?: Function; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** A handler for the update event. */ + onUpdated?: Function; + /** Indicates whether to use native or simulated scrolling. */ + useNative?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ + scrollByContent?: boolean; + /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ + scrollByThumb?: boolean; + } + /** A widget used to display scrollable content. */ + export class dxScrollable extends DOMComponent { + constructor(element: JQuery, options?: dxScrollableOptions); + constructor(element: Element, options?: dxScrollableOptions); + /** Returns the height of the scrollable widget in pixels. */ + clientHeight(): number; + /** Returns the width of the scrollable widget in pixels. */ + clientWidth(): number; + /** Returns an HTML element of the widget. */ + content(): JQuery; + /** Scrolls the widget content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ + scrollBy(distanceObject: dxScrollableLocation): void; + /** Returns the height of the scrollable content in pixels. */ + scrollHeight(): number; + /** Returns the current scroll position against the leftmost position. */ + scrollLeft(): number; + /** Returns how far the scrollable content is scrolled from the top and from the left. */ + scrollOffset(): dxScrollableLocation; + /** Scrolls widget content to the specified position. */ + scrollTo(targetLocation: number): void; + /** Scrolls widget content to a specified position. */ + scrollTo(targetLocation: dxScrollableLocation): void; + /** Scrolls widget content to the specified element. */ + scrollToElement(element: Element): void; + /** Returns the current scroll position against the topmost position. */ + scrollTop(): number; + /** Returns the width of the scrollable content in pixels. */ + scrollWidth(): number; + /** Updates the dimensions of the scrollable contents. */ + update(): void; + } + export interface dxRadioGroupOptions extends CollectionWidgetOptions, DataExpressionMixinOptions { + activeStateEnabled?: boolean; + /** Specifies the radio group layout. */ + layout?: string; + } + /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ + export class dxRadioGroup extends CollectionWidget { + constructor(element: JQuery, options?: dxRadioGroupOptions); + constructor(element: Element, options?: dxRadioGroupOptions); + } + export interface dxPopupOptions extends dxOverlayOptions { + animation?: fx.AnimationOptions; + /** Specifies whether or not to allow a user to drag the popup window. */ + dragEnabled?: boolean; + /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ + fullScreen?: boolean; + position?: PositionOptions; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showTitle?: boolean; + /** The title in the overlay window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + width?: any; + /** Specifies items displayed on the top or bottom toolbar of the popup window. */ + buttons?: Array; + /** Specifies whether or not the widget displays the Close button. */ + showCloseButton?: boolean; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + } + /** A widget that displays required content in a popup window. */ + export class dxPopup extends dxOverlay { + constructor(element: JQuery, options?: dxPopupOptions); + constructor(element: Element, options?: dxPopupOptions); + } + export interface dxPopoverOptions extends dxPopupOptions { + /** An object defining animation options of the widget. */ + animation?: fx.AnimationOptions; + /** Specifies the height of the widget. */ + height?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + shading?: boolean; + /** A Boolean value specifying whether or not to display the title in the overlay window. */ + showTitle?: boolean; + /** The target element associated with a popover. */ + target?: any; + /** Specifies the width of the widget. */ + width?: any; + } + /** A widget that displays the required content in a popup window. */ + export class dxPopover extends dxPopup { + constructor(element: JQuery, options?: dxPopoverOptions); + constructor(element: Element, options?: dxPopoverOptions); + /** Displays the widget for the specified target element. */ + show(target?: any): JQueryPromise; + } + export interface dxOverlayOptions extends WidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ + closeOnBackButton?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ + closeOnOutsideClick?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + /** Specifies whether or not an end-user can drag the widget. */ + dragEnabled?: boolean; + /** Specifies whether or not an end user can resize the widget. */ + resizeEnabled?: boolean; + /** The height of the widget in pixels. */ + height?: any; + /** Specifies the maximum height the widget can reach while resizing. */ + maxHeight?: any; + /** Specifies the maximum width the widget can reach while resizing. */ + maxWidth?: any; + /** Specifies the minimum height the widget can reach while resizing. */ + minHeight?: any; + /** Specifies the minimum width the widget can reach while resizing. */ + minWidth?: any; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the resizeStart event. */ + onResizeStart?: Function; + /** A handler for the resize event. */ + onResize?: Function; + /** A handler for the resizeEnd event. */ + onResizeEnd?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ + shading?: boolean; + /** Specifies the shading color. */ + shadingColor?: string; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + /** The widget width in pixels. */ + width?: any; + } + /** A widget displaying the required content in an overlay window. */ + export class dxOverlay extends Widget { + constructor(element: JQuery, options?: dxOverlayOptions); + constructor(element: Element, options?: dxOverlayOptions); + /** An HTML element of the widget. */ + content(): JQuery; + /** Hides the widget. */ + hide(): JQueryPromise; + /** Recalculates the overlay's size and position. */ + repaint(): void; + /** Shows the widget. */ + show(): JQueryPromise; + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** A static method that specifies the base z-index for all overlay widgets. */ + static baseZIndex(zIndex: number): void; + } + export interface dxNumberBoxOptions extends dxTextEditorOptions { + /** The maximum value accepted by the number box. */ + max?: number; + /** The minimum value accepted by the number box. */ + min?: number; + /** Specifies whether or not to show spin buttons. */ + showSpinButtons?: boolean; + useTouchSpinButtons?: boolean; + /** Specifies by which value the widget value changes when a spin button is clicked. */ + step?: number; + /** The current number box value. */ + value?: number; + } + /** A textbox widget that enables a user to enter numeric values. */ + export class dxNumberBox extends dxTextEditor { + constructor(element: JQuery, options?: dxNumberBoxOptions); + constructor(element: Element, options?: dxNumberBoxOptions); + } + export interface dxNavBarOptions extends dxTabsOptions { + scrollingEnabled?: boolean; + } + /** A widget that contains items used to navigate through application views. */ + export class dxNavBar extends dxTabs { + constructor(element: JQuery, options?: dxNavBarOptions); + constructor(element: Element, options?: dxNavBarOptions); + } + export interface dxMultiViewOptions extends CollectionWidgetOptions { + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently displayed item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget used to display a view and to switch between several views. */ + export class dxMultiView extends CollectionWidget { + constructor(element: JQuery, options?: dxMultiViewOptions); + constructor(element: Element, options?: dxMultiViewOptions); + } + export interface dxMapOptions extends WidgetOptions { + /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route. */ + autoAdjust?: boolean; + center?: { + /** The latitude location displayed in the center of the widget. */ + lat?: number; + /** The longitude location displayed in the center of the widget. */ + lng?: number; + }; + /** A handler for the click event. */ + onClick?: any; + /** Specifies whether or not map widget controls are available. */ + controls?: boolean; + /** Specifies the height of the widget. */ + height?: any; + /** A key used to authenticate the application within the required map provider. */ + key?: { + /** A key used to authenticate the application within the "Bing" map provider. */ + bing?: string; + /** A key used to authenticate the application within the "Google" map provider. */ + google?: string; + /** A key used to authenticate the application within the "Google Static" map provider. */ + googleStatic?: string; + } + /** A handler for the markerAdded event. */ + onMarkerAdded?: Function; + /** A URL pointing to the custom icon to be used for map markers. */ + markerIconSrc?: string; + /** A handler for the markerRemoved event. */ + onMarkerRemoved?: Function; + /** An array of markers displayed on a map. */ + markers?: Array; + /** The name of the current map data provider. */ + provider?: string; + /** A handler for the ready event. */ + onReady?: Function; + /** A handler for the routeAdded event. */ + onRouteAdded?: Function; + /** A handler for the routeRemoved event. */ + onRouteRemoved?: Function; + /** An array of routes shown on the map. */ + routes?: Array; + /** The type of a map to display. */ + type?: string; + /** Specifies the width of the widget. */ + width?: any; + /** The zoom level of the map. */ + zoom?: number; + } + /** An interactive map widget. */ + export class dxMap extends Widget { + constructor(element: JQuery, options?: dxMapOptions); + constructor(element: Element, options?: dxMapOptions); + /** Adds a marker to the map. */ + addMarker(markerOptions: Object): JQueryPromise; + /** Adds a route to the map. */ + addRoute(routeOptions: Object): JQueryPromise; + /** Removes a marker from the map. */ + removeMarker(marker: Object): JQueryPromise; + /** Removes a route from the map. */ + removeRoute(route: any): JQueryPromise; + } + export interface dxLookupOptions extends dxDropDownListOptions { + /** An object defining widget animation options. */ + animation?: fx.AnimationOptions; + /** The text displayed on the Cancel button. */ + cancelButtonText?: string; + /** The text displayed on the Clear button. */ + clearButtonText?: string; + /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ + cleanSearchOnOpening?: boolean; + /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlaying window. */ + closeOnOutsideClick?: any; + /** The text displayed on the Apply button. */ + applyButtonText?: string; + /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ + fullScreen?: boolean; + focusStateEnabled?: boolean; + /** A Boolean value specifying whether or not to group widget items. */ + grouped?: boolean; + /** The name of the template used to display a group header. */ + groupTemplate?: any; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ + pageLoadingText?: string; + /** The text displayed by the widget when nothing is selected. */ + placeholder?: string; + /** The height of the widget popup element. */ + popupHeight?: any; + /** The width of the widget popup element. */ + popupWidth?: any; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether or not the search bar is visible. */ + searchEnabled?: boolean; + /** The text that is provided as a hint in the lookup's search bar. */ + searchPlaceholder?: string; + /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ + shading?: boolean; + /** Specifies whether to display the Cancel button in the lookup window. */ + showCancelButton?: boolean; + /** + * A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. + * @deprecated pageLoadMode.md + */ + showNextButton?: boolean; + /** The title of the lookup window. */ + title?: string; + /** A template to be used for rendering the widget title. */ + titleTemplate?: any; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** Specifies whether or not to show lookup contents in a dxPopover widget. */ + usePopover?: boolean; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + /** A handler for the titleRendered event. */ + onTitleRendered?: Function; + /** A Boolean value specifying whether or not to display the title in the popup window. */ + showPopupTitle?: boolean; + } + /** A widget that allows a user to select predefined values from a lookup window. */ + export class dxLookup extends dxDropDownList { + constructor(element: JQuery, options?: dxLookupOptions); + constructor(element: Element, options?: dxLookupOptions); + /** This section lists the data source fields that are used in a default template for lookup drop-down items. */ + } + export interface dxLoadPanelOptions extends dxOverlayOptions { + /** An object defining the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** The delay in milliseconds after which the load panel is displayed. */ + delay?: number; + /** The height of the widget. */ + height?: number; + /** A URL pointing to an image to be used as a load indicator. */ + indicatorSrc?: string; + /** The text displayed in the load panel. */ + message?: string; + /** A Boolean value specifying whether or not to show a load indicator. */ + showIndicator?: boolean; + /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ + showPane?: boolean; + /** The width of the widget. */ + width?: number; + } + /** A widget used to indicate whether or not an element is loading. */ + export class dxLoadPanel extends dxOverlay { + constructor(element: JQuery, options?: dxLoadPanelOptions); + constructor(element: Element, options?: dxLoadPanelOptions); + } + export interface dxLoadIndicatorOptions extends WidgetOptions { + /** Specifies the path to an image used as the indicator. */ + indicatorSrc?: string; + } + /** The widget used to indicate the loading process. */ + export class dxLoadIndicator extends Widget { + constructor(element: JQuery, options?: dxLoadIndicatorOptions); + constructor(element: Element, options?: dxLoadIndicatorOptions); + } + export interface dxListOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not to display a grouped list. */ + grouped?: boolean; + /** The template to be used for rendering item groups. */ + groupTemplate?: any; + onItemDeleting?: Function; + /** A handler for the itemDeleted event. */ + onItemDeleted?: Function; + /** A handler for the groupRendered event. */ + onGroupRendered?: Function; + /** A handler for the itemReordered event. */ + onItemReordered?: Function; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** A handler for the itemSwipe event. */ + onItemSwipe?: Function; + /** The text displayed on the button used to load the next page from the data source. */ + nextButtonText?: string; + /** A handler for the pageLoading event. */ + onPageLoading?: Function; + /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ + pageLoadingText?: string; + /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ + pulledDownText?: string; + /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ + pullingDownText?: string; + /** A handler for the pullRefresh event. */ + onPullRefresh?: Function; + /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ + pullRefreshEnabled?: boolean; + /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ + refreshingText?: string; + /** A handler for the scroll event. */ + onScroll?: Function; + /** A Boolean value specifying whether to enable or disable list scrolling. */ + scrollingEnabled?: boolean; + /** Specifies when the widget shows the scrollbar. */ + showScrollbar?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNativeScrolling?: boolean; + /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ + bounceEnabled?: boolean; + /** A Boolean value specifying if the list is scrolled by content. */ + scrollByContent?: boolean; + /** A Boolean value specifying if the list is scrolled using the scrollbar. */ + scrollByThumb?: boolean; + onItemContextMenu?: Function; + onItemHold?: Function; + /** Specifies whether or not an end-user can collapse groups. */ + collapsibleGroups?: boolean; + /** Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ + pageLoadMode?: string; + /** Specifies whether or not to display controls used to select list items. */ + showSelectionControls?: boolean; + /** Specifies item selection mode. */ + selectionMode?: string; + selectAllText?: string; + onSelectAllChanged?: Function; + /** Specifies the array of items for a context menu called for a list item. */ + menuItems?: Array; + /** Specifies whether an item context menu is shown when a user holds or swipes an item. */ + menuMode?: string; + /** Specifies whether or not an end user can delete list items. */ + allowItemDeleting?: boolean; + /** Specifies the way a user can delete items from the list. */ + itemDeleteMode?: string; + /** Specifies whether or not an end user can reorder list items. */ + allowItemReordering?: boolean; + /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ + indicateLoading?: boolean; + activeStateEnabled?: boolean; + } + /** A list widget. */ + export class dxList extends CollectionWidget { + constructor(element: JQuery, options?: dxListOptions); + constructor(element: Element, options?: dxListOptions); + /** Returns the height of the widget in pixels. */ + clientHeight(): number; + /** Removes the specified item from the list. */ + deleteItem(itemIndex: any): JQueryPromise; + /** Removes the specified item from the list. */ + deleteItem(itemElement: Element): JQueryPromise; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemIndex: any): boolean; + /** Returns a Boolean value that indicates whether or not the specified item is selected. */ + isItemSelected(itemElement: Element): boolean; + /** Reloads list data. */ + reload(): void; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; + /** Moves the specified item to the specified position in the list. */ + reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; + /** Scrolls the list content by the specified number of pixels. */ + scrollBy(distance: number): void; + /** Returns the height of the list content in pixels. */ + scrollHeight(): number; + /** Scrolls list content to the specified position. */ + scrollTo(location: number): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemElement: Element): void; + /** Scrolls the list to the specified item. */ + scrollToItem(itemIndex: any): void; + /** Returns how far the list content is scrolled from the top. */ + scrollTop(): number; + /** Selects the specified item from the list. */ + selectItem(itemElement: Element): void; + /** Selects the specified item from the list. */ + selectItem(itemIndex: any): void; + /** Deselects the specified item from the list. */ + unselectItem(itemElement: Element): void; + /** Unselects the specified item from the list. */ + unselectItem(itemIndex: any): void; + /** Updates the widget scrollbar according to widget content size. */ + updateDimensions(): JQueryPromise; + /** Expands the specified group. */ + expandGroup(groupIndex: number): JQueryPromise; + /** Collapses the specified group. */ + collapseGroup(groupIndex: number): JQueryPromise; + } + export interface dxGalleryOptions extends CollectionWidgetOptions { + /** The time, in milliseconds, spent on slide animation. */ + animationDuration?: number; + /** Specifies whether or not to animate the displayed item change. */ + animationEnabled?: boolean; + /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ + indicatorEnabled?: boolean; + /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ + loop?: boolean; + /** The index of the currently active gallery item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ + showIndicator?: boolean; + /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ + showNavButtons?: boolean; + /** The time interval in milliseconds, after which the gallery switches to the next item. */ + slideshowDelay?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** Specifies whether or not to display parts of previous and next images along the sides of the current image. */ + wrapAround?: boolean; + /** Specifies if the widget stretches images to fit the total gallery width. */ + stretchImages?: boolean; + /** Specifies the width of an area used to display a single image. */ + initialItemWidth?: number; + } + /** An image gallery widget. */ + export class dxGallery extends CollectionWidget { + constructor(element: JQuery, options?: dxGalleryOptions); + constructor(element: Element, options?: dxGalleryOptions); + /** Shows the specified gallery item. */ + goToItem(itemIndex: number, animation: boolean): JQueryPromise; + /** Shows the next gallery item. */ + nextItem(animation: boolean): JQueryPromise; + /** Shows the previous gallery item. */ + prevItem(animation: boolean): JQueryPromise; + } + export interface dxDropDownEditorOptions extends dxTextBoxOptions { + /** Specifies the current value displayed by the widget. */ + value?: Object; + /** A handler for the closed event. */ + onClosed?: Function; + /** A handler for the opened event. */ + onOpened?: Function; + /** Specifies whether or not the drop-down editor is displayed. */ + opened?: boolean; + /** Specifies whether or not the widget allows an end-user to enter a custom value. */ + fieldEditEnabled?: boolean; + /** Specifies the way an end-user applies the selected value. */ + applyValueMode?: string; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down editor widget. */ + export class dxDropDownEditor extends dxTextBox { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** Closes the drop-down editor. */ + close(): void; + /** Opens the drop-down editor. */ + open(): void; + /** Resets the widget's value to null. */ + reset(): void; + /** Returns an <input> element of the widget. */ + field(): JQuery; + /** Returns an HTML element of the popup window content. */ + content(): JQuery; + } + export interface dxDateBoxOptions extends dxTextEditorOptions { + /** A format used to display date/time information. */ + format?: string; + /** A Globalize format string specifying the date display format. */ + formatString?: string; + /** The last date that can be selected within the widget. */ + max?: any; + /** The minimum date that can be selected within the widget. */ + min?: any; + /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ + placeholder?: string; + /** + * Specifies whether or not a user can pick out a date using the drop-down calendar. + * @deprecated Use 'pickerType' option instead. + */ + useCalendar?: boolean; + /** An object or a value, specifying the date and time currently selected using the date box. */ + value?: any; + /** + * Specifies whether or not the widget uses the native HTML input element. + * @deprecated Use 'pickerType' option instead. + */ + useNative?: boolean; + /** Specifies the interval between neighboring values in the popup list in minutes. */ + interval?: number; + /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ + maxZoomLevel?: string; + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + minZoomLevel?: string; + /** Specifies the type of date/time picker. */ + pickerType?: string; + /** Specifies the message displayed if the typed value is not a valid date or time. */ + invalidDateMessage?: string; + /** Specifies the message displayed if the specified date is later than the max value or earlier than the min value. */ + dateOutOfRangeMessage?: string; + } + /** A date box widget. */ + export class dxDateBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxDateBoxOptions); + constructor(element: Element, options?: dxDateBoxOptions); + } + export interface dxCheckBoxOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies the widget state. */ + value?: boolean; + /** Specifies the text displayed by the check box. */ + text?: string; + } + /** A check box widget. */ + export class dxCheckBox extends Editor { + constructor(element: JQuery, options?: dxCheckBoxOptions); + constructor(element: Element, options?: dxCheckBoxOptions); + } + export interface dxCalendarOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Specifies a date displayed on the current calendar page. */ + currentDate?: Date; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The latest date the widget allows to select. */ + max?: Date; + /** The earliest date the widget allows to select. */ + min?: Date; + /** Specifies whether or not the widget displays a button that selects the current date. */ + showTodayButton?: boolean; + /** Specifies the current calendar zoom level. */ + zoomLevel?: string; + /** Specifies the maximum zoom level of the calendar. */ + maxZoomLevel?: string; + /** Specifies the minimum zoom level of the calendar. */ + minZoomLevel?: string; + /** The template to be used for rendering calendar cells. */ + cellTemplate?: any; + } + /** A calendar widget. */ + export class dxCalendar extends Editor { + constructor(element: JQuery, options?: dxCalendarOptions); + constructor(element: Element, options?: dxCalendarOptions); + } + export interface dxButtonOptions extends WidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A handler for the click event. */ + onClick?: any; + /** Specifies the icon to be displayed on the button. */ + icon?: string; + iconSrc?: string; + /** A template to be used for rendering the dxButton widget. */ + template?: any; + /** The text displayed on the button. */ + text?: string; + /** Specifies the button type. */ + type?: string; + /** Specifies the name of the validation group to be accessed in the click event handler. */ + validationGroup?: string; + } + /** A button widget. */ + export class dxButton extends Widget { + constructor(element: JQuery, options?: dxButtonOptions); + constructor(element: Element, options?: dxButtonOptions); + } + export interface dxBoxOptions extends CollectionWidget { + /** Specifies how widget items are aligned along the main direction. */ + align?: string; + /** Specifies the direction of item positioning in the widget. */ + direction?: string; + /** Specifies how widget items are aligned cross-wise. */ + crossAlign?: string; + } + /** A container widget used to arrange inner elements. */ + export class dxBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { + /** Specifies the collection of rows for the grid used to position layout elements. */ + rows?: Array; + /** Specifies the collection of columns for the grid used to position layout elements. */ + cols?: Array; + /** Specifies the function returning the screen factor depending on the screen width. */ + screenByWidth?: (width: number) => string; + /** Specifies the screen factor with which all elements are located in a single column. */ + singleColumnScreen?: string; + } + /** A widget used to build an adaptive markup that is dependent on screen resolution. */ + export class dxResponsiveBox extends CollectionWidget { + constructor(element: JQuery, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); + } + export interface dxAutocompleteOptions extends dxDropDownListOptions { + /** Specifies the current value displayed by the widget. */ + value?: string; + /** The minimum number of characters that must be entered into the text box to begin a search. */ + minSearchLength?: number; + /** Specifies the maximum count of items displayed by the widget. */ + maxItemCount?: number; + /** Gets the currently selected item. */ + selectedItem?: Object; + } + /** A textbox widget that supports autocompletion. */ + export class dxAutocomplete extends dxDropDownList { + constructor(element: JQuery, options?: dxAutocompleteOptions); + constructor(element: Element, options?: dxAutocompleteOptions); + /** Opens the drop-down editor. */ + open(): void; + /** Closes the drop-down editor. */ + close(): void; + } + export interface dxAccordionOptions extends CollectionWidgetOptions { + /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ + animationDuration?: number; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ + collapsible?: boolean; + /** Specifies whether the widget can expand several items or only a single item at once. */ + multiple?: boolean; + /** The template to be used for rendering dxAccordion items. */ + itemTemplate?: any; + /** A handler for the itemTitleClick event. */ + onItemTitleClick?: any; + /** A handler for the itemTitleHold event. */ + onItemTitleHold?: Function; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + /** The index number of the currently selected item. */ + selectedIndex?: number; + /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ + deferRendering?: boolean; + } + /** A widget that displays data source items on collapsible panels. */ + export class dxAccordion extends CollectionWidget { + constructor(element: JQuery, options?: dxAccordionOptions); + constructor(element: Element, options?: dxAccordionOptions); + /** Collapses the specified item. */ + collapseItem(index: number): JQueryPromise; + /** Expands the specified item. */ + expandItem(index: number): JQueryPromise; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + } + export interface dxFileUploaderOptions extends EditorOptions { + /** A read-only option that holds a File instance representing the selected file. */ + value?: File; + /** Holds the File instances representing files selected in the widget. */ + values?: Array; + buttonText?: string; + /** The text displayed on the button that opens the file browser. */ + selectButtonText?: string; + /** The text displayed on the button that starts uploading. */ + uploadButtonText?: string; + /** Specifies the text displayed on the area to which an end-user can drop a file. */ + labelText?: string; + /** Specifies the value passed to the name attribute of the underlying input element. */ + name?: string; + /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ + multiple?: boolean; + /** Specifies a file type or several types accepted by the widget. */ + accept?: string; + /** Specifies a target Url for the upload request. */ + uploadUrl?: string; + /** Specifies if an end user can remove a file from the selection and interrupt uploading. */ + allowCanceling?: boolean; + /** Specifies whether or not the widget displays the list of selected files. */ + showFileList?: boolean; + /** Gets the current progress in percentages. */ + progress?: number; + /** The message displayed by the widget when it is ready to upload the specified files. */ + readyToUploadMessage?: string; + /** The message displayed by the widget when uploading is finished. */ + uploadedMessage?: string; + /** The message displayed by the widget on uploading failure. */ + uploadFailedMessage?: string; + /** Specifies how the widget uploads files. */ + uploadMode?: string; + /** A handler for the uploaded event. */ + onUploaded?: Function; + /** A handler for the uploaded event. */ + onProgress?: Function; + /** A handler for the uploadError event. */ + onUploadError?: Function; + /** A handler for the valueChanged event. */ + onValueChanged?: Function; + } + /** A widget used to select and upload a file or multiple files. */ + export class dxFileUploader extends Editor { + constructor(element: JQuery, options?: dxFileUploaderOptions); + constructor(element: Element, options?: dxFileUploaderOptions); + } + export interface dxTrackBarOptions extends EditorOptions { + /** The minimum value the widget can accept. */ + min?: number; + /** The maximum value the widget can accept. */ + max?: number; + /** The current widget value. */ + value?: number; + } + /** A base class for track bar widgets. */ + export class dxTrackBar extends Editor { + constructor(element: JQuery, options?: dxTrackBarOptions); + constructor(element: Element, options?: dxTrackBarOptions); + } + export interface dxProgressBarOptions extends dxTrackBarOptions { + /** Specifies a format for the progress status. */ + statusFormat?: any; + /** Specifies whether or not the widget displays a progress status. */ + showStatus?: boolean; + /** A handler for the complete event. */ + onComplete?: Function; + } + /** A widget used to indicate progress. */ + export class dxProgressBar extends dxTrackBar { + constructor(element: JQuery, options?: dxProgressBarOptions); + constructor(element: Element, options?: dxProgressBarOptions); + } + export interface dxSliderOptions extends dxTrackBarOptions { + activeStateEnabled?: boolean; + /** The slider step size. */ + step?: number; + /** The current slider value. */ + value?: number; + /** Specifies whether or not to highlight a range selected within the widget. */ + showRange?: boolean; + /** Specifies the size of a step by which a slider handle is moved when a user uses the Page up or Page down keyboard shortcuts. */ + keyStep?: number; + /** Specifies options for the slider tooltip. */ + tooltip?: { + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies format for the tooltip. */ + format?: any; + /** Specifies whether the tooltip is located over or under the slider. */ + position?: string; + /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ + showMode?: string; + }; + /** Specifies options for labels displayed at the min and max values. */ + label?: { + /** Specifies whether or not slider labels are visible. */ + visible?: boolean; + /** Specifies whether labels are located over or under the scale. */ + position?: string; + /** Specifies a format for labels. */ + format?: any; + }; + } + /** A widget that allows a user to select a numeric value within a given range. */ + export class dxSlider extends dxTrackBar { + constructor(element: JQuery, options?: dxSliderOptions); + constructor(element: Element, options?: dxSliderOptions); + } + export interface dxRangeSliderOptions extends dxSliderOptions { + /** The left edge of the interval currently selected using the range slider. */ + start?: number; + /** The right edge of the interval currently selected using the range slider. */ + end?: number; + } + /** A widget that enables a user to select a range of numeric values. */ + export class dxRangeSlider extends dxSlider { + constructor(element: JQuery, options?: dxRangeSliderOptions); + constructor(element: Element, options?: dxRangeSliderOptions); + } + export interface dxFormItemLabel { + /** Specifies the label text. */ + text?: string; + /** Specifies whether or not the label is visible. */ + visible?: boolean; + /** Specifies whether or not a colon is displayed at the end of the current label. */ + showColon?: boolean; + /** Specifies the location of a label against the editor. */ + location?: string; + /** Specifies the label horizontal alignment. */ + alignment?: string; + } + export interface dxFormItem { + /** Specifies the type of the current item. */ + itemType?: string; + /** Specifies whether or not the current form item is visible. */ + visible?: boolean; + /** Specifies the sequence number of the item in a form, group or tab. */ + visibleIndex?: number; + /** Specifies a CSS class to be applied to the form item. */ + cssClass?: string; + /** Specifies the number of columns spanned by the item. */ + colSpan?: number; + } + export interface dxFormSimpleItem extends dxFormItem { + /** Specifies the path to the formData object field bound to the current form item. */ + dataField?: string; + /** Specifies the form item name. */ + name?: string; + /** Specifie which editor widget is used to display and edit the form item value. */ + editorType?: string; + /** Specifies configuration options for the editor widget of the current form item. */ + editorOptions?: Object; + /** A template to be used for rendering the form item. */ + template?: any; + /** Specifies the help text displayed for the current form item. */ + helpText?: string; + /** Specifies whether the current form item is required. */ + isRequired?: boolean; + /** Specifies options for the form item label. */ + label?: dxFormItemLabel; + /** An array of validation rules to be checked for the form item editor. */ + validationRules?: Array; + } + export interface dxFormGroupItem extends dxFormItem { + /** Specifies the group caption. */ + caption?: string; + /** A template to be used for rendering the group item. */ + template?: any; + /** The count of columns in the group layout. */ + colCount?: number; + /** Specifies whether or not all group item labels are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the group. */ + items?: Array; + } + export interface dxFormTab { + /** Specifies the tab title. */ + title?: string; + /** The count of columns in the tab layout. */ + colCount?: number; + /** Specifies whether or not labels of items displayed within the current tab are aligned. */ + alignItemLabels?: boolean; + /** Holds an array of form items displayed within the tab. */ + items?: Array; + } + export interface dxFormTabbedItem extends dxFormItem { + /** Holds a configuration object for the dxTabPanel widget used to display the current form item. */ + tabPanelOptions?: Object; + /** An array of tab configuration objects. */ + tabs?: Array; + } + export interface dxFormOptions extends WidgetOptions { + /** An object providing data for the form. */ + formData?: Object; + /** The count of columns in the form layout. */ + colCount?: any; + /** Specifies the location of a label against the editor. */ + labelLocation?: string; + /** Specifies whether or not all editors on the form are read-only. */ + readOnly?: boolean; + /** A handler for the fieldDataChanged event. */ + onFieldDataChanged?: (e: Object) => void; + /** A handler for the editorEnterKey event. */ + onEditorEnterKey?: (e: Object) => void; + /** Specifies a function that customizes a form item after it has been created. */ + customizeItem?: Function; + /** The minimum column width used for calculating column count in the form layout. */ + minColWidth?: number; + /** Specifies whether or not all root item labels are aligned. */ + alignItemLabels?: boolean; + /** Specifies whether or not item labels in all groups are aligned. */ + alignItemLabelsInAllGroups?: boolean; + /** Specifies whether or not a colon is displayed at the end of form labels. */ + showColonAfterLabel?: boolean; + /** Specifies whether or not the required mark is displayed for optional fields. */ + showRequiredMark?: boolean; + /** Specifies whether or not the optional mark is displayed for optional fields. */ + showOptionalMark?: boolean; + /** The text displayed for required fields. */ + requiredMark?: string; + /** The text displayed for optional fields. */ + optionalMark?: string; + /** Specifies whether or not the total validation summary is displayed on the form. */ + showValidationSummary?: boolean; + /** Holds an array of form items. */ + items?: Array; + /** A Boolean value specifying whether to enable or disable form scrolling. */ + scrollingEnabled?: boolean; + } + /** A form widget used to display and edit values of object fields. */ + export class dxForm extends Widget { + constructor(element: JQuery, options?: dxFormOptions); + constructor(element: Element, options?: dxFormOptions); + /** Updates the specified field of the formData object and the corresponding editor on the form. */ + updateData(dataField: string, value: any): void; + /** Updates the specified fields of the formData object and the corresponding editors on the form. */ + updateData(data: Object): void; + /** Updates the value of a form item option. */ + itemOption(field: string, option: string, value: any): void; + /** Updates the values of form item options. */ + itemOption(field: string, options: Object): void; + /** Returns an editor instance associated with the specified formData field. */ + getEditor(field: string): Object; + /** Updates the dimensions of the widget contents. */ + updateDimensions(): JQueryPromise; + /** Validates the values of all editors on the form against the list of the validation rules specified for each form item. */ + validate(): Object; + } +} +interface JQuery { + dxProgressBar(): JQuery; + dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; + dxProgressBar(options: string): any; + dxProgressBar(options: string, ...params: any[]): any; + dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; + dxSlider(): JQuery; + dxSlider(options: "instance"): DevExpress.ui.dxSlider; + dxSlider(options: string): any; + dxSlider(options: string, ...params: any[]): any; + dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; + dxRangeSlider(): JQuery; + dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; + dxRangeSlider(options: string): any; + dxRangeSlider(options: string, ...params: any[]): any; + dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; + dxFileUploader(): JQuery; + dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; + dxFileUploader(options: string): any; + dxFileUploader(options: string, ...params: any[]): any; + dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; + dxValidator(): JQuery; + dxValidator(options: "instance"): DevExpress.ui.dxValidator; + dxValidator(options: string): any; + dxValidator(options: string, ...params: any[]): any; + dxValidator(options: DevExpress.ui.dxValidatorOptions): JQuery; + dxValidationGroup(): JQuery; + dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; + dxValidationGroup(options: string): any; + dxValidationGroup(options: string, ...params: any[]): any; + dxValidationSummary(): JQuery; + dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; + dxValidationSummary(options: string): any; + dxValidationSummary(options: string, ...params: any[]): any; + dxValidationSummary(options: DevExpress.ui.dxValidationSummaryOptions): JQuery; + dxTooltip(): JQuery; + dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; + dxTooltip(options: string): any; + dxTooltip(options: string, ...params: any[]): any; + dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; + dxResizable(): JQuery; + dxResizable(options: "instance"): DevExpress.ui.dxResizable; + dxResizable(options: string): any; + dxResizable(options: string, ...params: any[]): any; + dxResizable(options: DevExpress.ui.dxResizableOptions): JQuery; + dxDropDownList(): JQuery; + dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; + dxDropDownList(options: string): any; + dxDropDownList(options: string, ...params: any[]): any; + dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; + dxToolbar(): JQuery; + dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; + dxToolbar(options: string): any; + dxToolbar(options: string, ...params: any[]): any; + dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; + dxToast(): JQuery; + dxToast(options: "instance"): DevExpress.ui.dxToast; + dxToast(options: string): any; + dxToast(options: string, ...params: any[]): any; + dxToast(options: DevExpress.ui.dxToastOptions): JQuery; + dxTextEditor(): JQuery; + dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; + dxTextEditor(options: string): any; + dxTextEditor(options: string, ...params: any[]): any; + dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; + dxTextBox(): JQuery; + dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; + dxTextBox(options: string): any; + dxTextBox(options: string, ...params: any[]): any; + dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; + dxTextArea(): JQuery; + dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; + dxTextArea(options: string): any; + dxTextArea(options: string, ...params: any[]): any; + dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; + dxTabs(): JQuery; + dxTabs(options: "instance"): DevExpress.ui.dxTabs; + dxTabs(options: string): any; + dxTabs(options: string, ...params: any[]): any; + dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; + dxTabPanel(): JQuery; + dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; + dxTabPanel(options: string): any; + dxTabPanel(options: string, ...params: any[]): any; + dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; + dxSelectBox(): JQuery; + dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; + dxSelectBox(options: string): any; + dxSelectBox(options: string, ...params: any[]): any; + dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; + dxTagBox(): JQuery; + dxTagBox(options: "instance"): DevExpress.ui.dxTagBox; + dxTagBox(options: string): any; + dxTagBox(options: string, ...params: any[]): any; + dxTagBox(options: DevExpress.ui.dxTagBoxOptions): JQuery; + dxScrollView(): JQuery; + dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; + dxScrollView(options: string): any; + dxScrollView(options: string, ...params: any[]): any; + dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; + dxScrollable(): JQuery; + dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; + dxScrollable(options: string): any; + dxScrollable(options: string, ...params: any[]): any; + dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; + dxRadioGroup(): JQuery; + dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; + dxRadioGroup(options: string): any; + dxRadioGroup(options: string, ...params: any[]): any; + dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; + dxPopup(): JQuery; + dxPopup(options: "instance"): DevExpress.ui.dxPopup; + dxPopup(options: string): any; + dxPopup(options: string, ...params: any[]): any; + dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; + dxPopover(): JQuery; + dxPopover(options: "instance"): DevExpress.ui.dxPopover; + dxPopover(options: string): any; + dxPopover(options: string, ...params: any[]): any; + dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; + dxOverlay(): JQuery; + dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; + dxOverlay(options: string): any; + dxOverlay(options: string, ...params: any[]): any; + dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; + dxNumberBox(): JQuery; + dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; + dxNumberBox(options: string): any; + dxNumberBox(options: string, ...params: any[]): any; + dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; + dxNavBar(): JQuery; + dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; + dxNavBar(options: string): any; + dxNavBar(options: string, ...params: any[]): any; + dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; + dxMultiView(): JQuery; + dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; + dxMultiView(options: string): any; + dxMultiView(options: string, ...params: any[]): any; + dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; + dxMap(): JQuery; + dxMap(options: "instance"): DevExpress.ui.dxMap; + dxMap(options: string): any; + dxMap(options: string, ...params: any[]): any; + dxMap(options: DevExpress.ui.dxMapOptions): JQuery; + dxLookup(): JQuery; + dxLookup(options: "instance"): DevExpress.ui.dxLookup; + dxLookup(options: string): any; + dxLookup(options: string, ...params: any[]): any; + dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; + dxLoadPanel(): JQuery; + dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; + dxLoadPanel(options: string): any; + dxLoadPanel(options: string, ...params: any[]): any; + dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; + dxLoadIndicator(): JQuery; + dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; + dxLoadIndicator(options: string): any; + dxLoadIndicator(options: string, ...params: any[]): any; + dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; + dxList(): JQuery; + dxList(options: "instance"): DevExpress.ui.dxList; + dxList(options: string): any; + dxList(options: string, ...params: any[]): any; + dxList(options: DevExpress.ui.dxListOptions): JQuery; + dxGallery(): JQuery; + dxGallery(options: "instance"): DevExpress.ui.dxGallery; + dxGallery(options: string): any; + dxGallery(options: string, ...params: any[]): any; + dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; + dxDropDownEditor(): JQuery; + dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; + dxDropDownEditor(options: string): any; + dxDropDownEditor(options: string, ...params: any[]): any; + dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; + dxDateBox(): JQuery; + dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; + dxDateBox(options: string): any; + dxDateBox(options: string, ...params: any[]): any; + dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; + dxCheckBox(): JQuery; + dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; + dxCheckBox(options: string): any; + dxCheckBox(options: string, ...params: any[]): any; + dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; + dxBox(): JQuery; + dxBox(options: "instance"): DevExpress.ui.dxBox; + dxBox(options: string): any; + dxBox(options: string, ...params: any[]): any; + dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; + dxButton(): JQuery; + dxButton(options: "instance"): DevExpress.ui.dxButton; + dxButton(options: string): any; + dxButton(options: string, ...params: any[]): any; + dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; + dxCalendar(): JQuery; + dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; + dxCalendar(options: string): any; + dxCalendar(options: string, ...params: any[]): any; + dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; + dxAccordion(): JQuery; + dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; + dxAccordion(options: string): any; + dxAccordion(options: string, ...params: any[]): any; + dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; + dxResponsiveBox(): JQuery; + dxResponsiveBox(options: "instance"): DevExpress.ui.dxResponsiveBox; + dxResponsiveBox(options: string): any; + dxResponsiveBox(options: string, ...params: any[]): any; + dxResponsiveBox(options: DevExpress.ui.dxResponsiveBoxOptions): JQuery; + dxAutocomplete(): JQuery; + dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; + dxAutocomplete(options: string): any; + dxAutocomplete(options: string, ...params: any[]): any; + dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; + dxForm(): JQuery; + dxForm(options: "instance"): DevExpress.ui.dxForm; + dxForm(options: string): any; + dxForm(options: string, ...params: any[]): any; + dxForm(options: DevExpress.ui.dxForm): JQuery; +} + +declare module DevExpress.ui { + export interface dxTileViewOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the height of the base tile view item. */ + baseItemHeight?: number; + /** Specifies the width of the base tile view item. */ + baseItemWidth?: number; + /** Specifies whether tiles are placed horizontally or vertically. */ + direction?: string; + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the distance in pixels between adjacent tiles. */ + itemMargin?: number; + /** A Boolean value specifying whether or not to display a scrollbar. */ + showScrollbar?: boolean; + } + /** A widget displaying several blocks of data as tiles. */ + export class dxTileView extends CollectionWidget { + constructor(element: JQuery, options?: dxTileViewOptions); + constructor(element: Element, options?: dxTileViewOptions); + /** Returns the current scroll position of the widget content. */ + scrollPosition(): number; + } + export interface dxSwitchOptions extends EditorOptions { + activeStateEnabled?: boolean; + /** Text displayed when the widget is in a disabled state. */ + offText?: string; + /** Text displayed when the widget is in an enabled state. */ + onText?: string; + /** A Boolean value specifying whether the current switch state is "On" or "Off". */ + value?: boolean; + } + /** A switch widget. */ + export class dxSwitch extends Editor { + constructor(element: JQuery, options?: dxSwitchOptions); + constructor(element: Element, options?: dxSwitchOptions); + } + export interface dxSlideOutViewOptions extends WidgetOptions { + /** Specifies the current menu position. */ + menuPosition?: string; + /** Specifies whether or not the menu panel is visible. */ + menuVisible?: boolean; + /** Specifies whether or not the menu is shown when a user swipes the widget content. */ + swipeEnabled?: boolean; + /** A template to be used for rendering menu panel content. */ + menuTemplate?: any; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal a custom menu. */ + export class dxSlideOutView extends Widget { + constructor(element: JQuery, options?: dxSlideOutViewOptions); + constructor(element: Element, options?: dxSlideOutViewOptions); + /** Returns an HTML element of the widget menu block. */ + menuContent(): JQuery; + /** Returns an HTML element of the widget content block. */ + content(): JQuery; + /** Displays the widget's menu block. */ + showMenu(): JQueryPromise; + /** Hides the widget's menu block. */ + hideMenu(): JQueryPromise; + /** Toggles the visibility of the widget's menu block. */ + toggleMenuVisibility(): JQueryPromise; + } + export interface dxSlideOutOptions extends CollectionWidgetOptions { + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** A Boolean value specifying whether or not to display a grouped menu. */ + menuGrouped?: boolean; + /** Specifies the current menu position. */ + menuPosition?: string; + /** The name of the template used to display a group header. */ + menuGroupTemplate?: any; + /** The template used to render menu items. */ + menuItemTemplate?: any; + /** A handler for the menuGroupRendered event. */ + onMenuGroupRendered?: Function; + /** A handler for the menuItemRendered event. */ + onMenuItemRendered?: Function; + /** Specifies whether or not the slide-out menu is displayed. */ + menuVisible?: boolean; + /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + } + /** The widget that allows you to slide-out the current view to reveal an item list. */ + export class dxSlideOut extends CollectionWidget { + constructor(element: JQuery, options?: dxSlideOutOptions); + constructor(element: Element, options?: dxSlideOutOptions); + /** Hides the widget's slide-out menu. */ + hideMenu(): JQueryPromise; + /** Displays the widget's slide-out menu. */ + showMenu(): JQueryPromise; + /** Toggles the visibility of the widget's slide-out menu. */ + toggleMenuVisibility(showing: boolean): JQueryPromise; + } + export interface dxPivotOptions extends CollectionWidgetOptions { + /** The index of the currently active pivot item. */ + selectedIndex?: number; + /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ + swipeEnabled?: boolean; + /** A template to be used for rendering widget content. */ + contentTemplate?: any; + /** The template to be used for rendering an item title. */ + itemTitleTemplate?: any; + } + /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ + export class dxPivot extends CollectionWidget { + constructor(element: JQuery, options?: dxPivotOptions); + constructor(element: Element, options?: dxPivotOptions); + } + export interface dxPanoramaOptions extends CollectionWidgetOptions { + /** An object exposing options for setting a background image for the panorama. */ + backgroundImage?: { + /** Specifies the height of the panorama's background image. */ + height?: number; + /** Specifies the URL of the image that is used as the panorama's background image. */ + url?: string; + /** Specifies the width of the panorama's background image. */ + width?: number; + }; + /** The index of the currently active panorama item. */ + selectedIndex?: number; + /** Specifies the widget content title. */ + title?: string; + } + /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ + export class dxPanorama extends CollectionWidget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + } + export interface dxDropDownMenuOptions extends WidgetOptions { + /** A handler for the buttonClick event. */ + onButtonClick?: any; + /** The name of the icon to be displayed by the DropDownMenu button. */ + buttonIcon?: string; + /** The text displayed in the DropDownMenu button. */ + buttonText?: string; + buttonIconSrc?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** A handler for the itemClick event. */ + onItemClick?: any; + /** An array of items displayed by the widget. */ + items?: Array; + /** The template to be used for rendering items. */ + itemTemplate?: any; + /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ + usePopover?: boolean; + /** The width of the menu popup in pixels. */ + popupWidth?: any; + /** The height of the menu popup in pixels. */ + popupHeight?: any; + /** Specifies whether or not the drop-down menu is displayed. */ + opened?: boolean; + hoverStateEnabled?: boolean; + activeStateEnabled?: boolean; + } + /** A drop-down menu widget. */ + export class dxDropDownMenu extends Widget { + constructor(element: JQuery, options?: dxDropDownEditorOptions); + constructor(element: Element, options?: dxDropDownEditorOptions); + /** This section lists the data source fields that are used in a default template for drop-down menu items. */ + /** Opens the drop-down menu. */ + open(): void; + /** Closes the drop-down menu. */ + close(): void; + } + export interface dxActionSheetOptions extends CollectionWidgetOptions { + /** A handler for the cancelClick event. */ + onCancelClick?: any; + /** The text displayed in the button that closes the action sheet. */ + cancelText?: string; + /** Specifies whether or not to display the Cancel button in action sheet. */ + showCancelButton?: boolean; + /** A Boolean value specifying whether or not the title of the action sheet is visible. */ + showTitle?: boolean; + /** Specifies the element the action sheet popover points at. */ + target?: any; + /** The title of the action sheet. */ + title?: string; + /** Specifies whether or not to show the action sheet within a dxPopover widget. */ + usePopover?: boolean; + /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ + visible?: boolean; + } + /** A widget consisting of a set of choices related to a certain task. */ + export class dxActionSheet extends CollectionWidget { + constructor(element: JQuery, options?: dxActionSheetOptions); + constructor(element: Element, options?: dxActionSheetOptions); + /** Hides the widget. */ + hide(): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ + toggle(showing: boolean): JQueryPromise; + } +} +interface JQuery { + dxTileView(): JQuery; + dxTileView(options: "instance"): DevExpress.ui.dxTileView; + dxTileView(options: string): any; + dxTileView(options: string, ...params: any[]): any; + dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; + dxSwitch(): JQuery; + dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; + dxSwitch(options: string): any; + dxSwitch(options: string, ...params: any[]): any; + dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; + dxSlideOut(): JQuery; + dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; + dxSlideOut(options: string): any; + dxSlideOut(options: string, ...params: any[]): any; + dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; + dxPivot(): JQuery; + dxPivot(options: "instance"): DevExpress.ui.dxPivot; + dxPivot(options: string): any; + dxPivot(options: string, ...params: any[]): any; + dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; + dxPanorama(): JQuery; + dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; + dxPanorama(options: string): any; + dxPanorama(options: string, ...params: any[]): any; + dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; + dxActionSheet(): JQuery; + dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; + dxActionSheet(options: string): any; + dxActionSheet(options: string, ...params: any[]): any; + dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; + dxDropDownMenu(): JQuery; + dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; + dxDropDownMenu(options: string): any; + dxDropDownMenu(options: string, ...params: any[]): any; + dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; +} +declare module DevExpress.data { + export interface XmlaStoreOptions { + /** The HTTP address to an XMLA OLAP server. */ + url?: string; + /** The name of the database associated with the Store. */ + catalog?: string; + /** The cube name. */ + cube?: string; + beforeSend?: (request: Object) => void; + } + /** A Store that provides access to an OLAP cube using the XMLA standard. */ + export class XmlaStore { + constructor(options: XmlaStoreOptions); + } + export interface PivotGridField { + index?: number; + /** A boolean value specifying whether or not the field is visible in the pivot grid and the Field Chooser. */ + visible?: boolean; + /** Name of the data source field containing data for the pivot grid field. */ + dataField?: string; + /** A caption that will be displayed in the pivot grid's field chooser to identify the field. */ + caption?: string; + /** Specifies a type of field values. */ + dataType?: string; + /** Specifies how the values of the current field are combined into groups. Cannot be used for the XmlaStore store type. */ + groupInterval?: any; + /** Specifies how to aggregate field data. Cannot be used for the XmlaStore store type. */ + summaryType?: string; + /** Allows you to use a custom aggregate function to calculate the summary values. Cannot be used for the XmlaStore store type. */ + calculateCustomSummary?: (options: { + summaryProcess?: string; + value?: any; + totalValue?: any; + }) => void; + /** Specifies the function that determines how to split data from the data source into ranges for header items. Cannot be used for the XmlaStore store type. */ + selector?: (data: Object) => any; + /** Type of the area where the field is located. */ + area?: string; + /** Index among the other fields displayed within the same area. */ + areaIndex?: number; + /** The name of the folder in which the field is located. */ + displayFolder?: string; + /** The name of the group to which the field belongs. */ + groupName?: string; + /** The index of the field within a group. */ + groupIndex?: number; + /** Specifies the initial sort order of field values. */ + sortOrder?: string; + /** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */ + sortBy?: string; + /** Specifies the data field against which the header items of this field should be sorted. */ + sortBySummaryField?: string; + /** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */ + sortBySummaryPath?: Array; + /** The filter values for the current field. */ + filterValues?: Array; + /** The filter type for the current field. */ + filterType?: string; + /** Indicates whether all header items of the field's header level are expanded. */ + expanded?: boolean; + /** Specifies whether the field should be treated as a Data Field. */ + isMeasure?: boolean; + /** Specifies a display format for field values. */ + format?: string; + /** Specifies a callback function that returns the text to be displayed in the cells of a field. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies a precision for formatted field values. */ + precision?: number; + /** Specifies how to sort the header items. */ + sortingMethod?: (a: Object, b: Object) => number; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies the absolute width of the field in the pivot grid. */ + width?: number; + /** Specifies the summary post-processing algorithm. */ + summaryDisplayMode?: string; + /** Specifies whether to summarize each next summary value with the previous one by rows or columns. */ + runningTotal?: string; + /** Specifies whether to allow the predefined summary post-processing functions ('absoluteVariation' and 'percentVariation') and runningTotal to take values of different groups into account. */ + allowCrossGroupCalculation?: boolean; + /** Specifies a callback function that allows you to modify summary values after they are calculated. */ + calculateSummaryValue?: (e: Object) => number; + /** Specifies whether or not to display Total values for the field. */ + showTotals?: boolean; + /** Specifies whether or not to display Grand Total values for the field. */ + showGrandTotals?: boolean; + } + export class SummaryCell { + /** Gets the parent cell in a specified direction. */ + parent(direction: string): SummaryCell; + /** Gets all children cells in a specified direction. */ + children(direction: string): Array; + /** Gets a partial Grand Total cell of a row or column. */ + grandTotal(direction: string): SummaryCell; + /** Gets the Grand Total of the entire pivot grid. */ + grandTotal(): SummaryCell; + /** Gets the cell next to the current one in a specified direction. */ + next(direction: string): SummaryCell; + /** Gets the cell next to current in a specified direction. */ + next(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the cell prior to the current one in a specified direction. */ + prev(direction: string): SummaryCell; + /** Gets the cell previous to current in a specified direction. */ + prev(direction: string, allowCrossGroup: boolean): SummaryCell; + /** Gets the child cell in a specified direction. */ + child(direction: string, fieldValue: any): SummaryCell; + /** Gets the cell located by the path of the source cell with one field value changed. */ + slice(field: PivotGridField, value: any): SummaryCell; + /** Gets the header cell of a row or column field to which the current cell belongs. */ + field(area: string): PivotGridField; + /** Gets the value of the current cell. */ + value(): any; + /** Gets the value of the current cell. */ + value(isCalculatedValue: boolean): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField): any; + /** Gets the value of any field linked with the current cell. */ + value(field: PivotGridField, isCalculatedValue: boolean): any; + } + export interface PivotGridDataSourceOptions { + /** Specifies the underlying Store instance used to access data. */ + store?: any; + /** Indicates whether or not the automatic field generation from data in the Store is enabled. */ + retrieveFields?: boolean; + /** Specifies data filtering conditions. Cannot be used for the XmlaStore store type. */ + filter?: Object; + /** An array of pivot grid fields. */ + fields?: Array; + /** A handler for the changed event. */ + onChanged?: () => void; + /** A handler for the loadingChanged event. */ + onLoadingChanged?: (isLoading: boolean) => void; + /** A handler for the loadError event. */ + onLoadError?: (e?: Object) => void; + /** A handler for the fieldsPrepared event. */ + onFieldsPrepared?: (e?: Array) => void; + } + /** An object that provides access to data for the dxPivotGrid widget. */ + export class PivotGridDataSource implements EventsMixin { + constructor(options?: PivotGridDataSource); + /** Starts reloading data from any store and updating the data source. */ + reload(): JQueryPromise; + /** Starts updating the data source. Reloads data from the XMLA store only. */ + load(): JQueryPromise; + /** Indicates whether or not the PivotGridDataSource is currently being loaded. */ + isLoading(): boolean; + /** Gets data displayed in a PivotGrid. */ + getData(): Object; + /** Gets all fields within a specified area. */ + getAreaFields(area: string, collectGroups: boolean): Array; + /** Gets all fields from the data source. */ + fields(): Array; + /** Sets the fields option. */ + fields(fields: Array): void; + /** Gets current options of a specified field. */ + field(id: any): PivotGridField; + /** Sets one or more options of a specified field. */ + field(id: any, field: PivotGridField): void; + /** Collapses a specified header item. */ + collapseHeaderItem(area: string, path: Array): void; + /** Expands a specified header item. */ + expandHeaderItem(area: string, path: Array): void; + /** Expands all header items of a field. */ + expandAll(id: any): void; + /** Collapses all header items of a field. */ + collapseAll(id: any): void; + /** Disposes of all resources associated with this PivotGridDataSource. */ + dispose(): void; + /** Gets the current filter expression. Cannot be used for the XmlaStore store type. */ + filter(): Object; + /** Applies a new filter expression. Cannot be used for the XmlaStore store type. */ + filter(filterExpr: Object): void; + /** Provides access to a list of records (facts) that were used to calculate a specific summary. */ + createDrillDownDataSource(options: { + columnPath?: Array; + rowPath?: Array; + dataIndex?: number; + maxRowCount?: number; + customColumns?: Array; + }): DevExpress.data.DataSource; + /** Gets the current PivotGridDataSource state (fields configuration, sorting, filters, expanded headers, etc.) */ + state(): Object; + /** Sets the PivotGridDataSource state. */ + state(state: Object): void; + on(eventName: string, eventHandler: Function): PivotGridDataSource; + on(events: { [eventName: string]: Function; }): PivotGridDataSource; + off(eventName: string): PivotGridDataSource; + off(eventName: string, eventHandler: Function): PivotGridDataSource; + } +} +declare module DevExpress.ui { + export interface dxSchedulerOptions extends WidgetOptions { + /** Specifies a date displayed on the current scheduler view by default. */ + currentDate?: Date; + /** The earliest date the widget allows you to select. */ + min?: Date; + /** The latest date the widget allows you to select. */ + max?: Date; + /** Specifies the view used in the scheduler by default. */ + currentView?: string; + /** A data source used to fetch data to be displayed by the widget. */ + dataSource?: any; + /** Specifies the first day of a week. */ + firstDayOfWeek?: number; + /** The template to be used for rendering appointments. */ + appointmentTemplate?: any; + /** The template to be used for rendering an appointment tooltip. */ + appointmentTooltipTemplate?: any; + /** Lists the views to be available within the scheduler's View Selector. */ + views?: Array; + /** Specifies the resource kinds by which the scheduler's appointments are grouped in a timetable. */ + groups?: Array; + /** Specifies a start hour in the scheduler view's time interval. */ + startDayHour?: number; + /** Specifies an end hour in the scheduler view's time interval. */ + endDayHour?: number; + /** Specifies whether or not the "All-day" panel is visible. */ + showAllDayPanel?: boolean; + /** Specifies cell duration in minutes. */ + cellDuration?: number; + /** Specifies the edit mode for recurrent appointments. */ + recurrenceEditMode?: string; + /** Specifies which editing operations an end-user can perform on appointments. */ + editing?: { + /** Specifies whether or not an end-user can add appointments. */ + allowAdding?: boolean; + /** Specifies whether or not an end-user can change appointment options. */ + allowUpdating?: boolean; + /** Specifies whether or not an end-user can delete appointments. */ + allowDeleting?: boolean; + /** Specifies whether or not an end-user can change an appointment duration. */ + allowResizing?: boolean; + /** Specifies whether or not an end-user can drag appointments. */ + allowDragging?: boolean; + } + /** Specifies an array of resources available in the scheduler. */ + resources?: Array<{ + /** Indicates whether or not several resources of this kind can be assigned to an appointment. */ + allowMultiple?: boolean; + /** + * Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. + * @deprecated Use the 'useColorAsDefault' property instead + */ + mainColor?: boolean; + /** Indicates whether or not resources of this kind have priority in the color identification of the appointments that have resources of different kinds assigned. */ + useColorAsDefault?: boolean; + /** A data source used to fetch resources to be available in the scheduler. */ + dataSource?: any; + /** Specifies the resource object field whose value is displayed by the Resource editor in the Appointment popup window. */ + displayExpr?: any; + /** Specifies the resource object field that is used as a value of the Resource editor in the Appointment popup window. */ + valueExpr?: any; + /** The name of the appointment object field that specifies a resource of this kind. */ + field?: string; + /** Specifies the label of the Appointment popup window field that allows end users to assign a resource of this kind. */ + label?: string; + }>; + /** A handler for the AppointmentAdding event. */ + onAppointmentAdding?: Function; + /** A handler for the appointmentAdded event. */ + onAppointmentAdded?: Function; + /** A handler for the AppointmentUpdating event. */ + onAppointmentUpdating?: Function; + /** A handler for the appointmentUpdated event. */ + onAppointmentUpdated?: Function; + /** A handler for the AppointmentDeleting event. */ + onAppointmentDeleting?: Function; + /** A handler for the appointmentDeleted event. */ + onAppointmentDeleted?: Function; + /** A handler for the appointmentRendered event. */ + onAppointmentRendered?: Function; + /** A handler for the appointmentClick event. */ + onAppointmentClick?: any; + /** A handler for the appointmentDblClick event. */ + onAppointmentDblClick?: any; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the appointmentFormCreated event. */ + onAppointmentFormCreated?: Function; + /** Specifies whether or not an end-user can scroll the view horizontally. */ + horizontalScrollingEnabled?: boolean; + /** Specifies whether a user can switch views using tabs or a drop-down menu. */ + useDropDownViewSwitcher?: boolean; + } + /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ + export class dxScheduler extends Widget { + constructor(element: JQuery, options?: dxSchedulerOptions); + constructor(element: Element, options?: dxSchedulerOptions); + /** Add the appointment defined by the object passed as a parameter to the data associated with the widget. */ + addAppointment(appointment: Object): void; + /** Updates the appointment specified by the first method parameter by the appointment object specified by the second method parameter in the the data associated with the widget. */ + updateAppointment(target: Object, appointment: Object): void; + /** Deletes the appointment defined by the parameter from the the data associated with the widget. */ + deleteAppointment(appointment: Object): void; + /** Scrolls the scheduler work space to the specified time. */ + scrollToTime(hours: number, minutes: number): void; + /** Displays the Appointment Details popup. */ + showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean): void; + } + export interface dxColorBoxOptions extends dxDropDownEditorOptions { + /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ + applyButtonText?: string; + applyValueMode?: string; + /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ + cancelButtonText?: string; + /** Specifies whether or not the widget value includes the alpha channel component. */ + editAlphaChannel?: boolean; + /** Specifies the size of a step by which a handle is moved using a keyboard shortcut. */ + keyStep?: number; + } + /** A widget used to specify a color value. */ + export class dxColorBox extends dxDropDownEditor { + constructor(element: JQuery, options?: dxColorBoxOptions); + constructor(element: Element, options?: dxColorBoxOptions); + } + export interface HierarchicalCollectionWidgetOptions extends CollectionWidgetOptions { + /** Specifies the name of the data source item field whose value is displayed by the widget. */ + displayExpr?: any; + /** Specifies the name of the data source item field used as a key. */ + keyExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is selected. */ + selectedExpr?: any; + /** Specifies the name of the data source item field that contains an array of nested items. */ + itemsExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget item is disabled. */ + disabledExpr?: any; + /** Specifies the name of the data source item field that holds the key of the parent item. */ + parentIdExpr?: any; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding widget items is expanded. */ + expandedExpr?: any; + hoverStateEnabled?: boolean; + focusStateEnabled?: boolean; + } + export class HierarchicalCollectionWidget extends CollectionWidget { + } + export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions { + /** Specifies whether or not to animate item collapsing and expanding. */ + animationEnabled?: boolean; + /** Specifies whether a nested or plain array is used as a data source. */ + dataStructure?: string; + /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ + expandAllEnabled?: boolean; + /** Specifies whether or not a check box is displayed at each tree view item. */ + showCheckBoxes?: boolean; + /** Specifies the current check boxes display mode. */ + showCheckBoxesMode?: string; + /** Specifies whether or not to select nodes recursively. */ + selectNodesRecursive?: boolean; + /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ + expandNodesRecursive?: boolean; + /** Specifies whether the "Select All" check box is displayed over the tree view. */ + selectAllEnabled?: boolean; + /** Specifies the text displayed at the "Select All" check box. */ + selectAllText?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding node includes child nodes. */ + hasItemsExpr?: any; + /** Specifies if the virtual mode is enabled. */ + virtualModeEnabled?: boolean; + /** Specifies the parent ID value of the root item. */ + rootValue?: any; + /** Specifies the current value used to filter tree view items. */ + searchValue?: string; + /** A string value specifying available scrolling directions. */ + scrollDirection?: string; + /** A handler for the itemSelected event. */ + onItemSelected?: Function; + /** A handler for the itemExpanded event. */ + onItemExpanded?: Function; + /** A handler for the itemCollapsed event. */ + onItemCollapsed?: Function; + onItemClick?: Function; + onItemContextMenu?: Function; + onItemRendered?: Function; + onItemHold?: Function; + } + /** A widget displaying specified data items as a tree. */ + export class dxTreeView extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxTreeViewOptions); + constructor(element: Element, options?: dxTreeViewOptions); + /** Updates the tree view scrollbars according to the current size of the widget content. */ + updateDimensions(): JQueryPromise; + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + /** Expands the specified item. */ + expandItem(itemElement: any): void; + /** Collapses the specified item. */ + collapseItem(itemElement: any): void; + /** Returns all nodes of the tree view. */ + getNodes(): Array; + /** Selects all widget items. */ + selectAll(): void; + /** Unselects all widget items. */ + unselectAll(): void; + } + export interface dxMenuBaseOptions extends HierarchicalCollectionWidgetOptions { + /** An object that defines the animation options of the widget. */ + animation?: fx.AnimationOptions; + /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ + activeStateEnabled?: boolean; + /** Specifies the name of the CSS class associated with the menu. */ + cssClass?: string; + /** Holds an array of menu items. */ + items?: Array; + /** Specifies whether or not an item becomes selected if an end-user clicks it. */ + selectionByClick?: boolean; + /** Specifies the selection mode supported by the menu. */ + selectionMode?: string; + /** Specifies options of submenu showing and hiding. */ + showSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu show and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + } + export class dxMenuBase extends HierarchicalCollectionWidget { + constructor(element: JQuery, options?: dxMenuBaseOptions); + constructor(element: Element, options?: dxMenuBaseOptions); + /** Selects the specified item. */ + selectItem(itemElement: any): void; + /** Unselects the specified item. */ + unselectItem(itemElement: any): void; + } + export interface dxMenuOptions extends dxMenuBaseOptions { + /** Specifies whether or not the submenu is hidden when the mouse pointer leaves it. */ + hideSubmenuOnMouseLeave?: boolean; + /** Specifies whether the menu has horizontal or vertical orientation. */ + orientation?: string; + /** Specifies options for showing and hiding the first level submenu. */ + showFirstSubmenuMode?: { + /** Specifies the mode name. */ + name?: string; + /** Specifies the delay of submenu showing and hiding. */ + delay?: { + /** The time span after which the submenu is shown. */ + show?: number; + /** The time span after which the submenu is hidden. */ + hide?: number; + }; + }; + /** Specifies the direction at which the submenus are displayed. */ + submenuDirection?: string; + /** A handler for the submenuHidden event. */ + onSubmenuHidden?: Function; + /** A handler for the submenuHiding event. */ + onSubmenuHiding?: Function; + /** A handler for the submenuShowing event. */ + onSubmenuShowing?: Function; + /** A handler for the submenuShown event. */ + onSubmenuShown?: Function; + } + /** A menu widget. */ + export class dxMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxMenuOptions); + constructor(element: Element, options?: dxMenuOptions); + } + export interface dxContextMenuOptions extends dxMenuBaseOptions { + /** Holds an object that specifies options of alternative menu invocation. */ + alternativeInvocationMode?: { + /** Specifies whether or not the standard context menu invocation (on a right mouse click or on a long tap) is disabled. */ + enabled?: Boolean; + /** Specifies the element used to invoke the context menu. */ + invokingElement?: any; + }; + /** A handler for the hidden event. */ + onHidden?: Function; + /** A handler for the hiding event. */ + onHiding?: Function; + /** A handler for the positioning event. */ + onPositioning?: Function; + /** A handler for the showing event. */ + onShowing?: Function; + /** A handler for the shown event. */ + onShown?: Function; + /** An object defining widget positioning options. */ + position?: PositionOptions; + /** Specifies the direction at which submenus are displayed. */ + submenuDirection?: string; + /** The target element associated with a popover. */ + target?: any; + /** A Boolean value specifying whether or not the widget is visible. */ + visible?: boolean; + } + /** A context menu widget. */ + export class dxContextMenu extends dxMenuBase { + constructor(element: JQuery, options?: dxContextMenuOptions); + constructor(element: Element, options?: dxContextMenuOptions); + /** Toggles the visibility of the widget. */ + toggle(showing: boolean): JQueryPromise; + /** Shows the widget. */ + show(): JQueryPromise; + /** Hides the widget. */ + hide(): JQueryPromise; + } + export interface dxRemoteOperations { + /** Specifies whether or not filtering must be performed on the server side. */ + filtering?: boolean; + /** Specifies whether or not paging must be performed on the server side. */ + paging?: boolean; + /** Specifies whether or not sorting must be performed on the server side. */ + sorting?: boolean; + /** Specifies whether or not grouping must be performed on the server side. */ + grouping?: boolean; + /** Specifies whether or not summaries calculation must be performed on the server side. */ + summary?: boolean; + } + export interface dxDataGridColumn { + /** Specifies the content alignment within column cells. */ + alignment?: string; + /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ + allowEditing?: boolean; + /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row and column header filtering are visible. */ + allowFiltering?: boolean; + /** Specifies whether or not to allow filtering by this column using its header. */ + allowHeaderFiltering?: boolean; + /** Specifies whether or not the column can be anchored to a grid edge by end users. Setting this option makes sense only when the columnFixing | enabled option is set to true. */ + allowFixing?: boolean; + /** Specifies if a column can be used for searching grid records. Setting this option makes sense only when the search panel is visible. */ + allowSearch?: boolean; + /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ + allowGrouping?: boolean; + /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ + allowHiding?: boolean; + /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ + allowReordering?: boolean; + /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ + allowResizing?: boolean; + /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ + allowSorting?: boolean; + /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ + autoExpandGroup?: boolean; + /** Specifies a callback function that returns a value to be displayed in a column cell. */ + calculateCellValue?: (rowData: Object) => string; + /** Specifies a callback function to be invoked after the cell value is edited by an end-user and before the new value is saved to the data source. */ + setCellValue?: (rowData: Object, value: any) => void; + /** Specifies a callback function that defines filters for customary calculated grid cells. */ + calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string, target: string) => Array; + /** Specifies a caption for a column. */ + caption?: string; + /** Specifies a custom template for grid column cells. */ + cellTemplate?: any; + /** Specifies a CSS class to be applied to a column. */ + cssClass?: string; + /** Specifies how to get a value to be displayed in a cell when it is not in an editing state. */ + calculateDisplayValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for grouping column cells. */ + calculateGroupValue?: any; + /** Specifies a field name or a function that returns a field name or a value to be used for sorting column cells. */ + calculateSortValue?: any; + /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ + customizeText?: (cellInfo: { value: any; valueText: string }) => string; + /** Specifies the field of a data source that provides data for a column. */ + dataField?: string; + /** Specifies the required type of column values. */ + dataType?: string; + /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ + editCellTemplate?: any; + /** Specifies configuration options for the editor widget of the current column. */ + editorOptions?: Object; + /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ + encodeHtml?: boolean; + /** In a boolean column, replaces all false items with a specified text. */ + falseText?: string; + /** Specifies the set of available filter operations. */ + filterOperations?: Array; + /** Specifies a filter value for a column. */ + filterValue?: any; + /** Specifies initial filter values for the column's header filter. */ + filterValues?: Array; + /** Specifies whether to include or exclude the records with the values selected in the column's header filter. */ + filterType?: string; + /** Indicates whether the column takes part in horizontal grid scrolling or is anchored to a grid edge. */ + fixed?: boolean; + /** Specifies the grid edge to which the column is anchored. */ + fixedPosition?: string; + /** Specifies a format for the values displayed in a column. */ + format?: string; + /** Specifies a custom template for the group cell of a grid column. */ + groupCellTemplate?: any; + /** Specifies the index of a column when grid records are grouped by the values of this column. */ + groupIndex?: number; + /** Specifies a custom template for the header of a grid column. */ + headerCellTemplate?: any; + /** Specifies options of a lookup column. */ + lookup?: { + /** Specifies whether or not a user can nullify values of a lookup column. */ + allowClearing?: boolean; + /** Specifies the data source providing data for a lookup column. */ + dataSource?: any; + /** Specifies the expression defining the data source field whose values must be displayed. */ + displayExpr?: any; + /** Specifies the expression defining the data source field whose values must be replaced. */ + valueExpr?: string; + }; + /** Specifies column-level options for filtering using a column header filter. */ + headerFilter?: { + /** Specifies the data source to be used for header filter. */ + dataSource?: any; + /** Specifies how header filter values should be combined into groups. */ + groupInterval?: any; + }; + /** Specifies a precision for formatted values displayed in a column. */ + precision?: number; + /** Specifies a filter operation applied to a column. */ + selectedFilterOperation?: string; + /** Specifies whether or not the column displays its values by using editors. */ + showEditorAlways?: boolean; + /** Specifies whether or not to display the column when grid records are grouped by it. */ + showWhenGrouped?: boolean; + /** Specifies the index of a column when grid records are sorted by the values of this column. */ + sortIndex?: number; + /** Specifies the initial sort order of column values. */ + sortOrder?: string; + /** In a boolean column, replaces all true items with a specified text. */ + trueText?: string; + /** Specifies whether a column is visible or not. */ + visible?: boolean; + /** Specifies the sequence number of the column in the grid. */ + visibleIndex?: number; + /** Specifies a column width in pixels or percentages. */ + width?: any; + /** Specifies an array of validation rules to be checked when updating column cell values. */ + validationRules?: Array; + /** Specifies whether or not to display the header of a hidden column in the column chooser. */ + showInColumnChooser?: boolean; + /** Specifies the identifier of the column. */ + name?: string; + /** The form item configuration object. Used only when the editing mode is "form". */ + formItem?: DevExpress.ui.dxFormItem; + } + export interface dxDataGridOptions extends WidgetOptions { + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** Indicates whether to show the error row for the grid. */ + errorRowEnabled?: boolean; + /** A handler for the rowValidating event. */ + onRowValidating?: (e: Object) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** A handler for the initNewRow event. */ + onInitNewRow?: (e: { data: Object }) => void; + /** A handler for the rowInserted event. */ + onRowInserted?: (e: { data: Object; key: any }) => void; + /** A handler for the rowInserting event. */ + onRowInserting?: (e: { data: Object; cancel: any }) => void; + /** A handler for the rowRemoved event. */ + onRowRemoved?: (e: { data: Object; key: any }) => void; + /** A handler for the rowRemoving event. */ + onRowRemoving?: (e: { data: Object; key: any; cancel: any }) => void; + /** A handler for the rowUpdated event. */ + onRowUpdated?: (e: { data: Object; key: any }) => void; + /** A handler for the rowUpdating event. */ + onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: any }) => void; + /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ + cellHintEnabled?: boolean; + /** Specifies whether or not grid columns can be reordered by a user. */ + allowColumnReordering?: boolean; + /** Specifies whether or not grid columns can be resized by a user. */ + allowColumnResizing?: boolean; + /** A handler for the cellClick event. */ + onCellClick?: any; + /** A handler for the cellHoverChanged event. */ + onCellHoverChanged?: (e: Object) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: Object) => void; + /** Specifies whether or not the width of grid columns depends on column content. */ + columnAutoWidth?: boolean; + /** Specifies the options of a column chooser. */ + columnChooser?: { + /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether a user can invoke the column chooser or not. */ + enabled?: boolean; + /** Specifies the height of the column chooser panel. */ + height?: number; + /** Specifies text displayed in the title of the column chooser panel. */ + title?: string; + /** Specifies the width of the column chooser panel. */ + width?: number; + }; + /** Specifies options for column fixing. */ + columnFixing?: { + /** Indicates if column fixing is enabled. */ + enabled?: boolean; + /** Contains options that specify texts for column-fixing related commands in the column header's context menu. */ + texts?: { + /** Specifies text for a context menu item that fixes the column for which the context menu is invoked. */ + fix?: string; + /** Specifies text for a context menu item that unfixes the column for which the context menu is invoked. */ + unfix?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the left grid edge. */ + leftPosition?: string; + /** Specifies text for a context menu subitem that fixes a column, for which the context menu is invoked, to the right grid edge. */ + rightPosition?: string; + }; + }; + /** Specifies options for filtering using a column header filter. */ + headerFilter?: { + /** Indicates whether or not the column header filter button is visible. */ + visible?: boolean; + /** Specifies the height of the dropdown menu invoked when using a column header filter. */ + height?: number; + /** Specifies the width of the dropdown menu invoked when using a column header filter. */ + width?: number; + /** Contains options that specify texts for the dropdown menu invoked when you use a column header filter. */ + texts?: { + /** Specifies text for the item specifying an empty value in the column header filter's dropdown menu. */ + emptyValue?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu and applies specified filtering. */ + ok?: string; + /** Specifies text for a button that closes the column header filter's dropdown menu without applying performed selection. */ + cancel?: string; + } + }; + /** An array of grid columns. */ + columns?: Array; + onContentReady?: Function; + /** Specifies a function that customizes grid columns after they are created. */ + customizeColumns?: (columns: Array) => void; + /** Specifies a data source for the grid. */ + dataSource?: any; + /** Specifies whether or not to enable data caching. */ + cacheEnabled?: boolean; + /** A handler for the editingStart event. */ + onEditingStart?: (e: { + data: Object; + key: any; + cancel: boolean; + column: dxDataGridColumn + }) => void; + /** A handler for the editorPrepared event. */ + onEditorPrepared?: (e: Object) => void; + /** A handler for the editorPreparing event. */ + onEditorPreparing?: (e: Object) => void; + /** Contains options that specify how grid content can be changed. */ + editing?: { + editMode?: string; + editEnabled?: boolean; + insertEnabled?: boolean; + removeEnabled?: boolean; + /** Specifies how grid values can be edited manually. */ + mode?: string; + /** Specifies whether or not grid records can be edited at runtime. */ + allowUpdating?: boolean; + /** Specifies whether or not new grid records can be added at runtime. */ + allowAdding?: boolean; + /** Specifies whether or not grid records can be deleted at runtime. */ + allowDeleting?: boolean; + /** The form configuration object. Used only when the editing mode is "form". */ + form?: DevExpress.ui.dxFormOptions; + /** Contains options that specify texts for editing-related grid controls. */ + texts?: { + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ + saveAllChanges?: string; + /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + cancelRowChanges?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ + cancelAllChanges?: string; + /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteMessage?: string; + /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ + confirmDeleteTitle?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Cancel changes" button. Setting this option makes sense only when the editMode option is set to cell and the validation capabilities are enabled. */ + validationCancelChanges?: string; + /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the allowDeleting option is set to true. */ + deleteRow?: string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the allowAdding option is true. */ + addRow?: string; + /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + editRow?: string; + /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the allowUpdating option is set to true. */ + saveRowChanges?: string; + /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the allowDeleting option is set to true. */ + undeleteRow?: string; + }; + }; + /** Specifies filter row options. */ + filterRow?: { + /** Specifies when to apply a filter. */ + applyFilter?: string; + /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ + applyFilterText?: string; + /** Specifies descriptions for filter operations. */ + operationDescriptions?: { + "=": string; + "<>": string; + "<": string; + "<=": string; + ">": string; + ">=": string; + "startswith": string; + "contains": string; + "notcontains": string; + "endswith": string; + }; + /** Specifies text for the reset operation in a filter list. */ + resetOperationText?: string; + /** Specifies text for the operation of clearing the applied filter when a select box is used. */ + showAllText?: string; + /** Specifies text for the range start in the 'between' filter type. */ + betweenStartText?: string; + /** Specifies text for the range end in the 'between' filter type. */ + betweenEndText?: string; + /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ + showOperationChooser?: boolean; + /** Specifies whether the filter row is visible or not. */ + visible?: boolean; + }; + /** Specifies the behavior of grouped grid records. */ + grouping?: { + /** Specifies whether the user can collapse grouped records in a grid or not. */ + allowCollapsing?: boolean; + /** Specifies whether groups appear expanded or not. */ + autoExpandAll?: boolean; + /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ + groupContinuedMessage?: string; + /** Specifies the message displayed in a group row when the corresponding group continues on the next page. */ + groupContinuesMessage?: string; + }; + /** Specifies options that configure the group panel. */ + groupPanel?: { + /** Specifies whether columns can be dragged onto or from the group panel. */ + allowColumnDragging?: boolean; + /** Specifies text displayed by the group panel when it does not contain any columns. */ + emptyPanelText?: string; + /** Specifies whether the group panel is visible or not. */ + visible?: boolean; + }; + /** Specifies options configuring the load panel. */ + loadPanel?: { + /** Specifies whether to show the load panel or not. */ + enabled?: boolean; + /** Specifies the height of the load panel in pixels. */ + height?: number; + /** Specifies a URL pointing to an image to be used as a loading indicator. */ + indicatorSrc?: string; + /** Specifies whether or not a loading indicator must be displayed on the load panel. */ + showIndicator?: boolean; + /** Specifies whether or not the pane of the load panel must be displayed. */ + showPane?: boolean; + /** Specifies text displayed by the load panel. */ + text?: string; + /** Specifies the width of the load panel in pixels. */ + width?: number; + }; + /** Specifies text displayed when a grid does not contain any records. */ + noDataText?: string; + /** Specifies the options of a grid pager. */ + pager?: { + /** Specifies the page sizes that can be selected at runtime. */ + allowedPageSizes?: any; + /** Specifies whether to show the page size selector or not. */ + showPageSizeSelector?: boolean; + /** Specifies whether to show the pager or not. */ + visible?: any; + /** Specifies the text accompanying the page navigator. */ + infoText?: string; + /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ + showInfo?: boolean; + /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ + showNavigationButtons?: boolean; + }; + /** Specifies paging options. */ + paging?: { + /** Specifies whether dxDataGrid loads data page by page or all at once. */ + enabled?: boolean; + /** Specifies the grid page that should be displayed by default. */ + pageIndex?: number; + /** Specifies the size of grid pages. */ + pageSize?: number; + }; + /** Specifies whether or not grid rows must be shaded in a different way. */ + rowAlternationEnabled?: boolean; + /** A handler for the rowClick event. */ + onRowClick?: any; + /** A handler for the rowPrepared event. */ + onRowPrepared?: (e: Object) => void; + /** Specifies a custom template for grid rows. */ + rowTemplate?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ + preloadEnabled?: boolean; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + /** Specifies the scrollbar display policy. */ + showScrollbar?: string; + /** Specifies whether or not the scrolling by content is enabled. */ + scrollByContent?: boolean; + /** Specifies whether or not the scrollbar thumb scrolling enabled. */ + scrollByThumb?: boolean; + }; + /** Specifies options of the search panel. */ + searchPanel?: { + /** Specifies whether or not search strings in the located grid records should be highlighted. */ + highlightSearchText?: boolean; + /** Specifies text displayed by the search panel when no search string was typed. */ + placeholder?: string; + /** Specifies whether the search panel is visible or not. */ + visible?: boolean; + /** Specifies the width of the search panel in pixels. */ + width?: number; + /** Sets a search string for the search panel. */ + text?: string; + }; + /** Specifies the operations that must be performed on the server side. */ + remoteOperations?: any; + /** Allows you to sort groups according to the values of group summary items. */ + sortByGroupSummaryInfo?: Array<{ + /** Specifies the group summary item whose values must be used to sort groups. */ + summaryItem?: string; + /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ + groupColumn?: string; + /** Specifies the sort order of group summary item values. */ + sortOrder?: string; + }>; + /** Allows you to build a master-detail interface in the grid. */ + masterDetail?: { + /** Enables an end-user to expand/collapse detail sections. */ + enabled?: boolean; + /** Specifies whether detail sections appear expanded or collapsed. */ + autoExpandAll?: boolean; + /** Specifies the template for detail sections. */ + template?: any; + }; + /** Specifies options for exporting grid data. */ + export?: { + /** Indicates if the export feature is enabled in the grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies whether to enable Excel filtering for the exported data in the resulting XLSX file. */ + excelFilterEnabled?: boolean; + /** Specifies whether to enable word wrapping for the exported data in the resulting XLSX file. */ + excelWrapTextEnabled?: boolean; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + /** Indicates whether to allow end users to export not only the data displayed in the grid, but the selected rows only. */ + allowExportSelectedData?: boolean; + /** Contains options that specify texts for the export-related commands and hints. */ + texts?: { + /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ + exportTo?: string; + /** Specifies text for the Export button when this button exports to the XSLX format. */ + exportToExcel?: string; + /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ + excelFormat?: string; + /** Specifies text for the option in the Export dropdown menu that allows you to choose whether to export all the grid data or the selected rows only. */ + selectedRows?: string; + } + }; + /** Specifies the keys of the records that must appear selected initially. */ + selectedRowKeys?: Array; + /** Specifies options of runtime selection. */ + selection?: { + /** Specifies the checkbox row display policy in the multiple mode. */ + showCheckBoxesMode?: string; + /** Specifies whether the user can select all grid records at once. */ + allowSelectAll?: boolean; + /** Specifies the selection mode. */ + mode?: string; + }; + /** A handler for the dataErrorOccured event. */ + onDataErrorOccurred?: (e: { error: Error }) => void; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + currentSelectedRowKeys: Array; + currentDeselectedRowKeys: Array; + selectedRowKeys: Array; + selectedRowsData: Array; + }) => void; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + format: string; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A handler for the keyDown event. */ + onKeyDown?: (e: Object) => void; + /** A handler for the rowExpanding event. */ + onRowExpanding?: (e: Object) => void; + /** A handler for the rowExpanded event. */ + onRowExpanded?: (e: Object) => void; + /** A handler for the rowCollapsing event. */ + onRowCollapsing?: (e: Object) => void; + /** A handler for the rowCollapsed event. */ + onRowCollapsed?: (e: Object) => void; + /** Specifies whether column headers are visible or not. */ + showColumnHeaders?: boolean; + /** Specifies whether or not vertical lines separating one grid column from another are visible. */ + showColumnLines?: boolean; + /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ + showRowLines?: boolean; + /** Specifies options of runtime sorting. */ + sorting?: { + /** Specifies text for the context menu item that sets an ascending sort order in a column. */ + ascendingText?: string; + /** Specifies text for the context menu item that resets sorting settings for a column. */ + clearText?: string; + /** Specifies text for the context menu item that sets a descending sort order in a column. */ + descendingText?: string; + /** Specifies the runtime sorting mode. */ + mode?: string; + }; + /** Specifies options of state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (state: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + /** Specifies the options of the grid summary. */ + summary?: { + /** Contains options that specify text patterns for summary items. */ + texts?: { + /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ + sum?: string; + /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ + sumOtherColumn?: string; + /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ + min?: string; + /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ + minOtherColumn?: string; + /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ + max?: string; + /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ + maxOtherColumn?: string; + /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ + avg?: string; + /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ + avgOtherColumn?: string; + /** Specifies a pattern for the 'count' summary items. */ + count?: string; + }; + /** Specifies items of the group summary. */ + groupItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the column that provides data for a group summary item. */ + column?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies whether or not a summary item must be displayed in the group footer. */ + showInGroupFooter?: boolean; + /** Indicates whether to display group summary items in parentheses after the group row header or to align them by the corresponding columns within the group row. */ + alignByColumn?: boolean; + /** Specifies the column that must hold the summary item when this item is displayed in the group footer or aligned by a column in the group row. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + }>; + /** Specifies items of the total summary. */ + totalItems?: Array<{ + /** Specifies the identifier of a summary item. */ + name?: string; + /** Specifies the alignment of a summary item. */ + alignment?: string; + /** Specifies the column that provides data for a summary item. */ + column?: string; + /** Specifies a CSS class to be applied to a summary item. */ + cssClass?: string; + /** Customizes the text to be displayed in the summary item. */ + customizeText?: (itemInfo: { + value: any; + valueText: string; + }) => string; + /** Specifies a pattern for the summary item text. */ + displayFormat?: string; + /** Specifies a precision for the summary item value of a numeric format. */ + precision?: number; + /** Specifies the column that must hold the summary item. */ + showInColumn?: string; + /** Specifies how to aggregate data for a summary item. */ + summaryType?: string; + /** Specifies a format for the summary item value. */ + valueFormat?: string; + }>; + /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ + calculateCustomSummary?: (options: { + component: dxDataGrid; + name?: string; + value: any; + totalValue: any; + summaryProcess: string + }) => void; + }; + /** Specifies whether text that does not fit into a column should be wrapped. */ + wordWrapEnabled?: boolean; + } + /** A data grid widget. */ + export class dxDataGrid extends Widget { + constructor(element: JQuery, options?: dxDataGridOptions); + constructor(element: Element, options?: dxDataGridOptions); + /** Ungroups grid records. */ + clearGrouping(): void; + /** Clears sorting settings of all grid columns at once. */ + clearSorting(): void; + /** Allows you to obtain a cell by its row index and the data field of its column. */ + getCellElement(rowIndex: number, dataField: string): any; + /** Allows you to obtain a cell by its row index and the visible index of its column. */ + getCellElement(rowIndex: number, visibleColumnIndex: number): any; + /** Returns the current state of the grid. */ + state(): Object; + /** Sets the grid state. */ + state(state: Object): void; + /** Allows you to obtain the row index by a data key. */ + getRowIndexByKey(key: any): number; + /** Allows you to obtain the data key by a row index. */ + getKeyByRowIndex(rowIndex: number): any; + /** Adds a new column to a grid. */ + addColumn(columnOptions: dxDataGridColumn): void; + /** Removes the column from the grid. */ + deleteColumn(id: any): void; + /** Displays the load panel. */ + beginCustomLoading(messageText: string): void; + /** Discards changes made in a grid. */ + cancelEditData(): void; + /** Checks whether or not the grid contains unsaved changes. */ + hasEditData(): boolean; + /** Clears all the filters of a specific type applied to grid records. */ + clearFilter(): void; + /** Deselects all grid records. */ + clearSelection(): void; + /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ + closeEditCell(): void; + /** Collapses groups or master rows in a grid. */ + collapseAll(groupIndex?: number): void; + /** Returns the number of data columns in a grid. */ + columnCount(): number; + /** Returns the value of a specific column option. */ + columnOption(id: any, optionName: string): any; + /** Sets an option of a specific column. */ + columnOption(id: any, optionName: string, optionValue: any): void; + /** Returns the options of a column by an identifier. */ + columnOption(id: any): Object; + /** Sets several options of a column at once. */ + columnOption(id: any, options: Object): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, visibleColumnIndex: number): void; + /** Sets a specific cell into the editing state. */ + editCell(rowIndex: number, dataField: string): void; + /** Sets a specific row into the editing state. */ + editRow(rowIndex: number): void; + /** Gets the cell value. */ + cellValue(rowIndex: number, dataField: string): any; + /** Gets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number): any; + /** Sets the cell value. */ + cellValue(rowIndex: number, dataField: string, value: any): void; + /** Sets the cell value. */ + cellValue(rowIndex: number, visibleColumnIndex: number, value: any): void; + /** Hides the load panel. */ + endCustomLoading(): void; + /** Expands groups or master rows in a grid. */ + expandAll(groupIndex: number): void; + /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ + isRowExpanded(key: any): boolean; + /** Allows you to expand a specific group or master row by its key. */ + expandRow(key: any): void; + /** Allows you to collapse a specific group or master row by its key. */ + collapseRow(key: any): void; + /** Applies a filter to the grid's data source. */ + filter(filterExpr?: any): void; + /** Returns a filter expression applied to the grid's data source using the filter(filterExpr) method. */ + filter(): any; + /** Returns a filter expression applied to the grid using all possible scenarious. */ + getCombinedFilter(): any; + /** Gets the keys of currently selected grid records. */ + getSelectedRowKeys(): Array; + /** Gets the data objects of currently selected grid records. */ + getSelectedRowsData(): Array; + /** Hides the column chooser panel. */ + hideColumnChooser(): void; + /** Adds a new data row to a grid. */ + addRow(): void; + /** + * Adds a new data row to a grid. + * @deprecated Use the addRow() method instead. + */ + insertRow(): void; + /** Returns the key corresponding to the passed data object. */ + keyOf(obj: Object): any; + /** Switches a grid to a specified page. */ + pageIndex(newIndex: number): void; + /** Gets the index of the current page. */ + pageIndex(): number; + /** Sets the page size. */ + pageSize(value: number): void; + /** Gets the current page size. */ + pageSize(): number; + /** Refreshes grid data. */ + refresh(): void; + /** Removes a specific row from a grid. */ + deleteRow(rowIndex: number): void; + /** + * Removes a specific row from a grid. + * @deprecated Use the deleteRow() method instead. + */ + removeRow(rowIndex: number): void; + /** Saves changes made in a grid. */ + saveEditData(): void; + /** Searches grid records by a search string. */ + searchByText(text: string): void; + /** Selects all grid records. */ + selectAll(): void; + /** Deselects the rows that are currently selected within the applied filter. */ + deselectAll(): void; + /** Selects specific grid records. */ + selectRows(keys: Array, preserve: boolean): void; + /** Deselects specific grid records. */ + deselectRows(keys: Array): void; + /** Selects grid rows by indexes. */ + selectRowsByIndexes(indexes: Array): void; + /** Allows you to find out whether a row is selected or not. */ + isRowSelected(key: any): boolean; + /** Invokes the column chooser panel. */ + showColumnChooser(): void; + startSelectionWithCheckboxes(): boolean; + /** Returns the number of records currently held by a grid. */ + totalCount(): number; + /** Recovers a row deleted in the batch edit mode. */ + undeleteRow(rowIndex: number): void; + /** Allows you to obtain a data object by its key. */ + byKey(key: any): JQueryPromise; + /** Gets the value of a total summary item. */ + getTotalSummaryValue(summaryItemName: string): any; + /** Exports grid data to Excel. */ + exportToExcel(selectionOnly: boolean): void; + /** Updates the grid to the size of its content. */ + updateDimensions(): void; + /** Focuses the specified cell element in the grid. */ + focus(element?: JQuery): void; + } + export interface dxPivotGridOptions extends WidgetOptions { + onContentReady?: Function; + /** Specifies a data source for the pivot grid. */ + dataSource?: any; + useNativeScrolling?: any; + /** A configuration object specifying scrolling options. */ + scrolling?: { + /** Specifies the scrolling mode. */ + mode?: string; + /** Specifies whether or not the widget uses native scrolling. */ + useNative?: any; + }; + /** Allows an end-user to change sorting options. */ + allowSorting?: boolean; + /** Allows an end-user to sort columns by summary values. */ + allowSortingBySummary?: boolean; + /** Allows an end-user to change filtering options. */ + allowFiltering?: boolean; + /** Allows an end-user to expand/collapse all header items within a header level. */ + allowExpandAll?: boolean; + /** Specifies whether to display the Total rows. */ + showRowTotals?: boolean; + /** Specifies whether to display the Grand Total row. */ + showRowGrandTotals?: boolean; + /** Specifies whether to display the Total columns. */ + showColumnTotals?: boolean; + /** Specifies whether to display the Grand Total column. */ + showColumnGrandTotals?: boolean; + /** Specifies whether or not to hide rows and columns with no data. */ + hideEmptySummaryCells?: boolean; + /** Specifies where to show the total rows or columns. */ + showTotalsPrior?: string; + /** Specifies whether the outer borders of the grid are visible or not. */ + showBorders?: boolean; + /** The Field Chooser configuration options. */ + fieldChooser?: { + /** Enables or disables the field chooser. */ + enabled?: boolean; + /** Specifies the field chooser layout. */ + layout?: number; + /** Specifies the text to display as a title of the field chooser popup window. */ + title?: string; + /** Specifies the field chooser width. */ + width?: number; + /** Specifies the field chooser height. */ + height?: number; + /** Strings that can be changed or localized in the pivot grid's integrated Field Chooser. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** Strings that can be changed or localized in the dxPivotGrid widget. */ + texts?: { + /** The string to display as a header of the Grand Total row and column. */ + grandTotal?: string; + /** The string to display as a header of the Total row and column. */ + total?: string; + /** Specifies the text displayed when a pivot grid does not contain any fields. */ + noData?: string; + /** The string to display as a Show Field Chooser context menu item. */ + showFieldChooser?: string; + /** The string to display as an Expand All context menu item. */ + expandAll?: string; + /** The string to display as a Collapse All context menu item. */ + collapseAll?: string; + /** The string to display as a Sort Column by Summary Value context menu item. */ + sortColumnBySummary?: string; + /** The string to display as a Sort Row by Summary Value context menu item. */ + sortRowBySummary?: string; + /** The string to display as a Remove All Sorting context menu item. */ + removeAllSorting?: string; + /** The string to display as an Export to Excel file context menu item. */ + exportToExcel?: string; + }; + /** The Load panel configuration options. */ + loadPanel?: { + /** Enables or disables the load panel. */ + enabled?: boolean; + /** Specifies the height of the load panel. */ + height?: number; + /** Specifies the URL pointing to an image that will be used as a load indicator. */ + indicatorSrc?: string; + /** Specifies whether or not to show a load indicator. */ + showIndicator?: boolean; + /** Specifies whether or not to show load panel background. */ + showPane?: boolean; + /** Specifies the text to display inside a load panel. */ + text?: string; + /** Specifies the width of the load panel. */ + width?: number; + }; + /** A handler for the cellClick event. */ + onCellClick?: (e: any) => void; + /** A handler for the cellPrepared event. */ + onCellPrepared?: (e: any) => void; + /** A handler for the contextMenuPreparing event. */ + onContextMenuPreparing?: (e: Object) => void; + /** Specifies options for exporting pivot grid data. */ + export?: { + /** Indicates whether the export feature is enabled for the pivot grid. */ + enabled?: boolean; + /** Specifies a default name for the file to which grid data is exported. */ + fileName?: string; + /** Specifies the URL of the server-side proxy that streams the resulting file to the end user to enable export in IE8, IE9 and Safari browsers. */ + proxyUrl?: string; + }; + /** A handler for the exporting event. */ + onExporting?: (e: { + fileName: string; + format: string; + cancel: boolean; + }) => void; + /** A handler for the exported event. */ + onExported?: (e: Object) => void; + /** A configuration object specifying options related to state storing. */ + stateStoring?: { + /** Specifies a callback function that performs specific actions on state loading. */ + customLoad?: () => JQueryPromise; + /** Specifies a callback function that performs specific actions on state saving. */ + customSave?: (gridState: Object) => void; + /** Specifies whether or not a grid saves its state. */ + enabled?: boolean; + /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ + savingTimeout?: number; + /** Specifies a unique key to be used for storing the grid state. */ + storageKey?: string; + /** Specifies the type of storage to be used for state storing. */ + type?: string; + }; + } + /** A data summarization widget for multi-dimensional data analysis and data mining. */ + export class dxPivotGrid extends Widget { + constructor(element: JQuery, options?: dxPivotGridOptions); + constructor(element: Element, options?: dxPivotGridOptions); + /** Gets the PivotGridDataSource instance. */ + getDataSource(): DevExpress.data.PivotGridDataSource; + /** Gets the dxPopup instance of the field chooser window. */ + getFieldChooserPopup(): DevExpress.ui.dxPopup; + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + /** Exports pivot grid data to the Excel file. */ + exportToExcel(): void; + } + export interface dxPivotGridFieldChooserOptions extends WidgetOptions { + /** Specifies the height of the widget. */ + height?: any; + /** Specifies the field chooser layout. */ + layout?: number; + /** The data source of a dxPivotGrid widget. */ + dataSource?: DevExpress.data.PivotGridDataSource; + onContentReady?: Function; + /** Strings that can be changed or localized in the dxPivotGridFieldChooser widget. */ + texts?: { + /** The string to display instead of Row Fields. */ + rowFields?: string; + /** The string to display instead of Column Fields. */ + columnFields?: string; + /** The string to display instead of Data Fields. */ + dataFields?: string; + /** The string to display instead of Filter Fields. */ + filterFields?: string; + /** The string to display instead of All Fields. */ + allFields?: string; + }; + } + /** A complementary widget for dxPivotGrid that allows you to manage data displayed in the dxPivotGrid. */ + export class dxPivotGridFieldChooser extends Widget { + constructor(element: JQuery, options?: dxPivotGridFieldChooserOptions); + constructor(element: Element, options?: dxPivotGridFieldChooserOptions); + /** Updates the widget to the size of its content. */ + updateDimensions(): void; + } +} +interface JQuery { + dxTreeView(): JQuery; + dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; + dxTreeView(options: string): any; + dxTreeView(options: string, ...params: any[]): any; + dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; + dxMenuBase(): JQuery; + dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; + dxMenuBase(options: string): any; + dxMenuBase(options: string, ...params: any[]): any; + dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; + dxMenu(): JQuery; + dxMenu(options: "instance"): DevExpress.ui.dxMenu; + dxMenu(options: string): any; + dxMenu(options: string, ...params: any[]): any; + dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; + dxContextMenu(): JQuery; + dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; + dxContextMenu(options: string): any; + dxContextMenu(options: string, ...params: any[]): any; + dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; + dxColorBox(): JQuery; + dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; + dxColorBox(options: string): any; + dxColorBox(options: string, ...params: any[]): any; + dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; + dxDataGrid(): JQuery; + dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; + dxDataGrid(options: string): any; + dxDataGrid(options: string, ...params: any[]): any; + dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; + dxPivotGrid(): JQuery; + dxPivotGrid(options: "instance"): DevExpress.ui.dxPivotGrid; + dxPivotGrid(options: string): any; + dxPivotGrid(options: string, ...params: any[]): any; + dxPivotGrid(options: DevExpress.ui.dxPivotGridOptions): JQuery; + dxPivotGridFieldChooser(): JQuery; + dxPivotGridFieldChooser(options: "instance"): DevExpress.ui.dxPivotGridFieldChooser; + dxPivotGridFieldChooser(options: string): any; + dxPivotGridFieldChooser(options: string, ...params: any[]): any; + dxPivotGridFieldChooser(options: DevExpress.ui.dxPivotGridFieldChooserOptions): JQuery; + dxScheduler(): JQuery; + dxScheduler(options: "instance"): DevExpress.ui.dxScheduler; + dxScheduler(options: string): any; + dxScheduler(options: string, ...params: any[]): any; + dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery; +} +declare module DevExpress.framework { + /** An object used to store information on the views displayed in an application. */ + export class ViewCache { + viewRemoved: JQueryCallback; + /** Removes all the viewInfo objects from the cache. */ + clear(): void; + /** Obtains a viewInfo object from the cache by the specified key. */ + getView(key: string): Object; + /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ + hasView(key: string): boolean; + /** Removes a viewInfo object from the cache by the specified key. */ + removeView(key: string): Object; + /** Adds the specified viewInfo object to the cache under the specified key. */ + setView(key: string, viewInfo: Object): void; + } + export interface dxCommandOptions extends DOMComponentOptions { + /** Specifies an action performed when the execute() method of the command is called. */ + onExecute?: any; + /** Indicates whether or not the widget that displays this command is disabled. */ + disabled?: boolean; + /** Specifies whether the current command is rendered when a view is being rendered or after a view is shown. */ + renderStage?: string; + /** Specifies the name of the icon shown inside the widget associated with this command. */ + icon?: string; + iconSrc?: string; + /** The identifier of the command. */ + id?: string; + /** Specifies the title of the widget associated with this command. */ + title?: string; + /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ + type?: string; + /** A Boolean value specifying whether or not the widget associated with this command is visible. */ + visible?: boolean; + } + /** A markup component used to define markup options for a command. */ + export class dxCommand extends DOMComponent { + constructor(element: JQuery, options: dxCommandOptions); + constructor(options: dxCommandOptions); + /** Executes the action associated with this command. */ + execute(): void; + } + /** An object responsible for routing. */ + export class Router { + /** Adds a routing rule to the list of registered rules. */ + register(pattern: string, defaults?: Object, constraints?: Object): void; + /** Decodes the specified URI to an object using the registered routing rules. */ + parse(uri: string): Object; + /** Formats an object to a URI. */ + format(obj: Object): string; + } + export interface StateManagerOptions { + /** A storage to which the state manager saves the application state. */ + storage?: Object; + } + /** An object used to store the current application state. */ + export class StateManager { + constructor(options?: StateManagerOptions); + /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ + addStateSource(stateSource: Object): void; + /** Removes a specified state source from the state manager's collection of state sources. */ + removeStateSource(stateSource: Object): void; + /** Saves the current application state. */ + saveState(): void; + /** Restores the application state that has been saved by the saveState() method to the state storage. */ + restoreState(): void; + /** Removes the application state that has been saved by the saveState() method to the state storage. */ + clearState(): void; + } + export module html { + export var layoutSets: Array; + export var animationSets: { [animationSetName: string]: AnimationSet }; + export interface AnimationSet { + [animationName: string]: any + } + export interface HtmlApplicationOptions { + /** Specifies where the commands that are defined in the application's views must be displayed. */ + commandMapping?: Object; + /** Specifies whether or not view caching is disabled. */ + disableViewCache?: boolean; + /** An array of layout controllers that should be used to show application views in the current navigation context. */ + layoutSet?: any; + /** Specifies the animation presets that are used to animate different UI elements in the current application. */ + animationSet?: AnimationSet; + /** Specifies whether the current application must behave as a mobile or web application. */ + mode?: string; + /** Specifies the object that represents a root namespace of the application. */ + namespace?: Object; + /** Specifies application behavior when the user navigates to a root view. */ + navigateToRootViewMode?: string; + /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ + navigation?: Array; + /** A state manager to be used in the application. */ + stateManager?: StateManager; + /** Specifies the storage to be used by the application's state manager to store the application state. */ + stateStorage?: Object; + /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ + useViewTitleAsBackText?: boolean; + /** A custom view cache to be used in the application. */ + viewCache?: Object; + /** Specifies a limit for the views that can be cached. */ + viewCacheSize?: number; + /** Specifies the current version of application templates. */ + templatesVersion?: string; + /** Specifies options for the viewport meta tag of a mobile browser. */ + viewPort?: JQuery; + /** A custom router to be used in the application. */ + router?: Router; + } + /** An object used to manage views, as well as control the application life cycle. */ + export class HtmlApplication implements EventsMixin { + constructor(options: HtmlApplicationOptions); + afterViewSetup: JQueryCallback; + beforeViewSetup: JQueryCallback; + initialized: JQueryCallback; + navigating: JQueryCallback; + navigatingBack: JQueryCallback; + resolveLayoutController: JQueryCallback; + resolveViewCacheKey: JQueryCallback; + viewDisposed: JQueryCallback; + viewDisposing: JQueryCallback; + viewHidden: JQueryCallback; + viewRendered: JQueryCallback; + viewShowing: JQueryCallback; + viewShown: JQueryCallback; + /** Provides access to the ViewCache object. */ + viewCache: ViewCache; + /** An array of dxCommand components that are created based on the application's navigation option value. */ + navigation: Array; + /** Provides access to the StateManager object. */ + stateManager: StateManager; + /** Provides access to the Router object. */ + router: Router; + /** Navigates to the URI preceding the current one in the navigation history. */ + back(): void; + /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ + canBack(): boolean; + /** Calls the clearState() method of the application's StateManager object. */ + clearState(): void; + /** Creates global navigation commands. */ + createNavigation(navigationConfig: Array): void; + /** Returns an HTML template of the specified view. */ + getViewTemplate(viewName: string): JQuery; + /** Returns a configuration object used to create a dxView component for a specified view. */ + getViewTemplateInfo(viewName: string): Object; + /** Adds a specified HTML template to a collection of view or layout templates. */ + loadTemplates(source: any): JQueryPromise; + /** Navigates to the specified URI. */ + navigate(uri?: any, options?: Object): void; + /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ + renderNavigation(): void; + /** Calls the restoreState() method of the application's StateManager object. */ + restoreState(): void; + /** Calls the saveState method of the application's StateManager object. */ + saveState(): void; + /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ + templateContext(): Object; + on(eventName: "initialized", eventHandler: () => void): HtmlApplication; + on(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + on(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + on(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + on(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + on(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + on(eventName: string, eventHandler: Function): HtmlApplication; + on(events: { [eventName: string]: Function; }): HtmlApplication; + off(eventName: "initialized"): HtmlApplication; + off(eventName: "afterViewSetup"): HtmlApplication; + off(eventName: "beforeViewSetup"): HtmlApplication; + off(eventName: "navigating"): HtmlApplication; + off(eventName: "navigatingBack"): HtmlApplication; + off(eventName: "resolveLayoutController"): HtmlApplication; + off(eventName: "resolveViewCacheKey"): HtmlApplication; + off(eventName: "viewDisposed"): HtmlApplication; + off(eventName: "viewDisposing"): HtmlApplication; + off(eventName: "viewHidden"): HtmlApplication; + off(eventName: "viewRendered"): HtmlApplication; + off(eventName: "viewShowing"): HtmlApplication; + off(eventName: "viewShown"): HtmlApplication; + off(eventName: string): HtmlApplication; + off(eventName: "initialized", eventHandler: () => void): HtmlApplication; + off(eventName: "afterViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "beforeViewSetup", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "navigating", eventHandler: (e: { + currentUri: string; + uri: string; + cancel: boolean; + options: { + root: boolean; + target: string; + direction: string; + rootInDetailPane: boolean; + modal: boolean; + }; + }) => void): HtmlApplication; + off(eventName: "navigatingBack", eventHandler: (e: { + cancel: boolean; + isHardwareButton: boolean; + }) => void): HtmlApplication; + off(eventName: "resolveLayoutController", eventHandler: (e: { + viewInfo: Object; + layoutController: Object; + availableLayoutControllers: Array; + }) => void): HtmlApplication; + off(eventName: "resolveViewCacheKey", eventHandler: (e: { + key: string; + navigationItem: Object; + routeData: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposed", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewDisposing", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewHidden", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewRendered", eventHandler: (e: { + viewInfo: Object; + }) => void): HtmlApplication; + off(eventName: "viewShowing", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: "viewShown", eventHandler: (e: { + viewInfo: Object; + direction: string; + }) => void): HtmlApplication; + off(eventName: string, eventHandler: Function): HtmlApplication; + } + } +} +declare module DevExpress.viz.core { + /** + * Applies a theme for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(theme) method instead. + */ + export function currentTheme(theme: string): void; + /** + * Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets. + * @deprecated Use the DevExpress.viz.currentTheme(platform, colorScheme) method instead. + */ + export function currentTheme(platform: string, colorScheme: string): void; + /** + * Registers a new theme based on the existing one. + * @deprecated Use the DevExpress.viz.registerTheme(customTheme, baseTheme) method instead. + */ + export function registerTheme(customTheme: Object, baseTheme: string): void; + /** + * Applies a predefined or registered custom palette to all visualization widgets at once. + * @deprecated Use the DevExpress.viz.currentPalette(paletteName) method instead. + */ + export function currentPalette(paletteName: string): void; + /** + * Obtains the color sets of a predefined or registered palette. + * @deprecated Use the DevExpress.viz.getPalette(paletteName) method instead. + */ + export function getPalette(paletteName: string): Object; + /** + * Registers a new palette. + * @deprecated Use the DevExpress.viz.registerPalette(paletteName, palette) method instead. + */ + export function registerPalette(paletteName: string, palette: Object): void; + export interface Border { + /** Sets a border color for a selected series. */ + color?: string; + /** Sets border visibility for a selected series. */ + visible?: boolean; + /** Sets a border width for a selected series. */ + width?: number; + } + export interface DashedBorder extends Border { + /** Specifies a dash style for the border of a selected series point. */ + dashStyle?: string; + } + export interface DashedBorderWithOpacity extends DashedBorder { + /** Specifies the opacity of the tooltip's border. */ + opacity?: number; + } + export interface Font { + /** Specifies the font color for a strip label. */ + color?: string; + /** Specifies the font family for a strip label. */ + family?: string; + /** Specifies the font opacity for a strip label. */ + opacity?: number; + /** Specifies the font size for a strip label. */ + size?: any; + /** Specifies the font weight for the text displayed in strips. */ + weight?: number; + } + export interface Hatching { + direction?: string; + /** Specifies the opacity of hatching lines. */ + opacity?: number; + /** Specifies the distance between hatching lines in pixels. */ + step?: number; + /** Specifies the width of hatching lines in pixels. */ + width?: number; + } + export interface Margins { + /** Specifies the distance in pixels between the bottom side of the title and the surrounding widget elements. */ + bottom?: number; + /** Specifies the distance in pixels between the left side of the title and the surrounding widget elements. */ + left?: number; + /** Specifies the distance between the right side of the title and surrounding widget elements in pixels. */ + right?: number; + /** Specifies the distance between the top side of the title and surrounding widget elements in pixels. */ + top?: number; + } + export interface Size { + /** Specifies the width of the widget. */ + width?: number; + /** Specifies the height of the widget. */ + height?: number; + } + export interface Title { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** Specifies the widget title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies the widget title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the distance between the title and surrounding widget elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + } + export interface Tooltip { + /** Specifies the length of the tooltip's arrow in pixels. */ + arrowLength?: number; + /** Specifies the appearance of the tooltip's border. */ + border?: viz.core.DashedBorderWithOpacity; + /** Specifies a color for the tooltip. */ + color?: string; + /** Specifies the z-index for tooltips. */ + zIndex?: number; + /** Specifies the container to draw tooltips inside of it. */ + container?: any; + /** Specifies text and appearance of a set of tooltips. */ + customizeTooltip?: (arg: Object) => { color?: string; text?: string }; + /** Specifies whether or not the tooltip is enabled. */ + enabled?: boolean; + /** Specifies font options for the text displayed by the tooltip. */ + font?: Font; + /** Specifies a format for the text displayed by the tooltip. */ + format?: string; + /** Specifies the opacity of a tooltip. */ + opacity?: number; + /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ + paddingLeftRight?: number; + /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ + paddingTopBottom?: number; + /** Specifies a precision for formatted values displayed by the tooltip. */ + precision?: number; + /** Specifies options of the tooltip's shadow. */ + shadow?: { + /** Specifies the blur distance of the tooltip's shadow. */ + blur?: number; + /** Specifies the color of the tooltip's shadow. */ + color?: string; + /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetX?: number; + /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ + offsetY?: number; + /** Specifies the opacity of the tooltip's shadow. */ + opacity?: number; + }; + } + export interface Animation { + /** Determines how long animation runs. */ + duration?: number; + /** Specifies the animation easing mode. */ + easing?: string; + /** Indicates whether or not animation is enabled. */ + enabled?: boolean; + } + export interface LoadingIndicator { + /** Specifies a color for the loading indicator background. */ + backgroundColor?: string; + /** Specifies font options for the loading indicator text. */ + font?: viz.core.Font; + /** Specifies whether to show the loading indicator or not. */ + show?: boolean; + /** Specifies a text to be displayed by the loading indicator. */ + text?: string; + } + export interface LegendBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies a radius for the corners of the legend border. */ + cornerRadius?: number; + } + export interface BaseLegend { + /** Specifies the color of the legend's background. */ + backgroundColor?: string; + /** Specifies legend border settings. */ + border?: viz.core.LegendBorder; + /** Specifies how many columns must be taken to arrange legend items. */ + columnCount?: number; + /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ + columnItemSpacing?: number; + /** Specifies font options for legend items. */ + font?: viz.core.Font; + /** Specifies the legend's position on the map. */ + horizontalAlignment?: string; + /** Specifies the alignment of legend items. */ + itemsAlignment?: string; + /** Specifies the position of text relative to the item marker. */ + itemTextPosition?: string; + /** Specifies the distance between the legend and the container borders in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of item markers in the legend in pixels. */ + markerSize?: number; + /** Specifies whether to arrange legend items horizontally or vertically. */ + orientation?: string; + /** Specifies the spacing between the legend left/right border and legend items in pixels. */ + paddingLeftRight?: number; + /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ + paddingTopBottom?: number; + /** Specifies how many rows must be taken to arrange legend items. */ + rowCount?: number; + /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ + rowItemSpacing?: number; + /** Specifies the legend's position on the map. */ + verticalAlignment?: string; + /** Specifies whether or not the legend is visible on the map. */ + visible?: boolean; + } + export interface BaseWidgetOptions { + /** A handler for the drawn event. */ + onDrawn?: (e: { + component: BaseWidget; + element: Element; + }) => void; + /** A handler for the incidentOccurred event. */ + onIncidentOccurred?: ( + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } + ) => void; + /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ + pathModified?: boolean; + /** Specifies whether or not the widget supports right-to-left representation. */ + rtlEnabled?: boolean; + /** Sets the name of the theme to be used in the widget. */ + theme?: string; + } + /** This section describes options and methods that are common to all widgets. */ + export class BaseWidget extends DOMComponent { + /** Returns the widget's SVG markup. */ + svg(): string; + } +} +declare module DevExpress.viz.charts { + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface BaseSeries { + /** Provides information about the state of the series object. */ + fullState: number; + /** Returns the type of the series. */ + type: string; + /** Unselects all the selected points of the series. The points are displayed in an initial style. */ + clearSelection(): void; + /** Gets the color of a particular series. */ + getColor(): string; + /** Gets points from the series point collection based on the specified argument. */ + getPointsByArg(pointArg: any): Array; + /** Gets a point from the series point collection based on the specified point position. */ + getPointByPos(positionIndex: number): Object; + /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ + select(): void; + /** Selects the specified point. The point is displayed in a 'selected' style. */ + selectPoint(point: BasePoint): void; + /** Deselects the specified point. The point is displayed in an initial style. */ + deselectPoint(point: BasePoint): void; + /** Returns an array of all points in the series. */ + getAllPoints(): Array; + /** Returns visible series points. */ + getVisiblePoints(): Array; + /** Returns the name of the series. */ + name: string; + /** Returns the tag of the series. */ + tag: string; + /** Hides a series. */ + hide(): void; + /** Provides information about the hover state of a series. */ + isHovered(): boolean; + /** Provides information about the selection state of a series. */ + isSelected(): boolean; + /** Provides information about the visibility state of a series. */ + isVisible(): boolean; + /** Makes a particular series visible. */ + show(): void; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface BasePoint { + /** Provides information about the state of the point object. */ + fullState: number; + /** Returns the point's argument value that was set in the data source. */ + originalArgument: any; + /** Returns the point's value that was set in the data source. */ + originalValue: any; + /** Returns the tag of the point. */ + tag: string; + /** Deselects the point. */ + clearSelection(): void; + /** Gets the color of a particular point. */ + getColor(): string; + /** Hides the tooltip of the point. */ + hideTooltip(): void; + /** Provides information about the hover state of a point. */ + isHovered(): boolean; + /** Provides information about the selection state of a point. */ + isSelected(): boolean; + /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ + select(): void; + /** Shows the tooltip of the point. */ + showTooltip(): void; + /** Allows you to obtain the label of a series point. */ + getLabel(): any; + /** Returns the series object to which the point belongs. */ + series: BaseSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface ChartSeries extends BaseSeries { + /** Returns the name of the series pane. */ + pane: string; + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: ChartPoint): void; + deselectPoint(point: ChartPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface ChartPoint extends BasePoint { + /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalCloseValue: any; + /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalHighValue: any; + /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalLowValue: any; + /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ + originalMinValue: any; + /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ + originalOpenValue: any; + /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ + size: any; + /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + series: ChartSeries; + } + /** This section describes the methods that can be used in code to manipulate the Label object. */ + export interface Label { + /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ + getBoundingRect(): { x: number; y: number; width: number; height: number; }; + /** Hides the point label. */ + hide(): void; + /** Shows the point label. */ + show(): void; + } + export interface PieSeries extends BaseSeries { + selectPoint(point: PiePoint): void; + deselectPoint(point: PiePoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PiePoint extends BasePoint { + /** Gets the percentage value of the specific point. */ + percent: any; + /** Provides information about the visibility state of a point. */ + isVisible(): boolean; + /** Makes a specific point visible. */ + show(): void; + /** Hides a specific point. */ + hide(): void; + series: PieSeries; + } + /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ + export interface PolarSeries extends BaseSeries { + /** Returns the name of the value axis of the series. */ + axis: string; + selectPoint(point: PolarPoint): void; + deselectPoint(point: PolarPoint): void; + getAllPoints(): Array; + getVisiblePoints(): Array; + } + /** This section describes the methods that can be used in code to manipulate the Point object. */ + export interface PolarPoint extends BasePoint { + series: PolarSeries; + } + export interface Strip { + /** Specifies a color for a strip. */ + color?: string; + /** An object that defines the label configuration options of a strip. */ + label?: { + /** Specifies the text displayed in a strip. */ + text?: string; + }; + /** Specifies a start value for a strip. */ + startValue?: any; + /** Specifies an end value for a strip. */ + endValue?: any; + } + export interface BaseSeriesConfigLabel { + /** Specifies a format for arguments displayed by point labels. */ + argumentFormat?: string; + /** Specifies a precision for formatted point arguments displayed in point labels. */ + argumentPrecision?: number; + /** Specifies a background color for point labels. */ + backgroundColor?: string; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies connector options for series point labels. */ + connector?: { + /** Specifies the color of label connectors. */ + color?: string; + /** Indicates whether or not label connectors are visible. */ + visible?: boolean; + /** Specifies the width of label connectors. */ + width?: number; + }; + /** Specifies a callback function that returns the text to be displayed by point labels. */ + customizeText?: (pointInfo: Object) => string; + /** Specifies font options for the text displayed in point labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed by point labels. */ + format?: string; + position?: string; + /** Specifies a precision for formatted point values displayed in point labels. */ + precision?: number; + /** Specifies the angle used to rotate point labels from their initial position. */ + rotationAngle?: number; + /** Specifies the visibility of point labels. */ + visible?: boolean; + } + export interface SeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies whether or not to show a label when the point has a zero value. */ + showForZeroValues?: boolean; + } + export interface ChartSeriesConfigLabel extends SeriesConfigLabel { + /** Specifies how to align point labels relative to the corresponding data points that they represent. */ + alignment?: string; + /** Specifies how to shift point labels horizontally from their initial positions. */ + horizontalOffset?: number; + /** Specifies how to shift point labels vertically from their initial positions. */ + verticalOffset?: number; + /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ + percentPrecision?: number; + } + export interface BaseCommonSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + axis?: string; + /** An object defining the label configuration options for a series in the dxChart widget. */ + label?: ChartSeriesConfigLabel; + /** Specifies border options for point labels. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the dash style of the series' line. */ + dashStyle?: string; + hoverMode?: string; + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /**

Sets a color for a series when it is hovered over.

*/ + color?: string; + /** Specifies the dash style for the line in a hovered series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a hovered series. */ + width?: number; + }; + /** Specifies whether a chart ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies the minimal length of a displayed bar in pixels. */ + minBarSize?: number; + /** Specifies opacity for a series. */ + opacity?: number; + /** Specifies the series elements to highlight when the series is selected. */ + selectionMode?: string; + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the dash style for the line in a selected series. */ + dashStyle?: string; + hatching?: viz.core.Hatching; + /** Specifies the width of a line in a selected series. */ + width?: number; + }; + /** Specifies whether or not to show the series in the chart's legend. */ + showInLegend?: boolean; + /** Specifies the name of the stack where the values of the _stackedBar_ series must be located. */ + stack?: string; + /** Specifies the name of the data source field that provides data about a point. */ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + /** Specifies the visibility of a series. */ + visible?: boolean; + /** Specifies a line width. */ + width?: number; + /** Configures error bars. */ + valueErrorBar?: { + /** Specifies whether error bars must be displayed in full or partially. */ + displayMode?: string; + /** Specifies the data field that provides data for low error values. */ + lowValueField?: string; + /** Specifies the data field that provides data for high error values. */ + highValueField?: string; + /** Specifies how error bar values must be calculated. */ + type?: string; + /** Specifies the value to be used for generating error bars. */ + value?: number; + /** Specifies the color of error bars. */ + color?: string; + /** Specifies the opacity of error bars. */ + opacity?: number; + /** Specifies the length of the lines that indicate the error bar edges. */ + edgeLength?: number; + /** Specifies the width of the error bar line. */ + lineWidth?: number; + }; + } + export interface CommonPointOptions { + /** Specifies border options for points in the line and area series. */ + border?: viz.core.Border; + /** Specifies the points color. */ + color?: string; + /** Specifies what series points to highlight when a point is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered point. */ + hoverStyle?: { + /** An object defining the border options for a hovered point. */ + border?: viz.core.Border; + /** Sets a color for a point when it is hovered over. */ + color?: string; + /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies what series points to highlight when a point is selected. */ + selectionMode?: string; + /** An object defining configuration options for a selected point. */ + selectionStyle?: { + /** An object defining the border options for a selected point. */ + border?: viz.core.Border; + /**

Sets a color for a point when it is selected.

*/ + color?: string; + /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ + size?: number; + /** Specifies a symbol for presenting points of the line and area series. */ + symbol?: string; + visible?: boolean; + } + export interface ChartCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: any; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: any; + /** Specifies the width of an image that is used as a point marker. */ + width?: any; + }; + } + export interface PolarCommonPointOptions extends CommonPointOptions { + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: number; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: string; + /** Specifies the width of an image that is used as a point marker. */ + width?: number; + }; + } + /** An object that defines configuration options for chart series. */ + export interface CommonSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies the data source field that provides a 'close' value for a _candleStick_ or _stock_ series. */ + closeValueField?: string; + /** Specifies a radius for bar corners. */ + cornerRadius?: number; + /** Specifies the data source field that provides a 'high' value for a _candleStick_ or _stock_ series. */ + highValueField?: string; + /** Specifies the color for the body (rectangle) of a _candleStick_ series. */ + innerColor?: string; + /** Specifies the data source field that provides a 'low' value for a _candleStick_ or _stock_ series. */ + lowValueField?: string; + /** Specifies the data source field that provides an 'open' value for a _candleStick_ or _stock_ series. */ + openValueField?: string; + /** Specifies the pane that will be used to display a series. */ + pane?: string; + /** An object defining configuration options for points in line-, scatter- and area-like series. */ + point?: ChartCommonPointOptions; + /** Specifies the data source field that provides values for one end of a range series. To set the data source field for the other end of the range series, use the rangeValue2Field property. */ + rangeValue1Field?: string; + /** Specifies the data source field that provides values for the second end of a range series. To set the data source field for the other end of the range series, use the rangeValue1Field property. */ + rangeValue2Field?: string; + /** Specifies reduction options for the stock or candleStick series. */ + reduction?: { + /** Specifies a color for the points whose reduction level price is lower in comparison to the value in the previous point. */ + color?: string; + /** Specifies for which price level (open, high, low or close) to enable reduction options in the series. */ + level?: string; + }; + /** Specifies the data source field that defines the size of bubbles. */ + sizeField?: string; + } + export interface CommonSeriesSettings extends CommonSeriesConfig { + /**

An object that specifies configuration options for all series of the area type in the chart.

*/ + area?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the bubble type in the chart. */ + bubble?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _candleStick_ type in the chart. */ + candlestick?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedArea_ type in the chart. */ + fullstackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline Area type in the chart. */ + fullstackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedBar_ type in the chart. */ + fullstackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _fullStackedLine_ type in the chart. */ + fullstackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Full-Stacked Spline type in the chart. */ + fullstackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeArea_ type in the chart. */ + rangearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _rangeBar_ type in the chart. */ + rangebar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _spline_ type in the chart. */ + spline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _splineArea_ type in the chart. */ + splinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedArea_ type in the chart. */ + stackedarea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline Area type in the chart. */ + stackedsplinearea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedLine_ type in the chart. */ + stackedline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the Stacked Spline type in the chart. */ + stackedspline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepArea_ type in the chart. */ + steparea?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stepLine_ type in the chart. */ + stepline?: CommonSeriesConfig; + /** An object that specifies configuration options for all series of the _stock_ type in the chart. */ + stock?: CommonSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface SeriesConfig extends CommonSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + /** An object that defines configuration options for polar chart series. */ + export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig { + /** Specifies whether or not to close the chart by joining the end point with the first point. */ + closed?: boolean; + label?: SeriesConfigLabel; + point?: PolarCommonPointOptions; + } + export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig { + /** An object that specifies configuration options for all series of the area type in the chart. */ + area?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ + bar?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _line_ type in the chart. */ + line?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ + scatter?: CommonPolarSeriesConfig; + /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ + stackedbar?: CommonPolarSeriesConfig; + /** Sets a series type. */ + type?: string; + } + export interface PolarSeriesConfig extends CommonPolarSeriesConfig { + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + /** Sets the series type. */ + type?: string; + } + export interface PieSeriesConfigLabel extends BaseSeriesConfigLabel { + /** Specifies how to shift labels from their initial position in a radial direction in pixels. */ + radialOffset?: number; + /** Specifies a precision for the percentage values displayed in labels. */ + percentPrecision?: number; + } + /** An object that defines configuration options for chart series. */ + export interface CommonPieSeriesConfig { + /** Specifies the data source field that provides arguments for series points. */ + argumentField?: string; + /** Specifies the required type for series arguments. */ + argumentType?: string; + /** An object defining the series border configuration options. */ + border?: viz.core.DashedBorder; + /** Specifies a series color. */ + color?: string; + /** Specifies the chart elements to highlight when a series is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered series. */ + hoverStyle?: { + /** An object defining the border options for a hovered series. */ + border?: viz.core.DashedBorder; + /** Sets a color for the series when it is hovered over. */ + color?: string; + /** Specifies the hatching options to be applied when a point is hovered over. */ + hatching?: viz.core.Hatching; + }; + /** + * Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. + * @deprecated use the 'innerRadius' option instead + */ + innerRadius?: number; + /** An object defining the label configuration options. */ + label?: PieSeriesConfigLabel; + /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ + maxLabelCount?: number; + /** Specifies a minimal size of a displayed pie segment. */ + minSegmentSize?: number; + /** + * Specifies the direction in which the dxPieChart series points are located. + * @deprecated use the 'segmentsDirection' option instead + */ + segmentsDirection?: string; + /**

Specifies the chart elements to highlight when the series is selected.

*/ + selectionMode?: string; + /** An object defining configuration options for the series when it is selected. */ + selectionStyle?: { + /** An object defining the border options for a selected series. */ + border?: viz.core.DashedBorder; + /** Sets a color for a series when it is selected. */ + color?: string; + /** Specifies the hatching options to be applied when a point is selected. */ + hatching?: viz.core.Hatching; + }; + /** Specifies chart segment grouping options. */ + smallValuesGrouping?: { + /** Specifies the name of the grouped chart segment. This name represents the segment in the chart legend. */ + groupName?: string; + /** Specifies the segment grouping mode. */ + mode?: string; + /** Specifies a threshold for segment values. */ + threshold?: number; + /** Specifies how many segments must not be grouped. */ + topCount?: number; + }; + /** + * Specifies a start angle for a pie chart in arc degrees. + * @deprecated use the 'startAngle' option instead + */ + startAngle?: number; + /**

Specifies the name of the data source field that provides data about a point.

*/ + tagField?: string; + /** Specifies the data source field that provides values for series points. */ + valueField?: string; + } + export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { + type?: string; + } + export interface PieSeriesConfig extends CommonPieSeriesConfig { + /** + * Sets the series type. + * @deprecated use the 'type' option instead + */ + type?: string; + /** Specifies the name that identifies the series. */ + name?: string; + /** Specifies data about a series. */ + tag?: any; + } + export interface SeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => SeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface PolarSeriesTemplate { + /** Specifies a callback function that returns a series object with individual series settings. */ + customizeSeries?: (seriesName: string) => PolarSeriesConfig; + /** Specifies a data source field that represents the series name. */ + nameField?: string; + } + export interface ChartCommonConstantLineLabel { + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + /** Specifies the position of the constant line label relative to the chart plot. */ + position?: string; + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + } + export interface PolarCommonConstantLineLabel { + /** Indicates whether or not to display labels for the axis constant lines. */ + visible?: boolean; + /** Specifies font options for a constant line label. */ + font?: viz.core.Font; + } + export interface ConstantLineStyle { + /** Specifies a color for a constant line. */ + color?: string; + /** Specifies a dash style for a constant line. */ + dashStyle?: string; + /** Specifies a constant line width in pixels. */ + width?: number; + } + export interface ChartCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartCommonConstantLineLabel; + /** Specifies the space between the constant line label and the left/right side of the constant line. */ + paddingLeftRight?: number; + /** Specifies the space between the constant line label and the top/bottom side of the constant line. */ + paddingTopBottom?: number; + } + export interface PolarCommonConstantLineStyle extends ConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarCommonConstantLineLabel; + } + export interface CommonAxisLabel { + /** Specifies font options for axis labels. */ + font?: viz.core.Font; + /** Specifies the spacing between an axis and its labels in pixels. */ + indentFromAxis?: number; + /** Indicates whether or not axis labels are visible. */ + visible?: boolean; + } + export interface ChartCommonAxisLabel extends CommonAxisLabel { + /** Specifies the label's position relative to the tick (grid line). */ + alignment?: string; + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: { + /** Specifies how to arrange axis labels. */ + mode?: string; + /** Specifies the angle used to rotate axis labels. */ + rotationAngle?: number; + /** Specifies the spacing that must be set between staggered rows when the 'stagger' algorithm is applied. */ + staggeringSpacing?: number; + }; + } + export interface PolarCommonAxisLabel extends CommonAxisLabel { + /** Specifies the overlap resolving algorithm to be applied to axis labels. */ + overlappingBehavior?: string; + } + export interface CommonAxisTitle { + /** Specifies font options for an axis title. */ + font?: viz.core.Font; + /** Specifies a margin for an axis title in pixels. */ + margin?: number; + } + export interface BaseCommonAxisSettings { + /** Specifies the color of the line that represents an axis. */ + color?: string; + /** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */ + discreteAxisDivisionMode?: string; + /** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */ + grid?: { + /** Specifies a color for grid lines. */ + color?: string; + /** Specifies an opacity for grid lines. */ + opacity?: number; + /** Indicates whether or not the grid lines of an axis are visible. */ + visible?: boolean; + /** Specifies the width of grid lines. */ + width?: number; + }; + /** Specifies the options of the minor grid. */ + minorGrid?: { + /** Specifies a color for the lines of the minor grid. */ + color?: string; + /** Specifies an opacity for the lines of the minor grid. */ + opacity?: number; + /** Indicates whether the minor grid is visible or not. */ + visible?: boolean; + /** Specifies a width for the lines of the minor grid. */ + width?: number; + }; + /** Indicates whether or not an axis is inverted. */ + inverted?: boolean; + /** Specifies the opacity of the line that represents an axis. */ + opacity?: number; + /** Indicates whether or not to set ticks/grid lines of a continuous axis of the 'date-time' type at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** An object defining the configuration options for axis ticks. */ + tick?: { + /** Specifies ticks color. */ + color?: string; + /** Specifies tick opacity. */ + opacity?: number; + /** Indicates whether or not ticks are visible on an axis. */ + visible?: boolean; + /** Specifies tick width. */ + width?: number; + /** Specifies tick length. */ + length?: number; + }; + /** Specifies the options of the minor ticks. */ + minorTick?: { + /** Specifies a color for the minor ticks. */ + color?: string; + /** Specifies an opacity for the minor ticks. */ + opacity?: number; + /** Indicates whether or not the minor ticks are displayed on an axis. */ + visible?: boolean; + /** Specifies minor tick width. */ + width?: number; + /** Specifies minor tick length. */ + length?: number; + }; + /** Indicates whether or not the line that represents an axis in a chart is visible. */ + visible?: boolean; + /** Specifies the width of the line that represents an axis in the chart. */ + width?: number; + } + export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxChart widget. */ + label?: ChartCommonAxisLabel; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + /** Specifies, in pixels, the space reserved for an axis. */ + placeholderSize?: number; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + /** Specifies the label's position on a strip. */ + horizontalAlignment?: string; + /** Specifies a label's position on a strip. */ + verticalAlignment?: string; + }; + /** Specifies the spacing, in pixels, between the left/right strip border and the strip label. */ + paddingLeftRight?: number; + /** Specifies the spacing, in pixels, between the top/bottom strip borders and the strip label. */ + paddingTopBottom?: number; + }; + /** An object defining the title configuration options that are common for all axes in the dxChart widget. */ + title?: CommonAxisTitle; + /** Indicates whether or not to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + } + export interface PolarCommonAxisSettings extends BaseCommonAxisSettings { + /** Specifies the appearance of all the widget's constant lines. */ + constantLineStyle?: PolarCommonConstantLineStyle; + /** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */ + label?: PolarCommonAxisLabel; + /** An object defining configuration options for strip style. */ + stripStyle?: { + /** An object defining the configuration options for a strip label style. */ + label?: { + /** Specifies font options for a strip label. */ + font?: viz.core.Font; + }; + }; + } + export interface ChartConstantLineLabel extends ChartCommonConstantLineLabel { + /** Specifies the horizontal alignment of a constant line label. */ + horizontalAlignment?: string; + /** Specifies the vertical alignment of a constant line label. */ + verticalAlignment?: string; + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel { + /** Specifies the text to be displayed in a constant line label. */ + text?: string; + } + export interface AxisLabel { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ + customizeHint?: (argument: { value: any; valueText: string }) => string; + /** Specifies a callback function that returns the text to be displayed in value axis labels. */ + customizeText?: (argument: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed by axis labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the axis labels. */ + precision?: number; + } + export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } + export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } + export interface AxisTitle extends CommonAxisTitle { + /** Specifies the text for the value axis title. */ + text?: string; + } + export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + } + export interface ChartConstantLine extends ChartConstantLineStyle { + /** An object defining constant line label options. */ + label?: ChartConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface PolarConstantLine extends PolarCommonConstantLineStyle { + /** An object defining constant line label options. */ + label?: PolarConstantLineLabel; + /** Specifies a value to be displayed by a constant line. */ + value?: any; + } + export interface Axis { + /** Specifies a coefficient for dividing the value axis. */ + axisDivisionFactor?: number; + /** Specifies the order in which discrete values are arranged on the value axis. */ + categories?: Array; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic axis. */ + logarithmBase?: number; + /** Specifies an interval between axis ticks/grid lines. */ + tickInterval?: any; + /** Specifies the interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the number of minor ticks between two neighboring major ticks. */ + minorTickCount?: number; + /** Specifies the required type of the value axis. */ + type?: string; + /** Specifies the pane on which the current value axis will be displayed. */ + pane?: string; + /** Specifies options for value axis strips. */ + strips?: Array; + } + export interface ChartAxis extends ChartCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies the appearance options for the constant lines of the value axis. */ + constantLineStyle?: ChartCommonConstantLineStyle; + /** Specifies options for value axis labels. */ + label?: ChartAxisLabel; + /** Specifies the maximum value on the value axis. */ + max?: any; + /** Specifies the minimum value on the value axis. */ + min?: any; + /** Specifies the position of the value axis on a chart. */ + position?: string; + /** Specifies the title for a value axis. */ + title?: AxisTitle; + } + export interface PolarAxis extends PolarCommonAxisSettings, Axis { + /** Defines an array of the value axis constant lines. */ + constantLines?: Array; + /** Specifies options for value axis labels. */ + label?: PolarAxisLabel; + } + export interface ArgumentAxis { + /** Specifies the desired type of axis values. */ + argumentType?: string; + /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ + hoverMode?: string; + } + export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } + export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { + /** Specifies a start angle for the argument axis in degrees. */ + startAngle?: number; + /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ + firstPointOnStartAngle?: boolean; + /** Specifies the period of the argument values in the data source. */ + period?: number; + } + export interface ValueAxis { + /** Specifies the name of the value axis. */ + name?: string; + /** Specifies whether or not to indicate a zero value on the value axis. */ + showZero?: boolean; + /** Specifies the desired type of axis values. */ + valueType?: string; + } + export interface ChartValueAxis extends ChartAxis, ValueAxis { + /** Specifies the spacing, in pixels, between multiple value axes in a chart. */ + multipleAxesSpacing?: number; + /** Specifies the value by which the chart's value axes are synchronized. */ + synchronizedValue?: number; + } + export interface PolarValueAxis extends PolarAxis, ValueAxis { + /** Indicates whether to display series with indents from axis boundaries. */ + valueMarginsEnabled?: boolean; + /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ + maxValueMargin?: number; + /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ + minValueMargin?: number; + tick?: { + visible?: boolean; + } + } + export interface CommonPane { + /** Specifies a background color in a pane. */ + backgroundColor?: string; + /** Specifies the border options of a chart's pane. */ + border?: PaneBorder; + } + export interface Pane extends CommonPane { + /** Specifies the name of a pane. */ + name?: string; + } + export interface PaneBorder extends viz.core.DashedBorderWithOpacity { + /** Specifies the bottom border's visibility state in a pane. */ + bottom?: boolean; + /** Specifies the left border's visibility state in a pane. */ + left?: boolean; + /** Specifies the right border's visibility state in a pane. */ + right?: boolean; + /** Specifies the top border's visibility state in a pane. */ + top?: boolean; + } + export interface ChartAnimation extends viz.core.Animation { + /** Specifies the maximum series point count in the chart that the animation supports. */ + maxPointCountSupported?: number; + } + export interface BaseChartTooltip extends viz.core.Tooltip { + /** Specifies a format for arguments of the chart's series points. */ + argumentFormat?: string; + /** Specifies a precision for formatted arguments displayed in tooltips. */ + argumentPrecision?: number; + /** Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series. */ + percentPrecision?: number; + } + export interface BaseChartOptions extends viz.core.BaseWidgetOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies the width of the widget that is small enough for the layout to begin adapting. */ + width?: number; + /** Specifies the height of the widget that is small enough for the layout to begin adapting. */ + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies animation options. */ + animation?: ChartAnimation; + /** Specifies a callback function that returns an object with options for a specific point label. */ + customizeLabel?: (labelInfo: Object) => Object; + /** Specifies a callback function that returns an object with options for a specific point. */ + customizePoint?: (pointInfo: Object) => Object; + /** Specifies a data source for the chart. */ + dataSource?: any; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies options of a dxChart's (dxPieChart's) legend. */ + legend?: core.BaseLegend; + /** Specifies the blank space between the chart's extreme elements and the boundaries of the area provided for the widget (see size) in pixels. */ + margin?: viz.core.Margins; + /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** A handler for the done event. */ + onDone?: (e: { + component: BaseChart; + element: Element; + }) => void; + /** A handler for the pointClick event. */ + onPointClick?: any; + /** A handler for the pointHoverChanged event. */ + onPointHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** A handler for the pointSelectionChanged event. */ + onPointSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TPoint; + }) => void; + /** Specifies whether a single point or multiple points can be selected in the chart. */ + pointSelectionMode?: string; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options for the dxChart and dxPieChart widget series. */ + series?: any; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** Specifies a title for the chart. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: BaseChartTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseChart; + element: Element; + target: BasePoint; + }) => void; + } + /** A base class for all chart widgets included in the ChartJS library. */ + export class BaseChart extends viz.core.BaseWidget { + /** Deselects the chart's selected series. The series is displayed in an initial style. */ + clearSelection(): void; + /** Gets the current size of the widget. */ + getSize(): { width: number; height: number }; + /** Returns an array of all series in the chart. */ + getAllSeries(): Array; + /** Gets a series within the chart's series collection by the specified name (see the name option). */ + getSeriesByName(seriesName: string): BaseSeries; + /** Gets a series within the chart's series collection by its position number. */ + getSeriesByPos(seriesIndex: number): BaseSeries; + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Hides all widget tooltips. */ + hideTooltip(): void; + /** Redraws a widget. */ + render(renderOptions?: { + force?: boolean; + animate?: boolean; + asyncSeriesRendering?: boolean; + }): void; + } + export interface AdvancedLegend extends core.BaseLegend { + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /**

Specifies a callback function that returns the text to be displayed by legend items.

*/ + customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; + /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + } + export interface AdvancedOptions extends BaseChartOptions { + /** A handler for the argumentAxisClick event. */ + onArgumentAxisClick?: any; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate the values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort the series points. */ + sortingMethod?: any; + }; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** A handler for the seriesClick event. */ + onSeriesClick?: any; + /** A handler for the seriesHoverChanged event. */ + onSeriesHoverChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** A handler for the seriesSelectionChanged event. */ + onSeriesSelectionChanged?: (e: { + component: BaseChart; + element: Element; + target: TSeries; + }) => void; + /** Specifies whether a single series or multiple series can be selected in the chart. */ + seriesSelectionMode?: string; + /** Specifies how the chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + } + export interface Legend extends AdvancedLegend { + /** Specifies whether the legend is located outside or inside the chart's plot. */ + position?: string; + } + export interface ChartTooltip extends BaseChartTooltip { + /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies to the Bar and Bubble series. */ + location?: string; + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxChartOptions extends AdvancedOptions { + adaptiveLayout?: { + keepLabels?: boolean; + }; + /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ + synchronizeMultiAxes?: boolean; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ + adjustOnZoom?: boolean; + /** Specifies argument axis options for the dxChart widget. */ + argumentAxis?: ChartArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxChart widget. */ + commonAxisSettings?: ChartCommonAxisSettings; + /** An object defining the configuration options that are common for all panes in the dxChart widget. */ + commonPaneSettings?: CommonPane; + /** An object defining the configuration options that are common for all series of the dxChart widget. */ + commonSeriesSettings?: CommonSeriesSettings; + /** An object that specifies the appearance options of the chart crosshair. */ + crosshair?: { + /** Specifies a color for the crosshair lines. */ + color?: string; + /** Specifies a dash style for the crosshair lines. */ + dashStyle?: string; + /** Specifies whether to enable the crosshair or not. */ + enabled?: boolean; + /** Specifies the opacity of the crosshair lines. */ + opacity?: number; + /** Specifies the width of the crosshair lines. */ + width?: number; + /** Specifies the appearance of the horizontal crosshair line. */ + horizontalLine?: CrosshaierWithLabel; + /** Specifies the appearance of the vertical crosshair line. */ + verticalLine?: CrosshaierWithLabel; + /** Specifies the options of the crosshair labels. */ + label?: { + /** Specifies a color for the background of the crosshair labels. */ + backgroundColor?: string; + /** Specifies whether the crosshair labels are visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the crosshair labels. */ + font?: viz.core.Font; + } + }; + /** Specifies a default pane for the chart's series. */ + defaultPane?: string; + /** Specifies a coefficient determining the diameter of the largest bubble. */ + maxBubbleSize?: number; + /** Specifies the diameter of the smallest bubble measured in pixels. */ + minBubbleSize?: number; + /** Defines the dxChart widget's pane(s). */ + panes?: Array; + /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ + rotated?: boolean; + /** Specifies the options of a chart's legend. */ + legend?: Legend; + /** Specifies options for dxChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: SeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: ChartTooltip; + /** Specifies value axis options for the dxChart widget. */ + valueAxis?: Array; + /** Enables scrolling in your chart. */ + scrollingMode?: string; + /** Enables zooming in your chart. */ + zoomingMode?: string; + /** Specifies the settings of the scroll bar. */ + scrollBar?: { + /** Specifies whether the scroll bar is visible or not. */ + visible?: boolean; + /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ + offset?: number; + /** Specifies the color of the scroll bar. */ + color?: string; + /** Specifies the width of the scroll bar in pixels. */ + width?: number; + /** Specifies the opacity of the scroll bar. */ + opacity?: number; + /** Specifies the position of the scroll bar in the chart. */ + position?: string; + }; + } + /** A widget used to embed charts into HTML JS applications. */ + export class dxChart extends BaseChart { + constructor(element: JQuery, options?: dxChartOptions); + constructor(element: Element, options?: dxChartOptions); + /** Sets the specified start and end values for the chart's argument axis. */ + zoomArgument(startValue: any, endValue: any): void; + } + interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { + /** Configures the label that belongs to the horizontal crosshair line. */ + label?: { + /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ + backgroundColor?: string; + /** Specifies whether the label of the horizontal crosshair line is visible or not. */ + visible?: boolean; + /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ + font?: viz.core.Font; + } + } + export interface PolarChartTooltip extends BaseChartTooltip { + /** Specifies the kind of information to display in a tooltip. */ + shared?: boolean; + } + export interface dxPolarChartOptions extends AdvancedOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + width?: number; + height?: number; + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Indicates whether or not to display a "spider web". */ + useSpiderWeb?: boolean; + /** Specifies argument axis options for the dxPolarChart widget. */ + argumentAxis?: PolarArgumentAxis; + /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ + commonAxisSettings?: PolarCommonAxisSettings; + /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ + commonSeriesSettings?: CommonPolarSeriesSettings; + /** Specifies the options of a chart's legend. */ + legend?: AdvancedLegend; + /** Specifies options for dxPolarChart widget series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: PolarSeriesTemplate; + /** Specifies tooltip options. */ + tooltip?: PolarChartTooltip; + /** Specifies value axis options for the dxPolarChart widget. */ + valueAxis?: PolarValueAxis; + } + /** A chart widget displaying data in a polar coordinate system. */ + export class dxPolarChart extends BaseChart { + constructor(element: JQuery, options?: dxPolarChartOptions); + constructor(element: Element, options?: dxPolarChartOptions); + } + export interface PieLegend extends core.BaseLegend { + /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ + hoverMode?: string; + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ + customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + /** Specifies a callback function that returns the text to be displayed by a legend item. */ + customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; + } + export interface dxPieChartOptions extends BaseChartOptions { + /** Specifies adaptive layout options. */ + adaptiveLayout?: { + /** Specifies whether or not point labels can be hidden when the layout is adapting. */ + keepLabels?: boolean; + }; + /** Specifies dxPieChart legend options. */ + legend?: PieLegend; + /** Specifies options for the series of the dxPieChart widget. */ + series?: Array; + /** Specifies the diameter of the pie. */ + diameter?: number; + /** Specifies the direction that the pie chart segments will occupy. */ + segmentsDirection?: string; + /** Specifies the starting angle in arc degrees for the first segment in a pie chart. */ + startAngle?: number; + /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ + innerRadius?: number; + /** A handler for the legendClick event. */ + onLegendClick?: any; + /** Specifies how a chart must behave when series point labels overlap. */ + resolveLabelOverlapping?: string; + /** An object defining the configuration options that are common for all series of the dxPieChart widget. */ + commonSeriesSettings?: CommonPieSeriesSettings; + /** Specifies the type of the pie chart series. */ + type?: string; + } + /** A circular chart widget for HTML JS applications. */ + export class dxPieChart extends BaseChart { + constructor(element: JQuery, options?: dxPieChartOptions); + constructor(element: Element, options?: dxPieChartOptions); + /** + * Provides access to the dxPieChart series. + * @deprecated ..\..\BaseChart\3 Methods\getAllSeries().md + */ + getSeries(): PieSeries; + } +} +interface JQuery { + dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; + dxChart(methodName: string, ...params: any[]): any; + dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; + dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; + dxPieChart(methodName: string, ...params: any[]): any; + dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; + dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; + dxPolarChart(methodName: string, ...params: any[]): any; + dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; +} +declare module DevExpress.viz.gauges { + export interface BaseRangeContainer { + /** Specifies a range container's background color. */ + backgroundColor?: string; + /** Specifies the offset of the range container from an invisible scale line in pixels. */ + offset?: number; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: any; + /** An array of objects representing ranges contained in the range container. */ + ranges?: Array<{ startValue: number; endValue: number; color: string }>; + /** Specifies a color of a range. */ + color?: string; + /** Specifies an end value of a range. */ + endValue?: number; + /** Specifies a start value of a range. */ + startValue?: number; + } + export interface ScaleTick { + /** Specifies the color of the scale's minor ticks. */ + color?: string; + /** + * Specifies an array of custom minor ticks. + * @deprecated ..\customMinorTicks.md + */ + customTickValues?: Array; + /** Specifies the length of the scale's minor ticks. */ + length?: number; + /** + * Indicates whether automatically calculated minor ticks are visible or not. + * @deprecated This functionality in not more available + */ + showCalculatedTicks?: boolean; + /** + * Specifies an interval between minor ticks. + * @deprecated ..\minorTickInterval.md + */ + tickInterval?: number; + /** Indicates whether scale minor ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's minor ticks. */ + width?: number; + } + export interface ScaleMajorTick extends ScaleTick { + /** + * Specifies whether or not to expand the current major tick interval if labels overlap each other. + * @deprecated ..\label\overlappingBehavior\useAutoArrangement.md + */ + useTicksAutoArrangement?: boolean; + } + export interface ScaleMinorTick extends ScaleTick { + /** Specifies the opacity of the scale's minor ticks. */ + opacity?: number; + } + export interface BaseScaleLabel { + /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ + useRangeColors?: boolean; + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: number; valueText: string }) => string; + /** Specifies the overlap resolving options to be applied to scale labels. */ + overlappingBehavior?: { + /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ + useAutoArrangement?: boolean; + /** Specifies what label to hide in case of overlapping. */ + hideFirstOrLast?: string; + }; + /** Specifies font options for the text displayed in the scale labels of the gauge. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies whether or not scale labels are visible on the gauge. */ + visible?: boolean; + } + export interface BaseScale { + /** Specifies the end value for the scale of the gauge. */ + endValue?: number; + /** + * Specifies whether or not to hide the first scale label. + * @deprecated This functionality in not more available + */ + hideFirstLabel?: boolean; + /** + * Specifies whether or not to hide the first major tick on the scale. + * @deprecated This functionality in not more available + */ + hideFirstTick?: boolean; + /** + * Specifies whether or not to hide the last scale label. + * @deprecated This functionality in not more available + */ + hideLastLabel?: boolean; + /** + * Specifies whether or not to hide the last major tick on the scale. + * @deprecated This functionality in not more available + */ + hideLastTick?: boolean; + /** Specifies an interval between major ticks. */ + tickInterval?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: number; + /** Specifies an array of custom major ticks. */ + customTicks?: Array; + /** Specifies an array of custom minor ticks. */ + customMinorTicks?: Array; + /** Specifies common options for scale labels. */ + label?: BaseScaleLabel; + /** + * Specifies options of the gauge's major ticks. + * @deprecated ..\tick\tick.md + */ + majorTick?: ScaleMajorTick; + /** Specifies options of the gauge's major ticks. */ + tick?: { + /** Specifies the color of the scale's major ticks. */ + color?: string; + /** Specifies the length of the scale's major ticks. */ + length?: number; + /** Indicates whether scale major ticks are visible or not. */ + visible?: boolean; + /** Specifies the width of the scale's major ticks. */ + width?: number; + /** Specifies the opacity of the scale's major ticks. */ + opacity?: number; + }; + /** Specifies options of the gauge's minor ticks. */ + minorTick?: ScaleMinorTick; + /** Specifies the start value for the scale of the gauge. */ + startValue?: number; + } + export interface BaseValueIndicator { + /** Specifies the type of subvalue indicators. */ + type?: string; + /** Specifies the background color for the indicator of the rangeBar type. */ + backgroundColor?: string; + /** Specifies the base value for the indicator of the rangeBar type. */ + baseValue?: number; + /** Specifies a color of the indicator. */ + color?: string; + /** Specifies the range bar size for an indicator of the rangeBar type. */ + size?: number; + text?: { + /** Specifies a callback function that returns the text to be displayed in an indicator. */ + customizeText?: (indicatedValue: { value: number; valueText: string }) => string; + font?: viz.core.Font; + /** Specifies a format for the text displayed in an indicator. */ + format?: string; + /** Specifies the range bar's label indent in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by an indicator. */ + precision?: number; + }; + offset?: number; + length?: number; + width?: number; + /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ + arrowLength?: number; + /** Sets the array of colors to be used for coloring subvalue indicators. */ + palette?: Array; + /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ + indentFromCenter?: number; + /** Specifies the second color for the indicator of the twoColorNeedle type. */ + secondColor?: string; + /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ + secondFraction?: number; + /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ + spindleSize?: number; + /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ + spindleGapSize?: number; + /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface SharedGaugeOptions { + /** Specifies animation options. */ + animation?: viz.core.Animation; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies the size of the widget in pixels. */ + size?: viz.core.Size; + /** + * Specifies a subtitle for the widget. + * @deprecated ..\..\..\BaseGauge\1 Configuration\title\subtitle\subtitle.md + */ + subtitle?: { + /** + * Specifies font options for the subtitle. + * @deprecated ..\..\title\subtitle\font\font.md + */ + font?: viz.core.Font; + /** + * Specifies a text for the subtitle. + * @deprecated ..\title\subtitle\text.md + */ + text?: string; + }; + /** Specifies a title for a gauge. */ + title?: { + /** Specifies font options for the title. */ + font?: viz.core.Font; + /** + * Specifies a title's position on the gauge. + * @deprecated basegaugeoptions_title_verticalAlignment and basegaugeoptions_title_horizontalAlignment + */ + position?: string; + /** Specifies the distance between the title and surrounding gauge elements in pixels. */ + margin?: viz.core.Margins; + /** Specifies the height of the space reserved for the title. */ + placeholderSize?: number; + /** Specifies the gauge title's position in the vertical direction. */ + verticalAlignment?: string; + /** Specifies the gauge title's horizontal position. */ + horizontalAlignment?: string; + /** Specifies text for the title. */ + text?: string; + /** Specifies a subtitle for the widget. */ + subtitle?: { + /** Specifies font options for the subtitle. */ + font?: viz.core.Font; + /** Specifies text for the subtitle. */ + text?: string; + } + }; + /** Specifies options for gauge tooltips. */ + tooltip?: viz.core.Tooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxBaseGauge; + element: Element; + target: {}; + }) => void; + } + export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ + margin?: viz.core.Margins; + /** Specifies options of the gauge's range container. */ + rangeContainer?: BaseRangeContainer; + /** Specifies a gauge's scale options. */ + scale?: BaseScale; + /** Specifies the appearance options of subvalue indicators. */ + subvalueIndicator?: BaseValueIndicator; + /** Specifies a set of subvalues to be designated by the subvalue indicators. */ + subvalues?: Array; + /** Specifies the main value on a gauge. */ + value?: number; + /** Specifies the appearance options of the value indicator. */ + valueIndicator?: BaseValueIndicator; + } + /** A gauge widget. */ + export class dxBaseGauge extends viz.core.BaseWidget { + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Returns the main gauge value. */ + value(): number; + /** Updates a gauge value. */ + value(value: number): void; + /** Returns an array of gauge subvalues. */ + subvalues(): Array; + /** Updates gauge subvalues. */ + subvalues(subvalues: Array): void; + } + export interface LinearRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ + width?: any; + /** Specifies an end width of a range container. */ + end?: number; + /** Specifies a start width of a range container. */ + start?: number; + } + export interface LinearScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface LinearScale extends BaseScale { + /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ + horizontalOrientation?: string; + label?: LinearScaleLabel; + /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ + verticalOrientation?: string; + } + export interface dxLinearGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ + geometry?: { + /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ + orientation?: string; + }; + /** Specifies gauge range container options. */ + rangeContainer?: LinearRangeContainer; + scale?: LinearScale; + } + /** A widget that represents a gauge with a linear scale. */ + export class dxLinearGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxLinearGaugeOptions); + constructor(element: Element, options?: dxLinearGaugeOptions); + } + export interface CircularRangeContainer extends BaseRangeContainer { + /** Specifies the orientation of the range container in the dxCircularGauge widget. */ + orientation?: string; + /** Specifies the range container's width in pixels. */ + width?: number; + } + export interface CircularScaleLabel extends BaseScaleLabel { + /** Specifies the spacing between scale labels and ticks. */ + indentFromTick?: number; + } + export interface CircularScale extends BaseScale { + label?: CircularScaleLabel; + /** Specifies the orientation of scale ticks. */ + orientation?: string; + } + export interface dxCircularGaugeOptions extends BaseGaugeOptions { + /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ + geometry?: { + /** Specifies the end angle of the circular gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the circular gauge's arc. */ + startAngle?: number; + }; + /** Specifies gauge range container options. */ + rangeContainer?: CircularRangeContainer; + scale?: CircularScale; + } + /** A widget that represents a gauge with a circular scale. */ + export class dxCircularGauge extends dxBaseGauge { + constructor(element: JQuery, options?: dxCircularGaugeOptions); + constructor(element: Element, options?: dxCircularGaugeOptions); + } + export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { + /** Specifies a color for the remaining segment of the bar's track. */ + backgroundColor?: string; + /** Specifies a distance between bars in pixels. */ + barSpacing?: number; + /** Specifies a base value for bars. */ + baseValue?: number; + /** Specifies an end value for the gauge's invisible scale. */ + endValue?: number; + /** Defines the shape of the gauge's arc. */ + geometry?: { + /** Specifies the end angle of the bar gauge's arc. */ + endAngle?: number; + /** Specifies the start angle of the bar gauge's arc. */ + startAngle?: number; + }; + /** Specifies the options of the labels that accompany gauge bars. */ + label?: { + /** Specifies a color for the label connector text. */ + connectorColor?: string; + /** Specifies the width of the label connector in pixels. */ + connectorWidth?: number; + /** Specifies a callback function that returns a text for labels. */ + customizeText?: (barValue: { value: number; valueText: string }) => string; + /** Specifies font options for bar labels. */ + font?: viz.core.Font; + /** Specifies a format for bar labels. */ + format?: string; + /** Specifies the distance between the upper bar and bar labels in pixels. */ + indent?: number; + /** Specifies a precision for the formatted value displayed by labels. */ + precision?: number; + /** Specifies whether bar labels appear on a gauge or not. */ + visible?: boolean; + }; + /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ + palette?: string; + /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ + relativeInnerRadius?: number; + /** Specifies a start value for the gauge's invisible scale. */ + startValue?: number; + /** Specifies the array of values to be indicated on a bar gauge. */ + values?: Array; + } + /** A circular bar widget. */ + export class dxBarGauge extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxBarGaugeOptions); + constructor(element: Element, options?: dxBarGaugeOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws the widget. */ + render(): void; + /** Returns an array of gauge values. */ + values(): Array; + /** Updates the values displayed by a gauge. */ + values(values: Array): void; + } +} +interface JQuery { + dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; + dxLinearGauge(methodName: string, ...params: any[]): any; + dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; + dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; + dxCircularGauge(methodName: string, ...params: any[]): any; + dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; + dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; + dxBarGauge(methodName: string, ...params: any[]): any; + dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; +} +declare module DevExpress.viz.rangeSelector { + export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { + /** Specifies the options for the range selector's background. */ + background?: { + /** Specifies the background color for the dxRangeSelector. */ + color?: string; + /** Specifies image options. */ + image?: { + /** Specifies a location for the image in the background of a range selector. */ + location?: string; + /** Specifies the image's URL. */ + url?: string; + }; + /** Indicates whether or not the background (background color and/or image) is visible. */ + visible?: boolean; + }; + /** Specifies a title for the range selector. */ + title?: viz.core.Title; + /** Specifies the dxRangeSelector's behavior options. */ + behavior?: { + /** Indicates whether or not you can swap sliders. */ + allowSlidersSwap?: boolean; + /** Indicates whether or not animation is enabled. */ + animationEnabled?: boolean; + /** Specifies when to call the onSelectedRangeChanged function. */ + callSelectedRangeChanged?: string; + /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ + manualRangeSelectionEnabled?: boolean; + /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ + moveSelectedRangeByClick?: boolean; + /** Indicates whether to snap a slider to ticks. */ + snapToTicks?: boolean; + }; + /** Specifies the options required to display a chart as the range selector's background. */ + chart?: { + /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ + bottomIndent?: number; + /** An object defining the common configuration options for the chart’s series. */ + commonSeriesSettings?: viz.charts.CommonSeriesSettings; + /** An object providing options for managing data from a data source. */ + dataPrepareSettings?: { + /** Specifies whether or not to validate values from a data source. */ + checkTypeForAllData?: boolean; + /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ + convertToAxisDataType?: boolean; + /** Specifies how to sort series points. */ + sortingMethod?: any; + }; + /** Specifies whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ + equalBarWidth?: boolean; + /** Specifies a common bar width as a percentage from 0 to 1. */ + barWidth?: number; + /** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ + palette?: any; + /** An object defining the chart’s series. */ + series?: Array; + /** Defines options for the series template. */ + seriesTemplate?: viz.charts.SeriesTemplate; + /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ + topIndent?: number; + /** Specifies whether or not to filter the series points depending on their quantity. */ + useAggregation?: boolean; + /** Specifies options for the chart's value axis. */ + valueAxis?: { + /** Indicates whether or not the chart's value axis must be inverted. */ + inverted?: boolean; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ + logarithmBase?: number; + /** Specifies the maximum value of the chart's value axis. */ + max?: number; + /** Specifies the minimum value of the chart's value axis. */ + min?: number; + /** Specifies the type of the value axis. */ + type?: string; + /** Specifies the desired type of axis values. */ + valueType?: string; + }; + }; + /** Specifies the color of the parent page element. */ + containerBackgroundColor?: string; + /** Specifies a data source for the scale values and for the chart at the background. */ + dataSource?: any; + /** Specifies the data source field that provides data for the scale. */ + dataSourceField?: string; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ + margin?: viz.core.Margins; + /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ + redrawOnResize?: boolean; + /** Specifies options of the range selector's scale. */ + scale?: { + /** Specifies the scale's end value. */ + endValue?: any; + /** Specifies common options for scale labels. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale labels. */ + customizeText?: (scaleValue: { value: any; valueText: string; }) => string; + /** Specifies font options for the text displayed in the range selector's scale labels. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in scale labels. */ + format?: string; + /** Specifies a precision for the formatted value displayed in the scale labels. */ + precision?: number; + /** Specifies a spacing between scale labels and the background bottom edge. */ + topIndent?: number; + /** Specifies whether or not the scale's labels are visible. */ + visible?: boolean; + }; + /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ + logarithmBase?: number; + /** + * Specifies an interval between major ticks. + * @deprecated ..\tickInterval\tickInterval.md + */ + majorTickInterval?: any; + tickInterval?: any; + /** Specifies options for the date-time scale's markers. */ + marker?: { + /** Defines the options that can be set for the text that is displayed by the scale markers. */ + label?: { + /** Specifies a callback function that returns the text to be displayed in scale markers. */ + customizeText?: (markerValue: { value: any; valueText: string }) => string; + /** Specifies a format for the text displayed in scale markers. */ + format?: string; + }; + /** Specifies the height of the marker's separator. */ + separatorHeight?: number; + /** Specifies the space between the marker label and the marker separator. */ + textLeftIndent?: number; + /** Specifies the space between the marker's label and the top edge of the marker's separator. */ + textTopIndent?: number; + /** Specified the indent between the marker and the scale lables. */ + topIndent?: number; + /** Indicates whether scale markers are visible. */ + visible?: boolean; + }; + /** Specifies the maximum range that can be selected. */ + maxRange?: any; + /** Specifies the number of minor ticks between neighboring major ticks. */ + minorTickCount?: number; + /** Specifies an interval between minor ticks. */ + minorTickInterval?: any; + /** Specifies the minimum range that can be selected. */ + minRange?: any; + /** Specifies the height of the space reserved for the scale in pixels. */ + placeholderHeight?: number; + /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ + setTicksAtUnitBeginning?: boolean; + /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ + showCustomBoundaryTicks?: boolean; + /** + * Indicates whether or not to show minor ticks on the scale. + * @deprecated minorTick\visible.md + */ + showMinorTicks?: boolean; + /** Specifies the scale's start value. */ + startValue?: any; + /** Specifies options defining the appearance of scale ticks. */ + tick?: { + /** Specifies the color of scale ticks (both major and minor ticks). */ + color?: string; + /** Specifies the opacity of scale ticks (both major and minor ticks). */ + opacity?: number; + /** Specifies the width of the scale's ticks (both major and minor ticks). */ + width?: number; + }; + minorTick?: { + color?: string; + opacity?: number; + width?: number; + visible?: boolean; + }; + /** Specifies the type of the scale. */ + type?: string; + /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ + useTicksAutoArrangement?: boolean; + /** Specifies the type of values on the scale. */ + valueType?: string; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; + }; + /** Specifies the range to be selected when displaying the dxRangeSelector. */ + selectedRange?: { + /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + startValue?: any; + /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ + endValue?: any; + }; + /** Specifies the color of the selected range. */ + selectedRangeColor?: string; + /** Range selector's indent options. */ + indent?: { + /** Specifies range selector's left indent. */ + left?: number; + /** Specifies range selector's right indent. */ + right?: number; + }; + /** A handler for the selectedRangeChanged event. */ + onSelectedRangeChanged?: (e: { + startValue: any; + endValue: any; + component: dxRangeSelector; + element: Element; + }) => void; + /** Specifies range selector shutter options. */ + shutter?: { + /** Specifies shutter color. */ + color?: string; + /** Specifies the opacity of the color of shutters. */ + opacity?: number; + }; + /** Specifies in pixels the size of the dxRangeSelector widget. */ + size?: viz.core.Size; + /** Specifies the appearance of the range selector's slider handles. */ + sliderHandle?: { + /** Specifies the color of the slider handles. */ + color?: string; + /** Specifies the opacity of the slider handles. */ + opacity?: number; + /** Specifies the width of the slider handles. */ + width?: number; + }; + /** Defines the options of the range selector slider markers. */ + sliderMarker?: { + /** Specifies the color of the slider markers. */ + color?: string; + /** Specifies a callback function that returns the text to be displayed by slider markers. */ + customizeText?: (scaleValue: { value: any; valueText: any; }) => string; + /** Specifies font options for the text displayed by the range selector slider markers. */ + font?: viz.core.Font; + /** Specifies a format for the text displayed in slider markers. */ + format?: string; + /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ + invalidRangeColor?: string; + /** + * Specifies the empty space between the marker's border and the marker’s text. + * @deprecated Use the 'paddingTopBottom' and 'paddingLeftRight' options instead + */ + padding?: number; + /** Specifies the empty space between the marker's top and bottom borders and the marker's text. */ + paddingTopBottom?: number; + /** Specifies the empty space between the marker's left and right borders and the marker's text. */ + paddingLeftRight?: number; + /** Specifies the placeholder height of the slider marker. */ + placeholderHeight?: number; + /** + * Specifies in pixels the height and width of the space reserved for the range selector slider markers. + * @deprecated Use the 'placeholderHeight' and 'indent' options instead + */ + placeholderSize?: { + /** Specifies the height of the placeholder for the left and right slider markers. */ + height?: number; + /** Specifies the width of the placeholder for the left and right slider markers. */ + width?: { + /** Specifies the width of the left slider marker's placeholder. */ + left?: number; + /** Specifies the width of the right slider marker's placeholder. */ + right?: number; + }; + }; + /** Specifies a precision for the formatted value displayed in slider markers. */ + precision?: number; + /** Indicates whether or not the slider markers are visible. */ + visible?: boolean; + }; + } + /** A widget that allows end users to select a range of values on a scale. */ + export class dxRangeSelector extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxRangeSelectorOptions); + constructor(element: Element, options?: dxRangeSelectorOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(skipChartAnimation?: boolean): void; + /** Returns the currently selected range. */ + getSelectedRange(): { startValue: any; endValue: any; }; + /** Sets a specified range. */ + setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; + } +} +interface JQuery { + dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; + dxRangeSelector(methodName: string, ...params: any[]): any; + dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; +} +declare module DevExpress.viz.map { + /** This section describes the fields and methods that can be used in code to manipulate the Layer object. */ + export interface MapLayer { + /** The name of the layer. */ + name: string; + /** The layer index in the layers array. */ + index: number; + /** The layer type. Can be "area", "line" or "marker". */ + type: string; + /** The type of the layer elements. */ + elementType: string; + /** Gets all layer elements. */ + getElements(): Array; + /** Deselects all layer elements. */ + clearSelection(): void; + } + /** This section describes the fields and methods that can be used in code to manipulate the Layer Element object. */ + export interface MapLayerElement { + /** The parent layer of the layer element. */ + layer: MapLayer; + /** Gets the layer element coordinates. */ + coordinates(): Object; + /** Sets the value of an attribute. */ + attribute(name: string, value: any): void; + /** Gets the value of an attribute. */ + attribute(name: string): any; + /** Gets the selection state of the layer element. */ + selected(): boolean; + /** Sets the selection state of the layer element. */ + selected(state: boolean): void; + /** Applies the layer element settings and updates element appearance. */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Area object. + * @deprecated Use the "Layer Element" instead + */ + export interface Area { + /** + * Contains the element type. + * @deprecated ..\..\Layer\2 Fields\type.md + */ + type: string; + /** + * Return the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ + attribute(name: string): any; + /** + * Provides information about the selection state of an area. + * @deprecated Use the "selected()" method of the Layer Element + */ + selected(): boolean; + /** + * Sets a new selection state for an area. + * @deprecated Use the "selected(state)" method of the Layer Element + */ + selected(state: boolean): void; + /** + * Applies the area settings specified as a parameter and updates the area appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ + applySettings(settings: any): void; + } + /** + * This section describes the fields and methods that can be used in code to manipulate the Markers object. + * @deprecated Use the "Layer Element" instead + */ + export interface Marker { + /** + * Contains the descriptive text accompanying the map marker. + * @deprecated Get the text with the "attribute" method (using the "layers.label.dataField" value) + */ + text: string; + /** + * Contains the type of the element. + * @deprecated ..\..\Layer\2 Fields\type.md + */ + type: string; + /** + * Contains the URL of an image map marker. + * @deprecated Get the url with the "attribute" method (using the "layers.dataField" value) + */ + url: string; + /** + * Contains the value of a bubble map marker. + * @deprecated Get the value with the "attribute" method (using the "layers.dataField" value) + */ + value: number; + /** + * Contains the values of a pie map marker. + * @deprecated Get the values with the "attribute" method (using the "layers.dataField" value) + */ + values: Array; + /** + * Returns the value of an attribute. + * @deprecated ..\..\Layer Element\3 Methods\attribute(name_value).md + */ + attribute(name: string): any; + /** + * Returns the coordinates of a specific marker. + * @deprecated ..\..\Layer Element\3 Methods\coordinates().md + */ + coordinates(): Array; + /** + * Provides information about the selection state of a marker. + * @deprecated Use the "selected()" method of the Layer Element + */ + selected(): boolean; + /** + * Sets a new selection state for a marker. + * @deprecated Use the "selected(state)" method of the Layer Element + */ + selected(state: boolean): void; + /** + * Applies the marker settings specified as a parameter and updates marker appearance. + * @deprecated ..\..\Layer Element\3 Methods\applySettings(settings).md + */ + applySettings(settings: any): void; + } + export interface MapLayerSettings { + /** Specifies the layer name. */ + name?: string; + /** Specifies layer type. */ + type?: string; + /** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */ + elementType?: string; + /** Specifies a data source for the layer. */ + data?: any; + /** Specifies the width of the layer elements border in pixels. */ + borderWidth?: number; + /** Specifies a color for the border of the layer elements. */ + borderColor?: string; + /** Specifies a color for layer elements. */ + color?: string; + /** Specifies a color for the border of the layer element when it is hovered over. */ + hoveredBorderColor?: string; + /** Specifies the pixel-measured width for the border of the layer element when it is hovered over. */ + hoveredBorderWidth?: number; + /** Specifies a color for a layer element when it is hovered over. */ + hoveredColor?: string; + /** Specifies a pixel-measured width for the border of the layer element when it is selected. */ + selectedBorderWidth?: number; + /** Specifies a color for the border of the layer element when it is selected. */ + selectedBorderColor?: string; + /** Specifies a color for the layer element when it is selected. */ + selectedColor?: string; + /** Specifies the layer opacity (from 0 to 1). */ + opacity?: number; + /** Specifies the size of markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "dot", "pie" or "image". */ + size?: number; + /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if the layer type is "marker". */ + minSize?: number; + /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if the layer type is "marker". */ + maxSize?: number; + /** Specifies whether or not to change the appearance of a layer element when it is hovered over. */ + hoverEnabled?: boolean; + /** Specifies whether single or multiple map elements can be selected on a vector map. */ + selectionMode?: string; + /** Specifies the name of the palette or a custom range of colors to be used for coloring a layer. */ + palette?: any; + /** Specifies the number of colors in a palette. */ + paletteSize?: number; + /** Allows you to paint layer elements with similar attributes in the same color. */ + colorGroups?: Array; + /** Specifies the field that provides data to be used for coloring of layer elements. */ + colorGroupingField?: string; + /** Allows you to display bubbles with similar attributes in the same size. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroups?: Array; + /** Specifies the field that provides data to be used for sizing bubble markers. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble". */ + sizeGroupingField?: string; + /** Specifies the name of the attribute containing marker data. Setting this option makes sense only if the layer type is "marker" and the elementType is "bubble", "pie" or "image". */ + dataField?: string; + /** Specifies the function that customizes each layer element individually. */ + customize?: (eleemnts: Array) => void; + /** Specifies marker label options. */ + label?: { + /** The name of the data attribute containing marker texts. */ + dataField?: string; + /** Enables marker labels. */ + enabled?: boolean; + /** Specifies font options for marker labels. */ + font?: viz.core.Font; + }; + } + export interface AreaSettings { + /** + * Specifies the width of the area border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for the area border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies a color for an area. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each area individually. + * @deprecated ..\layers\customize.md + */ + customize?: (areaInfo: Area) => AreaSettings; + /** + * Specifies a color for the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for an area when this area is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of an area when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Configures area labels. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Specifies the data field that provides data for area labels. + * @deprecated ..\..\layers\label\dataField.md + */ + dataField?: string; + /** + * Enables area labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for area labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the name of the palette or a custom range of colors to be used for coloring a map. + * @deprecated ..\layers\palette.md + */ + palette?: any; + /** + * Specifies the number of colors in a palette. + * @deprecated ..\layers\paletteSize.md + */ + paletteSize?: number; + /** + * Allows you to paint areas with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring areas. + * @deprecated ..\layers\colorGroupingField.md + */ + colorGroupingField?: string; + /** + * Specifies a color for the area border when the area is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for an area when this area is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies the pixel-measured width of the area border when the area is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies whether single or multiple areas can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + } + export interface MarkerSettings { + /** + * Specifies a color for the marker border. + * @deprecated ..\layers\borderColor.md + */ + borderColor?: string; + /** + * Specifies the width of the marker border in pixels. + * @deprecated ..\layers\borderWidth.md + */ + borderWidth?: number; + /** + * Specifies a color for a marker of the dot or bubble type. + * @deprecated ..\layers\color.md + */ + color?: string; + /** + * Specifies the function that customizes each marker individually. + * @deprecated ..\layers\customize.md + */ + customize?: (markerInfo: Marker) => MarkerSettings; + /** + * Specifies the pixel-measured width of the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderWidth.md + */ + hoveredBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is hovered over. + * @deprecated ..\layers\hoveredBorderColor.md + */ + hoveredBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is hovered over. + * @deprecated ..\layers\hoveredColor.md + */ + hoveredColor?: string; + /** + * Specifies whether or not to change the appearance of a marker when it is hovered over. + * @deprecated ..\layers\hoverEnabled.md + */ + hoverEnabled?: boolean; + /** + * Specifies marker label options. + * @deprecated ..\..\layers\label\label.md + */ + label?: { + /** + * Enables marker labels. + * @deprecated ..\..\layers\label\enabled.md + */ + enabled?: boolean; + /** + * Specifies font options for marker labels. + * @deprecated ..\..\..\layers\label\font\font.md + */ + font?: viz.core.Font; + }; + /** + * Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\maxSize.md + */ + maxSize?: number; + /** + * Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\minSize.md + */ + minSize?: number; + /** + * Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. + * @deprecated ..\layers\opacity.md + */ + opacity?: number; + /** + * Specifies the pixel-measured width of the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderWidth.md + */ + selectedBorderWidth?: number; + /** + * Specifies a color for the marker border when the marker is selected. + * @deprecated ..\layers\selectedBorderColor.md + */ + selectedBorderColor?: string; + /** + * Specifies a color for a marker of the dot or bubble type when this marker is selected. + * @deprecated ..\layers\selectedColor.md + */ + selectedColor?: string; + /** + * Specifies whether a single or multiple markers can be selected on a vector map. + * @deprecated ..\layers\selectionMode.md + */ + selectionMode?: string; + /** + * Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. + * @deprecated ..\layers\size.md + */ + size?: number; + /** + * Specifies the type of markers to be used on the map. + * @deprecated ..\layers\elementType.md + */ + type?: string; + /** + * Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. + * @deprecated ..\layers\palette.md + */ + palette?: any; + /** + * Allows you to paint markers with similar attributes in the same color. + * @deprecated ..\layers\colorGroups.md + */ + colorGroups?: Array; + /** + * Specifies the field that provides data to be used for coloring markers. + * @deprecated ..\layers\colorGroupingField.md + */ + colorGroupingField?: string; + /** + * Allows you to display bubbles with similar attributes in the same size. + * @deprecated ..\layers\sizeGroups.md + */ + sizeGroups?: Array; + /** + * Specifies the field that provides data to be used for sizing bubble markers. + * @deprecated ..\layers\sizeGroupingField.md + */ + sizeGroupingField?: string; + } + export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { + /** + * An object specifying options for the map areas. + * @deprecated Use the 'layers' option instead + */ + areaSettings?: AreaSettings; + /** Specifies the options for the map background. */ + background?: { + /** Specifies a color for the background border. */ + borderColor?: string; + /** Specifies a color for the background. */ + color?: string; + }; + /** Specifies options for dxVectorMap widget layers. */ + layers?: Array; + /** Specifies the map projection. */ + projection?: Object; + /** Specifies the positioning of a map in geographical coordinates. */ + bounds?: Array; + /** Specifies the options of the control bar. */ + controlBar?: { + /** Specifies a color for the outline of the control bar elements. */ + borderColor?: string; + /** Specifies a color for the inner area of the control bar elements. */ + color?: string; + /** Specifies whether or not to display the control bar. */ + enabled?: boolean; + /** Specifies the margin of the control bar in pixels. */ + margin?: number; + /** Specifies the position of the control bar. */ + horizontalAlignment?: string; + /** Specifies the position of the control bar. */ + verticalAlignment?: string; + /** Specifies the opacity of the Control_Bar. */ + opacity?: number; + }; + /** Specifies the appearance of the loading indicator. */ + loadingIndicator?: viz.core.LoadingIndicator; + /** + * Specifies a data source for the map area. + * @deprecated Use the 'layers.data' option instead + */ + mapData?: any; + /** + * Specifies a data source for the map markers. + * @deprecated Use the 'layers.data' option instead + */ + markers?: any; + /** + * An object specifying options for the map markers. + * @deprecated Use the 'layers' option instead + */ + markerSettings?: MarkerSettings; + /** Specifies the size of the dxVectorMap widget. */ + size?: viz.core.Size; + /** Specifies a title for the vector map. */ + title?: viz.core.Title; + /** Specifies tooltip options. */ + tooltip?: viz.core.Tooltip; + /** Configures map legends. */ + legends?: Array; + /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ + wheelEnabled?: boolean; + /** Specifies whether the map should respond to touch gestures. */ + touchEnabled?: boolean; + /** Disables the zooming capability. */ + zoomingEnabled?: boolean; + /** Specifies the geographical coordinates of the center for a map. */ + center?: Array; + /** A handler for the centerChanged event. */ + onCenterChanged?: (e: { + center: Array; + component: dxVectorMap; + element: Element; + }) => void; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: dxVectorMap; + element: Element; + target: {}; + }) => void; + /** Specifies a number that is used to zoom a map initially. */ + zoomFactor?: number; + /** Specifies a map's maximum zoom factor. */ + maxZoomFactor?: number; + /** A handler for the zoomFactorChanged event. */ + onZoomFactorChanged?: (e: { + component: dxVectorMap; + element: Element; + zoomFactor: number; + }) => void; + /** A handler for the click event. */ + onClick?: any; + /** A handler for the selectionChanged event. */ + onSelectionChanged?: (e: { + component: dxVectorMap; + element: Element; + target: MapLayerElement; + }) => void; + /** + * A handler for the areaClick event. + * @deprecated Use the 'onClick' option instead + */ + onAreaClick?: any; + /** + * A handler for the areaSelectionChanged event. + * @deprecated Use the 'onSelectionChanged' option instead + */ + onAreaSelectionChanged?: (e: { + target: Area; + component: dxVectorMap; + element: Element; + }) => void; + /** + * A handler for the markerClick event. + * @deprecated Use the 'onClick' option instead + */ + onMarkerClick?: any; + /** + * A handler for the markerSelectionChanged event. + * @deprecated Use the 'onSelecitonChanged' option instead + */ + onMarkerSelectionChanged?: (e: { + target: Marker; + component: dxVectorMap; + element: Element; + }) => void; + /** Disables the panning capability. */ + panningEnabled?: boolean; + } + export interface Legend extends viz.core.BaseLegend { + /** Specifies the color of item markers in the legend. The specified color applied only when the legend uses 'size' source. */ + markerColor?: string; + /** Specifies text for legend items. */ + customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; + /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ + customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; + /** Specifies the source of data for the legend. */ + source?: { + /** Specifies a layer to which the legend belongs. */ + layer?: string; + /** Specifies the type of the legend grouping. */ + grouping?: string; + } + } + /** A vector map widget. */ + export class dxVectorMap extends viz.core.BaseWidget { + constructor(element: JQuery, options?: dxVectorMapOptions); + constructor(element: Element, options?: dxVectorMapOptions); + /** Displays the loading indicator. */ + showLoadingIndicator(): void; + /** Conceals the loading indicator. */ + hideLoadingIndicator(): void; + /** Redraws a widget. */ + render(): void; + /** Gets the current coordinates of the map center. */ + center(): Array; + /** Sets the coordinates of the map center. */ + center(centerCoordinates: Array): void; + /** + * Deselects all the selected areas on a map. The areas are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ + clearAreaSelection(): void; + /** + * Deselects all the selected markers on a map. The markers are displayed in their initial style after. + * @deprecated Use the 'clearSelection' method on a layer instead + */ + clearMarkerSelection(): void; + /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ + clearSelection(): void; + /** Converts client area coordinates into map coordinates. */ + convertCoordinates(x: number, y: number): Array; + /** Gets all map layers. */ + getLayers(): Array; + /** Gets the layer by its index. */ + getLayerByIndex(index: number): MapLayer; + /** Gets the layer by its name. */ + getLayerByName(name: string): MapLayer; + /** + * Returns an array with all the map areas. + * @deprecated Use the 'getElements' method on a layer instead + */ + getAreas(): Array; + /** + * Returns an array with all the map markers. + * @deprecated Use the 'getElements' method on a layer instead + */ + getMarkers(): Array; + /** Gets the current coordinates of the map viewport. */ + viewport(): Array; + /** Sets the coordinates of the map viewport. */ + viewport(viewportCoordinates: Array): void; + /** Gets the current value of the map zoom factor. */ + zoomFactor(): number; + /** Sets the value of the map zoom factor. */ + zoomFactor(zoomFactor: number): void; + } + export var projection: ProjectionCreator; + export interface ProjectionCreator { + /** Creates a new projection. */ + (data: { + to?: (coordinates: Array) => Array; + from?: (coordinates: Array) => Array; + aspectRatio?: number; + }): Object; + /** Gets the default or custom projection from the projection storage. */ + get(name: string): Object; + /** Adds a new projection to the internal projections storage. */ + add(name: string, projection: Object): void; + } +} +interface JQuery { + dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; + dxVectorMap(methodName: string, ...params: any[]): any; + dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; +} +declare module DevExpress.viz.sparklines { + export interface SparklineTooltip extends viz.core.Tooltip { + /** + * Specifies how a tooltip is horizontally aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + horizontalAlignment?: string; + /** + * Specifies how a tooltip is vertically aligned relative to the graph. + * @deprecated Tooltip alignment is no more available. + */ + verticalAlignment?: string; + } + export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { + /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ + margin?: viz.core.Margins; + /** Specifies the size of the widget. */ + size?: viz.core.Size; + /** Specifies tooltip options. */ + tooltip?: SparklineTooltip; + /** A handler for the tooltipShown event. */ + onTooltipShown?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + /** A handler for the tooltipHidden event. */ + onTooltipHidden?: (e: { + component: BaseSparkline; + element: Element; + }) => void; + } + /** Overridden by descriptions for particular widgets. */ + export class BaseSparkline extends viz.core.BaseWidget { + /** Redraws a widget. */ + render(): void; + } + export interface dxBulletOptions extends BaseSparkline { + /** Specifies a color for the bullet bar. */ + color?: string; + /** Specifies an end value for the invisible scale. */ + endScaleValue?: number; + /** Specifies whether or not to show the target line. */ + showTarget?: boolean; + /** Specifies whether or not to show the line indicating zero on the invisible scale. */ + showZeroLevel?: boolean; + /** Specifies a start value for the invisible scale. */ + startScaleValue?: number; + /** Specifies the value indicated by the target line. */ + target?: number; + /** Specifies a color for both the target and zero level lines. */ + targetColor?: string; + /** Specifies the width of the target line. */ + targetWidth?: number; + /** Specifies the primary value indicated by the bullet bar. */ + value?: number; + } + /** A bullet graph widget. */ + export class dxBullet extends BaseSparkline { + constructor(element: JQuery, options?: dxBulletOptions); + constructor(element: Element, options?: dxBulletOptions); + } + export interface dxSparklineOptions extends BaseSparklineOptions { + /** Specifies the data source field that provides arguments for a sparkline. */ + argumentField?: string; + /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ + barNegativeColor?: string; + /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ + barPositiveColor?: string; + /** Specifies a data source for the sparkline. */ + dataSource?: Array; + /** Sets a color for the boundary of both the first and last points on a sparkline. */ + firstLastColor?: string; + /** Specifies whether a sparkline ignores null data points or not. */ + ignoreEmptyPoints?: boolean; + /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineColor?: string; + /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ + lineWidth?: number; + /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ + lossColor?: string; + /** Sets a color for the boundary of the maximum point on a sparkline. */ + maxColor?: string; + /** Sets a color for the boundary of the minimum point on a sparkline. */ + minColor?: string; + /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointColor?: string; + /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ + pointSize?: number; + /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ + pointSymbol?: string; + /** Specifies whether or not to indicate both the first and last values on a sparkline. */ + showFirstLast?: boolean; + /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ + showMinMax?: boolean; + /** Determines the type of a sparkline. */ + type?: string; + /** Specifies the data source field that provides values for a sparkline. */ + valueField?: string; + /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ + winColor?: string; + /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ + winlossThreshold?: number; + /** Specifies the minimum value of the sparkline value axis. */ + minValue?: number; + /** Specifies the maximum value of the sparkline's value axis. */ + maxValue?: number; + } + /** A sparkline widget. */ + export class dxSparkline extends BaseSparkline { + constructor(element: JQuery, options?: dxSparklineOptions); + constructor(element: Element, options?: dxSparklineOptions); + } +} +interface JQuery { + dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; + dxBullet(methodName: string, ...params: any[]): any; + dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; + dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; + dxSparkline(methodName: string, ...params: any[]): any; + dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; +} \ No newline at end of file diff --git a/devextreme/devextreme.d.ts b/devextreme/devextreme.d.ts index e0777077c..1d31b7d4f 100644 --- a/devextreme/devextreme.d.ts +++ b/devextreme/devextreme.d.ts @@ -1,4 +1,4 @@ -// Type definitions for DevExtreme 15.2.4 +// Type definitions for DevExtreme 15.2.5 // Project: http://js.devexpress.com/ // Definitions by: DevExpress Inc. // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -35,7 +35,7 @@ declare module DevExpress { brokenRules: any[]; validators: IValidator[]; } - export interface GroupConfig extends EventsMixin { + export interface GroupConfig extends EventsMixin { group: any; validators: IValidator[]; validate(): ValidationGroupValidationResult; @@ -56,7 +56,7 @@ declare module DevExpress { /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ export function validateModel(model: Object): ValidationGroupValidationResult; /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ - export function registerModelForValidation(model: Object): void; + export function registerModelForValidation(model: Object) : void; } export var hardwareBackButton: JQueryCallback; /** Processes the hardware back button click. */ @@ -429,7 +429,10 @@ declare module DevExpress { } /** An object that provides access to a data web service or local data storage for collection container widgets. */ export class DataSource implements EventsMixin { - constructor(options?: DataSourceOptions); + constructor(url: string); + constructor(data: Array); + constructor(options: CustomStoreOptions); + constructor(options: DataSourceOptions); /** Disposes all resources associated with this DataSource. */ dispose(): void; /** Returns the current filter option value. */ @@ -452,6 +455,8 @@ declare module DevExpress { key(): any; /** Starts loading data. */ load(): JQueryPromise>; + /** Clears currently loaded DataSource items and calls the load() method. */ + reload(): JQueryPromise>; /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ loadOptions(): Object; /** Returns the current pageSize option value. */ @@ -612,6 +617,8 @@ declare module DevExpress { enumerate(): JQueryPromise; /** Filters the current Query data. */ filter(criteria: Array): Query; + /** Filters the current Query data. */ + filter(predicate: (item: any) => boolean): Query; /** Groups the current Query data. */ groupBy(getter: Object): Query; /** Applies the specified transformation to each item. */ @@ -1429,7 +1436,7 @@ declare module DevExpress.ui { clearButtonText?: string; /** Specifies whether or not the widget cleans the search box when the popup window is displayed. */ cleanSearchOnOpening?: boolean; - /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlaying window. */ + /** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ closeOnOutsideClick?: any; /** The text displayed on the Apply button. */ applyButtonText?: string; @@ -2053,7 +2060,7 @@ declare module DevExpress.ui { dataField?: string; /** Specifies the form item name. */ name?: string; - /** Specifie which editor widget is used to display and edit the form item value. */ + /** Specifies which editor widget is used to display and edit the form item value. */ editorType?: string; /** Specifies configuration options for the editor widget of the current form item. */ editorOptions?: Object; @@ -2133,6 +2140,7 @@ declare module DevExpress.ui { items?: Array; /** A Boolean value specifying whether to enable or disable form scrolling. */ scrollingEnabled?: boolean; + onContentReady?: Function; } /** A form widget used to display and edit values of object fields. */ export class dxForm extends Widget { @@ -2401,7 +2409,7 @@ declare module DevExpress.ui { scrollPosition(): number; } export interface dxSwitchOptions extends EditorOptions { - activeStateEnabled?: boolean; + activeStateEnabled?: boolean; /** Text displayed when the widget is in a disabled state. */ offText?: string; /** Text displayed when the widget is in an enabled state. */ @@ -2902,6 +2910,22 @@ declare module DevExpress.ui { horizontalScrollingEnabled?: boolean; /** Specifies whether a user can switch views using tabs or a drop-down menu. */ useDropDownViewSwitcher?: boolean; + /** Specifies the name of the data source item field that defines the start of the appointment. */ + startDateExpr?: string; + /** Specifies the name of the data source item field that defines the ending of the appointment. */ + endDateExpr?: string; + /** Specifies the name of the data source item field that holds the subject of the appointment. */ + textExpr?: string; + /** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */ + descriptionExpr?: string; + /** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */ + allDayExpr?: string; + /** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */ + recurrenceRuleExpr?: string; + /** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */ + recurrenceExceptionExpr?: string; + /** Specifies whether filtering is performed on the server or client side. */ + remoteFiltering?: boolean; } /** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */ export class dxScheduler extends Widget { @@ -2961,7 +2985,10 @@ declare module DevExpress.ui { dataStructure?: string; /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ expandAllEnabled?: boolean; - /** Specifies whether or not a check box is displayed at each tree view item. */ + /** + * Specifies whether or not a check box is displayed at each tree view item. + * @deprecated Use the showCheckBoxesMode option instead. + */ showCheckBoxes?: boolean; /** Specifies the current check boxes display mode. */ showCheckBoxesMode?: string; @@ -2969,7 +2996,10 @@ declare module DevExpress.ui { selectNodesRecursive?: boolean; /** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */ expandNodesRecursive?: boolean; - /** Specifies whether the "Select All" check box is displayed over the tree view. */ + /** + * Specifies whether the "Select All" check box is displayed over the tree view. + * @deprecated Use the showCheckBoxesMode option instead. + */ selectAllEnabled?: boolean; /** Specifies the text displayed at the "Select All" check box. */ selectAllText?: string; @@ -3222,7 +3252,7 @@ declare module DevExpress.ui { }; /** Specifies column-level options for filtering using a column header filter. */ headerFilter?: { - /** Specifies the data source to be used for header filter. */ + /** Specifies the data source to be used for the header filter. */ dataSource?: any; /** Specifies how header filter values should be combined into groups. */ groupInterval?: any; @@ -3499,6 +3529,8 @@ declare module DevExpress.ui { }; /** Specifies whether or not grid rows must be shaded in a different way. */ rowAlternationEnabled?: boolean; + /** Specifies whether to enable two-way data binding. */ + twoWayBindingEnabled?: boolean; /** A handler for the rowClick event. */ onRowClick?: any; /** A handler for the rowPrepared event. */ @@ -3571,7 +3603,7 @@ declare module DevExpress.ui { texts?: { /** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */ exportTo?: string; - /** Specifies text for the Export button when this button exports to the XSLX format. */ + /** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */ exportToExcel?: string; /** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */ excelFormat?: string; @@ -3605,6 +3637,13 @@ declare module DevExpress.ui { format: string; cancel: boolean; }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; /** A handler for the exported event. */ onExported?: (e: Object) => void; /** A handler for the keyDown event. */ @@ -4001,6 +4040,13 @@ declare module DevExpress.ui { format: string; cancel: boolean; }) => void; + /** A handler for the fileSaving event. */ + onFileSaving?: (e: { + fileName: string; + format: string; + data: any; + cancel: boolean; + }) => void; /** A handler for the exported event. */ onExported?: (e: Object) => void; /** A configuration object specifying options related to state storing. */ @@ -4480,11 +4526,11 @@ declare module DevExpress.viz.core { font?: viz.core.Font; /** Specifies the widget title's horizontal position. */ horizontalAlignment?: string; - /** Specifies the widget title's position in the vertical direction. */ + /** Specifies the widget title's position in the vertical direction. */ verticalAlignment?: string; /** Specifies the distance between the title and surrounding widget elements in pixels. */ margin?: viz.core.Margins; - /** Specifies the height of the space reserved for the title. */ + /** Specifies the height of the space reserved for the title. */ placeholderSize?: number; /** Specifies text for the title. */ text?: string; @@ -4492,7 +4538,7 @@ declare module DevExpress.viz.core { subtitle?: { /** Specifies font options for the subtitle. */ font?: viz.core.Font; - /** Specifies text for the subtitle. */ + /** Specifies text for the subtitle. */ text?: string; } } @@ -4595,7 +4641,7 @@ declare module DevExpress.viz.core { /** Specifies whether or not the legend is visible on the map. */ visible?: boolean; } - export interface BaseWidgetOptions { + export interface BaseWidgetOptions extends DOMComponentOptions { /** A handler for the drawn event. */ onDrawn?: (e: { component: BaseWidget; @@ -4603,16 +4649,16 @@ declare module DevExpress.viz.core { }) => void; /** A handler for the incidentOccurred event. */ onIncidentOccurred?: ( - component: BaseWidget, - element: Element, - target: { - id: string; - type: string; - args: any; - text: string; - widget: string; - version: string; - } + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } ) => void; /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ pathModified?: boolean; @@ -5153,6 +5199,10 @@ declare module DevExpress.viz.charts { valueField?: string; } export interface CommonPieSeriesSettings extends CommonPieSeriesConfig { + /** + * Specifies the type of the pie chart series. + * @deprecated use the 'type' option instead + */ type?: string; } export interface PieSeriesConfig extends CommonPieSeriesConfig { @@ -5447,10 +5497,12 @@ declare module DevExpress.viz.charts { } export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { - /** Specifies a start angle for the argument axis in degrees. */ + /** Specifies the angle in arc degrees to which the argument axis should be rotated. The positive values rotate the axis clockwise. */ startAngle?: number; /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ firstPointOnStartAngle?: boolean; + /** Specifies the value to be used as the origin for the argument axis. */ + originValue?: number; /** Specifies the period of the argument values in the data source. */ period?: number; } @@ -5823,7 +5875,7 @@ declare module DevExpress.viz.charts { diameter?: number; /** Specifies the direction that the pie chart segments will occupy. */ segmentsDirection?: string; - /** Specifies the starting angle in arc degrees for the first segment in a pie chart. */ + /** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */ startAngle?: number; /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */ innerRadius?: number; @@ -6391,6 +6443,7 @@ declare module DevExpress.viz.rangeSelector { * @deprecated ..\tickInterval\tickInterval.md */ majorTickInterval?: any; + /** Specifies an interval between axis ticks. */ tickInterval?: any; /** Specifies options for the date-time scale's markers. */ marker?: { @@ -6442,10 +6495,15 @@ declare module DevExpress.viz.rangeSelector { /** Specifies the width of the scale's ticks (both major and minor ticks). */ width?: number; }; + /** Specifies options of the range selector's minor ticks. */ minorTick?: { + /** Specifies the color of the scale's minor ticks. */ color?: string; + /** Specifies the opacity of the scale's minor ticks. */ opacity?: number; + /** Specifies the width of the scale's minor ticks. */ width?: number; + /** Indicates whether scale minor ticks are visible or not. */ visible?: boolean; }; /** Specifies the type of the scale. */ @@ -6454,8 +6512,8 @@ declare module DevExpress.viz.rangeSelector { useTicksAutoArrangement?: boolean; /** Specifies the type of values on the scale. */ valueType?: string; - /** Specifies the order of arguments on a discrete scale. */ - categories?: Array; + /** Specifies the order of arguments on a discrete scale. */ + categories?: Array; }; /** Specifies the range to be selected when displaying the dxRangeSelector. */ selectedRange?: { @@ -6692,7 +6750,7 @@ declare module DevExpress.viz.map { elementType?: string; /** Specifies a data source for the layer. */ data?: any; - /** Specifies the width of the layer elements border in pixels. */ + /** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */ borderWidth?: number; /** Specifies a color for the border of the layer elements. */ borderColor?: string; @@ -6700,11 +6758,11 @@ declare module DevExpress.viz.map { color?: string; /** Specifies a color for the border of the layer element when it is hovered over. */ hoveredBorderColor?: string; - /** Specifies the pixel-measured width for the border of the layer element when it is hovered over. */ + /** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */ hoveredBorderWidth?: number; /** Specifies a color for a layer element when it is hovered over. */ hoveredColor?: string; - /** Specifies a pixel-measured width for the border of the layer element when it is selected. */ + /** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */ selectedBorderWidth?: number; /** Specifies a color for the border of the layer element when it is selected. */ selectedBorderColor?: string; @@ -7050,9 +7108,9 @@ declare module DevExpress.viz.map { center?: Array; /** A handler for the centerChanged event. */ onCenterChanged?: (e: { - center: Array; - component: dxVectorMap; - element: Element; + center: Array; + component: dxVectorMap; + element: Element; }) => void; /** A handler for the tooltipShown event. */ onTooltipShown?: (e: { From c6ab786741001862e0c80f610b4a2b12dbb763d1 Mon Sep 17 00:00:00 2001 From: romiem Date: Tue, 2 Feb 2016 16:22:59 +0000 Subject: [PATCH 070/113] Update angular.d.ts If splitting the config into seperate files, this constructor overload is useful. For example, you might need a RoutesConfig.ts file. #### Example ##### RoutesConfig.ts ``` export class RoutesConfig { static $inject = ['$stateProvider', '$urlRouterProvider', '$locationProvider']; constructor (private $stateProvider: angular.ui.IStateProvider, private $urlRouterProvider: angular.ui.IUrlRouterProvider, private $locationProvider: ng.ILocationProvider) { // Unmatched URLs, redirect to root $urlRouterProvider.otherwise('/block'); $stateProvider .state('home', { url: '/', template: '' }); $locationProvider.html5Mode(true); } } ``` ##### Main.ts ``` import {RoutesConfig} from './common/RoutesConfig'; angular.module('myApp', []) .config(RoutesConfig) ``` --- angularjs/angular.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index d1197dec1..4d5ed56d9 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -200,6 +200,7 @@ declare module angular { * @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration. */ config(inlineAnnotatedFunction: any[]): IModule; + config(object: Object): IModule; /** * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator. * From bf7bedd4f12efb58b8f72ef8420c92db9c795a93 Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Tue, 2 Feb 2016 10:14:40 -0800 Subject: [PATCH 071/113] Add typings for pure-render-decorator 0.2.0. --- pure-render-decorator/pure-render-decorator-tests.ts | 6 ++++++ .../pure-render-decorator-tests.ts.tscparams | 1 + pure-render-decorator/pure-render-decorator.d.ts | 9 +++++++++ 3 files changed, 16 insertions(+) create mode 100644 pure-render-decorator/pure-render-decorator-tests.ts create mode 100644 pure-render-decorator/pure-render-decorator-tests.ts.tscparams create mode 100644 pure-render-decorator/pure-render-decorator.d.ts diff --git a/pure-render-decorator/pure-render-decorator-tests.ts b/pure-render-decorator/pure-render-decorator-tests.ts new file mode 100644 index 000000000..e03a149e8 --- /dev/null +++ b/pure-render-decorator/pure-render-decorator-tests.ts @@ -0,0 +1,6 @@ +/// + +import PureRender from 'pure-render-decorator'; + +@PureRender +class TestClass {} diff --git a/pure-render-decorator/pure-render-decorator-tests.ts.tscparams b/pure-render-decorator/pure-render-decorator-tests.ts.tscparams new file mode 100644 index 000000000..105ac9ef6 --- /dev/null +++ b/pure-render-decorator/pure-render-decorator-tests.ts.tscparams @@ -0,0 +1 @@ +--target es5 --noImplicitAny --experimentalDecorators --module commonjs diff --git a/pure-render-decorator/pure-render-decorator.d.ts b/pure-render-decorator/pure-render-decorator.d.ts new file mode 100644 index 000000000..d8c22aad8 --- /dev/null +++ b/pure-render-decorator/pure-render-decorator.d.ts @@ -0,0 +1,9 @@ +// Type definitions for pure-render-decorator v0.2.0 +// Project: https://github.com/felixgirault/pure-render-decorator +// Definitions by: Sean Kelley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'pure-render-decorator' { + var PureRender: ClassDecorator; + export default PureRender; +} From 408129b4055668adf9fcb00b3efe1e6d38d43dd5 Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Tue, 2 Feb 2016 14:37:39 -0800 Subject: [PATCH 072/113] pure-render-decorator correction: it doesn't export a default, it IS the export. --- pure-render-decorator/pure-render-decorator-tests.ts | 2 +- pure-render-decorator/pure-render-decorator.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pure-render-decorator/pure-render-decorator-tests.ts b/pure-render-decorator/pure-render-decorator-tests.ts index e03a149e8..e509fe508 100644 --- a/pure-render-decorator/pure-render-decorator-tests.ts +++ b/pure-render-decorator/pure-render-decorator-tests.ts @@ -1,6 +1,6 @@ /// -import PureRender from 'pure-render-decorator'; +import * as PureRender from 'pure-render-decorator'; @PureRender class TestClass {} diff --git a/pure-render-decorator/pure-render-decorator.d.ts b/pure-render-decorator/pure-render-decorator.d.ts index d8c22aad8..d24e842b6 100644 --- a/pure-render-decorator/pure-render-decorator.d.ts +++ b/pure-render-decorator/pure-render-decorator.d.ts @@ -5,5 +5,5 @@ declare module 'pure-render-decorator' { var PureRender: ClassDecorator; - export default PureRender; + export = PureRender; } From 2ea30ab68d42a04f4efd7530b32284ece7af9f86 Mon Sep 17 00:00:00 2001 From: Long Zheng Date: Wed, 3 Feb 2016 12:04:06 +1100 Subject: [PATCH 073/113] Updated stripe.d.ts Stripe allows ```createToken``` at the card object --- stripe/stripe.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/stripe/stripe.d.ts b/stripe/stripe.d.ts index 27d60d961..2111fc036 100644 --- a/stripe/stripe.d.ts +++ b/stripe/stripe.d.ts @@ -62,6 +62,7 @@ interface StripeCardData { address_state?: string; address_zip?: string; address_country?: string; + createToken(data: StripeTokenData, responseHandler: (status: number, response: StripeTokenResponse) => void): void; } interface StripeBankAccount From 1c783c857474e629cda3c5a84a4f9c7a341dbd80 Mon Sep 17 00:00:00 2001 From: prespic Date: Wed, 3 Feb 2016 10:31:03 +0100 Subject: [PATCH 074/113] goToPage instead of scrollToPage Acording to documentation http://iscrolljs.com/#snap --- iscroll/iscroll-5.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iscroll/iscroll-5.d.ts b/iscroll/iscroll-5.d.ts index abd793027..8b7a80543 100644 --- a/iscroll/iscroll-5.d.ts +++ b/iscroll/iscroll-5.d.ts @@ -79,7 +79,7 @@ declare class IScroll { scrollTo(x: number, y: number, time?: number, relative?: boolean): void; scrollToElement(element: string, time?: number): void; scrollToElement(element: HTMLElement, time?: number): void; - scrollToPage(pageX: number, pageY: number, time?: number): void; + goToPage(pageX: number, pageY: number, time?: number): void; disable(): void; enable(): void; stop(): void; From 7109dbc7b680ce5fa4f6f96d394824c48e12ffa9 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 3 Feb 2016 11:27:51 +0000 Subject: [PATCH 075/113] Add constructor for Virtual DataType --- sequelize/sequelize.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sequelize/sequelize.d.ts b/sequelize/sequelize.d.ts index a7a085e20..5b913b184 100644 --- a/sequelize/sequelize.d.ts +++ b/sequelize/sequelize.d.ts @@ -1777,8 +1777,10 @@ declare module "sequelize" { interface DataTypeUUIDv1 extends DataTypeAbstract { } interface DataTypeUUIDv4 extends DataTypeAbstract { } - - interface DataTypeVirtual extends DataTypeAbstract { } + + interface DataTypeVirtual extends DataTypeAbstract { + new( subtype : DataTypeAbstract, requireAttributes? : Array ) : DataTypeVirtual; + } interface DataTypeEnum extends DataTypeAbstract { From d1777f15c4d7b1bec5253674e577d12d12a7717e Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 3 Feb 2016 11:45:16 +0000 Subject: [PATCH 076/113] Comment for VirtualDataType --- sequelize/sequelize.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sequelize/sequelize.d.ts b/sequelize/sequelize.d.ts index 5b913b184..ae1927ae2 100644 --- a/sequelize/sequelize.d.ts +++ b/sequelize/sequelize.d.ts @@ -1777,8 +1777,15 @@ declare module "sequelize" { interface DataTypeUUIDv1 extends DataTypeAbstract { } interface DataTypeUUIDv4 extends DataTypeAbstract { } - + interface DataTypeVirtual extends DataTypeAbstract { + + /** + * Virtual field + * + * Accepts subtype any of the DataTypes + * Array of required attributes that are available on the model + */ new( subtype : DataTypeAbstract, requireAttributes? : Array ) : DataTypeVirtual; } From b5dda320c03c6505c9884bb4b335c13427e12504 Mon Sep 17 00:00:00 2001 From: Amaury Bauzac Date: Wed, 3 Feb 2016 12:52:14 +0100 Subject: [PATCH 077/113] Wrapped interface into a module Changes due to a refused PR --- phantomcss/phantomcss-tests.ts | 3 +- phantomcss/phantomcss.d.ts | 163 ++++++++++++++++----------------- 2 files changed, 83 insertions(+), 83 deletions(-) diff --git a/phantomcss/phantomcss-tests.ts b/phantomcss/phantomcss-tests.ts index e3c066c6a..d555017ed 100644 --- a/phantomcss/phantomcss-tests.ts +++ b/phantomcss/phantomcss-tests.ts @@ -4,7 +4,7 @@ // phantomCSS 0.11.1 is based on resemblejs 1.2.1, phantomJS 1.9.2 , casperJS 1.1.0-DEV -var options: PhantomCSSOptions = { +var options: PhantomCSS.PhantomCSSOptions = { libraryRoot: './modules/PhantomCSS', screenshotRoot: './screenshots', @@ -60,6 +60,7 @@ var options: PhantomCSSOptions = { rebase: null//casper.cli.get("rebase") } +declare var phantomcss:PhantomCSS.PhantomCSS; phantomcss.turnOffAnimations(); phantomcss.init(options); diff --git a/phantomcss/phantomcss.d.ts b/phantomcss/phantomcss.d.ts index 3afd4b7fd..98c5c3732 100644 --- a/phantomcss/phantomcss.d.ts +++ b/phantomcss/phantomcss.d.ts @@ -5,88 +5,87 @@ /// /// - -interface PhantomCSS{ +declare module PhantomCSS { + interface PhantomCSS { + init(options: PhantomCSSOptions): void; + update(options: PhantomCSSOptions): void; - init(options:PhantomCSSOptions):void; - update( options:PhantomCSSOptions):void; - - /** - * Take a screenshot of the targeted HTML element - * FileName is required if addIteratorToImage option is set to false - */ - screenshot(target:string, fileName?:string ):void; + /** + * Take a screenshot of the targeted HTML element + * FileName is required if addIteratorToImage option is set to false + */ + screenshot(target: string, fileName?: string): void; - /** - * Take a screenshot of the targeted HTML element - * FileName is required if addIteratorToImage option is set to false - */ - screenshot(target:ClipRect, fileName?:string):void; - /** - * Take a screenshot of the targeted HTML element - * FileName is required if addIteratorToImage option is set to false - */ - screenshot( target:string, timeToWait:number, hideSelector:string, fileName?:string ):void; - - compareAll( exclude:string ):void; - compareAll( exclude:string, diffList:string[], include:string ):void; - compareMatched( match:string, exclude:string ):void; - compareMatched( match:RegExp, exclude:RegExp ):void; - /** - * Explicitly define what files you want to compare - */ - compareExplicit( list:string[] ):void; - /** - * Compare image diffs generated in this test run only - */ - compareSession( list?:any[] ):void; - compareFiles( baseFile:string, diffFiles:string ):PhantomCSSTest; - waitForTests( tests:PhantomCSSTest[] ):void; - done():void; - /** - * Turn off CSS transitions and jQuery animations - */ - turnOffAnimations():void; - getExitStatus():number; - /** - * Get a list of image diffs generated in this test run - */ - getCreatedDiffFiles():Array; -} + /** + * Take a screenshot of the targeted HTML element + * FileName is required if addIteratorToImage option is set to false + */ + screenshot(target: ClipRect, fileName?: string): void; + /** + * Take a screenshot of the targeted HTML element + * FileName is required if addIteratorToImage option is set to false + */ + screenshot(target: string, timeToWait: number, hideSelector: string, fileName?: string): void; -interface PhantomCSSTest{ - filename? : string; - error?: boolean; - fail?:boolean; - success?:boolean; - failFile?:string; - mismatch?:any; -} + compareAll(exclude: string): void; + compareAll(exclude: string, diffList: string[], include: string): void; + compareMatched(match: string, exclude: string): void; + compareMatched(match: RegExp, exclude: RegExp): void; + /** + * Explicitly define what files you want to compare + */ + compareExplicit(list: string[]): void; + /** + * Compare image diffs generated in this test run only + */ + compareSession(list?: any[]): void; + compareFiles(baseFile: string, diffFiles: string): PhantomCSSTest; + waitForTests(tests: PhantomCSSTest[]): void; + done(): void; + /** + * Turn off CSS transitions and jQuery animations + */ + turnOffAnimations(): void; + getExitStatus(): number; + /** + * Get a list of image diffs generated in this test run + */ + getCreatedDiffFiles(): Array; + } -interface PhantomCSSOptions{ + interface PhantomCSSTest { + filename?: string; + error?: boolean; + fail?: boolean; + success?: boolean; + failFile?: string; + mismatch?: any; + } + + interface PhantomCSSOptions { /** Rebase is useful when you want to create new baseline images without manually deleting the files casperjs demo/test.js --rebase */ - rebase?: any; + rebase?: any; /** A reference to a particular Casper instance. Required for SlimerJS. - */ - casper?: Casper; + */ + casper?: Casper; /** libraryRoot is relative to this file and must point to your phantomcss folder (not lib or node_modules). If you are using NPM, this will be './node_modules/phantomcss'. */ - libraryRoot?: string; - - screenshotRoot?:string; + libraryRoot?: string; + + screenshotRoot?: string; /** By default, failure images are put in the './failures' folder. If failedComparisonsRoot is set to false a separate folder will not be created but failure images can still be found alongside the original and new images. */ - failedComparisonsRoot?:string; + failedComparisonsRoot?: string; /** You might want to keep master/baseline images in a completely @@ -94,7 +93,7 @@ interface PhantomCSSOptions{ with version control systems. By default this resolves to the screenshotRoot folder. */ - comparisonResultRoot?: string; + comparisonResultRoot?: string; /** Don't add count number to images. If set to false (default), a filename is @@ -106,40 +105,40 @@ interface PhantomCSSOptions{ Remove results directory tree after run. Use in conjunction with failedComparisonsRoot to see failed comparisons. */ - cleanupComparisonImages?: boolean; + cleanupComparisonImages?: boolean; /** * Don't add label to generated failure image */ - addLabelToFailedImage?:boolean; + addLabelToFailedImage?: boolean; /** * Change the output screenshot filenames for your specific * integration */ - fileNameGetter?: (rootPath:string, fileName?:string) => string; + fileNameGetter?: (rootPath: string, fileName?: string) => string; /** Mismatch tolerance defaults to 0.05%. Increasing this value will decrease test coverage */ - mismatchTolerance?: number; - - onPass?: (test:PhantomCSSTest) => void; - onFail?: (test:PhantomCSSTest) => void; - onTimeout?: (test:PhantomCSSTest) => void; - onComplete?:( tests:PhantomCSSTest[], noOfFails:number, noOfErrors:number ) => void; + mismatchTolerance?: number; + + onPass?: (test: PhantomCSSTest) => void; + onFail?: (test: PhantomCSSTest) => void; + onTimeout?: (test: PhantomCSSTest) => void; + onComplete?: (tests: PhantomCSSTest[], noOfFails: number, noOfErrors: number) => void; /** Called when creating new baseline images */ - onNewImage?: (test:PhantomCSSTest) => void; + onNewImage?: (test: PhantomCSSTest) => void; - /** - Prefix the screenshot number to the filename, instead of suffixing it - */ - prefixCount?: boolean; - - hideElements?: string; - outputSettings?: Resemble.OutputSettings; -} + /** + Prefix the screenshot number to the filename, instead of suffixing it + */ + prefixCount?: boolean; -declare var phantomcss:PhantomCSS; \ No newline at end of file + hideElements?: string; + outputSettings?: Resemble.OutputSettings; + } + +} \ No newline at end of file From 72d95b38f008fed506c6cbf3af8a693bd7c3363a Mon Sep 17 00:00:00 2001 From: hinamiyagk Date: Wed, 3 Feb 2016 22:47:24 +0900 Subject: [PATCH 078/113] Add jsonObject parameter to callback and make callback required --- fs-extra/fs-extra-tests.ts | 8 ++++---- fs-extra/fs-extra.d.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 80655ab5b..32fc34d76 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -75,10 +75,10 @@ fs.outputJSON(file, data, errorCallback); fs.outputJsonSync(file, data); fs.outputJSONSync(file, data); -fs.readJson(file, errorCallback); -fs.readJson(file, openOpts, errorCallback); -fs.readJSON(file, errorCallback); -fs.readJSON(file, openOpts, errorCallback); +fs.readJson(file, (error: Error, jsonObject: any) => {}); +fs.readJson(file, openOpts, (error: Error, jsonObject: any) => {}); +fs.readJSON(file, (error: Error, jsonObject: any) => {}); +fs.readJSON(file, openOpts, (error: Error, jsonObject: any) => {}); fs.readJsonSync(file, openOpts); fs.readJSONSync(file, openOpts); diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts index e4f800185..b5cba7c08 100644 --- a/fs-extra/fs-extra.d.ts +++ b/fs-extra/fs-extra.d.ts @@ -65,10 +65,10 @@ declare module "fs-extra" { export function outputJsonSync(file: string, data: any): void; export function outputJSONSync(file: string, data: any): void; - export function readJson(file: string, callback?: (err: Error) => void): void; - export function readJson(file: string, options?: OpenOptions, callback?: (err: Error) => void): void; - export function readJSON(file: string, callback?: (err: Error) => void): void; - export function readJSON(file: string, options?: OpenOptions, callback?: (err: Error) => void): void; + export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void; + export function readJson(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void; + export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void; + export function readJSON(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void; export function readJsonSync(file: string, options?: OpenOptions): any; export function readJSONSync(file: string, options?: OpenOptions): any; From 3d52090ef77b01b85b8a6cbc36e53b62c9166596 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Wed, 3 Feb 2016 20:17:22 +0500 Subject: [PATCH 079/113] lodash: changed _.every --- lodash/lodash-tests.ts | 104 +++++++++++++++++++++++++---------------- lodash/lodash.d.ts | 59 +++++++++-------------- 2 files changed, 86 insertions(+), 77 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 49974a788..85dbdd536 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3407,52 +3407,68 @@ module TestEachRight { } // _.every -module TestEvery { - let array: TResult[]; - let list: _.List; - let dictionary: _.Dictionary; +namespace TestEvery { + type SampleObject = {a: number; b: string; c: boolean;}; - let listIterator: (value: TResult, index: number, collection: _.List) => boolean; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => boolean; + let array: SampleObject[]; + let list: _.List; + let dictionary: _.Dictionary; + let numericDictionary: _.NumericDictionary; + + let listIterator: (value: SampleObject, index: number, collection: _.List) => boolean; + let dictionaryIterator: (value: SampleObject, key: string, collection: _.Dictionary) => boolean; + let numericDictionaryIterator: (value: SampleObject, key: number, collection: _.NumericDictionary) => boolean; { let result: boolean; - result = _.every(array); - result = _.every(array, listIterator); - result = _.every(array, listIterator, any); - result = _.every(array, ''); - result = _.every<{a: number}, TResult>(array, {a: 42}); + result = _.every(array); + result = _.every(array, listIterator); + result = _.every(array, 'a'); + result = _.every(array, ['a', 42]); + result = _.every<{a: number}, SampleObject>(array, {a: 42}); - result = _.every(list); - result = _.every(list, listIterator); - result = _.every(list, listIterator, any); - result = _.every(list, ''); - result = _.every<{a: number}, TResult>(list, {a: 42}); + result = _.every(list); + result = _.every(list, listIterator); + result = _.every(list, 'a'); + result = _.every(list, ['a', 42]); + result = _.every<{a: number}, SampleObject>(list, {a: 42}); - result = _.every(dictionary); - result = _.every(dictionary, dictionaryIterator); - result = _.every(dictionary, dictionaryIterator, any); - result = _.every(dictionary, ''); - result = _.every<{a: number}, TResult>(dictionary, {a: 42}); + result = _.every(dictionary); + result = _.every(dictionary, dictionaryIterator); + result = _.every(dictionary, 'a'); + result = _.every(dictionary, ['a', 42]); + result = _.every<{a: number}, SampleObject>(dictionary, {a: 42}); + + result = _.every(numericDictionary); + result = _.every(numericDictionary, numericDictionaryIterator); + result = _.every(numericDictionary, 'a'); + result = _.every(numericDictionary, ['a', 42]); + result = _.every<{a: number}, SampleObject>(numericDictionary, {a: 42}); result = _(array).every(); result = _(array).every(listIterator); - result = _(array).every(listIterator, any); - result = _(array).every(''); + result = _(array).every('a'); + result = _(array).every(['a', 42]); result = _(array).every<{a: number}>({a: 42}); - result = _(list).every(); - result = _(list).every(listIterator); - result = _(list).every(listIterator, any); - result = _(list).every(''); + result = _(list).every(); + result = _(list).every(listIterator); + result = _(list).every('a'); + result = _(list).every(['a', 42]); result = _(list).every<{a: number}>({a: 42}); - result = _(dictionary).every(); - result = _(dictionary).every(dictionaryIterator); - result = _(dictionary).every(dictionaryIterator, any); - result = _(dictionary).every(''); + result = _(dictionary).every(); + result = _(dictionary).every(dictionaryIterator); + result = _(dictionary).every('a'); + result = _(dictionary).every(['a', 42]); result = _(dictionary).every<{a: number}>({a: 42}); + + result = _(numericDictionary).every(); + result = _(numericDictionary).every(numericDictionaryIterator); + result = _(numericDictionary).every('a'); + result = _(numericDictionary).every(['a', 42]); + result = _(numericDictionary).every<{a: number}>({a: 42}); } { @@ -3460,21 +3476,27 @@ module TestEvery { result = _(array).chain().every(); result = _(array).chain().every(listIterator); - result = _(array).chain().every(listIterator, any); - result = _(array).chain().every(''); + result = _(array).chain().every('a'); + result = _(array).chain().every(['a', 42]); result = _(array).chain().every<{a: number}>({a: 42}); - result = _(list).chain().every(); - result = _(list).chain().every(listIterator); - result = _(list).chain().every(listIterator, any); - result = _(list).chain().every(''); + result = _(list).chain().every(); + result = _(list).chain().every(listIterator); + result = _(list).chain().every('a'); + result = _(list).chain().every(['a', 42]); result = _(list).chain().every<{a: number}>({a: 42}); - result = _(dictionary).chain().every(); - result = _(dictionary).chain().every(dictionaryIterator); - result = _(dictionary).chain().every(dictionaryIterator, any); - result = _(dictionary).chain().every(''); + result = _(dictionary).chain().every(); + result = _(dictionary).chain().every(dictionaryIterator); + result = _(dictionary).chain().every('a'); + result = _(dictionary).chain().every(['a', 42]); result = _(dictionary).chain().every<{a: number}>({a: 42}); + + result = _(numericDictionary).chain().every(); + result = _(numericDictionary).chain().every(numericDictionaryIterator); + result = _(numericDictionary).chain().every('a'); + result = _(numericDictionary).chain().every(['a', 42]); + result = _(numericDictionary).chain().every<{a: number}>({a: 42}); } } diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c3af67d28..97e576da5 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -6049,27 +6049,16 @@ declare module _ { //_.every interface LoDashStatic { /** - * Checks if predicate returns truthy for all elements of collection. The predicate is bound to thisArg and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate + * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to iterate over. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns true if all elements pass the predicate check, else false. */ every( collection: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): boolean; /** @@ -6077,24 +6066,30 @@ declare module _ { */ every( collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): boolean; /** * @see _.every */ every( - collection: List|Dictionary, - predicate?: string, - thisArg?: any + collection: NumericDictionary, + predicate?: NumericDictionaryIterator + ): boolean; + + /** + * @see _.every + */ + every( + collection: List|Dictionary|NumericDictionary, + predicate?: string|any[] ): boolean; /** * @see _.every */ every( - collection: List|Dictionary, + collection: List|Dictionary|NumericDictionary, predicate?: TObject ): boolean; } @@ -6104,16 +6099,14 @@ declare module _ { * @see _.every */ every( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator|NumericDictionaryIterator ): boolean; /** * @see _.every */ every( - predicate?: string, - thisArg?: any + predicate?: string|any[] ): boolean; /** @@ -6129,16 +6122,14 @@ declare module _ { * @see _.every */ every( - predicate?: ListIterator|DictionaryIterator, - thisArg?: any + predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator ): boolean; /** * @see _.every */ every( - predicate?: string, - thisArg?: any + predicate?: string|any[] ): boolean; /** @@ -6154,16 +6145,14 @@ declare module _ { * @see _.every */ every( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator|NumericDictionaryIterator ): LoDashExplicitWrapper; /** * @see _.every */ every( - predicate?: string, - thisArg?: any + predicate?: string|any[] ): LoDashExplicitWrapper; /** @@ -6179,16 +6168,14 @@ declare module _ { * @see _.every */ every( - predicate?: ListIterator|DictionaryIterator, - thisArg?: any + predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator ): LoDashExplicitWrapper; /** * @see _.every */ every( - predicate?: string, - thisArg?: any + predicate?: string|any[] ): LoDashExplicitWrapper; /** From d485633bf2193a432701e937f9f1f01641a9daef Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Tue, 2 Feb 2016 17:57:09 +0500 Subject: [PATCH 080/113] lodash: changed _.some --- lodash/lodash-tests.ts | 114 +++++++++++++++++++++-------------------- lodash/lodash.d.ts | 51 +++++------------- 2 files changed, 72 insertions(+), 93 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 66f0bf2ca..97cde614a 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4380,65 +4380,67 @@ module TestSize { } // _.some -module TestSome { - let array: TResult[]; - let list: _.List; - let dictionary: _.Dictionary; - let numericDictionary: _.NumericDictionary; +namespace TestSome { + type SampleObject = {a: number; b: string; c: boolean;}; - let listIterator: (value: TResult, index: number, collection: _.List) => boolean; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => boolean; - let numericDictionaryIterator: (value: TResult, key: number, collection: _.NumericDictionary) => boolean; + let array: SampleObject[]; + let list: _.List; + let dictionary: _.Dictionary; + let numericDictionary: _.NumericDictionary; + + let listIterator: (value: SampleObject, index: number, collection: _.List) => boolean; + let dictionaryIterator: (value: SampleObject, key: string, collection: _.Dictionary) => boolean; + let numericDictionaryIterator: (value: SampleObject, key: number, collection: _.NumericDictionary) => boolean; { let result: boolean; - result = _.some(array); - result = _.some(array, listIterator); - result = _.some(array, listIterator, any); - result = _.some(array, ''); - result = _.some<{a: number}, TResult>(array, {a: 42}); + result = _.some(array); + result = _.some(array, listIterator); + result = _.some(array, 'a'); + result = _.some(array, ['a', 42]); + result = _.some<{a: number}, SampleObject>(array, {a: 42}); - result = _.some(list); - result = _.some(list, listIterator); - result = _.some(list, listIterator, any); - result = _.some(list, ''); - result = _.some<{a: number}, TResult>(list, {a: 42}); + result = _.some(list); + result = _.some(list, listIterator); + result = _.some(list, 'a'); + result = _.some(list, ['a', 42]); + result = _.some<{a: number}, SampleObject>(list, {a: 42}); - result = _.some(dictionary); - result = _.some(dictionary, dictionaryIterator); - result = _.some(dictionary, dictionaryIterator, any); - result = _.some(dictionary, ''); - result = _.some<{a: number}, TResult>(dictionary, {a: 42}); + result = _.some(dictionary); + result = _.some(dictionary, dictionaryIterator); + result = _.some(dictionary, 'a'); + result = _.some(dictionary, ['a', 42]); + result = _.some<{a: number}, SampleObject>(dictionary, {a: 42}); - result = _.some(numericDictionary); - result = _.some(numericDictionary, numericDictionaryIterator); - result = _.some(numericDictionary, numericDictionaryIterator, any); - result = _.some(numericDictionary, ''); - result = _.some<{a: number}, TResult>(numericDictionary, {a: 42}); + result = _.some(numericDictionary); + result = _.some(numericDictionary, numericDictionaryIterator); + result = _.some(numericDictionary, 'a'); + result = _.some(numericDictionary, ['a', 42]); + result = _.some<{a: number}, SampleObject>(numericDictionary, {a: 42}); result = _(array).some(); result = _(array).some(listIterator); - result = _(array).some(listIterator, any); - result = _(array).some(''); + result = _(array).some('a'); + result = _(array).some(['a', 42]); result = _(array).some<{a: number}>({a: 42}); - result = _(list).some(); - result = _(list).some(listIterator); - result = _(list).some(listIterator, any); - result = _(list).some(''); + result = _(list).some(); + result = _(list).some(listIterator); + result = _(list).some('a'); + result = _(list).some(['a', 42]); result = _(list).some<{a: number}>({a: 42}); - result = _(dictionary).some(); - result = _(dictionary).some(dictionaryIterator); - result = _(dictionary).some(dictionaryIterator, any); - result = _(dictionary).some(''); + result = _(dictionary).some(); + result = _(dictionary).some(dictionaryIterator); + result = _(dictionary).some('a'); + result = _(dictionary).some(['a', 42]); result = _(dictionary).some<{a: number}>({a: 42}); - result = _(numericDictionary).some(); - result = _(numericDictionary).some(numericDictionaryIterator); - result = _(numericDictionary).some(numericDictionaryIterator, any); - result = _(numericDictionary).some(''); + result = _(numericDictionary).some(); + result = _(numericDictionary).some(numericDictionaryIterator); + result = _(numericDictionary).some('a'); + result = _(numericDictionary).some(['a', 42]); result = _(numericDictionary).some<{a: number}>({a: 42}); } @@ -4447,26 +4449,26 @@ module TestSome { result = _(array).chain().some(); result = _(array).chain().some(listIterator); - result = _(array).chain().some(listIterator, any); - result = _(array).chain().some(''); + result = _(array).chain().some('a'); + result = _(array).chain().some(['a', 42]); result = _(array).chain().some<{a: number}>({a: 42}); - result = _(list).chain().some(); - result = _(list).chain().some(listIterator); - result = _(list).chain().some(listIterator, any); - result = _(list).chain().some(''); + result = _(list).chain().some(); + result = _(list).chain().some(listIterator); + result = _(list).chain().some('a'); + result = _(list).chain().some(['a', 42]); result = _(list).chain().some<{a: number}>({a: 42}); - result = _(dictionary).chain().some(); - result = _(dictionary).chain().some(dictionaryIterator); - result = _(dictionary).chain().some(dictionaryIterator, any); - result = _(dictionary).chain().some(''); + result = _(dictionary).chain().some(); + result = _(dictionary).chain().some(dictionaryIterator); + result = _(dictionary).chain().some('a'); + result = _(dictionary).chain().some(['a', 42]); result = _(dictionary).chain().some<{a: number}>({a: 42}); - result = _(numericDictionary).chain().some(); - result = _(numericDictionary).chain().some(numericDictionaryIterator); - result = _(numericDictionary).chain().some(numericDictionaryIterator, any); - result = _(numericDictionary).chain().some(''); + result = _(numericDictionary).chain().some(); + result = _(numericDictionary).chain().some(numericDictionaryIterator); + result = _(numericDictionary).chain().some('a'); + result = _(numericDictionary).chain().some(['a', 42]); result = _(numericDictionary).chain().some<{a: number}>({a: 42}); } } diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index aaa8dc7e3..47b8e1765 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -7700,28 +7700,16 @@ declare module _ { //_.some interface LoDashStatic { /** - * Checks if predicate returns truthy for any element of collection. The function returns as soon as it finds - * a passing value and does not iterate over the entire collection. The predicate is bound to thisArg and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate + * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to iterate over. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns true if any element passes the predicate check, else false. */ some( collection: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): boolean; /** @@ -7729,8 +7717,7 @@ declare module _ { */ some( collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): boolean; /** @@ -7738,8 +7725,7 @@ declare module _ { */ some( collection: NumericDictionary, - predicate?: NumericDictionaryIterator, - thisArg?: any + predicate?: NumericDictionaryIterator ): boolean; /** @@ -7747,8 +7733,7 @@ declare module _ { */ some( collection: List|Dictionary|NumericDictionary, - predicate?: string, - thisArg?: any + predicate?: string|any[] ): boolean; /** @@ -7765,16 +7750,14 @@ declare module _ { * @see _.some */ some( - predicate?: ListIterator|NumericDictionaryIterator, - thisArg?: any + predicate?: ListIterator|NumericDictionaryIterator ): boolean; /** * @see _.some */ some( - predicate?: string, - thisArg?: any + predicate?: string|any[] ): boolean; /** @@ -7790,16 +7773,14 @@ declare module _ { * @see _.some */ some( - predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator, - thisArg?: any + predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator ): boolean; /** * @see _.some */ some( - predicate?: string, - thisArg?: any + predicate?: string|any[] ): boolean; /** @@ -7815,16 +7796,14 @@ declare module _ { * @see _.some */ some( - predicate?: ListIterator|NumericDictionaryIterator, - thisArg?: any + predicate?: ListIterator|NumericDictionaryIterator ): LoDashExplicitWrapper; /** * @see _.some */ some( - predicate?: string, - thisArg?: any + predicate?: string|any[] ): LoDashExplicitWrapper; /** @@ -7840,16 +7819,14 @@ declare module _ { * @see _.some */ some( - predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator, - thisArg?: any + predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator ): LoDashExplicitWrapper; /** * @see _.some */ some( - predicate?: string, - thisArg?: any + predicate?: string|any[] ): LoDashExplicitWrapper; /** From 0a82642ce7804b4016dc229720d5c6c232e70b2a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 3 Feb 2016 11:06:10 -0800 Subject: [PATCH 081/113] Replaced some overloads with simple union types. --- bluebird/bluebird.d.ts | 89 ++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 59 deletions(-) diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index 2dfdcf854..d501635d8 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -51,11 +51,9 @@ interface PromiseConstructor { * * Alias for `attempt();` for compatibility with earlier ECMAScript version. */ - try(fn: () => PromiseLike, args?: any[], ctx?: any): Promise; - try(fn: () => T, args?: any[], ctx?: any): Promise; + try(fn: () => T | PromiseLike, args?: any[], ctx?: any): Promise; - attempt(fn: () => PromiseLike, args?: any[], ctx?: any): Promise; - attempt(fn: () => T, args?: any[], ctx?: any): Promise; + attempt(fn: () => T | PromiseLike, args?: any[], ctx?: any): Promise; /** * Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. @@ -66,9 +64,8 @@ interface PromiseConstructor { /** * Create a promise that is resolved with the given `value`. If `value` is a thenable or promise, the returned promise will assume its state. */ + resolve(value: T | PromiseLike): Promise; resolve(): Promise; - resolve(value: PromiseLike): Promise; - resolve(value: T): Promise; /** * Create a promise that is rejected with the given `reason`. @@ -84,8 +81,7 @@ interface PromiseConstructor { /** * Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. */ - cast(value: PromiseLike): Promise; - cast(value: T): Promise; + cast(value: T | PromiseLike): Promise; /** * Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`. @@ -106,8 +102,7 @@ interface PromiseConstructor { * Returns a promise that will be fulfilled with `value` (or `undefined`) after given `ms` milliseconds. If `value` is a promise, the delay will start counting down when it is fulfilled and the returned promise will be fulfilled with the fulfillment value of the `value` promise. */ // TODO enable more overloads - delay(ms: number, value: PromiseLike): Promise; - delay(ms: number, value: T): Promise; + delay(ms: number, value: T | PromiseLike): Promise; delay(ms: number): Promise; /** @@ -177,10 +172,10 @@ interface PromiseConstructor { // array with promises of value all(values: PromiseLike[]): Promise; // array with promises of different types - all(values: [PromiseLike, PromiseLike]): Promise<[T1, T2]>; - all(values: [PromiseLike, PromiseLike, PromiseLike]): Promise<[T1, T2, T3]>; - all(values: [PromiseLike, PromiseLike, PromiseLike, PromiseLike]): Promise<[T1, T2, T3, T4]>; all(values: [PromiseLike, PromiseLike, PromiseLike, PromiseLike, PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; + all(values: [PromiseLike, PromiseLike, PromiseLike, PromiseLike]): Promise<[T1, T2, T3, T4]>; + all(values: [PromiseLike, PromiseLike, PromiseLike]): Promise<[T1, T2, T3]>; + all(values: [PromiseLike, PromiseLike]): Promise<[T1, T2]>; // array with values all(values: T[]): Promise; @@ -269,20 +264,16 @@ interface PromiseConstructor { * *The original array is not modified.* */ // promise of array with promises of value - map(values: PromiseLike[]>, mapper: (item: T, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; - map(values: PromiseLike[]>, mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; + map(values: PromiseLike[]>, mapper: (item: T, index: number, arrayLength: number) => U | PromiseLike, options?: Promise.ConcurrencyOption): Promise; // promise of array with values - map(values: PromiseLike, mapper: (item: T, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; - map(values: PromiseLike, mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; + map(values: PromiseLike, mapper: (item: T, index: number, arrayLength: number) => U | PromiseLike, options?: Promise.ConcurrencyOption): Promise; // array with promises of value - map(values: PromiseLike[], mapper: (item: T, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; - map(values: PromiseLike[], mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; + map(values: PromiseLike[], mapper: (item: T, index: number, arrayLength: number) => U | PromiseLike, options?: Promise.ConcurrencyOption): Promise; // array with values - map(values: T[], mapper: (item: T, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; - map(values: T[], mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; + map(values: T[], mapper: (item: T, index: number, arrayLength: number) => U | PromiseLike, options?: Promise.ConcurrencyOption): Promise; /** * Similar to `map` with concurrency set to 1 but guaranteed to execute in sequential order @@ -312,20 +303,16 @@ interface PromiseConstructor { * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* */ // promise of array with promises of value - reduce(values: PromiseLike[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike, initialValue?: U): Promise; - reduce(values: PromiseLike[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise; + reduce(values: PromiseLike[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Promise; // promise of array with values - reduce(values: PromiseLike, reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike, initialValue?: U): Promise; - reduce(values: PromiseLike, reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise; + reduce(values: PromiseLike, reducer: (total: U, current: T, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Promise; // array with promises of value - reduce(values: PromiseLike[], reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike, initialValue?: U): Promise; - reduce(values: PromiseLike[], reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise; + reduce(values: PromiseLike[], reducer: (total: U, current: T, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Promise; // array with values - reduce(values: T[], reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike, initialValue?: U): Promise; - reduce(values: T[], reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise; + reduce(values: T[], reducer: (total: U, current: T, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Promise; /** * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. @@ -335,20 +322,16 @@ interface PromiseConstructor { * *The original array is not modified. */ // promise of array with promises of value - filter(values: PromiseLike[]>, filterer: (item: T, index: number, arrayLength: number) => PromiseLike, option?: Promise.ConcurrencyOption): Promise; - filter(values: PromiseLike[]>, filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + filter(values: PromiseLike[]>, filterer: (item: T, index: number, arrayLength: number) => boolean | PromiseLike, option?: Promise.ConcurrencyOption): Promise; // promise of array with values - filter(values: PromiseLike, filterer: (item: T, index: number, arrayLength: number) => PromiseLike, option?: Promise.ConcurrencyOption): Promise; - filter(values: PromiseLike, filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + filter(values: PromiseLike, filterer: (item: T, index: number, arrayLength: number) => boolean | PromiseLike, option?: Promise.ConcurrencyOption): Promise; // array with promises of value - filter(values: PromiseLike[], filterer: (item: T, index: number, arrayLength: number) => PromiseLike, option?: Promise.ConcurrencyOption): Promise; - filter(values: PromiseLike[], filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + filter(values: PromiseLike[], filterer: (item: T, index: number, arrayLength: number) => boolean | PromiseLike, option?: Promise.ConcurrencyOption): Promise; // array with values - filter(values: T[], filterer: (item: T, index: number, arrayLength: number) => PromiseLike, option?: Promise.ConcurrencyOption): Promise; - filter(values: T[], filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise; + filter(values: T[], filterer: (item: T, index: number, arrayLength: number) => boolean | PromiseLike, option?: Promise.ConcurrencyOption): Promise; /** * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. @@ -412,11 +395,9 @@ interface Promise extends PromiseLike, Promise.Inspection { * * Alias `.lastly();` for compatibility with earlier ECMAScript version. */ - finally(handler: () => PromiseLike): Promise; - finally(handler: () => U): Promise; + finally(handler: () => U | PromiseLike): Promise; - lastly(handler: () => PromiseLike): Promise; - lastly(handler: () => U): Promise; + lastly(handler: () => U | PromiseLike): Promise; /** * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. @@ -426,16 +407,13 @@ interface Promise extends PromiseLike, Promise.Inspection { /** * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. */ - done(onFulfilled: (value: T) => PromiseLike, onRejected: (error: any) => PromiseLike, onProgress?: (note: any) => any): void; - done(onFulfilled: (value: T) => PromiseLike, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void; - done(onFulfilled: (value: T) => U, onRejected: (error: any) => PromiseLike, onProgress?: (note: any) => any): void; - done(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void; + done(onFulfilled: (value: T) => PromiseLike, onRejected: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): void; + done(onFulfilled: (value: T) => U, onRejected: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): void; /** * Like `.finally()`, but not called for rejections. */ - tap(onFulFill: (value: T) => PromiseLike): Promise; - tap(onFulfill: (value: T) => U): Promise; + tap(onFulFill: (value: T) => U | PromiseLike): Promise; /** * Shorthand for `.then(null, null, handler);`. Attach a progress handler that will be called if this promise is progressed. Returns a new promise chained from this promise. @@ -481,10 +459,7 @@ interface Promise extends PromiseLike, Promise.Inspection { /** * Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors. */ - fork(onFulfilled: (value: T) => PromiseLike, onRejected: (error: any) => PromiseLike, onProgress?: (note: any) => any): Promise; - fork(onFulfilled: (value: T) => PromiseLike, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; - fork(onFulfilled: (value: T) => U, onRejected: (error: any) => PromiseLike, onProgress?: (note: any) => any): Promise; - fork(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + fork(onFulfilled: (value: T) => U | PromiseLike, onRejected: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): Promise; /** * Create an uncancellable promise based on this promise. @@ -605,8 +580,7 @@ interface Promise extends PromiseLike, Promise.Inspection { * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. */ // TODO how to model instance.spread()? like Q? - spread(onFulfill: Function, onReject?: (reason: any) => PromiseLike): Promise; - spread(onFulfill: Function, onReject?: (reason: any) => U): Promise; + spread(onFulfill: Function, onReject?: (reason: any) => U | PromiseLike): Promise; /* // TODO or something like this? spread(onFulfill: (...values: W[]) => PromiseLike, onReject?: (reason: any) => PromiseLike): Promise; @@ -654,8 +628,7 @@ interface Promise extends PromiseLike, Promise.Inspection { * Same as calling `Promise.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ // TODO type inference from array-resolving promise? - map(mapper: (item: Q, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; - map(mapper: (item: Q, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise; + map(mapper: (item: Q, index: number, arrayLength: number) => U | PromiseLike, options?: Promise.ConcurrencyOption): Promise; /** * Same as `Promise.mapSeries(thisPromise, mapper)`. @@ -667,15 +640,13 @@ interface Promise extends PromiseLike, Promise.Inspection { * Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ // TODO type inference from array-resolving promise? - reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => PromiseLike, initialValue?: U): Promise; - reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U, initialValue?: U): Promise; + reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Promise; /** * Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. */ // TODO type inference from array-resolving promise? - filter(filterer: (item: U, index: number, arrayLength: number) => PromiseLike, options?: Promise.ConcurrencyOption): Promise; - filter(filterer: (item: U, index: number, arrayLength: number) => boolean, options?: Promise.ConcurrencyOption): Promise; + filter(filterer: (item: U, index: number, arrayLength: number) => boolean | PromiseLike, options?: Promise.ConcurrencyOption): Promise; /** * Same as calling ``Promise.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. From 290a1d7ee6c04ccf64c6fcfdf39d935baa91d55b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 3 Feb 2016 11:20:20 -0800 Subject: [PATCH 082/113] Restored optionality. --- bluebird/bluebird-tests.ts | 4 ++-- bluebird/bluebird.d.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index 00f6e951f..abbdf6ee2 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -291,9 +291,9 @@ fooProm = fooProm.caught((error: any) => { fooProm = fooProm.catch((reason: any) => { //handle multiple valid return types simultaneously - if (true) { + if (foo === null) { return; - } else if (false) { + } else if (!reason) { return voidProm; } else if (foo) { return foo; diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index d501635d8..7a53d4e07 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -407,8 +407,8 @@ interface Promise extends PromiseLike, Promise.Inspection { /** * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. */ - done(onFulfilled: (value: T) => PromiseLike, onRejected: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): void; - done(onFulfilled: (value: T) => U, onRejected: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): void; + done(onFulfilled?: (value: T) => PromiseLike, onRejected?: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): void; + done(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): void; /** * Like `.finally()`, but not called for rejections. @@ -459,7 +459,7 @@ interface Promise extends PromiseLike, Promise.Inspection { /** * Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors. */ - fork(onFulfilled: (value: T) => U | PromiseLike, onRejected: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): Promise; + fork(onFulfilled?: (value: T) => U | PromiseLike, onRejected?: (error: any) => U | PromiseLike, onProgress?: (note: any) => any): Promise; /** * Create an uncancellable promise based on this promise. From 132599cf88d07e03b97a7c1dceeb6740b5a85663 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 3 Feb 2016 11:28:27 -0800 Subject: [PATCH 083/113] Added a few relevant tests. --- bluebird/bluebird-tests.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index abbdf6ee2..9244a9da3 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -696,6 +696,15 @@ fooProm = Promise.try(() => { return fooThen; }, arr, x); +// - - - - - - - - - - - - - - - - - + +fooProm = Promise.try(() => { + if (fooProm) { + return fooProm; + } + return foo; +}); + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fooProm = Promise.attempt(() => { @@ -710,6 +719,15 @@ fooProm = Promise.attempt(() => { // - - - - - - - - - - - - - - - - - +fooProm = Promise.attempt(() => { + if (fooProm) { + return fooProm; + } + return foo; +}); + +// - - - - - - - - - - - - - - - - - + fooProm = Promise.attempt(() => { return fooThen; }); From 42fc7de90b2266a14e43a639823d95538a7c4434 Mon Sep 17 00:00:00 2001 From: Sumit Kumar Maitra Date: Wed, 3 Feb 2016 19:36:11 +0000 Subject: [PATCH 084/113] Updated type definition with constructor interface, updated tests and cleaned up definition as required. Ref: Issue #7943 --- quill/quill-tests.ts | 2 +- quill/quill.d.ts | 37 ++++++++++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/quill/quill-tests.ts b/quill/quill-tests.ts index 014ea85c2..3a87bd594 100644 --- a/quill/quill-tests.ts +++ b/quill/quill-tests.ts @@ -1,7 +1,7 @@ /// /// -export var Quill = require("quill"); +//export var Quill = require("quill"); function test_quill() { diff --git a/quill/quill.d.ts b/quill/quill.d.ts index e45f77d0d..3cef08844 100644 --- a/quill/quill.d.ts +++ b/quill/quill.d.ts @@ -6,10 +6,22 @@ /// declare interface DeltaStatic{ - ops : Array; + ops? : Array; + retain?: any, + delete?: any, + insert?: any, + attributes?: any +} + +declare interface RangeStatic{ + new(): RangeStatic; + start: number; + end: number; } declare interface QuillStatic { + new(selector: string, options?: Object):QuillStatic; + on(eventName: string, callback: (delta: DeltaStatic, source: string) => void): EventEmitter2; addModule(id: string, options: any) : Object; @@ -36,7 +48,7 @@ declare interface QuillStatic { deleteText(start: number, end: number, source: string): void; formatText(start: number, end: number): void; - formatText(start: number, end: number, name: string, value: string): void; + formatText(start: number, end: number, name: string, value: boolean): void; formatText(start: number, end: number, formats: any): void; formatText(start: number, end: number, source: string): void; formatText(start: number, end: number, name: string, value: string, source: string): void; @@ -44,7 +56,7 @@ declare interface QuillStatic { formatLine(start: number, end: number): void; - formatLine(start: number, end: number, name: string, value: string): void; + formatLine(start: number, end: number, name: string, value: boolean): void; formatLine(start: number, end: number, formats: any): void; formatLine(start: number, end: number, source: string): void; formatLine(start: number, end: number, name: string, value: string, source: string): void; @@ -62,14 +74,14 @@ declare interface QuillStatic { setText(text: string): void; - getSelection(): string; + getSelection(): RangeStatic; setSelection(start: number, end: number): void; setSelection(start: number, end: number, source: string): void; - setSelection(range: any): void; - setSelection(range: any, source: string): void; + setSelection(range: RangeStatic): void; + setSelection(range: RangeStatic, source: string): void; - prepareFormat(format: string, value: string): void; + prepareFormat(format: string, value: boolean): void; focus(): void; @@ -85,16 +97,23 @@ declare interface QuillStatic { addFormat(name: string, config: any): void; - addContainer(cssClass: string, before: number): HTMLDivElement; + addContainer(cssClass: string, before?: number): HTMLDivElement; } -declare var Quill: QuillStatic; +declare module "Range" +{ + var Range: RangeStatic; + export = Range; +} declare var Delta: DeltaStatic; declare module "Delta"{ export = Delta; } + +declare var Quill: QuillStatic; + declare module "Quill" { export = Quill; } From 830e8ebd9ef137d039d5c7ede24a421f08595f83 Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Wed, 3 Feb 2016 12:41:33 -0800 Subject: [PATCH 085/113] Rename the type variable for es6-promise from R to T to match lib.d.ts. This fixes an issue where two definitions for Promise that /should/ agree (i.e., be assignable to one another) aren't, and instead the immensely confusing error message: error TS2314: Generic type 'Promise' requires 2 type argument(s). Even though all the present definitions are paramaterized with a single type variable, Typescript appears to assume that the two different names are referring to two different types and therefore you must supply both. Here I changed it to T from R so that it matches lib.d.ts. For reference, this error occured for me specifically when I had both es6-promise and bluebird typings present. bluebird uses T already. --- es6-promise/es6-promise.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/es6-promise/es6-promise.d.ts b/es6-promise/es6-promise.d.ts index a8f8d7845..c0a77edd8 100644 --- a/es6-promise/es6-promise.d.ts +++ b/es6-promise/es6-promise.d.ts @@ -3,13 +3,13 @@ // Definitions by: François de Campredon , vvakame // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface Thenable { - then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; - then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; +interface Thenable { + then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; + then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => void): Thenable; catch(onRejected?: (error: any) => U | Thenable): Thenable; } -declare class Promise implements Thenable { +declare class Promise implements Thenable { /** * If you call resolve in the body of the callback passed to the constructor, * your promise is fulfilled with result object passed to resolve. @@ -17,7 +17,7 @@ declare class Promise implements Thenable { * For consistency and debugging (eg stack traces), obj should be an instanceof Error. * Any errors thrown in the constructor callback will be implicitly passed to reject(). */ - constructor(callback: (resolve : (value?: R | Thenable) => void, reject: (error?: any) => void) => void); + constructor(callback: (resolve : (value?: T | Thenable) => void, reject: (error?: any) => void) => void); /** * onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. @@ -29,8 +29,8 @@ declare class Promise implements Thenable { * @param onFulfilled called when/if "promise" resolves * @param onRejected called when/if "promise" rejects */ - then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Promise; - then(onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Promise; + then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => U | Thenable): Promise; + then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => void): Promise; /** * Sugar for promise.then(undefined, onRejected) @@ -45,7 +45,7 @@ declare module Promise { * Make a new promise from the thenable. * A thenable is promise-like in as far as it has a "then" method. */ - function resolve(value?: R | Thenable): Promise; + function resolve(value?: T | Thenable): Promise; /** * Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error @@ -57,12 +57,12 @@ declare module Promise { * the array passed to all can be a mixture of promise-like objects and other objects. * The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value. */ - function all(promises: (R | Thenable)[]): Promise; + function all(promises: (T | Thenable)[]): Promise; /** * Make a Promise that fulfills when any item fulfills, and rejects if any item rejects. */ - function race(promises: (R | Thenable)[]): Promise; + function race(promises: (T | Thenable)[]): Promise; } declare module 'es6-promise' { From a80a024f79575373c781e5867debcbbad041a3a2 Mon Sep 17 00:00:00 2001 From: CaselIT Date: Wed, 3 Feb 2016 21:50:31 +0100 Subject: [PATCH 086/113] Changed internal types from class to interface Thanks to @pfzero https://github.com/DefinitelyTyped/DefinitelyTyped/issues/7021#issuecomment-179439322 --- mongodb/mongodb.d.ts | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/mongodb/mongodb.d.ts b/mongodb/mongodb.d.ts index 2efe834e2..695f14c6a 100644 --- a/mongodb/mongodb.d.ts +++ b/mongodb/mongodb.d.ts @@ -11,6 +11,7 @@ declare module "mongodb" { import {EventEmitter} from 'events'; + // Class documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/MongoClient.html export class MongoClient { constructor(); @@ -150,7 +151,7 @@ declare module "mongodb" { socketOptions?: SocketOptions; } - // Class documentation : http://mongodb.github.io/node-mongodb-native/api-generated/db.html + // Class documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html export class Db extends EventEmitter { constructor(databaseName: string, serverConfig: Server | ReplSet | Mongos, options?: DbCreateOptions); @@ -322,7 +323,7 @@ declare module "mongodb" { } // http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html - export class Admin { + export interface Admin { // http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#addUser addUser(username: string, password: string, callback: MongoCallback): void; addUser(username: string, password: string, options?: AddUserOptions): Promise; @@ -552,7 +553,7 @@ declare module "mongodb" { } // Documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html - export class Collection { + export interface Collection { // Get the collection name. collectionName: string; // Get the full collection namespace. @@ -871,7 +872,7 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/OrderedBulkOperation.html - export class OrderedBulkOperation { + export interface OrderedBulkOperation { length: number; //http://mongodb.github.io/node-mongodb-native/2.1/api/OrderedBulkOperation.html#execute execute(callback: MongoCallback): void; @@ -884,7 +885,14 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/BulkWriteResult.html - export class BulkWriteResult { + export interface BulkWriteResult { + ok: boolean; + nInserted: number; + nUpdated: number; + nUpserted: number; + nModified: number; + nRemoved: number; + getInsertedIds(): Array; getLastOp(): Object; getRawResponse(): Object; @@ -916,7 +924,7 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/FindOperatorsOrdered.html - export class FindOperatorsOrdered { + export interface FindOperatorsOrdered { delete(): OrderedBulkOperation; deleteOne(): OrderedBulkOperation; replaceOne(doc: Object): OrderedBulkOperation; @@ -926,7 +934,7 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/UnorderedBulkOperation.html - export class UnorderedBulkOperation { + export interface UnorderedBulkOperation { //http://mongodb.github.io/node-mongodb-native/2.1/api/UnorderedBulkOperation.html#execute execute(callback: MongoCallback): void; execute(options: FSyncOptions): Promise; @@ -938,7 +946,7 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/FindOperatorsUnordered.html - export class FindOperatorsUnordered { + export interface FindOperatorsUnordered { length: number; remove(): UnorderedBulkOperation; removeOne(): UnorderedBulkOperation; @@ -1044,7 +1052,7 @@ declare module "mongodb" { export type CursorResult = any | void | boolean; //http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html - export class Cursor extends EventEmitter implements Readable { + export interface Cursor extends Readable, NodeJS.EventEmitter { sortValue: string; timeout: boolean; @@ -1161,7 +1169,7 @@ declare module "mongodb" { export type AggregationCursorResult = any | void; //http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html - export class AggregationCursor extends EventEmitter implements Readable { + export interface AggregationCursor extends Readable, NodeJS.EventEmitter { // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#batchSize batchSize(value: number): AggregationCursor; // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#clone @@ -1225,7 +1233,7 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html - export class CommandCursor extends EventEmitter implements Readable { + export interface CommandCursor extends Readable, NodeJS.EventEmitter { // http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#batchSize batchSize(value: number): CommandCursor; // http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#clone From e5d253e250da3dee38ac296aec73f7835e42708a Mon Sep 17 00:00:00 2001 From: Levi Baker Date: Wed, 3 Feb 2016 17:06:14 -0800 Subject: [PATCH 087/113] Added missing events to router config. RouterOptions was missing three events. --- kendo-ui/kendo-ui.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 82a454b22..fba446392 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -320,6 +320,9 @@ declare module kendo { hashBang?: boolean; root?: string; ignoreCase?: boolean; + change?(e: RouterChangeEvent): void; + routeMissing?(e: RouterRouteMissingEvent): void; + same?(e: RouterEvent): void; } interface RouterEvent { @@ -328,6 +331,15 @@ declare module kendo { preventDefault: Function; isDefaultPrevented(): boolean; } + + interface RouterChangeEvent extends RouterEvent { + params: any; + backButtonPressed: boolean; + } + + interface RouterRouteMissingEvent extends RouterEvent { + params: any; + } class Route extends Class { route: RegExp; From f743b7f4955076199e2252ace18b01e33280db69 Mon Sep 17 00:00:00 2001 From: Leo Liang Date: Thu, 4 Feb 2016 14:26:46 +0800 Subject: [PATCH 088/113] express.d.ts: define next() function type --- express/express-tests.ts | 13 +++++++++++++ express/express.d.ts | 15 ++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/express/express-tests.ts b/express/express-tests.ts index de39e2c8a..6ac53bf2d 100644 --- a/express/express-tests.ts +++ b/express/express-tests.ts @@ -17,6 +17,12 @@ app.use(function(req, res, next){ next(); }); +app.use(function(err: any, req: express.Request, res: express.Response, next: express.NextFunction) { + console.error(err); + next(err); +}); + + app.get('/', function(req, res){ res.send('hello world'); }); @@ -47,6 +53,13 @@ router.route('/users') res.send(req.query['token']); }); +router.get('/user/:id', function(req, res, next) { + if (req.params.id == 0) next('route'); + else next(); +}, function(req, res, next) { + res.render('regular'); +}); + app.use((req, res, next) => { // hacky trick, router is just a handler router(req, res, next); diff --git a/express/express.d.ts b/express/express.d.ts index 65848860b..171b6e6a7 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -407,9 +407,9 @@ declare module "express" { originalUrl: string; url: string; - + baseUrl: string; - + app: Application; } @@ -796,18 +796,23 @@ declare module "express" { charset: string; } + interface NextFunction { + (): void; + (err: any): void; + } + interface ErrorRequestHandler { - (err: any, req: Request, res: Response, next: Function): any; + (err: any, req: Request, res: Response, next: NextFunction): any; } interface RequestHandler { - (req: Request, res: Response, next: Function): any; + (req: Request, res: Response, next: NextFunction): any; } interface Handler extends RequestHandler {} interface RequestParamHandler { - (req: Request, res: Response, next: Function, param: any): any; + (req: Request, res: Response, next: NextFunction, param: any): any; } interface Application extends IRouter, Express.Application { From 509d82f8dee7db02ea6f9d25baa6634c398f9cfd Mon Sep 17 00:00:00 2001 From: Theo Date: Thu, 4 Feb 2016 09:38:04 +0000 Subject: [PATCH 089/113] Add tests for VIRTUAL DataType --- sequelize/sequelize-tests.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index 522f51dab..39c38e0d4 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -581,6 +581,9 @@ Sequelize.GEOMETRY( 'POINT' ); Sequelize.GEOMETRY( 'LINESTRING' ); Sequelize.GEOMETRY( 'POLYGON' ); Sequelize.GEOMETRY( 'POINT', 4326 ); +Sequelize.VIRTUAL; +Sequelize.VIRTUAL( Sequelize.STRING ); +new Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']); // // Deferrable From 8b566aaea0eac1f9241012c205ba4679cde4b9f9 Mon Sep 17 00:00:00 2001 From: Theo Date: Thu, 4 Feb 2016 09:40:28 +0000 Subject: [PATCH 090/113] Forgot new in creating the Virtual DataType --- sequelize/sequelize-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index 39c38e0d4..15010e544 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -582,7 +582,7 @@ Sequelize.GEOMETRY( 'LINESTRING' ); Sequelize.GEOMETRY( 'POLYGON' ); Sequelize.GEOMETRY( 'POINT', 4326 ); Sequelize.VIRTUAL; -Sequelize.VIRTUAL( Sequelize.STRING ); +new Sequelize.VIRTUAL( Sequelize.STRING ); new Sequelize.VIRTUAL( Sequelize.DATE , ['property1', 'property2']); // From 94095ef4ee4da04b49915aef5a3f821e3269f7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarno=20V=C3=A4lkki?= Date: Thu, 4 Feb 2016 16:01:35 +0200 Subject: [PATCH 091/113] modified IDeferred resolve method to allow passing a promise of type T so a deferred can be resolved with a promise --- angularjs/angular.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index d1197dec1..23bbed375 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1083,7 +1083,7 @@ declare module angular { } interface IDeferred { - resolve(value?: T): void; + resolve(value?: T|IPromise): void; reject(reason?: any): void; notify(state?: any): void; promise: IPromise; From 794ad5905b0862195d8a2193ae0cb00f128d889a Mon Sep 17 00:00:00 2001 From: Maciej Kucharski Date: Thu, 4 Feb 2016 16:00:23 +0100 Subject: [PATCH 092/113] Meteor.Error constructor can be also called with (number, string?, string?) see: http://docs.meteor.com/\#/full/meteor_error Even though property is specified as example right below shows usage with a number instead. --- meteor/meteor.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meteor/meteor.d.ts b/meteor/meteor.d.ts index 222de7ae7..251cafccc 100644 --- a/meteor/meteor.d.ts +++ b/meteor/meteor.d.ts @@ -522,10 +522,10 @@ declare module Match { declare module Meteor { var Error: ErrorStatic; interface ErrorStatic { - new(error: string, reason?: string, details?: string): Error; + new(error: string | number, reason?: string, details?: string): Error; } interface Error { - error: string; + error: string | number; reason?: string; details?: string; } From 4d5f70f15317fdddbe73e14b628d534291202f47 Mon Sep 17 00:00:00 2001 From: Maciej Kucharski Date: Thu, 4 Feb 2016 16:01:06 +0100 Subject: [PATCH 093/113] updated and fixed failing meteor tests --- meteor/meteor-tests.ts | 82 ++++++++++++++++---------------- meteor/meteor-tests.ts.tscparams | 2 +- 2 files changed, 43 insertions(+), 41 deletions(-) diff --git a/meteor/meteor-tests.ts b/meteor/meteor-tests.ts index e6f1e6f28..bd3b7156c 100644 --- a/meteor/meteor-tests.ts +++ b/meteor/meteor-tests.ts @@ -43,7 +43,7 @@ Meteor.publish("adminSecretInfo", function () { return Rooms.find({admin: this.userId}, {fields: {secretInfo: 1}}); }); -Meteor.publish("roomAndMessages", function (roomId) { +Meteor.publish("roomAndMessages", function (roomId: string) { check(roomId, String); return [ Rooms.find({_id: roomId}, {fields: {secretInfo: 0}}), @@ -54,20 +54,20 @@ Meteor.publish("roomAndMessages", function (roomId) { /** * Also from Publish and Subscribe, Meteor.publish section */ -Meteor.publish("counts-by-room", function (roomId) { +Meteor.publish("counts-by-room", function (roomId: string) { var self = this; check(roomId, String); var count = 0; var initializing = true; var handle = Messages.find({roomId: roomId}).observeChanges({ - added: function (id) { + added: function (id: any) { count++; // if (!initializing) // Todo: Not sure how to define in typescript // self.changed("counts", roomId, {count: count}); }, - removed: function (id) { + removed: function (id: any) { count--; // Todo: Not sure how to define in typescript // self.changed("counts", roomId, {count: count}); @@ -112,7 +112,7 @@ Tracker.autorun(function () { * From Methods, Meteor.methods section */ Meteor.methods({ - foo: function (arg1, arg2) { + foo: function (arg1: string, arg2: number[]) { check(arg1, String); check(arg2, [Number]); @@ -134,7 +134,11 @@ Meteor.methods({ throw new Meteor.Error("logged-out", "The user must be logged in to post a comment."); -Meteor.call("methodName", function (error) { +throw new Meteor.Error(403, + "The user must be logged in to post a comment."); + + +Meteor.call("methodName", function (error: Meteor.Error) { if (error.error === "logged-out") { Session.set("errorMessage", "Please log in to post a comment."); } @@ -147,7 +151,7 @@ console.log(error.details !== ""); /** * From Methods, Meteor.call section */ -Meteor.call('foo', 1, 2, function (error, result) {} ); +Meteor.call('foo', 1, 2, function (error:any, result:any) {} ); var result = Meteor.call('foo', 1, 2); /** @@ -164,7 +168,7 @@ interface MessagesDAO { var Chatrooms = new Mongo.Collection("chatrooms"); Messages = new Mongo.Collection("messages"); -var myMessages = Messages.find({userId: Session.get('myUserId')}).fetch(); +var myMessages:any[] = Messages.find({userId: Session.get('myUserId')}).fetch(); Messages.insert({text: "Hello, world!"}); @@ -186,17 +190,15 @@ Posts.insert({title: "Hello world", body: "First post"}); assert(Scratchpad.find({number: {$lt: 9}}).count() === 5); **/ -var Animal = function (doc) { -// _.extend(this, doc); -}; - -// DA: I altered this to remove dependencies on Underscore -Animal.prototype = { - makeNoise: function () { - console.log(this.sound); - } -}; +class Animal { + private sound:string; + constructor(doc:any) { + } + makeNoise() { + console.log(this.sound) + } +} interface AnimalDAO { _id?: string; @@ -207,7 +209,7 @@ interface AnimalDAO { // Define a Collection that uses Animal as its document var Animals = new Mongo.Collection("Animals", { - transform: function (doc) { return new Animal(doc); } + transform: function (doc:any): Animal { return new Animal(doc); } }); // Create an Animal and call its makeNoise method @@ -280,15 +282,15 @@ interface iPost { Posts = new Mongo.Collection("posts"); Posts.allow({ - insert: function (userId, doc: iPost) { + insert: function (userId:string, doc: iPost) { // the user must be logged in, and the document must be owned by the user return (userId && doc.owner === userId); }, - update: function (userId, doc: iPost, fields, modifier) { + update: function (userId:string, doc: iPost, fields:string[], modifier:any) { // can only change your own documents return doc.owner === userId; }, - remove: function (userId, doc: iPost) { + remove: function (userId:string, doc: iPost) { // can only remove your own documents return doc.owner === userId; }, @@ -296,11 +298,11 @@ Posts.allow({ }); Posts.deny({ - update: function (userId, doc: iPost, fields, modifier) { + update: function (userId:string, doc: iPost, fields:string[], modifier:any) { // can't change owners return doc.userId !== userId; }, - remove: function (userId, doc: iPost) { + remove: function (userId:string, doc: iPost) { // can't remove locked documents return doc.locked; }, @@ -312,7 +314,7 @@ Posts.deny({ */ var topPosts = Posts.find({}, {sort: {score: -1}, limit: 5}); var count = 0; -topPosts.forEach(function (post) { +topPosts.forEach(function (post:{title:string}) { console.log("Title of post " + count + ": " + post.title); count += 1; }); @@ -326,7 +328,7 @@ var Users = new Mongo.Collection('users'); var count1 = 0; var query = Users.find({admin: true, onlineNow: true}); var handle = query.observeChanges({ - added: function (id, user) { + added: function (id:string, user:{name:string}) { count1++; console.log(user.name + " brings the total to " + count1 + " admins."); }, @@ -364,7 +366,7 @@ Session.set("enemy", "Eurasia"); /** * From Sessions, Session.equals section */ -var value; +var value: string; Session.get("key") === value; Session.equals("key", value); @@ -383,7 +385,7 @@ Meteor.users.deny({update: function () { return true; }}); */ Meteor.loginWithGithub({ requestPermissions: ['user', 'public_repo'] -}, function (err) { +}, function (err: Meteor.Error) { if (err) Session.set('errorMessage', err.reason || 'Unknown error'); }); @@ -405,20 +407,20 @@ Accounts.ui.config({ /** * From Accounts, Accounts.validateNewUser section */ -Accounts.validateNewUser(function (user) { +Accounts.validateNewUser(function (user:{username:string}) { if (user.username && user.username.length >= 3) return true; throw new Meteor.Error("403", "Username must have at least 3 characters"); }); // Validate username, without a specific error message. -Accounts.validateNewUser(function (user) { +Accounts.validateNewUser(function (user:{username:string}) { return user.username !== "root"; }); /** * From Accounts, Accounts.onCreateUser section */ -Accounts.onCreateUser(function(options, user) { +Accounts.onCreateUser(function(options:{profile:any}, user:{profile:any, dexterity:number}) { var d6 = function () { return Math.floor(Math.random() * 6) + 1; }; user.dexterity = d6() + d6() + d6(); // We still want the default hook's 'profile' behavior. @@ -432,10 +434,10 @@ Accounts.onCreateUser(function(options, user) { */ Accounts.emailTemplates.siteName = "AwesomeSite"; Accounts.emailTemplates.from = "AwesomeSite Admin "; -Accounts.emailTemplates.enrollAccount.subject = function (user) { +Accounts.emailTemplates.enrollAccount.subject = function (user:{ profile:{name: string} }) { return "Welcome to Awesome Town, " + user.profile.name; }; -Accounts.emailTemplates.enrollAccount.text = function (user, url) { +Accounts.emailTemplates.enrollAccount.text = function (user:any, url:string) { return "You have been selected to participate in building a better future!" + " To activate your account, simply click the link below:\n\n" + url; @@ -485,13 +487,13 @@ var body = Template.body; */ var Chats = new Mongo.Collection('chats'); -Meteor.publish("chats-in-room", function (roomId) { +Meteor.publish("chats-in-room", function (roomId:string) { // Make sure roomId is a string, not an arbitrary mongo selector object. check(roomId, String); return Chats.find({room: roomId}); }); -Meteor.methods({addChat: function (roomId, message) { +Meteor.methods({addChat: function (roomId:string, message:{text:string, timestamp:Date, tags:string}) { check(roomId, String); check(message, { text: String, @@ -552,7 +554,7 @@ var getWeather = function () { return weather; }; -var setWeather = function (w) { +var setWeather = function (w:string) { weather = w; // (could add logic here to only call changed() // if the new value is different from the old) @@ -562,7 +564,7 @@ var setWeather = function (w) { /** * From HTTP, HTTP.call section */ -Meteor.methods({checkTwitter: function (userId) { +Meteor.methods({checkTwitter: function (userId:string) { check(userId, String); this.unblock(); var result = HTTP.call("GET", "http://api.twitter.com/xyz", @@ -575,7 +577,7 @@ Meteor.methods({checkTwitter: function (userId) { HTTP.call("POST", "http://api.twitter.com/xyz", {data: {some: "json", stuff: 1}}, - function (error, result) { + function (error: Meteor.Error, result:any) { if (result.statusCode === 200) { Session.set("twizzled", true); } @@ -585,7 +587,7 @@ HTTP.call("POST", "http://api.twitter.com/xyz", * From Email, Email.send section */ Meteor.methods({ - sendEmail: function (to, from, subject, text) { + sendEmail: function (to:string, from:string, subject:string, text:string) { check([to, from, subject, text], [String]); // Let other method calls from the same client start running, @@ -617,7 +619,7 @@ Blaze.toHTMLWithData(testView, {test: 1}); Blaze.toHTMLWithData(testView, function() {}); var reactiveVar1 = new ReactiveVar('test value'); -var reactiveVar2 = new ReactiveVar('test value', function(oldVal) { return true; }); +var reactiveVar2 = new ReactiveVar('test value', function(oldVal:any) { return true; }); var varValue: string = reactiveVar1.get(); reactiveVar1.set('new value'); diff --git a/meteor/meteor-tests.ts.tscparams b/meteor/meteor-tests.ts.tscparams index d3f5a12fa..2f5856b19 100644 --- a/meteor/meteor-tests.ts.tscparams +++ b/meteor/meteor-tests.ts.tscparams @@ -1 +1 @@ - +--noImplicitAny From f318fbd33149ef0921b84657996ad31dab1e3241 Mon Sep 17 00:00:00 2001 From: Frank Laub Date: Thu, 4 Feb 2016 07:40:52 -0800 Subject: [PATCH 094/113] Add definitions for react-fa --- react-fa/react-fa-tests.tsx | 11 +++++++++++ react-fa/react-fa.d.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 react-fa/react-fa-tests.tsx create mode 100644 react-fa/react-fa.d.ts diff --git a/react-fa/react-fa-tests.tsx b/react-fa/react-fa-tests.tsx new file mode 100644 index 000000000..778c6b16a --- /dev/null +++ b/react-fa/react-fa-tests.tsx @@ -0,0 +1,11 @@ +/// +/// + +import * as React from "react"; +import { render } from 'react-dom'; +import Icon = require('react-fa'); + +render( + , + document.getElementById('main') +) diff --git a/react-fa/react-fa.d.ts b/react-fa/react-fa.d.ts new file mode 100644 index 000000000..0b6b166a2 --- /dev/null +++ b/react-fa/react-fa.d.ts @@ -0,0 +1,28 @@ +// Type definitions for react-fa v4.0.0 +// Project: https://github.com/andreypopp/react-fa +// Definitions by: Frank Laub +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "react-fa" { + import { ComponentClass, Props } from 'react'; + + interface IconProps extends Props { + name: string; + className?: string; + size?: string; + spin?: boolean; + rotate?: string; + flip?: string; + fixedWidth?: boolean; + pulse?: boolean; + stack?: string; + inverse?: boolean; + } + + interface Icon extends ComponentClass { } + const Icon: Icon; + + export = Icon; +} From ae60c84b9225eeb5278ebdc4e1df4aec8f8602f9 Mon Sep 17 00:00:00 2001 From: Frank Laub Date: Thu, 4 Feb 2016 07:58:49 -0800 Subject: [PATCH 095/113] Add definitions for react-bootstrap-table --- .../react-bootstrap-table-tests.tsx | 30 +++++ .../react-bootstrap-table.d.ts | 115 ++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 react-bootstrap-table/react-bootstrap-table-tests.tsx create mode 100644 react-bootstrap-table/react-bootstrap-table.d.ts diff --git a/react-bootstrap-table/react-bootstrap-table-tests.tsx b/react-bootstrap-table/react-bootstrap-table-tests.tsx new file mode 100644 index 000000000..9a22bf9df --- /dev/null +++ b/react-bootstrap-table/react-bootstrap-table-tests.tsx @@ -0,0 +1,30 @@ +/// +/// + +import * as React from 'react'; +import { render } from 'react-dom'; +import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; + +var products = [{ + id: 1, + name: "Item name 1", + price: 100 +}, { + id: 2, + name: "Item name 2", + price: 100 +}]; + +// It's a data format example. +function priceFormatter(cell: any, row: any) { + return ' ' + cell; +} + +render( + + Product ID + Product Name + Product Price + , + document.getElementById("app") +); diff --git a/react-bootstrap-table/react-bootstrap-table.d.ts b/react-bootstrap-table/react-bootstrap-table.d.ts new file mode 100644 index 000000000..a93b716fb --- /dev/null +++ b/react-bootstrap-table/react-bootstrap-table.d.ts @@ -0,0 +1,115 @@ +// Type definitions for react-bootstrap-table v1.4.6 +// Project: https://github.com/AllenFang/react-bootstrap-table +// Definitions by: Frank Laub +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module "react-bootstrap-table" { + import { ComponentClass, Props, ReactElement } from 'react'; + import { EventEmitter } from 'events'; + + interface SelectRow { + mode?: string; + bgColor?: string; + selected?: any[]; + onSelect?: Function; + onSelectAll?: Function; + clickToSelect?: boolean; + hideSelectColumn?: boolean; + clickToSelectAndEditCell?: boolean; + showOnlySelected?: boolean; + } + + interface CellEdit { + mode?: string; + blurToSave?: boolean; + afterSaveCell?: Function; + } + + interface Options { + sortName?: string; + sortOrder?: string; + afterTableComplete?: Function; + afterDeleteRow?: Function; + afterInsertRow?: Function; + afterSearch?: Function; + afterColumnFilter?: Function; + onRowClick?: Function; + page?: number; + sizePerPageList?: number[]; + sizePerPage?: number; + paginationSize?: number; + onSortChange?: Function; + onPageChange?: Function; + onSizePerPageList?: Function; + noDataText?: string; + handleConfirmDeleteRow?: Function; + } + + interface FetchInfo { + dataTotalSize?: number; + } + + interface BootstrapTableProps extends Props { + keyField?: string; + height?: string; + maxHeight?: string; + data?: any; + remote?: boolean; + striped?: boolean; + bordered?: boolean; + hover?: boolean; + condensed?: boolean; + pagination?: boolean; + searchPlaceholder?: string; + selectRow?: SelectRow; + cellEdit?: CellEdit; + insertRow?: boolean; + deleteRow?: boolean; + search?: boolean; + columnFilter?: boolean; + trClassName?: any; + options?: Options; + fetchInfo?: FetchInfo; + exportCSV?: boolean; + csvFileName?: string; + } + + interface BootstrapTable extends ComponentClass { } + const BootstrapTable: BootstrapTable; + + interface TableHeaderColumnProps extends Props { + dataField?: string; + dataAlign?: string; + dataSort?: boolean; + onSort?: Function; + dataFormat?: Function; + isKey?: boolean; + editable?: any; + hidden?: boolean; + className?: string; + width?: string; + sortFunc?: Function; + columnClassName?: any; + filterFormatted?: boolean; + sort?: string; + } + + interface TableHeaderColumn extends ComponentClass { } + const TableHeaderColumn: TableHeaderColumn; + + class TableDataSet extends EventEmitter { + constructor(data: any); + setData(data: any): void; + clear(): void; + getData(): any; + } + + export { + BootstrapTable, + TableHeaderColumn, + TableDataSet + } +} From f57a6d7b028e476ed7dd9adda68a692bc7f47fc5 Mon Sep 17 00:00:00 2001 From: Matt Wheatley Date: Thu, 4 Feb 2016 16:11:41 +0000 Subject: [PATCH 096/113] Added tests and support for angular-environment --- .../angular-environment-tests.ts | 30 +++++++++++ angular-environment/angular-environment.d.ts | 52 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 angular-environment/angular-environment-tests.ts create mode 100644 angular-environment/angular-environment.d.ts diff --git a/angular-environment/angular-environment-tests.ts b/angular-environment/angular-environment-tests.ts new file mode 100644 index 000000000..ea3da32a5 --- /dev/null +++ b/angular-environment/angular-environment-tests.ts @@ -0,0 +1,30 @@ +/// +var envServiceProvider: ng.environment.ServiceProvider; +var envService: ng.environment.Service; + +envServiceProvider.config({ + domains: { + development: ['localhost', 'dev.local'], + production: ['acme.com', 'acme.net', 'acme.org'] + }, + vars: { + development: { + apiUrl: '//localhost/api', + staticUrl: '//localhost/static' + }, + production: { + apiUrl: '//api.acme.com/v2', + staticUrl: '//static.acme.com' + } + } +}); + +envServiceProvider.check(); + +envService.get(); + +envService.set('production'); + +var isProd: boolean = envService.is('production'); + +var val: any = envService.read('apiUrl'); diff --git a/angular-environment/angular-environment.d.ts b/angular-environment/angular-environment.d.ts new file mode 100644 index 000000000..a978f6883 --- /dev/null +++ b/angular-environment/angular-environment.d.ts @@ -0,0 +1,52 @@ +// Type definitions for angular-environment v1.0.4 +// Project: https://github.com/juanpablob/angular-environment +// Definitions by: Matt Wheatley +// Definitions: https://github.com/LiberisLabs + +declare module ng.environment { + interface ServiceProvider { + /** + * Sets the configuration object + */ + config: (config: ng.environment.Config) => void; + /** + * Evaluates the current domain and + * loads the correct environment variables. + */ + check: () => void; + } + interface Service { + /** + * Retrieve the current environment + */ + get: () => string, + + /** + * Force sets the current environment + */ + set: (environment: string) => void, + + /** + * Evaluates current environment against + * environment parameter. + */ + is: (environment: string) => boolean, + + /** + * Retrieves the correct version of a + * variable for the current environment. + */ + read: (key: string) => any; + } + + interface Config { + /** + * Map of domains to their environments + */ + domains: { [environment: string]: Array }, + /** + * List of variables split by environment + */ + vars: { [environment: string]: { [variable: string]: any }}, + } +} From 55da76ab813a655da7171f9f7d455312472ad918 Mon Sep 17 00:00:00 2001 From: Matt Wheatley Date: Thu, 4 Feb 2016 16:25:00 +0000 Subject: [PATCH 097/113] Renamed ng to angular for consistency --- angular-environment/angular-environment-tests.ts | 4 ++-- angular-environment/angular-environment.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/angular-environment/angular-environment-tests.ts b/angular-environment/angular-environment-tests.ts index ea3da32a5..b3f83b14f 100644 --- a/angular-environment/angular-environment-tests.ts +++ b/angular-environment/angular-environment-tests.ts @@ -1,6 +1,6 @@ /// -var envServiceProvider: ng.environment.ServiceProvider; -var envService: ng.environment.Service; +var envServiceProvider: angular.environment.ServiceProvider; +var envService: angular.environment.Service; envServiceProvider.config({ domains: { diff --git a/angular-environment/angular-environment.d.ts b/angular-environment/angular-environment.d.ts index a978f6883..6651817b6 100644 --- a/angular-environment/angular-environment.d.ts +++ b/angular-environment/angular-environment.d.ts @@ -3,12 +3,12 @@ // Definitions by: Matt Wheatley // Definitions: https://github.com/LiberisLabs -declare module ng.environment { +declare module angular.environment { interface ServiceProvider { /** * Sets the configuration object */ - config: (config: ng.environment.Config) => void; + config: (config: angular.environment.Config) => void; /** * Evaluates the current domain and * loads the correct environment variables. From aee0039a2d6686ec78352125010ebb38a7a7d743 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Thu, 4 Feb 2016 19:40:44 -0500 Subject: [PATCH 098/113] [node] Export Buffer and SlowBuffer from "buffer" module. --- node/node-tests.ts | 10 ++++++++++ node/node.d.ts | 3 +++ 2 files changed, 13 insertions(+) diff --git a/node/node-tests.ts b/node/node-tests.ts index 8faf5fed6..1d0a321c6 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -16,6 +16,8 @@ import * as path from "path"; import * as readline from "readline"; import * as childProcess from "child_process"; import * as os from "os"; +// Specifically test buffer module regression. +import {Buffer as ImportedBuffer, SlowBuffer as ImportedSlowBuffer} from "buffer"; assert(1 + 1 - 2 === 0, "The universe isn't how it should."); @@ -169,6 +171,14 @@ function bufferTests() { index = buffer.indexOf(23); index = buffer.indexOf(buffer); } + + // Imported Buffer from buffer module works properly + { + let b = new ImportedBuffer('123'); + b.writeUInt8(0, 6); + let sb = new ImportedSlowBuffer(43); + b.writeUInt8(0, 6); + } } diff --git a/node/node.d.ts b/node/node.d.ts index 8df3d16a7..7179464d1 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -411,6 +411,9 @@ interface NodeBuffer { ************************************************/ declare module "buffer" { export var INSPECT_MAX_BYTES: number; + var BuffType: typeof Buffer; + var SlowBuffType: typeof SlowBuffer; + export { BuffType as Buffer, SlowBuffType as SlowBuffer }; } declare module "querystring" { From 88a3ea263eba30418924f53331a00376c51c2f54 Mon Sep 17 00:00:00 2001 From: Kaoru Hagihara Date: Fri, 5 Feb 2016 10:42:31 +0900 Subject: [PATCH 099/113] update vue.d.ts to 1.0.16 --- vue/vue-tests.ts | 9 + vue/vue.d.ts | 483 ++++++++++++++++++++++++----------------------- 2 files changed, 254 insertions(+), 238 deletions(-) diff --git a/vue/vue-tests.ts b/vue/vue-tests.ts index d16bc0104..41ed38a2d 100644 --- a/vue/vue-tests.ts +++ b/vue/vue-tests.ts @@ -221,6 +221,15 @@ namespace TestExplicitExtend { }, methods: { action: this.action + }, + props: { + propA: Object, + propB: { + type: Application, + default: () => null, + twoWay: true, + coerce(value: any) {} + } } }); } diff --git a/vue/vue.d.ts b/vue/vue.d.ts index 2696e3247..8224cfd94 100644 --- a/vue/vue.d.ts +++ b/vue/vue.d.ts @@ -1,270 +1,277 @@ -// Type definitions for vuejs 1.0.11 +// Type definitions for vuejs 1.0.16 // Project: https://github.com/vuejs/vue // Definitions by: odangosan , kaorun343 // Definitions: https://github.com/borisyankov/DefinitelyTyped interface Array { $remove(item: T): Array; - $set(index: number, val: T): T; + $set(index: any, val: T): T; } declare namespace vuejs { - interface PropOption { - type?: any; - required?: boolean; - default?: boolean; - twoWay?: boolean; - validator?(value: any): boolean; - } + interface PropOption { + type?: { new (...args: any[]): any; }; + required?: boolean; + default?: any; + twoWay?: boolean; + validator?(value: any): boolean; + coerce?(value: any): any; + } - interface ComputedOption { - get(): any; - set(value: any): void; - } + interface ComputedOption { + get(): any; + set(value: any): void; + } - interface WatchOption { - handler(val: any, oldVal: any): void; - deep?: boolean; - immidiate?: boolean; - } + interface WatchOption { + handler(val: any, oldVal: any): void; + deep?: boolean; + immidiate?: boolean; + } - interface DirectiveOption { - bind?(): any; - update?(newVal?: any, oldVal?: any): any; - unbind?(): any; - params?: string[]; - deep?: boolean; - twoWay?: boolean; - acceptStatement?: boolean; - priority?: number; - [key: string]: any; - } + interface DirectiveOption { + bind?(): any; + update?(newVal?: any, oldVal?: any): any; + unbind?(): any; + params?: string[]; + deep?: boolean; + twoWay?: boolean; + acceptStatement?: boolean; + priority?: number; + [key: string]: any; + } - interface FilterOption { - read: Function; - write: Function; - } + interface FilterOption { + read?: Function; + write?: Function; + } - interface TransitionOption { - css?: boolean; - beforeEnter?(el: HTMLElement): void; - enter?(el: HTMLElement, done?: () => void): void; - afterEnter?(el: HTMLElement): void; - enterCancelled?(el: HTMLElement): void; - beforeLeave?(el: HTMLElement): void; - leave?(el: HTMLElement, done?: () => void): void; - afterLeave?(el: HTMLElement): void; - leaveCancelled?(el: HTMLElement): void; - stagger?(index: number): number; - } + interface TransitionOption { + css?: boolean; + animation?: string; + enterClass?: string; + leaveClass?: string; + beforeEnter?(el: HTMLElement): void; + enter?(el: HTMLElement, done?: () => void): void; + afterEnter?(el: HTMLElement): void; + enterCancelled?(el: HTMLElement): void; + beforeLeave?(el: HTMLElement): void; + leave?(el: HTMLElement, done?: () => void): void; + afterLeave?(el: HTMLElement): void; + leaveCancelled?(el: HTMLElement): void; + stagger?(index: number): number; + enterStagger?(index: number): number; + leaveStagger?(index: number): number; + [key: string]: any; + } - interface ComponentOption { - data?: {[key: string]: any } | Function; - props?: string[] | { [key: string]: PropOption }; - computed?: { [key: string]: ( Function | ComputedOption ) }; - methods?: { [key: string]: Function }; - watch?: { [key: string]: ( (val: any, oldVal: any) => void | string | WatchOption )}; - el?: string | HTMLElement | ( () => HTMLElement ); - template?: string; - replace?: boolean; - created?(): void; - beforeCompile?(): void; - compiled?(): void; - ready?(): void; - attached?(): void; - detached?(): void; - beforeDestroy?(): void; - destroyed?(): void; - activate?(): void; - directives?: { [key: string]: ( DirectiveOption | Function ) }; - elementDirectives?: { [key: string]: ( DirectiveOption | Function ) }; - filters?: { [key: string]: ( Function | FilterOption ) }; - components?: { [key: string]: ComponentOption }; - transitions?: { [key: string]: TransitionOption }; - partials?: { [key: string]: string }; - parent?: Vue; - events?: { [key: string]: ( (...args: any[]) => ( boolean | void ) ) | string }; - mixins?: ComponentOption[]; - name?: string; - [key: string]: any; - } + interface ComponentOption { + data?: { [key: string]: any } | Function; + props?: string[] | { [key: string]: (PropOption | { new (...args: any[]): any; }) }; + computed?: { [key: string]: (Function | ComputedOption) }; + methods?: { [key: string]: Function }; + watch?: { [key: string]: ((val: any, oldVal: any) => void) | string | WatchOption }; + el?: string | HTMLElement | (() => HTMLElement); + template?: string; + replace?: boolean; + created?(): void; + beforeCompile?(): void; + compiled?(): void; + ready?(): void; + attached?(): void; + detached?(): void; + beforeDestroy?(): void; + destroyed?(): void; + activate?(): void; + directives?: { [key: string]: (DirectiveOption | Function) }; + elementDirectives?: { [key: string]: (DirectiveOption | Function) }; + filters?: { [key: string]: (Function | FilterOption) }; + components?: { [key: string]: any }; + transitions?: { [key: string]: TransitionOption }; + partials?: { [key: string]: string }; + parent?: Vue; + events?: { [key: string]: ((...args: any[]) => (boolean | void)) | string }; + mixins?: Object[]; + name?: string; + [key: string]: any; + } - // instance/api/data.js - interface $get { ( exp: string, asStatement?: boolean ): any; } - interface $set { ( key: string | number, value: T ): T; } - interface $delete { ( key: string) : void; } - interface $watch { ( expOrFn: string | Function, callback: ( (newVal: any, oldVal?: any) => any ) | string, options?: { deep?: boolean, immidiate?: boolean } ): Function; } - interface $eval { ( expression: string ): string; } - interface $interpolate { ( expression: string ): string; } - interface $log { ( keypath?: string ): void; } - // instance/api/dom.js - interface $nextTick { ( callback: Function ): void; } - interface $appendTo { ( target: ( HTMLElement | string ), callback?: Function, withTransition?: boolean ): V; } - interface $prependTo { ( target: ( HTMLElement | string ), callback?: Function, withTransition?: boolean ): V; } - interface $before { ( target: ( HTMLElement | string ), callback?: Function, withTransition?: boolean ): V; } - interface $after { ( target: ( HTMLElement | string ), callback?: Function, withTransition?: boolean ): V; } - interface $remove { ( callback?: Function ): V; } - // instance/api/events.js - interface $on { (event: string, callback: Function): V; } - interface $once { (event: string, callback: Function): V; } - interface $off { (event?: string, callback?: Function): V; } - interface $emit { (event: string, ...args: any[]): V; } - interface $broadcast { (event: string, ...args: any[]): V; } - interface $dispatch { (event: string, ...args: any[]): V; } - // instance/api/lifecycle.js - interface $mount { ( elementOrSelector?: ( HTMLElement | string ) ): V; } - interface $destroy { (remove?: boolean): void; } - interface $compile { (el: Element | DocumentFragment, host?: Vue): Function; } + // instance/api/data.js + interface $get { (exp: string, asStatement?: boolean): any; } + interface $set { (key: string | number, value: T): T; } + interface $delete { (key: string): void; } + interface $watch { (expOrFn: string | Function, callback: ((newVal: any, oldVal?: any) => any) | string, options?: { deep?: boolean, immidiate?: boolean }): Function; } + interface $eval { (expression: string): string; } + interface $interpolate { (expression: string): string; } + interface $log { (keypath?: string): void; } + // instance/api/dom.js + interface $nextTick { (callback: Function): void; } + interface $appendTo { (target: (HTMLElement | string), callback?: Function, withTransition?: boolean): V; } + interface $prependTo { (target: (HTMLElement | string), callback?: Function, withTransition?: boolean): V; } + interface $before { (target: (HTMLElement | string), callback?: Function, withTransition?: boolean): V; } + interface $after { (target: (HTMLElement | string), callback?: Function, withTransition?: boolean): V; } + interface $remove { (callback?: Function): V; } + // instance/api/events.js + interface $on { (event: string, callback: Function): V; } + interface $once { (event: string, callback: Function): V; } + interface $off { (event?: string, callback?: Function): V; } + interface $emit { (event: string, ...args: any[]): V; } + interface $broadcast { (event: string, ...args: any[]): V; } + interface $dispatch { (event: string, ...args: any[]): V; } + // instance/api/lifecycle.js + interface $mount { (elementOrSelector?: (HTMLElement | string)): V; } + interface $destroy { (remove?: boolean): void; } + interface $compile { (el: Element | DocumentFragment, host?: Vue): Function; } - interface Vue { - $data?: any; - $el?: HTMLElement; - $options?: Object; - $parent?: Vue; - $root?: Vue; - $children?: Vue[]; - $refs?: Object; - $els?: Object; + interface Vue { + $data?: any; + $el?: HTMLElement; + $options?: Object; + $parent?: Vue; + $root?: Vue; + $children?: Vue[]; + $refs?: Object; + $els?: Object; - $get?: $get; - $set?: $set; - $delete?: $delete; - $eval?: $eval; - $interpolate?: $interpolate; - $log?: $log; - $watch?: $watch; - $on?: $on; - $once?: $once; - $off?: $off; - $emit?: $emit; - $dispatch?: $dispatch; - $broadcast?: $broadcast; - $appendTo?: $appendTo; - $before?: $before; - $after?: $after; - $remove?: $remove; - $nextTick?: $nextTick; - $mount?: $mount; - $destroy?: $destroy; - $compile?: $compile; + $get?: $get; + $set?: $set; + $delete?: $delete; + $eval?: $eval; + $interpolate?: $interpolate; + $log?: $log; + $watch?: $watch; + $on?: $on; + $once?: $once; + $off?: $off; + $emit?: $emit; + $dispatch?: $dispatch; + $broadcast?: $broadcast; + $appendTo?: $appendTo; + $before?: $before; + $after?: $after; + $remove?: $remove; + $nextTick?: $nextTick; + $mount?: $mount; + $destroy?: $destroy; + $compile?: $compile; - _init(options?: ComponentOption): void; - } + _init(options?: ComponentOption): void; + } - interface VueConfig { - debug: boolean; - delimiters: [string, string]; - unsafeDelimiters: [string, string]; - silent: boolean; - async: boolean; - convertAllProperties: boolean; - } + interface VueConfig { + debug: boolean; + delimiters: [string, string]; + unsafeDelimiters: [string, string]; + silent: boolean; + async: boolean; + convertAllProperties: boolean; + } - interface VueUtil { - // util/lang.js - set(obj: Object, key: string, value: any): void; - del(obj: Object, key: string): void; - hasOwn(obj: Object, key: string): boolean; - isLiteral(exp: string): boolean; - isReserved(str: string): boolean; - _toString(value: any): string; - toNumber(value: T): T | number; - toBoolean(value: T): T | boolean; - stripQuotes(str: string): string; - camelize(str: string): string; - hyphenate(str: string): string; - classify(str: string): string; - bind(fn: Function, ctx: Object): Function; - toAarray(list: ArrayLike, start?: number): Array; - extend(to: T, from: F): ( T & F ); - isObject(obj: any): boolean; - isPlainObject(obj: any): boolean; - isArray: typeof Array.isArray; - def(obj: Object, key: string, value: any, enumerable?: boolean): void; - debounce(func: Function, wait: number): Function; - indexOf(arr: Array, obj: T): number; - cancellable(fn: Function): Function; - looseEqual(a: any, b: any): boolean; - // util/env.js - hasProto: boolean; - inBrowser: boolean; - isIE9: boolean; - isAndroid: boolean; - transitionProp: string; - transitionEndEvent: string; - animationProp: string; - animationEndEvent: string; - nextTick(cb: Function, ctx?: Object): void; - // util/dom.js - query(el: string | Element): Element; - inDoc(node: Node): boolean; - getAttr(node: Node, _attr: string): string; - getBindAttr(node: Node, name: string): string; - before(el: Element, target: Element): void; - after(el: Element, target: Element): void; - remove(el: Element): void; - prepend(el: Element, target: Element): void; - replace(target: Element, el: Element): void; - on(el: Element, event: string, cb: Function): void; - off(el: Element, event: string, cb: Function): void; - addClass(el: Element, cls: string): void; - removeClass(el: Element, cls: string): void; - extractContent(el: Element, asFragment: boolean): ( HTMLDivElement | DocumentFragment ); - trimNode(node: Node): void; - isTemplate(el: Element): boolean; - createAnchor(content: string, persist: boolean): ( Comment | Text ); - findRef(node: Element): string; - mapNodeRange(node: Node, end: Node, op: Function): void; - removeNodeRange(start: Node, end: Node, vm: any, frag: DocumentFragment, cb: Function): void; - // util/options.js - mergeOptions(parent: P, child: C, vm?: any): ( P & C ); - resolveAsset(options: Object, type: string, id: string): ( Object | Function ); - assertAsset(val: any, type: string, id: string): void; - // util/component.js - commonTagRE: RegExp; - checkComponentAttr(el: Element, options?: Object): Object; - initProp(vm: Vue, prop: Object, value: any): void; - assertProp(prop: Object, value: any): boolean; - // util/debug.js - warn(msg: string, e?: Error): void; - // observer/index.js - defineReactive(obj: Object, key: string, val: any): void; - } + interface VueUtil { + // util/lang.js + set(obj: Object, key: string, value: any): void; + del(obj: Object, key: string): void; + hasOwn(obj: Object, key: string): boolean; + isLiteral(exp: string): boolean; + isReserved(str: string): boolean; + _toString(value: any): string; + toNumber(value: T): T | number; + toBoolean(value: T): T | boolean; + stripQuotes(str: string): string; + camelize(str: string): string; + hyphenate(str: string): string; + classify(str: string): string; + bind(fn: Function, ctx: Object): Function; + toAarray(list: ArrayLike, start?: number): Array; + extend(to: T, from: F): (T & F); + isObject(obj: any): boolean; + isPlainObject(obj: any): boolean; + isArray: typeof Array.isArray; + def(obj: Object, key: string, value: any, enumerable?: boolean): void; + debounce(func: Function, wait: number): Function; + indexOf(arr: Array, obj: T): number; + cancellable(fn: Function): Function; + looseEqual(a: any, b: any): boolean; + // util/env.js + hasProto: boolean; + inBrowser: boolean; + isIE9: boolean; + isAndroid: boolean; + transitionProp: string; + transitionEndEvent: string; + animationProp: string; + animationEndEvent: string; + nextTick(cb: Function, ctx?: Object): void; + // util/dom.js + query(el: string | Element): Element; + inDoc(node: Node): boolean; + getAttr(node: Node, _attr: string): string; + getBindAttr(node: Node, name: string): string; + before(el: Element, target: Element): void; + after(el: Element, target: Element): void; + remove(el: Element): void; + prepend(el: Element, target: Element): void; + replace(target: Element, el: Element): void; + on(el: Element, event: string, cb: Function): void; + off(el: Element, event: string, cb: Function): void; + addClass(el: Element, cls: string): void; + removeClass(el: Element, cls: string): void; + extractContent(el: Element, asFragment: boolean): (HTMLDivElement | DocumentFragment); + trimNode(node: Node): void; + isTemplate(el: Element): boolean; + createAnchor(content: string, persist: boolean): (Comment | Text); + findRef(node: Element): string; + mapNodeRange(node: Node, end: Node, op: Function): void; + removeNodeRange(start: Node, end: Node, vm: any, frag: DocumentFragment, cb: Function): void; + // util/options.js + mergeOptions(parent: P, child: C, vm?: any): (P & C); + resolveAsset(options: Object, type: string, id: string): (Object | Function); + assertAsset(val: any, type: string, id: string): void; + // util/component.js + commonTagRE: RegExp; + checkComponentAttr(el: Element, options?: Object): Object; + initProp(vm: Vue, prop: Object, value: any): void; + assertProp(prop: Object, value: any): boolean; + // util/debug.js + warn(msg: string, e?: Error): void; + // observer/index.js + defineReactive(obj: Object, key: string, val: any): void; + } - // instance/api/global.js - interface VueStatic { - new(options?: ComponentOption): Vue; - prototype: Vue; - util: VueUtil; - config: VueConfig; - set(object: Object, key: string, value: any): void; - delete(object: Object, key: string): void; - nextTick(callback: Function): any; + // instance/api/global.js + interface VueStatic { + new (options?: ComponentOption): Vue; + prototype: Vue; + util: VueUtil; + config: VueConfig; + set(object: Object, key: string, value: any): void; + delete(object: Object, key: string): void; + nextTick(callback: Function): any; - cid: number; + cid: number; - extend(options?: ComponentOption): VueStatic; - use(callback: Function | {install: Function, [key: string]: any}, option?: Object): VueStatic; - mixin(mixin: Object): void; + extend(options?: ComponentOption): VueStatic; + use(callback: Function | { install: Function, [key: string]: any }, option?: Object): VueStatic; + mixin(mixin: Object): void; - directive(id: string, definition: T): T; - directive(id: string): any; - elementDirective(id: string, definition: T): T; - elementDirective(id: string): any; - filter(id: string, definition: T): T; - filter(id: string): any; - component(id: string, definition: ComponentOption): any; - component(id: string): any; - transition(id: string, hooks: T): T; - transition(id: string): TransitionOption; - partial(id: string, partial: string): string; - partial(id: string): string; - } + directive(id: string, definition: T): T; + directive(id: string): any; + elementDirective(id: string, definition: T): T; + elementDirective(id: string): any; + filter(id: string, definition: T): T; + filter(id: string): any; + component(id: string, definition: ComponentOption): any; + component(id: string): any; + transition(id: string, hooks: T): T; + transition(id: string): TransitionOption; + partial(id: string, partial: string): string; + partial(id: string): string; + } } declare var Vue: vuejs.VueStatic; declare module "vue" { - export = Vue; + export = Vue; } From 0146caf10cf880cd83c311862cc65862b9cb919b Mon Sep 17 00:00:00 2001 From: Kaoru Hagihara Date: Fri, 5 Feb 2016 11:00:20 +0900 Subject: [PATCH 100/113] update vue-router.d.ts to 0.7.10 --- vue-router/vue-router-tests.ts | 5 ++--- vue-router/vue-router.d.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/vue-router/vue-router-tests.ts b/vue-router/vue-router-tests.ts index b0fc1b511..2a75768fb 100644 --- a/vue-router/vue-router-tests.ts +++ b/vue-router/vue-router-tests.ts @@ -62,9 +62,8 @@ namespace TestAdvanced { transition.next(); }, activate: function() { - return new Promise((resolve) => { - resolve(); - }); + var p: PromiseLike; + return p; }, deactivate: function({next}) { next(); diff --git a/vue-router/vue-router.d.ts b/vue-router/vue-router.d.ts index 97f31c922..05bd2a762 100644 --- a/vue-router/vue-router.d.ts +++ b/vue-router/vue-router.d.ts @@ -1,10 +1,9 @@ -// Type definitions for vue-router 0.7.7 +// Type definitions for vue-router 0.7.10 // Project: https://github.com/vuejs/vue-router // Definitions by: kaorun343 // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -/// declare namespace vuerouter { @@ -65,18 +64,19 @@ declare namespace vuerouter { } interface TransitionHook { - data?(transition?: Transition): Thenable | void; - activate?(transition?: Transition): Thenable | void; - deactivate?(transition?: Transition): Thenable | void; - canActivate?(transition?: Transition): Thenable | boolean | void; - canDeactivate?(transition?: Transition): Thenable | boolean | void; + data?(transition?: Transition): PromiseLike | void; + activate?(transition?: Transition): PromiseLike | void; + deactivate?(transition?: Transition): PromiseLike | void; + canActivate?(transition?: Transition): PromiseLike | boolean | void; + canDeactivate?(transition?: Transition): PromiseLike | boolean | void; canReuse?: boolean | ((transition: Transition) => boolean); } } declare namespace vuejs { interface Vue { - $route: vuerouter.$route; + $route?: vuerouter.$route; + $router?: vuerouter.Router; } interface ComponentOption { From 6ab7c12437ea859e1742857514fb2bc621bed23e Mon Sep 17 00:00:00 2001 From: Kaoru Hagihara Date: Fri, 5 Feb 2016 11:06:00 +0900 Subject: [PATCH 101/113] fix vue.js --- vue/vue-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vue/vue-tests.ts b/vue/vue-tests.ts index 41ed38a2d..360625f05 100644 --- a/vue/vue-tests.ts +++ b/vue/vue-tests.ts @@ -226,7 +226,7 @@ namespace TestExplicitExtend { propA: Object, propB: { type: Application, - default: () => null, + default: () => new Application(), twoWay: true, coerce(value: any) {} } From 2a9c4f4b9fa905c5568505333beb49e1ef805c57 Mon Sep 17 00:00:00 2001 From: Aluan Haddad Date: Fri, 5 Feb 2016 01:57:37 -0500 Subject: [PATCH 102/113] Change type of IFieldConfigurationObject.elementAttributes to hash Formly requires this property to be an object. A string value causes ApiCheck to throw. --- angular-formly/angular-formly.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/angular-formly/angular-formly.d.ts b/angular-formly/angular-formly.d.ts index 423e6ff9b..e625f4d3e 100644 --- a/angular-formly/angular-formly.d.ts +++ b/angular-formly/angular-formly.d.ts @@ -198,7 +198,9 @@ declare module AngularFormly { className?: string; - elementAttributes?: string; + elementAttributes?: { + [key: string]: string; + }; /** From 83b88a031cc8f2006fd361bf0a0b548c3bcc8259 Mon Sep 17 00:00:00 2001 From: sjef Date: Fri, 5 Feb 2016 13:14:37 +0100 Subject: [PATCH 103/113] Added missing bottom property in React.CSSProperties --- react/react.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/react/react.d.ts b/react/react.d.ts index e9b88dde2..9b57288cf 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -686,6 +686,11 @@ declare namespace __React { */ borderWidth?: any; + /** + * This property specifies how far an absolutely positioned box's bottom margin edge is offset above the bottom edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the bottom edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). + */ + bottom?: any; + /** * Obsolete. */ From c64873177e3b86a10f09a76b4d5545a0d8920ffb Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Fri, 5 Feb 2016 16:11:11 +0100 Subject: [PATCH 104/113] Enables ES6 module loading. --- highcharts/highcharts.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts index 4405f2407..0f04cc581 100644 --- a/highcharts/highcharts.d.ts +++ b/highcharts/highcharts.d.ts @@ -6285,3 +6285,16 @@ interface JQuery { **/ highcharts(options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): JQuery; } + +/** + * Enabling the usage of ES6 module loading. + */ +declare var Highcharts: HighchartsStatic; + +/** + * Declaration for ES6 module loading. + */ +declare module "highcharts" { + export = Highcharts; +} + From dff6dc82500b69e4a4c0a468bb4de63b5d043e2e Mon Sep 17 00:00:00 2001 From: aba Date: Fri, 5 Feb 2016 19:47:36 +0100 Subject: [PATCH 105/113] Fixing the test : * There is a new required parameter in OpenLayers. * Explicitly set the type of void functions ! I also add some tests. --- openlayers/openlayers-tests.ts | 23 +++++++++++++++++++++++ openlayers/openlayers.d.ts | 30 +++++++++++++++--------------- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/openlayers/openlayers-tests.ts b/openlayers/openlayers-tests.ts index f60e45bd9..3858720e2 100644 --- a/openlayers/openlayers-tests.ts +++ b/openlayers/openlayers-tests.ts @@ -360,10 +360,22 @@ var imageWMS: ol.source.ImageWMS = new ol.source.ImageWMS({ // ol.source.TileWMS // var tileWMS: ol.source.TileWMS = new ol.source.TileWMS({ + params: {}, serverType: stringValue, url:stringValue }); +// +// ol.source.WMTS +// +var wmts: ol.source.WMTS = new ol.source.WMTS({ + tileGrid: new ol.tilegrid.WMTS({}), + layer: "", + style: "", + matrixSet: "", + wrapX: true +}); + // // ol.animation // @@ -521,3 +533,14 @@ jsonValue = geojsonFormat.writeFeaturesObject(featureArray); jsonValue = geojsonFormat.writeFeaturesObject(featureArray, writeOptions); jsonValue = geojsonFormat.writeGeometryObject(geometry); jsonValue = geojsonFormat.writeGeometryObject(geometry, writeOptions); + +// +// ol.interactions +// +var modify: ol.interaction.Modify = new ol.interaction.Modify({ + features: new ol.Collection(featureArray) +}); + +var draw: ol.interaction.Draw = new ol.interaction.Draw({ + type: "Point" +}) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index 09a6e3397..eaf39d4a4 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -2888,7 +2888,7 @@ declare module ol { * @param destination The desired projection. Can be a string identifier or a ol.proj.Projection object. * @return This geometry. Note that original geometry is modified in place. */ - transform(source: ol.proj.ProjectionLike, destination: ol.proj.ProjectionLike); + transform(source: ol.proj.ProjectionLike, destination: ol.proj.ProjectionLike): ol.geom.Geometry; } /** @@ -4104,18 +4104,18 @@ declare module ol { * Add a single feature to the source. If you want to add a batch of features at once, * call source.addFeatures() instead. */ - addFeature(feature: ol.Feature); + addFeature(feature: ol.Feature):void; /** * Add a batch of features to the source. */ - addFeatures(features: ol.Feature[]); + addFeatures(features: ol.Feature[]):void; /** * Remove all features from the source. * @param Skip dispatching of removefeature events. */ - clear(fast?: boolean); + clear(fast?: boolean):void; /** * Get the extent of the features currently in the source. */ @@ -4194,9 +4194,9 @@ declare module ol { getScale(): number; getSnapToPiexl(): boolean; - setOpacity(opacity: number); - setRotation(rotation: number); - setScale(scale: number); + setOpacity(opacity: number):void; + setRotation(rotation: number):void; + setScale(scale: number):void; } interface GeometryFunction { @@ -4214,12 +4214,12 @@ declare module ol { getLineJoin(): string; getMitterLimit(): number; getWidth(): number; - setColor(color: ol.Color|string); - setLineCap(lineCap: string); - setLineDash(lineDash: number[]); - setLineJoin(lineJoin: string); - setMiterLimit(miterLimit: number); - setWidth(width: number); + setColor(color: ol.Color|string):void; + setLineCap(lineCap: string):void; + setLineDash(lineDash: number[]):void; + setLineJoin(lineJoin: string):void; + setMiterLimit(miterLimit: number):void; + setWidth(width: number):void; } /** @@ -4243,8 +4243,8 @@ declare module ol { getText(): ol.style.Text; getZIndex(): number; - setGeometry(geometry: string | ol.geom.Geometry | ol.style.GeometryFunction); - setZIndex( zIndex: number); + setGeometry(geometry: string | ol.geom.Geometry | ol.style.GeometryFunction):void; + setZIndex( zIndex: number):void; } /** From f7164a47ffe5e9a7ea2f4bec8fc4009347c64f6d Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 5 Feb 2016 16:34:02 -0800 Subject: [PATCH 106/113] Remove stale angular2 alpha typings --- angular2/angular2-2.0.0-alpha.26.d.ts | 4624 ------- angular2/angular2-2.0.0-alpha.28.d.ts | 6162 --------- angular2/angular2-2.0.0-alpha.30.d.ts | 6875 ---------- angular2/angular2-2.0.0-alpha.31.d.ts | 6137 --------- angular2/angular2-2.0.0-alpha.32.d.ts | 6043 --------- angular2/angular2-2.0.0-alpha.33.d.ts | 6310 --------- angular2/angular2-2.0.0-alpha.34.d.ts | 6564 --------- angular2/angular2-2.0.0-alpha.35.d.ts | 5775 -------- angular2/angular2-2.0.0-alpha.36.d.ts | 5920 -------- angular2/angular2-2.0.0-alpha.37.d.ts | 12214 ----------------- angular2/angular2-2.0.0-alpha.38.d.ts | 17106 ------------------------ angular2/angular2-2.0.0-alpha.39.d.ts | 17105 ----------------------- angular2/angular2-tests.ts | 3 - angular2/angular2.d.ts | 13 - angular2/http-2.0.0-alpha.37.d.ts | 1007 -- angular2/http-2.0.0-alpha.38.d.ts | 1310 -- angular2/http-2.0.0-alpha.39.d.ts | 1310 -- angular2/router-2.0.0-alpha.30.d.ts | 352 - angular2/router-2.0.0-alpha.31.d.ts | 459 - angular2/router-2.0.0-alpha.34.d.ts | 469 - angular2/router-2.0.0-alpha.35.d.ts | 689 - angular2/router-2.0.0-alpha.36.d.ts | 689 - angular2/router-2.0.0-alpha.37.d.ts | 738 - angular2/router-2.0.0-alpha.38.d.ts | 1330 -- angular2/router-2.0.0-alpha.39.d.ts | 1330 -- angular2/test_lib-2.0.0-alpha.38.d.ts | 408 - angular2/test_lib-2.0.0-alpha.39.d.ts | 408 - 27 files changed, 111350 deletions(-) delete mode 100644 angular2/angular2-2.0.0-alpha.26.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.28.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.30.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.31.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.32.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.33.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.34.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.35.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.36.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.37.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.38.d.ts delete mode 100644 angular2/angular2-2.0.0-alpha.39.d.ts delete mode 100644 angular2/angular2-tests.ts delete mode 100644 angular2/angular2.d.ts delete mode 100644 angular2/http-2.0.0-alpha.37.d.ts delete mode 100644 angular2/http-2.0.0-alpha.38.d.ts delete mode 100644 angular2/http-2.0.0-alpha.39.d.ts delete mode 100644 angular2/router-2.0.0-alpha.30.d.ts delete mode 100644 angular2/router-2.0.0-alpha.31.d.ts delete mode 100644 angular2/router-2.0.0-alpha.34.d.ts delete mode 100644 angular2/router-2.0.0-alpha.35.d.ts delete mode 100644 angular2/router-2.0.0-alpha.36.d.ts delete mode 100644 angular2/router-2.0.0-alpha.37.d.ts delete mode 100644 angular2/router-2.0.0-alpha.38.d.ts delete mode 100644 angular2/router-2.0.0-alpha.39.d.ts delete mode 100644 angular2/test_lib-2.0.0-alpha.38.d.ts delete mode 100644 angular2/test_lib-2.0.0-alpha.39.d.ts diff --git a/angular2/angular2-2.0.0-alpha.26.d.ts b/angular2/angular2-2.0.0-alpha.26.d.ts deleted file mode 100644 index a527b13ca..000000000 --- a/angular2/angular2-2.0.0-alpha.26.d.ts +++ /dev/null @@ -1,4624 +0,0 @@ -// Type definitions for Angular v2.0.0-alpha.26 -// Project: http://angular.io/ -// Definitions by: angular team -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -// *********************************************************** -// This file is generated by the Angular build process. -// Please do not create manual edits or send pull requests -// modifying this file. -// *********************************************************** - -// Angular depends transitively on these libraries. -// If you don't have them installed you can run -// $ tsd query es6-promise rx rx-lite --action install --save -/// -/// - -interface List extends Array {} -interface Map {} -interface StringMap {} -interface Type {} - -declare module "angular2/angular2" { - type SetterFn = typeof Function; - type int = number; - - // See https://github.com/Microsoft/TypeScript/issues/1168 - class BaseException /* extends Error */ { - message: any; - stack: any; - toString(): string; - } -} - - -declare module "angular2/angular2" { - class AbstractChangeDetector extends ChangeDetector { - addChild(cd: ChangeDetector): any; - addShadowDomChild(cd: ChangeDetector): any; - callOnAllChangesDone(): any; - checkNoChanges(): any; - detectChanges(): any; - detectChangesInRecords(throwOnChange: boolean): any; - lightDomChildren: List; - markAsCheckOnce(): any; - markPathToRootAsCheckOnce(): any; - mode: string; - parent: ChangeDetector; - ref: ChangeDetectorRef; - remove(): any; - removeChild(cd: ChangeDetector): any; - removeShadowDomChild(cd: ChangeDetector): any; - shadowDomChildren: List; - } - - class ProtoRecord { - args: List; - bindingRecord: BindingRecord; - contextIndex: number; - directiveIndex: DirectiveIndex; - expressionAsString: string; - fixedArgs: List; - funcOrValue: any; - isLifeCycleRecord(): boolean; - isPipeRecord(): boolean; - isPureFunction(): boolean; - lastInBinding: boolean; - lastInDirective: boolean; - mode: number; - name: string; - selfIndex: number; - } - - class LifecycleEvent { - name: string; - } - - interface FormDirective { - addControl(dir: ControlDirective): void; - addControlGroup(dir: ControlGroupDirective): void; - getControl(dir: ControlDirective): Control; - removeControl(dir: ControlDirective): void; - removeControlGroup(dir: ControlGroupDirective): void; - updateModel(dir: ControlDirective, value: any): void; - } - - - /** - * A directive that contains a group of [ControlDirective]. - * - * @exportedAs angular2/forms - */ - class ControlContainerDirective { - formDirective: FormDirective; - name: string; - path: List; - } - - - /** - * A marker annotation that marks a class as available to `Injector` for creation. Used by tooling - * for generating constructor stubs. - * - * ``` - * class NeedsService { - * constructor(svc:UsefulService) {} - * } - * - * @Injectable - * class UsefulService {} - * ``` - * @exportedAs angular2/di_annotations - */ - class Injectable { - } - - - /** - * Injectable Objects that contains a live list of child directives in the light Dom of a directive. - * The directives are kept in depth-first pre-order traversal of the DOM. - * - * In the future this class will implement an Observable interface. - * For now it uses a plain list of observable callbacks. - * - * @exportedAs angular2/view - */ - class BaseQueryList { - add(obj: any): any; - fireCallbacks(): any; - onChange(callback: any): any; - removeCallback(callback: any): any; - reset(newList: any): any; - } - - class AppProtoView { - bindElement(parent: ElementBinder, distanceToParent: int, protoElementInjector: ProtoElementInjector, componentDirective?: DirectiveBinding): ElementBinder; - - /** - * Adds an event binding for the last created ElementBinder via bindElement. - * - * If the directive index is a positive integer, the event is evaluated in the context of - * the given directive. - * - * If the directive index is -1, the event is evaluated in the context of the enclosing view. - * - * @param {string} eventName - * @param {AST} expression - * @param {int} directiveIndex The directive index in the binder or -1 when the event is not bound - * to a directive - */ - bindEvent(eventBindings: List, boundElementIndex: number, directiveIndex?: int): void; - elementBinders: List; - protoChangeDetector: ProtoChangeDetector; - protoLocals: Map; - render: RenderProtoViewRef; - variableBindings: Map; - } - - - /** - * Const of making objects: http://jsperf.com/instantiate-size-of-object - */ - class AppView implements ChangeDispatcher, EventDispatcher { - callAction(elementIndex: number, actionExpression: string, action: Object): any; - changeDetector: ChangeDetector; - componentChildViews: List; - - /** - * The context against which data-binding expressions in this view are evaluated against. - * This is always a component instance. - */ - context: any; - dispatchEvent(elementIndex: number, eventName: string, locals: Map): boolean; - elementInjectors: List; - freeHostViews: List; - getDetectorFor(directive: DirectiveIndex): any; - getDirectiveFor(directive: DirectiveIndex): any; - hydrated(): boolean; - init(changeDetector: ChangeDetector, elementInjectors: List, rootElementInjectors: List, preBuiltObjects: List, componentChildViews: List): any; - - /** - * Variables, local to this view, that can be used in binding expressions (in addition to the - * context). This is used for thing like `