Merge branch 'master' into material-ui/textfield

This commit is contained in:
DaIgeb
2017-04-17 20:51:03 +02:00
committed by GitHub
4038 changed files with 76466 additions and 143102 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ If adding a new definition:
If changing an existing definition:
- [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <<url here>>
- [ ] Increase the version number in the header if appropriate.
- [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "../tslint.json" }`.
- [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dslint/dt.json" }`.
If removing a declaration:
- [ ] If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
+7 -5
View File
@@ -71,7 +71,9 @@ Add to your `tsconfig.json`:
Create `types/foo/index.d.ts` containing declarations for the module "foo".
You should now be able import from `"foo"` in your code and it will route to the new type definition.
Then build *and* run the code to make sure your type definition actually corresponds to what happens at runtime.
Once you've tested your definitions with real code, make a PR contributing the definition by copying `types/foo` to `DefinitelyTyped/foo` and adding a `tsconfig.json` and `foo-tests.ts`.
Once you've tested your definitions with real code, make a [PR](#make-a-pull-request)
then follow the instructions to [edit an existing package](#edit-an-existing-package) or
[create a new package](#create-a-new-package).
### Make a pull request
@@ -83,7 +85,7 @@ First, [fork](https://guides.github.com/activities/forking/) this repository, in
#### Edit an existing package
* `cd my-package-to-edit`
* `cd types/my-package-to-edit`
* Make changes. Remember to edit tests.
* You may also want to add yourself to "Definitions by" section of the package header.
- Do this by adding your name to the end of the line, as in `// Definitions by: Alice <https://github.com/alice>, Bob <https://github.com/bob>`.
@@ -153,15 +155,15 @@ If a package was never on DefinitelyTyped, it does not need to be added to `notN
#### Lint
To lint a package, just add a `tslint.json` to that package containing `{ "extends": "../tslint.json" }`. All new packages must be linted.
To lint a package, just add a `tslint.json` to that package containing `{ "extends": "dtslint/dt.json" }`. All new packages must be linted.
If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. For example:
```js
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
// This package uses the Function type, and it will take effort to fix.
"forbidden-types": false
"ban-types": false
}
}
```
+1380
View File
File diff suppressed because it is too large Load Diff
+388
View File
@@ -0,0 +1,388 @@
/*
* Test file for node-jose. At this time these tests were taken verbatim
* from the documentation on the NPM page at
* https://www.npmjs.com/package/node-jose
* This file definitely needs to be cleaned up and more tests added to
* test the entirety of the definition file.
*/
import * as jose from 'node-jose';
let keystore = jose.JWK.createKeyStore();
let buf = new Buffer('a');
jose.JWK.asKeyStore("{key: somekey}").
then(function (result) {
// {result} is a jose.JWK.KeyStore
keystore = result;
});
let output = keystore.toJSON();
output = keystore.toJSON(true);
// by 'kid'
let kid: string = "someID";
let key = keystore.get(kid);
// ... and by 'kty'
key = keystore.get(kid, { kty: 'RSA' });
// ... and by 'use'
key = keystore.get(kid, { use: 'enc' });
// ... and by 'alg'
key = keystore.get(kid, { use: 'RSA-OAEP' });
// ... and by 'kty' and 'use'
key = keystore.get(kid, { kty: 'RSA', use: 'enc' });
// same as above, but with a single {props} argument
key = keystore.get({ kid: kid, kty: 'RSA', use: 'enc' });
// searching for keys
let everything = keystore.all();
// filter by 'kid'
everything = keystore.all({ kid: kid });
// filter by 'kty'
everything = keystore.all({ kty: 'RSA' });
// filter by 'use'
everything = keystore.all({ use: 'enc' });
// filter by 'alg'
everything = keystore.all({ alg: 'RSA-OAEP' });
// filter by 'kid' + 'kty' + 'alg'
everything = keystore.all({ kid: kid, kty: 'RSA', alg: 'RSA-OAEP' });
// input is either a:
// * jose.JWK.Key to copy from; or
// * JSON object representing a JWK; or
keystore.add({}).
then(function (result) {
// {result} is a jose.JWK.Key
key = result;
});
// input is either a:
// * String serialization of a JSON JWK/(base64-encoded) PEM/(binary-encoded) DER
// * Buffer of a JSON JWK/(base64-encoded) PEM/(binary-encoded) DER
// form is either a:
// * "json" for a JSON stringified JWK
// * "private" for a DER encoded 'raw' private key
// * "pkcs8" for a DER encoded (unencrypted!) PKCS8 private key
// * "public" for a DER encoded SPKI public key (alternate to 'spki')
// * "spki" for a DER encoded SPKI public key
// * "pkix" for a DER encoded PKIX X.509 certificate
// * "x509" for a DER encoded PKIX X.509 certificate
// * "pem" for a PEM encoded of PKCS8 / SPKI / PKIX
keystore.add(buf, "json").
then(function (result) {
// {result} is a jose.JWK.Key
key = result;
});
// first argument is the key type (kty)
// second is the key size (in bits) or named curve ('crv') for "EC"
keystore.generate("oct", 256).
then(function (result) {
// {result} is a jose.JWK.Key
key = result;
});
// ... with properties
var props = {
kid: 'gBdaS-G8RLax2qgObTD94w',
alg: 'A256GCM',
use: 'enc'
};
keystore.generate("oct", 256, props).
then(function (result) {
// {result} is a jose.JWK.Key
key = result;
});
keystore.remove(key);
// NOTE: key.keystore does not change!!
// where input is either a:
// * jose.JWK.Key instance
// * JSON Object representation of a JWK
jose.JWK.asKey({}).
then(function (result) {
// {result} is a jose.JWK.Key
// {result.keystore} is a unique jose.JWK.KeyStore
key = result;
});
// where input is either a:
// * String serialization of a JSON JWK/(base64-encoded) PEM/(binary-encoded) DER
// * Buffer of a JSON JWK/(base64-encoded) PEM/(binary-encoded) DER
// form is either a:
// * "json" for a JSON stringified JWK
// * "pkcs8" for a DER encoded (unencrypted!) PKCS8 private key
// * "spki" for a DER encoded SPKI public key
// * "pkix" for a DER encoded PKIX X.509 certificate
// * "x509" for a DER encoded PKIX X.509 certificate
// * "pem" for a PEM encoded of PKCS8 / SPKI / PKIX
jose.JWK.asKey({}, 'json').
then(function (result) {
// {result} is a jose.JWK.Key
// {result.keystore} is a unique jose.JWK.KeyStore
key = result;
});
output = key.toJSON();
output = key.toJSON(true);
// where hash is a supported algorithm, currently one of:
// * SHA-1
// * SHA-256
// * SHA-384
// * SHA-512
key.thumbprint('SHA-1').
then(function (print) {
// {print} is a Buffer containing the thumbprint binary value
});
// {input} is a Buffer
jose.JWS.createSign(key).
update(buf).
final().
then(function (result) {
// {result} is a JSON object -- JWS using the JSON General Serialization
});
jose.JWS.createSign({ format: 'flattened' }, key).
update(buf).
final().
then(function (result) {
// {result} is a JSON object -- JWS using the JSON Flattened Serialization
});
jose.JWS.createSign({ format: 'compact' }, key).
update(buf).
final().
then(function (result) {
// {result} is a String -- JWS using the Compact Serialization
});
jose.JWS.createSign({ alg: 'PS256' }, key).
update(buf).
final().
then(function (result) {
// ....
});
jose.JWS.createSign({ fields: { cty: 'jwk+json' } }, key).
update(buf).
final().
then(function (result) {
// ....
});
jose.JWS.createSign(key).
update(buf, "utf8").
final().
then(function (result) {
// ....
});
// {keys} is an Array of jose.JWK.Key instances
jose.JWS.createSign([key, key]).
update(buf).
final().
then(function (result) {
// ....
});
jose.JWS.createVerify(keystore).
verify("some.jws.object").
then(function (result) {
// {result} is a Object with:
// * header: the combined 'protected' and 'unprotected' header members
// * payload: Buffer of the signed content
// * signature: Buffer of the verified signature
// * key: The key used to verify the signature
});
// {key} can be:
// * jose.JWK.Key
// * JSON object representing a JWK
jose.JWS.createVerify(key).
verify('some.jws.object').
then(function (result) {
// ...
});
jose.JWS.createVerify().
verify('some.jws.key').
then(function (result) {
// ...
});
var opts = {
handlers: {
"exp": true
}
};
jose.JWS.createVerify(key, opts).
verify('some.jws.key').
then(function (result) {
// ...
});
var opts2 = {
handlers: {
"exp": function (jws: any) {
// {jws} is the JWS verify output, pre-verification
jws.header.exp = new Date(jws.header.exp);
}
}
};
jose.JWS.createVerify(key, opts2).
verify('some.jws.key').
then(function (result) {
// ...
});
var opts3 = {
handlers: {
"exp": {
complete: function (jws: any) {
// {jws} is the JWS verify output, post-verification
jws.header.exp = new Date(jws.header.exp);
}
}
}
};
jose.JWS.createVerify(key, opts3).
verify('some.jws.key').
then(function (result) {
// ...
});
//Encryption
// {input} is a Buffer
jose.JWE.createEncrypt(key).
update(buf).
final().
then(function (result) {
// {result} is a JSON Object -- JWE using the JSON General Serialization
});
jose.JWE.createEncrypt({ format: 'compact' }, key).
update(buf).
final().
then(function (result) {
// {result} is a String -- JWE using the Compact Serialization
});
jose.JWE.createEncrypt({ format: 'flattened' }, key).
update(buf).
final().
then(function (result) {
// {result} is a JSON Object -- JWE using the JSON Flattened Serialization
});
jose.JWE.createEncrypt({ zip: true }, key).
update(buf).
final().
then(function (result) {
// ....
});
jose.JWE.createEncrypt({ fields: { cty: 'jwk+json' } }, key).
update(buf).
final().
then(function (result) {
// ....
});
// {keys} is an Array of jose.JWK.Key instances
jose.JWE.createEncrypt([key, key]).
update(buf).
final().
then(function (result) {
// ....
});
jose.JWE.createDecrypt(keystore).
decrypt('some.jwe').
then(function (result) {
// {result} is a Object with:
// * header: the combined 'protected' and 'unprotected' header members
// * protected: an array of the member names from the "protected" member
// * key: Key used to decrypt
// * payload: Buffer of the decrypted content
// * plaintext: Buffer of the decrypted content (alternate)
});
jose.JWE.createDecrypt(key).
decrypt('some.jwe').
then(function (result) {
// ....
});
var opts4 = {
handlers: {
"exp": true
}
};
jose.JWE.createDecrypt(key, opts4).
decrypt('some.jwe').
then(function (result) {
// ...
});
//To perform additional (pre-decrypt) processing on a crit header member:
var opts5 = {
handlers: {
"exp": function (jwe: any) {
// {jwe} is the JWE decrypt output, pre-decryption
jwe.header.exp = new Date(jwe.header.exp);
}
}
};
jose.JWE.createDecrypt(key, opts5).
decrypt('some.jwe').
then(function (result) {
// ...
});
//To perform additional (post-decrypt) processing on a crit header member:
var opts6 = {
handlers: {
"exp": {
complete: function (jwe: any) {
// {jwe} is the JWE decrypt output, post-decryption
jwe.header.exp = new Date(jwe.header.exp);
}
}
}
};
jose.JWE.createDecrypt(key, opts6).
decrypt('some.jwe').
then(function (result) {
// ...
});
var buff = jose.util.asBuffer('input');
var output2 = jose.util.base64url.encode(buf);
// explicit encoding
output2 = jose.util.base64url.encode(buf, "utf8");
// implied "utf8" encoding
output2 = jose.util.base64url.encode(buf);
var output3 = jose.util.base64url.decode('input');
// argument is size (in bytes)
var rnd = jose.util.randomBytes(32);
@@ -17,6 +17,6 @@
},
"files": [
"index.d.ts",
"xml-js-tests.ts"
"node-jose-tests.ts"
]
}
}
+210
View File
@@ -12,18 +12,54 @@
"sourceRepoURL": "https://github.com/ant-design/ant-design",
"asOfVersion": "1.0.0"
},
{
"libraryName": "anydb-sql",
"typingsPackageName": "anydb-sql",
"sourceRepoURL": "https://github.com/doxout/anydb-sql",
"asOfVersion": "0.6.46"
},
{
"libraryName": "Argon2",
"typingsPackageName": "argon2",
"sourceRepoURL": "https://github.com/ranisalt/node-argon2",
"asOfVersion": "0.15.0"
},
{
"libraryName": "aws-sdk",
"typingsPackageName": "aws-sdk",
"sourceRepoURL": "https://github.com/aws/aws-sdk-js",
"asOfVersion": "2.7.0"
},
{
"libraryName": "axe-core",
"typingsPackageName": "axe-core",
"sourceRepoURL": "https://github.com/dequelabs/axe-core",
"asOfVersion": "2.0.7"
},
{
"libraryName": "axios",
"typingsPackageName": "axios",
"sourceRepoURL": "https://github.com/mzabriskie/axios",
"asOfVersion": "0.14.0"
},
{
"libraryName": "azure-mobile-apps",
"typingsPackageName": "azure-mobile-apps",
"sourceRepoURL": "https://github.com/Azure/azure-mobile-apps-node/",
"asOfVersion": "3.0.0"
},
{
"libraryName": "BabylonJS",
"typingsPackageName": "babylonjs",
"sourceRepoURL": "http://www.babylonjs.com/",
"asOfVersion": "2.4.1"
},
{
"libraryName": "Bugsnag Browser",
"typingsPackageName": "bugsnag-js",
"sourceRepoURL": "https://github.com/bugsnag/bugsnag-js",
"asOfVersion": "3.1.0"
},
{
"libraryName": "camel-case",
"typingsPackageName": "camel-case",
@@ -54,6 +90,12 @@
"sourceRepoURL": "https://github.com/date-fns/date-fns",
"asOfVersion": "2.6.0"
},
{
"libraryName": "DevExtreme",
"typingsPackageName": "devextreme",
"sourceRepoURL": "http://js.devexpress.com/",
"asOfVersion": "16.2.1"
},
{
"libraryName": "Dexie.js",
"typingsPackageName": "dexie",
@@ -78,6 +120,24 @@
"sourceRepoURL": "https://github.com/bterlson/ecmarkup",
"asOfVersion": "3.4.0"
},
{
"libraryName": "electron-builder",
"typingsPackageName": "electron-builder",
"sourceRepoURL": "https://github.com/loopline-systems/electron-builder",
"asOfVersion": "2.8.0"
},
{
"libraryName": "EventEmitter3",
"typingsPackageName": "eventemitter3",
"sourceRepoURL": "https://github.com/primus/eventemitter3",
"asOfVersion": "2.0.2"
},
{
"libraryName": "JSON-Patch",
"typingsPackageName": "fast-json-patch",
"sourceRepoURL": "https://github.com/Starcounter-Jack/JSON-Patch",
"asOfVersion": "1.1.5"
},
{
"libraryName": "FastSimplexNoise",
"typingsPackageName": "fast-simplex-noise",
@@ -102,6 +162,12 @@
"sourceRepoURL": "https://github.com/mikedeboer/node-github",
"asOfVersion": "7.1.0"
},
{
"libraryName": "gulp-typescript",
"typingsPackageName": "gulp-typescript",
"sourceRepoURL": "https://github.com/ivogabe/gulp-typescript",
"asOfVersion": "2.13.0"
},
{
"libraryName": "Facebook's Immutable",
"typingsPackageName": "immutable",
@@ -156,12 +222,30 @@
"sourceRepoURL": "https://github.com/blakeembrey/is-upper-case",
"asOfVersion": "1.1.2"
},
{
"libraryName": "JSNLog",
"typingsPackageName": "jsnlog",
"sourceRepoURL": "https://github.com/mperdeck/jsnlog.js",
"asOfVersion": "2.17.2"
},
{
"libraryName": "jsonschema",
"typingsPackageName": "jsonschema",
"sourceRepoURL": "https://github.com/tdegrunt/jsonschema",
"asOfVersion": "1.1.1"
},
{
"libraryName": "knockout-paging",
"typingsPackageName": "knockout-paging",
"sourceRepoURL": "https://github.com/ErikSchierboom/knockout-paging",
"asOfVersion": "0.3.1"
},
{
"libraryName": "knockout-pre-rendered",
"typingsPackageName": "knockout-pre-rendered",
"sourceRepoURL": "https://github.com/ErikSchierboom/knockout-pre-rendered",
"asOfVersion": "0.7.1"
},
{
"libraryName": "Linq.JS",
"typingsPackageName": "linq",
@@ -192,12 +276,30 @@
"sourceRepoURL": "https://github.com/blakeembrey/lower-case-first",
"asOfVersion": "1.0.1"
},
{
"libraryName": "maquette",
"typingsPackageName": "maquette",
"sourceRepoURL": "http://maquettejs.org/",
"asOfVersion": "2.1.6"
},
{
"libraryName": "mendixmodelsdk",
"typingsPackageName": "mendixmodelsdk",
"sourceRepoURL": "http://www.mendix.com",
"asOfVersion": "0.8.1"
},
{
"libraryName": "mobservable",
"typingsPackageName": "mobservable",
"sourceRepoURL": "github.com/mweststrate/mobservable",
"asOfVersion": "1.2.5"
},
{
"libraryName": "mobservable-react",
"typingsPackageName": "mobservable-react",
"sourceRepoURL": "https://github.com/mweststrate/mobservable-react",
"asOfVersion": "1.0.0"
},
{
"libraryName": "Moment",
"typingsPackageName": "moment",
@@ -222,12 +324,24 @@
"sourceRepoURL": "https://github.com/foretagsplatsen/numbro/",
"asOfVersion": "1.9.3"
},
{
"libraryName": "Onsen UI",
"typingsPackageName": "onsenui",
"sourceRepoURL": "http://onsen.io",
"asOfVersion": "2.0.0"
},
{
"libraryName": "param-case",
"typingsPackageName": "param-case",
"sourceRepoURL": "https://github.com/blakeembrey/param-case",
"asOfVersion": "1.1.2"
},
{
"libraryName": "parse5",
"typingsPackageName": "parse5",
"sourceRepoURL": "https://github.com/inikulin/parse5",
"asOfVersion": "3.0.0"
},
{
"libraryName": "pascal-case",
"typingsPackageName": "pascal-case",
@@ -240,12 +354,24 @@
"sourceRepoURL": "https://github.com/blakeembrey/path-case",
"asOfVersion": "1.1.2"
},
{
"libraryName": "pg-promise",
"typingsPackageName": "pg-promise",
"sourceRepoURL": "https://github.com/vitaly-t/pg-promise",
"asOfVersion": "5.4.3"
},
{
"libraryName": "pixi-spine",
"typingsPackageName": "pixi-spine",
"sourceRepoURL": "https://github.com/pixijs/pixi-spine",
"asOfVersion": "1.4.2"
},
{
"libraryName": "pkcs11js",
"typingsPackageName": "pkcs11js",
"sourceRepoURL": "https://github.com/PeculiarVentures/pkcs11js",
"asOfVersion": "1.0.4"
},
{
"libraryName": "poly2tri.js",
"typingsPackageName": "poly2tri",
@@ -276,6 +402,12 @@
"sourceRepoURL": "https://github.com/reactjs/redux",
"asOfVersion": "3.6.0"
},
{
"libraryName": "redux-batched-actions",
"typingsPackageName": "redux-batched-actions",
"sourceRepoURL": "https://github.com/tshelburne/redux-batched-actions",
"asOfVersion": "0.1.5"
},
{
"libraryName": "redux-persist",
"typingsPackageName": "redux-persist",
@@ -300,12 +432,36 @@
"sourceRepoURL": "https://github.com/gaearon/redux-thunk",
"asOfVersion": "2.1.0"
},
{
"libraryName": "reselect",
"typingsPackageName": "reselect",
"sourceRepoURL": "https://github.com/rackt/reselect",
"asOfVersion": "2.2.0"
},
{
"libraryName": "rest-io",
"typingsPackageName": "rest-io",
"sourceRepoURL": "https://github.com/EnoF/rest-io",
"asOfVersion": "4.1.0"
},
{
"libraryName": "route-recognizer",
"typingsPackageName": "route-recognizer",
"sourceRepoURL": "https://github.com/tildeio/route-recognizer",
"asOfVersion": "0.3.0"
},
{
"libraryName": "node-scanf",
"typingsPackageName": "scanf",
"sourceRepoURL": "https://github.com/Lellansin/node-scanf",
"asOfVersion": "0.7.3"
},
{
"libraryName": "sendgrid",
"typingsPackageName": "sendgrid",
"sourceRepoURL": "https://github.com/sendgrid/sendgrid-nodejs",
"asOfVersion": "4.3.0"
},
{
"libraryName": "sentence-case",
"typingsPackageName": "sentence-case",
@@ -342,18 +498,42 @@
"sourceRepoURL": "https://github.com/andrewplummer/Sugar",
"asOfVersion": "2.0.2"
},
{
"libraryName": "svg.js",
"typingsPackageName": "svg.js",
"sourceRepoURL": "http://www.svgjs.com/",
"asOfVersion": "2.3.1"
},
{
"libraryName": "swap-case",
"typingsPackageName": "swap-case",
"sourceRepoURL": "https://github.com/blakeembrey/swap-case",
"asOfVersion": "1.1.2"
},
{
"libraryName": "Tabris.js",
"typingsPackageName": "tabris",
"sourceRepoURL": "http://tabrisjs.com",
"asOfVersion": "1.8.0"
},
{
"libraryName": "tcomb",
"typingsPackageName": "tcomb",
"sourceRepoURL": "http://gcanti.github.io/tcomb/guide/index.html",
"asOfVersion": "2.6.0"
},
{
"libraryName": "title-case",
"typingsPackageName": "title-case",
"sourceRepoURL": "https://github.com/blakeembrey/title-case",
"asOfVersion": "1.1.2"
},
{
"libraryName": "TsMonad",
"typingsPackageName": "tsmonad",
"sourceRepoURL": "https://github.com/cbowdon/TsMonad",
"asOfVersion": "0.5.0"
},
{
"libraryName": "TypeScript",
"typingsPackageName": "typescript",
@@ -366,6 +546,12 @@
"sourceRepoURL": "https://github.com/Microsoft/TypeScript",
"asOfVersion": "2.0.0"
},
{
"libraryName": "uk.co.workingedge.phonegap.plugin.istablet",
"typingsPackageName": "uk.co.workingedge.phonegap.plugin.istablet",
"sourceRepoURL": "https://github.com/dpa99c/phonegap-istablet",
"asOfVersion": "1.1.3"
},
{
"libraryName": "upper-case",
"typingsPackageName": "upper-case",
@@ -378,6 +564,12 @@
"sourceRepoURL": "https://github.com/blakeembrey/upper-case-first",
"asOfVersion": "1.1.2"
},
{
"libraryName": "vso-node-api",
"typingsPackageName": "vso-node-api",
"sourceRepoURL": "https://github.com/Microsoft/vso-node-api",
"asOfVersion": "4.0.0"
},
{
"libraryName": "vuejs",
"typingsPackageName": "vue",
@@ -390,17 +582,35 @@
"sourceRepoURL": "https://github.com/vuejs/vue-router",
"asOfVersion": "2.0.0"
},
{
"libraryName": "webcola",
"typingsPackageName": "webcola",
"sourceRepoURL": "https://github.com/tgdwyer/WebCola",
"asOfVersion": "3.2.0"
},
{
"libraryName": "x2js",
"typingsPackageName": "x2js",
"sourceRepoURL": "https://code.google.com/p/x2js/",
"asOfVersion": "3.1.0"
},
{
"libraryName": "xml-js",
"typingsPackageName": "xml-js",
"sourceRepoURL": "https://github.com/nashwaan/xml-js",
"asOfVersion": "1.0.0"
},
{
"libraryName": "@xmpp/jid",
"typingsPackageName": "xmpp-jid",
"sourceRepoURL": "github.com/node-xmpp/node-xmpp/",
"asOfVersion": "1.2.0"
},
{
"libraryName": "Zone.js",
"typingsPackageName": "zone.js",
"sourceRepoURL": "https://github.com/angular/zone.js",
"asOfVersion": "0.5.12"
}
]
}
+1 -1
View File
@@ -18,7 +18,7 @@
"compile-scripts": "tsc -p scripts",
"not-needed": "node scripts/not-needed.js",
"test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed --nProcesses 1",
"lint": "dtslint --dt types"
"lint": "dtslint types"
},
"devDependencies": {
"dtslint": "Microsoft/dtslint#production",
+1 -1
View File
@@ -31,7 +31,7 @@ function fixTslint(dir: string): void {
if (!fs.existsSync(target)) return;
let json = JSON.parse(fs.readFileSync(target, 'utf-8'));
json = fix(json);
const text = Object.keys(json).length === 1 ? '{ "extends": "../tslint.json" }' : JSON.stringify(json, undefined, 4);
const text = Object.keys(json).length === 1 ? '{ "extends": "dtslint/dt.json" }' : JSON.stringify(json, undefined, 4);
fs.writeFileSync(target, text + "\n", "utf-8");
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -63,7 +63,7 @@ declare namespace acorn {
class SourceLocation implements ESTree.SourceLocation {
start: Position;
end: Position;
source?: string;
source?: string | null;
constructor(p: Parser, start: Position, end: Position);
}
+162
View File
@@ -0,0 +1,162 @@
import { Equation, Expression, Fraction, parse, toTex } from 'algebra.js';
{
let expr = new Expression("x");
expr = expr.subtract(3);
expr = expr.add("x");
expr.toString();
let eq = new Equation(expr, 4);
eq.toString();
let x = eq.solveFor("x");
x.toString();
}
{
let frac = new Fraction(1, 2);
frac.toString();
frac = frac.add(new Fraction(3, 4));
frac.toString();
frac = frac.subtract(2);
frac.toString();
frac = frac.multiply(new Fraction(4, 3));
frac.toString();
frac = frac.divide(5);
frac.toString();
let x = new Expression("x");
x = x.add(3);
x.toString();
x = x.subtract(new Fraction(1, 3));
x.toString();
x = x.add("y");
x.toString();
let otherExp = new Expression("x").add(6);
x = x.add(otherExp);
x.toString();
let expr1 = new Expression("a").add("b").add("c");
let expr2 = new Expression("c").subtract("b");
let expr3 = expr1.subtract(expr2);
expr1.toString() + " - (" + expr2.toString() + ") = " + expr3.toString();
expr1 = new Expression("x");
expr1 = expr1.add(2);
expr1 = expr1.multiply(4);
expr2 = new Expression("x");
expr2 = expr2.multiply("y");
expr2 = expr2.multiply(new Fraction(1, 3));
expr2 = expr2.add(4);
expr3 = expr1.multiply(expr2);
"(" + expr1.toString() + ")(" + expr2.toString() + ") = " + expr3.toString();
x = new Expression("x").divide(2).divide(new Fraction(1, 5));
x.toString();
let exp = new Expression("x");
exp = exp.add("y");
exp = exp.add(3);
exp.toString();
let sum = exp.summation("x", 3, 6);
sum.toString();
exp = new Expression("x").add(2);
let exp3 = exp.pow(3);
"(" + exp.toString() + ")^3 = " + exp3.toString();
let expr = new Expression("x");
expr = expr.multiply(2);
expr = expr.multiply("x");
expr = expr.add("y");
expr = expr.add(new Fraction(1, 3));
expr.toString();
let answer1 = expr.eval({ x: 2 });
let answer2 = expr.eval({ x: 2, y: new Fraction(3, 4) });
answer1.toString();
answer2.toString();
expr = new Expression("x").add(2);
expr.toString();
let sub = new Expression("y").add(4);
let answer = expr.eval({ x: sub });
answer.toString();
exp = new Expression("x").add(2);
exp.toString();
exp = exp.multiply(5, false);
exp.toString();
exp = exp.simplify();
exp.toString();
exp = exp.add(5, false);
exp.toString();
exp = exp.divide(5, false);
exp.toString();
exp = exp.simplify();
exp.toString();
exp = exp.pow(2, false);
exp.toString();
exp = exp.simplify();
exp.toString();
let z = new Expression("z");
let eq1 = new Equation(z.subtract(4).divide(9), z.add(6));
eq1.toString();
let eq2 = new Equation(z.add(4).multiply(9), 6);
eq2.toString();
let eq3 = new Equation(z.divide(2).multiply(7), new Fraction(1, 4));
eq3.toString();
}
{
let x1 = parse("1/5 * x + 2/15");
let x2 = parse("1/7 * x + 4");
let eq = new Equation(x1 as Expression, x2 as Expression);
eq.toString();
let answer = eq.solveFor("x");
"x = " + answer.toString();
let expr1 = parse("1/4 * x + 5/4");
let expr2 = parse("3 * y - 12/5");
eq = new Equation(expr1 as Expression, expr2 as Expression);
eq.toString();
let xAnswer = eq.solveFor("x");
let yAnswer = eq.solveFor("y");
"x = " + xAnswer.toString();
"y = " + yAnswer.toString();
let n1 = parse("x + 5") as Expression;
let n2 = parse("x - 3/4") as Expression;
let quad = new Equation(n1.multiply(n2), 0);
quad.toString();
let answers = quad.solveFor("x");
"x = " + answers.toString();
n1 = parse("x + 2") as Expression;
n2 = parse("x + 3") as Expression;
let n3 = parse("x + 4") as Expression;
let cubic = new Equation(n1.multiply(n2).multiply(n3), 0);
cubic.toString();
answers = cubic.solveFor("x");
"x = " + answers.toString();
let expr = new Expression("x");
expr = expr.multiply("x");
expr = expr.add("x");
expr = expr.add("y");
eq = new Equation(expr, 3);
eq.toString();
xAnswer = eq.solveFor("x");
yAnswer = eq.solveFor("y");
"x = " + xAnswer;
"y = " + yAnswer.toString();
let exp = parse("2 * x^2 + 4 * x + 4");
exp.toString();
exp = parse("x * y + 4");
exp.toString();
}
{
let eq = parse("x^2 + 4 * x + 4 = 0") as Equation;
eq.toString();
let ans = eq.solveFor("x");
"x = " + ans.toString();
let a = new Expression("x").pow(2);
let b = new Expression("x").multiply(new Fraction(5, 4));
let c = new Fraction(-21, 4);
let expr = a.add(b).add(c);
let quad = new Equation(expr, 0);
toTex(quad);
let answers = quad.solveFor("x");
toTex(answers);
let lambda = new Expression("lambda").add(3).divide(4);
let Phi = new Expression("Phi").subtract(new Fraction(1, 5)).add(lambda);
toTex(lambda);
toTex(Phi);
}
+62
View File
@@ -0,0 +1,62 @@
// Type definitions for algebra.js 0.2
// Project: http://algebra.js.org
// Definitions by: Federico Caselli <https://github.com/CaselIT>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
declare class Term {
coefficients: algebra.js.Fraction[];
variables: Variable[];
coefficient(): algebra.js.Fraction;
toString(): string;
}
declare class Variable {
variable: string;
toString(): string;
}
type Union = string | number | algebra.js.Fraction | Term;
declare namespace algebra.js {
function parse(input: string): Equation | Expression;
function toTex(input: Fraction | Expression | Equation | object | Array<Fraction | object>): string;
class Equation {
lhs: Expression;
rhs: Expression;
constructor(lhs: Expression, rhs: Expression | Fraction | number)
solveFor(variable: string): Fraction | Fraction[] | number[];
toString(): string;
}
class Expression {
constants: Fraction[];
terms: Term[];
constructor(variable: Union | undefined)
add(other: Union | Expression, simplify?: boolean): Expression;
divide(other: Fraction | number, simplify?: boolean): Expression;
eval(p: object, simplify?: boolean): Expression;
multiply(other: Union | Expression, simplify?: boolean): Expression;
pow(p: number, simplify?: boolean): Expression;
constant(): Fraction;
simplify(): Expression;
subtract(other: Union | Expression, simplify?: boolean): Expression;
summation(variable: string, lower: number, upper: number, simplify?: boolean): Expression;
toString(): string;
}
class Fraction {
denom: number;
numer: number;
constructor(num: number, denom: number)
abs(): Fraction;
add(other: Fraction | number, simplify?: boolean): Fraction;
divide(other: Fraction | number, simplify?: boolean): Fraction;
multiply(other: Fraction | number, simplify?: boolean): Fraction;
subtract(other: Fraction | number, simplify?: boolean): Fraction;
toString(): string;
valueOf(): number;
}
}
export = algebra.js;
@@ -17,6 +17,6 @@
},
"files": [
"index.d.ts",
"pkcs11js-tests.ts"
"algebra.js-tests.ts"
]
}
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -109,7 +109,7 @@ declare namespace AltJS {
flush():Object;
recycle( ...stores:Array<AltJS.AltStore<any>>):void;
rollback():void;
dispatch(action?:AltJS.Action<any>, data?:Object, details?:any):void;
dispatch(action?:AltJS.Action<any>|string, data?:Object, details?:any):void;
//Actions methods
addActions(actionsName:string, ActionsClass: ActionsClassConstructor):void;
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"ban-types": false
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"ban-types": false,
"unified-signatures": false
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"no-empty-interface": false
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+140 -39
View File
@@ -1,15 +1,12 @@
var myApp = angular.module('testModule', ['ngMaterial']);
const myApp = angular.module('testModule', ['ngMaterial']);
myApp.config((
$mdThemingProvider: ng.material.IThemingProvider,
$mdIconProvider: ng.material.IIconProvider,
$mdProgressCircularProvider: ng.material.IProgressCircularProvider) => {
$mdThemingProvider.alwaysWatchTheme(true);
var neonRedMap: ng.material.IPalette = $mdThemingProvider.extendPalette('red', {
'500': 'ff0000'
const neonRedMap: ng.material.IPalette = $mdThemingProvider.extendPalette('red', {
500: 'ff0000'
});
// Register the new color palette map with the name <code>neonRed</code>
$mdThemingProvider.definePalette('neonRed', neonRedMap);
@@ -21,12 +18,13 @@ myApp.config((
.warnPalette('red')
.dark(true);
var browserColors: ng.material.IBrowserColors = {
theme: 'default',
palette: 'neonRed',
hue: '500'
const browserColors: ng.material.IBrowserColors = {
theme: 'default',
palette: 'neonRed',
hue: '500'
};
$mdThemingProvider.enableBrowserColor(browserColors);
const removeColors = $mdThemingProvider.enableBrowserColor(browserColors);
removeColors();
// Disable theming generation at runtime
$mdThemingProvider.disableTheming();
@@ -41,44 +39,67 @@ myApp.config((
$mdProgressCircularProvider.configure({
progressSize: 100,
strokeWidth: 20,
duration: 800
duration: 800,
easeFn(t, b, c, d) {
t /= d;
return c * t * t + b;
},
easeFnIndeterminate(t, b, c, d) {
return c * Math.pow(2, 10 * (t / d - 1)) + b;
}
});
});
myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.IBottomSheetService) => {
myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.IBottomSheetService, $q: ng.IQService) => {
$scope['openBottomSheet'] = () => {
$mdBottomSheet.show({
template: '<md-bottom-sheet>Hello!</md-bottom-sheet>',
clickOutsideToClose: true,
disableBackdrop: true,
disableParentScroll: false,
parent: () => {}
});
const options: ng.material.IBottomSheetOptions = {};
options.resolve = {
nativePromise: () => Promise.resolve(),
angularPromise: () => $q.resolve(),
annotatedNativePromise: ['fakeService', (fake) => Promise.resolve()],
annotatedAngularPromise: ['fakeService', (fake) => $q.resolve()]
};
options.controller = 'TestController';
options.controller = (function TestController(param: any) { });
options.controller = (class { });
options.controller = ['fakeService', function TestController(fake: any) { }];
options.controller = ['fakeService', class { }];
options.parent = (scope, element) => new Element();
options.parent = (scope, element) => angular.element(new Element());
options.parent = '#container';
options.parent = new Element();
options.parent = angular.element(new Element());
};
$scope['hideBottomSheet'] = $mdBottomSheet.hide.bind($mdBottomSheet, 'hide');
$scope['cancelBottomSheet'] = $mdBottomSheet.cancel.bind($mdBottomSheet, 'cancel');
});
myApp.controller('ColorController', ($scope: ng.IScope, $mdColor: ng.material.IColorService) => {
var colorExpression : ng.material.IColorExpression;
var element : Element;
colorExpression = { color: '#FFFFFF' }
element = new Element();
const colorExpression: ng.material.IColorExpression = { color: '#FFFFFF' };
const element: Element = new Element();
$scope['applyThemeColors'] = () => {
$mdColor.applyThemeColors(element, colorExpression);
};
$scope['getThemeColor'] = () => {
$mdColor.getThemeColor('default-neonRed')
$mdColor.getThemeColor('default-neonRed');
};
$scope['hasTheme'] = () => {
$mdColor.hasTheme();
};
});
myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.IDialogService) => {
myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.IDialogService, $q: ng.IQService) => {
$scope['openDialog'] = () => {
$mdDialog.show({
template: '<md-dialog>Hello!</md-dialog>'
@@ -120,16 +141,56 @@ myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.
};
$scope['hideDialog'] = $mdDialog.hide.bind($mdDialog, 'hide');
$scope['cancelDialog'] = $mdDialog.cancel.bind($mdDialog, 'cancel');
const alertPreset: ng.material.IAlertDialog = $mdDialog.alert()
.resolve({
nativePromise: () => Promise.resolve(),
angularPromise: () => $q.resolve(),
annotatedNativePromise: ['fakeService', (fake) => Promise.resolve()],
annotatedAngularPromise: ['fakeService', (fake) => $q.resolve()]
})
.controller('TestController')
.controller(function TestController(param) { })
.controller(class { })
.controller(['fakeService', function TestController(fake) { }])
.controller(['fakeService', class { }])
;
const dialogOptions: ng.material.IDialogOptions = {};
dialogOptions.resolve = {
nativePromise: () => Promise.resolve(),
angularPromise: () => $q.resolve(),
annotatedNativePromise: ['fakeService', (fake) => Promise.resolve()],
annotatedAngularPromise: ['fakeService', (fake) => $q.resolve()]
};
dialogOptions.controller = 'TestController';
dialogOptions.controller = (function TestController(param) { });
dialogOptions.controller = (class { });
dialogOptions.controller = ['fakeService', function TestController(fake) { }];
dialogOptions.controller = ['fakeService', class { }];
$mdDialog.show({
onShowing(scope, element) { },
onComplete(scope, element) { },
onRemoving(element, removePromise) { },
});
$mdDialog.show({
onShowing: (scope, element) => { },
onComplete: (scope, element) => { },
onRemoving: (element, removePromise) => { },
});
});
class IconDirective implements ng.IDirective {
private $mdIcon: ng.material.IIcon;
constructor($mdIcon: ng.material.IIcon) {
this.$mdIcon = $mdIcon;
}
public link($scope: ng.IScope, $elm: ng.IAugmentedJQuery) {
link($scope: ng.IScope, $elm: ng.IAugmentedJQuery) {
this.$mdIcon('android').then((iconEl: Element) => $elm.append(iconEl));
this.$mdIcon('work:chair').then((iconEl: Element) => $elm.append(iconEl));
// Load and cache the external SVG using a URL
@@ -150,7 +211,7 @@ myApp.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.IM
});
myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.material.ISidenavService) => {
var componentId = 'left';
const componentId = 'left';
$scope['toggle'] = () => $mdSidenav(componentId).toggle();
$scope['open'] = () => $mdSidenav(componentId).open();
$scope['close'] = () => $mdSidenav(componentId).close();
@@ -165,41 +226,81 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
instance.isLockedOpen();
});
$scope['onClose'] = $mdSidenav(componentId).onClose(() => {});
$scope['onClose'] = $mdSidenav(componentId).onClose(() => { });
});
myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => {
myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService, $q: ng.IQService) => {
$scope['openToast'] = () => {
$mdToast.show($mdToast.simple().textContent('Hello!'));
$mdToast.updateTextContent('New Content');
}
};
$scope['customToast'] = () => {
var options = {
const options: ng.material.IToastOptions = {
hideDelay: 3000,
position: 'top right',
controller : 'ToastCtrl',
templateUrl : 'toast-template.html',
toastClass: 'my-class'
controller: 'ToastCtrl',
templateUrl: 'toast-template.html',
toastClass: 'my-class',
resolve: {
nativePromise: () => Promise.resolve(),
angularPromise: () => $q.resolve(),
annotatedNativePromise: ['fakeService', (fake) => Promise.resolve()],
annotatedAngularPromise: ['fakeService', (fake) => $q.resolve()]
}
};
options.controller = 'TestController';
options.controller = (function TestController(param) { });
options.controller = (class { });
options.controller = ['fakeService', function TestController(fake) { }];
options.controller = ['fakeService', class { }];
$mdToast.show(options);
}
};
});
myApp.controller('PanelController', ($scope: ng.IScope, $mdPanel: ng.material.IPanelService) => {
myApp.controller('PanelController', ($scope: ng.IScope, $mdPanel: ng.material.IPanelService, $q: ng.IQService) => {
$scope['createPanel'] = () => {
var config = {
const config: ng.material.IPanelConfig = {
id: 'myPanel',
template: '<h1>Hello!</h1>',
hasBackdrop: true,
disableParentScroll: true,
zIndex: 150
zIndex: 150,
resolve: {
nativePromise: () => Promise.resolve(),
angularPromise: () => $q.resolve(),
annotatedNativePromise: ['fakeService', (fake) => Promise.resolve()],
annotatedAngularPromise: ['fakeService', (fake) => $q.resolve()]
}
};
config.controller = 'TestController';
config.controller = (function TestController(param) { });
config.controller = (class { });
config.controller = ['fakeService', function TestController(fake) { }];
config.controller = ['fakeService', class { }];
config.onDomAdded = (paneRef) => Promise.resolve();
config.onDomAdded = () => $q.reject();
config.onDomAdded = () => { };
config.onOpenComplete = (paneRef) => Promise.resolve();
config.onOpenComplete = () => $q.reject();
config.onOpenComplete = () => { };
config.onRemoving = (paneRef) => Promise.resolve();
config.onRemoving = () => $q.reject();
config.onRemoving = () => { };
config.onDomRemoved = (paneRef) => Promise.resolve();
config.onDomRemoved = () => $q.reject();
config.onDomRemoved = () => { };
$mdPanel.create(config);
var panelRef = $mdPanel.create(config);
let panelRef = $mdPanel.create(config);
panelRef.open()
.then((ref: ng.material.IPanelRef) => {
ref.addClass('foo');
@@ -232,6 +333,6 @@ myApp.controller('PanelController', ($scope: ng.IScope, $mdPanel: ng.material.IP
$scope['newPanelAnimation'] = () => {
$mdPanel.newPanelAnimation().openFrom('.some-target');
$mdPanel.newPanelAnimation().openFrom({top: 0, left: 0});
$mdPanel.newPanelAnimation().openFrom({ top: 0, left: 0 });
};
});
+35 -34
View File
@@ -1,4 +1,4 @@
// Type definitions for Angular Material (angular.material module) 1.1
// Type definitions for angular-material 1.1
// Project: https://github.com/angular/material
// Definitions by: Blake Bigelow <https://github.com/blbigelow>, Peter Hajdu <https://github.com/PeterHajdu>, Davide Donadello <https://github.com/Dona278>, Geert Jansen <https://github.com/geertjansen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -9,21 +9,25 @@ declare var _: string;
export = _;
declare module 'angular' {
export namespace material {
namespace material {
interface ResolveObject {
[name: string]: Injectable<(...args: any[]) => PromiseLike<any>>;
}
interface IBottomSheetOptions {
templateUrl?: string;
template?: string;
scope?: angular.IScope; // default: new child scope
preserveScope?: boolean; // default: false
controller?: string | Function;
controller?: string | Injectable<IControllerConstructor>;
locals?: { [index: string]: any };
clickOutsideToClose?: boolean;
bindToController?: boolean; // default: false
disableBackdrop?: boolean;
escapeToClose?: boolean;
resolve?: { [index: string]: () => angular.IPromise<any> };
resolve?: ResolveObject;
controllerAs?: string;
parent?: Function | string | Object; // default: root node
parent?: ((scope: ng.IScope, element: JQuery) => Element | JQuery) | string | Element | JQuery; // default: root node
disableParentScroll?: boolean; // default: true
}
@@ -49,16 +53,16 @@ declare module 'angular' {
clickOutsideToClose(clickOutsideToClose?: boolean): T; // default: false
escapeToClose(escapeToClose?: boolean): T; // default: true
focusOnOpen(focusOnOpen?: boolean): T; // default: true
controller(controller?: string | Function): T;
controller(controller?: string | Injectable<IControllerConstructor>): T;
locals(locals?: { [index: string]: any }): T;
bindToController(bindToController?: boolean): T; // default: false
resolve(resolve?: { [index: string]: () => angular.IPromise<any> }): T;
resolve(resolve?: ResolveObject): T;
controllerAs(controllerAs?: string): T;
parent(parent?: string | Element | JQuery): T; // default: root node
onComplete(onComplete?: Function): T;
ariaLabel(ariaLabel: string): T;
}
// tslint:disable-next-line no-empty-interface
interface IAlertDialog extends IPresetDialog<IAlertDialog> {
}
@@ -97,15 +101,15 @@ declare module 'angular' {
clickOutsideToClose?: boolean; // default: false
escapeToClose?: boolean; // default: true
focusOnOpen?: boolean; // default: true
controller?: string | Function;
controller?: string | Injectable<IControllerConstructor>;
locals?: { [index: string]: any };
bindToController?: boolean; // default: false
resolve?: { [index: string]: () => angular.IPromise<any> }
resolve?: ResolveObject;
controllerAs?: string;
parent?: string | Element | JQuery; // default: root node
onShowing?: Function;
onComplete?: Function;
onRemoving?: Function;
onShowing?(scope: ng.IScope, element: JQuery): void;
onComplete?(scope: ng.IScope, element: JQuery): void;
onRemoving?(element: JQuery, removePromise: ng.IPromise<any>): void;
skipHide?: boolean;
multiple?: boolean;
fullscreen?: boolean; // default: false
@@ -120,9 +124,7 @@ declare module 'angular' {
cancel(response?: any): void;
}
interface IIcon {
(id: string): angular.IPromise<Element>; // id is a unique ID or URL
}
type IIcon = (id: string) => angular.IPromise<Element>; // id is a unique ID or URL
interface IIconProvider {
icon(id: string, url: string, viewBoxSize?: number): IIconProvider; // viewBoxSize default: 24
@@ -132,9 +134,7 @@ declare module 'angular' {
defaultFontSet(name: string): IIconProvider;
}
interface IMedia {
(media: string): boolean;
}
type IMedia = (media: string) => boolean;
interface ISidenavObject {
toggle(): angular.IPromise<void>;
@@ -142,7 +142,7 @@ declare module 'angular' {
close(): angular.IPromise<void>;
isOpen(): boolean;
isLockedOpen(): boolean;
onClose(onClose: Function): void;
onClose(onClose: () => void): void;
}
interface ISidenavService {
@@ -163,6 +163,7 @@ declare module 'angular' {
toastClass(toastClass: string): T;
}
// tslint:disable-next-line no-empty-interface
interface ISimpleToastPreset extends IToastPreset<ISimpleToastPreset> {
}
@@ -175,10 +176,10 @@ declare module 'angular' {
hideDelay?: number | false; // default (ms): 3000
position?: string; // any combination of 'bottom'/'left'/'top'/'right'/'fit'; default: 'bottom left'
toastClass?: string;
controller?: string | Function;
controller?: string | Injectable<IControllerConstructor>;
locals?: { [index: string]: any };
bindToController?: boolean; // default: false
resolve?: { [index: string]: () => angular.IPromise<any> }
resolve?: ResolveObject;
controllerAs?: string;
parent?: string | Element | JQuery; // default: root node
}
@@ -263,19 +264,19 @@ declare module 'angular' {
interface IThemeConfig {
disableTheming: boolean;
generateOnDemand: boolean;
generateOnDemand: boolean;
nonce: string;
defaultTheme: string;
alwaysWatchTheme: boolean;
registeredStyles: Array<string>;
registeredStyles: string[];
}
interface IThemingProvider {
alwaysWatchTheme(alwaysWatch: boolean): void;
definePalette(name: string, palette: IPalette): IThemingProvider;
enableBrowserColor(browserColors: IBrowserColors): Function;
enableBrowserColor(browserColors: IBrowserColors): () => void;
extendPalette(name: string, palette: IPalette): IPalette;
registerStyles(styles: String): void;
registerStyles(styles: string): void;
setDefaultTheme(theme: string): void;
setNonce(nonce: string): void;
theme(name: string, inheritFrom?: string): ITheme;
@@ -328,11 +329,11 @@ declare module 'angular' {
id?: string;
template?: string;
templateUrl?: string;
controller?: string | Function;
controller?: string | Injectable<IControllerConstructor>;
controllerAs?: string;
bindToController?: boolean; // default: true
locals?: { [index: string]: any };
resolve?: { [index: string]: () => angular.IPromise<any> }
resolve?: ResolveObject;
attachTo?: string | JQuery | Element;
propagateContainerEvents?: boolean;
panelClass?: string;
@@ -346,10 +347,10 @@ declare module 'angular' {
animation?: IPanelAnimation;
hasBackdrop?: boolean; // default: false
disableParentScroll?: boolean; // default: false
onDomAdded?: Function;
onOpenComplete?: Function;
onRemoving?: Function;
onDomRemoved?: Function;
onDomAdded?(...args: any[]): PromiseLike<void> | void;
onOpenComplete?(...args: any[]): PromiseLike<void> | void;
onRemoving?(...args: any[]): PromiseLike<void> | void;
onDomRemoved?(...args: any[]): PromiseLike<void> | void;
origin?: string | JQuery | Element;
onCloseSuccess?: ((panel: IPanelRef, closeReason: string) => any);
}
@@ -442,11 +443,11 @@ declare module 'angular' {
progressSize?: number;
strokeWidth?: number;
duration?: number;
easeFn?: Function;
easeFn?(t: number, b: number, c: number, d: number): number;
durationIndeterminate?: number;
startIndeterminate?: number;
endIndeterminate?: number;
easeFnIndeterminate?: Function;
easeFnIndeterminate?(t: number, b: number, c: number, d: number): number;
}
interface IProgressCircularProvider {
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "../tslint.json",
"rules": {
"interface-name": false,
"max-line-length": false
}
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+4 -4
View File
@@ -1,4 +1,4 @@
// Type definitions for Angular Translate (pascalprecht.translate module) 2.4
// Type definitions for Angular Translate (pascalprecht.translate module) 2.15
// Project: https://github.com/PascalPrecht/angular-translate
// Definitions by: Michel Salib <https://github.com/michelsalib>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -45,8 +45,8 @@ declare module 'angular' {
}
interface ITranslateService {
(translationId: string, interpolateParams?: any, interpolationId?: string): angular.IPromise<string>;
(translationId: string[], interpolateParams?: any, interpolationId?: string): angular.IPromise<{ [key: string]: string }>;
(translationId: string, interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string): angular.IPromise<string>;
(translationId: string[], interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string): angular.IPromise<{ [key: string]: string }>;
cloakClassName(): string;
cloakClassName(name: string): ITranslateProvider;
fallbackLanguage(langKey?: string): string;
@@ -117,7 +117,7 @@ declare module 'angular' {
interface IFilterService {
(name: 'translate'): {
(translationId: string, interpolateParams?: any, interpolation?: string): string;
(translationId: string, interpolateParams?: any, interpolation?: string, forceLanguage?: string): string;
};
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"class-name": true,
"indent": [true, "spaces"],
-2
View File
@@ -3,8 +3,6 @@
// Definitions by: Gorgi Kosev <https://github.com/spion>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="bluebird" />
import Promise = require('bluebird');
import { Column, Table, Transaction, AnydbSql } from 'anydb-sql';
export interface Migration {
+5
View File
@@ -0,0 +1,5 @@
{
"dependencies": {
"anydb-sql": "^0.6.53"
}
}
-70
View File
@@ -1,70 +0,0 @@
import anydbsql = require('anydb-sql');
import { Table, Column } from 'anydb-sql'
function do_not_run() {
var db = anydbsql({
url: 'postgres://user:pass@host:port/database',
connections: { min: 2, max: 20 }
});
// Table Post
interface Post {
content: string;
userId: string;
date: string;
}
interface PostTable extends Table<Post> {
content: Column<string>;
userId: Column<string>;
date: Column<string>;
}
var post = <PostTable>db.define<Post>({
name: 'posts',
columns: {
content: {},
userId: {},
date: {}
}
});
// Table User
interface User {
id: string;
email: string;
password: string;
name: string;
}
interface UserTable extends Table<User> {
id: Column<string>;
email: Column<string>;
password: Column<string>;
name: Column<string>;
}
var user = <UserTable>db.define<User>({
name: 'users',
columns: {
id: { primaryKey: true },
email: {},
password: {},
name: {},
date: {}
},
has: {
posts: { from: 'posts', many: true },
group: { from: 'groups'}
}
});
user.select(user.name, post.content)
.from(user.join(post).on(user.id.equals(post.userId)))
.where(post.date.gt('123'))
.all()
}
-193
View File
@@ -1,193 +0,0 @@
// Type definitions for anydb-sql
// Project: https://github.com/doxout/anydb-sql
// Definitions by: Gorgi Kosev <https://github.com/spion>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface AnyDBPool extends anydbSQL.DatabaseConnection {
query: (text: string, values: any[], callback: (err: Error, result: any) => void) => void
begin: () => anydbSQL.Transaction
close: (err: Error) => void
}
interface Dictionary<T> { [key: string]: T; }
declare namespace anydbSQL {
export interface OrderByValueNode { }
export interface ColumnDefinition {
primaryKey?: boolean;
dataType?: string;
references?: { table: string; column: string }
notNull?: boolean
}
export interface TableDefinition {
name: string
columns: Dictionary<ColumnDefinition>
has?: Dictionary<{ from: string; many?: boolean }>
}
export interface QueryLike {
query: string;
values: any[]
text: string
}
export interface DatabaseConnection {
queryAsync<T>(query: string, ...params: any[]): Promise<{ rowCount: number; rows: T[] }>
queryAsync<T>(query: QueryLike): Promise<{ rowCount: number; rows: T[] }>
}
export interface Transaction extends DatabaseConnection {
rollback(): void
commitAsync(): Promise<void>
}
export interface SubQuery<T> {
select(node: Column<T>): SubQuery<T>
where(...nodes: any[]): SubQuery<T>
from(table: TableNode): SubQuery<T>
group(...nodes: any[]): SubQuery<T>
order(criteria: OrderByValueNode): SubQuery<T>
notExists(subQuery: SubQuery<any>): SubQuery<T>
}
interface Executable<T> {
get(): Promise<T>
getWithin(tx: DatabaseConnection): Promise<T>
exec(): Promise<void>
all(): Promise<T[]>
execWithin(tx: DatabaseConnection): Promise<void>
allWithin(tx: DatabaseConnection): Promise<T[]>
toQuery(): QueryLike;
}
interface Queryable<T> {
where(...nodes: any[]): Query<T>
delete(): ModifyingQuery
select<U>(...nodes: any[]): Query<U>
selectDeep<U>(table: Table<T>): Query<T>
selectDeep<U>(...nodesOrTables: any[]): Query<U>
}
export interface Query<T> extends Executable<T>, Queryable<T> {
from(table: TableNode): Query<T>
update(o: Dictionary<any>): ModifyingQuery
update(o: {}): ModifyingQuery
group(...nodes: any[]): Query<T>
order(...criteria: OrderByValueNode[]): Query<T>
limit(l: number): Query<T>
offset(o: number): Query<T>
}
export interface ModifyingQuery extends Executable<void> {
returning<U>(...nodes: any[]): Query<U>
where(...nodes: any[]): ModifyingQuery
}
export interface TableNode {
join(table: TableNode): JoinTableNode
leftJoin(table: TableNode): JoinTableNode
}
export interface JoinTableNode extends TableNode {
on(filter: BinaryNode): TableNode
on(filter: string): TableNode
}
interface CreateQuery extends Executable<void> {
ifNotExists(): Executable<void>
}
interface DropQuery extends Executable<void> {
ifExists(): Executable<void>
}
export interface Table<T> extends TableNode, Queryable<T> {
create(): CreateQuery
drop(): DropQuery
as(name: string): Table<T>
update(o: any): ModifyingQuery
insert(row: T): ModifyingQuery
insert(rows: T[]): ModifyingQuery
select(): Query<T>
select<U>(...nodes: any[]): Query<U>
from<U>(table: TableNode): Query<U>
star(): Column<any>
subQuery<U>(): SubQuery<U>
eventEmitter: {
emit: (type: string, ...args: any[]) => void
on: (eventName: string, handler: Function) => void
}
columns: Column<any>[]
sql: SQL;
alter(): AlterQuery<T>
}
export interface AlterQuery<T> extends Executable<void> {
addColumn(column: Column<any>): AlterQuery<T>;
addColumn(name: string, options: string): AlterQuery<T>;
dropColumn(column: Column<any>): AlterQuery<T>;
renameColumn(column: Column<any>, newColumn: Column<any>): AlterQuery<T>;
renameColumn(column: Column<any>, newName: string): AlterQuery<T>;
renameColumn(name: string, newName: string): AlterQuery<T>;
rename(newName: string): AlterQuery<T>
}
export interface SQL {
functions: {
LOWER(c: Column<string>): Column<string>
}
}
export interface BinaryNode {
and(node: BinaryNode): BinaryNode
or(node: BinaryNode): BinaryNode
}
export interface Column<T> {
in(arr: T[]): BinaryNode
in(subQuery: SubQuery<T>): BinaryNode
notIn(arr: T[]): BinaryNode
equals(node: any): BinaryNode
notEquals(node: any): BinaryNode
gte(node: any): BinaryNode
lte(node: any): BinaryNode
gt(node: any): BinaryNode
lt(node: any): BinaryNode
like(str: string): BinaryNode
multiply: {
(node: Column<T>): Column<T>
(n: number): Column<number>
}
isNull(): BinaryNode
isNotNull(): BinaryNode
sum(): Column<number>
count(): Column<number>
count(name: string): Column<number>
distinct(): Column<T>
as(name: string): Column<T>
ascending: OrderByValueNode
descending: OrderByValueNode
asc: OrderByValueNode
desc: OrderByValueNode
}
export interface AnydbSql extends DatabaseConnection {
define<T>(map: TableDefinition): Table<T>;
transaction<T>(fn: (tx: Transaction) => Promise<T>): Promise<T>
allOf(...tables: Table<any>[]): any
models: Dictionary<Table<any>>
functions: {
LOWER: (name: Column<string>) => Column<string>
RTRIM: (name: Column<string>) => Column<string>
}
makeFunction(name: string): Function
begin(): Transaction
open(): void;
close(): void;
getPool(): AnyDBPool;
dialect(): string;
}
}
declare function anydbSQL(config: Object): anydbSQL.AnydbSql;
export = anydbSQL;
-22
View File
@@ -1,22 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"anydb-sql-tests.ts"
]
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+2 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for Apple Pay JS 1.0
// Type definitions for Apple Pay JS 1.0.1
// Project: https://developer.apple.com/reference/applepayjs
// Definitions by: Martin Costello <https://martincostello.com/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -392,7 +392,7 @@ declare namespace ApplePayJS {
/**
* A set of shipping method objects that describe the available shipping methods.
*/
shippingMethods?: ApplePayShippingMethod[] | string[];
shippingMethods?: ApplePayShippingMethod[];
/**
* How the items are to be shipped.
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+2 -2
View File
@@ -1,8 +1,8 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"interface-name": [ false ],
"no-internal-module": false,
"no-single-declare-module": false
}
}
}
+48 -48
View File
@@ -667,6 +667,8 @@ declare namespace __esri {
export type EasingFunction = (t: number, duration: number) => number;
export type EventHandler = (event: any) => void;
export interface PromisedWatchHandle extends IPromise<any> {
remove(): void;
}
@@ -1337,7 +1339,7 @@ declare namespace __esri {
maxZoom?: number;
snapToZoom?: boolean;
rotationEnabled?: boolean;
effectiveLODs?: number;
effectiveLODs?: LOD[];
effectiveMinZoom?: number;
effectiveMaxZoom?: number;
effectiveMinScale?: number;
@@ -1868,21 +1870,6 @@ declare namespace __esri {
worldScale?: boolean;
}
interface Evented {
emit(type: string, event: any): IHandle;
on(name: string, callback: Function): IHandle;
}
interface EventedConstructor {
new(): Evented;
hasEventListener(type: string): boolean;
on(type: string, listener: Function): any;
}
export const Evented: EventedConstructor;
interface Basemap extends Accessor, Loadable, JSONSupport {
baseLayers: Collection;
id: string;
@@ -1907,11 +1894,11 @@ declare namespace __esri {
export const Basemap: BasemapConstructor;
interface BasemapProperties extends LoadableProperties {
baseLayers?: Collection;
baseLayers?: Collection | any[];
id?: string;
loaded?: boolean;
portalItem?: PortalItemProperties;
referenceLayers?: Collection;
referenceLayers?: Collection | any[];
thumbnailUrl?: string;
title?: string;
}
@@ -2013,7 +2000,7 @@ declare namespace __esri {
export const Ground: GroundConstructor;
interface GroundProperties {
layers?: Collection;
layers?: Collection | any[];
}
interface Map extends Accessor, LayersMixin {
@@ -2029,7 +2016,7 @@ declare namespace __esri {
export const Map: MapConstructor;
interface MapProperties extends LayersMixinProperties {
allLayers?: Collection;
allLayers?: Collection | any[];
basemap?: BasemapProperties;
ground?: GroundProperties;
}
@@ -2053,7 +2040,7 @@ declare namespace __esri {
export const PopupTemplate: PopupTemplateConstructor;
interface PopupTemplateProperties {
actions?: Collection;
actions?: Collection | any[];
content?: string | any[] | Function;
fieldInfos?: PopupTemplateFieldInfos[];
overwriteActions?: boolean;
@@ -2718,6 +2705,7 @@ declare namespace __esri {
definitionExpression: string;
elevationInfo: FeatureLayerElevationInfo;
fields: Field[];
gdbVersion: string;
geometryType: string;
hasAttachments: boolean;
hasM: boolean;
@@ -2762,6 +2750,7 @@ declare namespace __esri {
definitionExpression?: string;
elevationInfo?: FeatureLayerElevationInfo;
fields?: FieldProperties[];
gdbVersion?: string;
geometryType?: string;
hasAttachments?: boolean;
hasM?: boolean;
@@ -2777,7 +2766,7 @@ declare namespace __esri {
renderer?: RendererProperties;
returnM?: boolean;
returnZ?: boolean;
source?: Collection;
source?: Collection | any[];
spatialReference?: SpatialReferenceProperties;
token?: string;
url?: string;
@@ -2823,7 +2812,7 @@ declare namespace __esri {
interface GraphicsLayerProperties extends LayerProperties, ScaleRangeLayerProperties {
elevationInfo?: GraphicsLayerElevationInfo;
graphics?: Collection;
graphics?: Collection | any[];
}
interface GroupLayer extends Layer, LayersMixin, JSONSupport, PortalLayer {
@@ -3419,7 +3408,7 @@ declare namespace __esri {
popupTemplate?: PopupTemplateProperties;
renderer?: RendererProperties;
source?: any | any;
sublayers?: Collection;
sublayers?: Collection | any[];
title?: string;
url?: string;
visible?: boolean;
@@ -4506,7 +4495,7 @@ declare namespace __esri {
interface Symbol3DProperties extends SymbolProperties {
styleOrigin?: Symbol3DStyleOrigin;
symbolLayers?: Collection;
symbolLayers?: Collection | any[];
}
interface Symbol3DLayer extends Accessor, JSONSupport {
@@ -6170,7 +6159,7 @@ declare namespace __esri {
goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | any, options?: MapViewGoToOptions): IPromise<any>;
hasEventListener(type: string): boolean;
hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise<any>;
on(type: string | string[], modifiersOrHandler: string[] | Function, handler?: Function): any;
on(type: string | string[], modifiersOrHandler: string[] | EventHandler, handler?: EventHandler): IHandle;
toMap(screenPoint: ScreenPoint, mapPoint?: Point): Point;
toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint;
}
@@ -6208,7 +6197,7 @@ declare namespace __esri {
goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | any, options?: SceneViewGoToOptions): IPromise<any>;
hasEventListener(type: string): boolean;
hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise<any>;
on(type: string | string[], modifiersOrHandler: string[] | Function, handler?: Function): any;
on(type: string | string[], modifiersOrHandler: string[] | EventHandler, handler?: EventHandler): IHandle;
toMap(screenPoint: ScreenPoint, mapPoint?: Point): Point;
toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint;
}
@@ -6257,11 +6246,11 @@ declare namespace __esri {
export const View: ViewConstructor;
interface ViewProperties extends BreakpointsOwnerProperties, DOMContainerProperties {
allLayerViews?: Collection;
allLayerViews?: Collection | any[];
animation?: ViewAnimationProperties;
graphics?: Collection;
graphics?: Collection | any[];
interacting?: boolean;
layerViews?: Collection;
layerViews?: Collection | any[];
map?: MapProperties;
padding?: ViewPadding;
ready?: boolean;
@@ -6502,7 +6491,7 @@ declare namespace __esri {
export const Presentation: PresentationConstructor;
interface PresentationProperties {
slides?: Collection;
slides?: Collection | any[];
}
interface Slide extends Accessor {
@@ -6736,7 +6725,7 @@ declare namespace __esri {
interface LayerListProperties extends WidgetProperties {
createActionsFunction?: Function;
operationalItems?: Collection;
operationalItems?: Collection | any[];
view?: MapView | SceneView;
viewModel?: LayerListViewModelProperties;
}
@@ -6813,7 +6802,6 @@ declare namespace __esri {
features: Graphic[];
location: Point;
promises: IPromise<any>[];
rendered: boolean;
selectedFeature: Graphic;
selectedFeatureIndex: number;
title: string;
@@ -6836,7 +6824,7 @@ declare namespace __esri {
export const Popup: PopupConstructor;
interface PopupProperties extends WidgetteProperties {
actions?: Collection;
actions?: Collection | any[];
content?: string | any;
currentDockPosition?: string;
dockEnabled?: boolean;
@@ -6845,7 +6833,6 @@ declare namespace __esri {
features?: GraphicProperties[];
location?: PointProperties;
promises?: IPromise<any>[];
rendered?: boolean;
selectedFeature?: GraphicProperties;
selectedFeatureIndex?: number;
title?: string;
@@ -7142,7 +7129,7 @@ declare namespace __esri {
interface BasemapGalleryViewModelProperties {
activeBasemap?: BasemapProperties;
items?: Collection;
items?: Collection | any[];
source?: LocalBasemapsSource | PortalBasemapsSource;
state?: string;
view?: MapView | SceneView;
@@ -7245,7 +7232,7 @@ declare namespace __esri {
interface LayerListViewModelProperties {
createActionsFunction?: Function;
operationalItems?: Collection;
operationalItems?: Collection | any[];
state?: string;
view?: MapView | SceneView;
}
@@ -7356,7 +7343,7 @@ declare namespace __esri {
export const PopupViewModel: PopupViewModelConstructor;
interface PopupViewModelProperties {
actions?: Collection;
actions?: Collection | any[];
content?: string | any;
featureCount?: number;
features?: GraphicProperties[];
@@ -7491,6 +7478,17 @@ declare namespace __esri {
view?: MapView | SceneView;
}
interface Evented {
hasEventListener(type: string): boolean;
on(type: string, listener: EventHandler): IHandle;
}
interface EventedConstructor {
new(): Evented;
}
export const Evented: EventedConstructor;
interface JSONSupport {
toJSON(): any;
}
@@ -7627,14 +7625,14 @@ declare namespace __esri {
export const ArcGISDynamicMapService: ArcGISDynamicMapServiceConstructor;
interface ArcGISDynamicMapServiceProperties {
allSublayers?: Collection;
allSublayers?: Collection | any[];
dpi?: number;
gdbVersion?: string;
imageFormat?: string;
imageMaxHeight?: number;
imageMaxWidth?: number;
imageTransparency?: boolean;
sublayers?: Collection;
sublayers?: Collection | any[];
}
interface ArcGISImageService {
@@ -7809,7 +7807,7 @@ declare namespace __esri {
export const LayersMixin: LayersMixinConstructor;
interface LayersMixinProperties {
layers?: Collection;
layers?: Collection | any[];
}
interface BreakpointsOwner {
@@ -7833,7 +7831,7 @@ declare namespace __esri {
}
interface DOMContainer {
container: string;
container: HTMLDivElement | string;
height: number;
popup: Popup;
resizing: boolean;
@@ -7850,7 +7848,7 @@ declare namespace __esri {
export const DOMContainer: DOMContainerConstructor;
interface DOMContainerProperties {
container?: string;
container?: HTMLDivElement | string;
height?: number;
popup?: Popup;
resizing?: boolean;
@@ -8381,6 +8379,8 @@ declare module "esri" {
export import EasingFunction = __esri.EasingFunction;
export import EventHandler = __esri.EventHandler;
export import PromisedWatchHandle = __esri.PromisedWatchHandle;
export import GroundQueryElevationOptions = __esri.GroundQueryElevationOptions;
@@ -8748,11 +8748,6 @@ declare module "esri" {
export import sizeGetSchemesParams = __esri.sizeGetSchemesParams;
}
declare module "esri/core/Evented" {
import Evented = __esri.Evented;
export = Evented;
}
declare module "esri/Basemap" {
import Basemap = __esri.Basemap;
export = Basemap;
@@ -9833,6 +9828,11 @@ declare module "esri/widgets/Zoom/ZoomViewModel" {
export = ZoomViewModel;
}
declare module "esri/core/Evented" {
import Evented = __esri.Evented;
export = Evented;
}
declare module "esri/core/JSONSupport" {
import JSONSupport = __esri.JSONSupport;
export = JSONSupport;
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+2 -2
View File
@@ -1,3 +1,3 @@
{
"extends": "../tslint.json"
}
"extends": "dtslint/dt.json"
}
+54
View File
@@ -5,12 +5,17 @@ var num: number = 5;
var error: Error = new Error();
var b: boolean = true;
var apiGwEvt: AWSLambda.APIGatewayEvent;
var customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent;
var clientCtx: AWSLambda.ClientContext;
var clientContextEnv: AWSLambda.ClientContextEnv;
var clientContextClient: AWSLambda.ClientContextClient;
var context: AWSLambda.Context;
var identity: AWSLambda.CognitoIdentity;
var proxyResult: AWSLambda.ProxyResult;
var authResponse: AWSLambda.AuthResponse;
var policyDocument: AWSLambda.PolicyDocument;
var statement: AWSLambda.Statement;
var authResponseContext: AWSLambda.AuthResponseContext;
var snsEvt: AWSLambda.SNSEvent;
var snsEvtRecs: AWSLambda.SNSEventRecord[];
var snsEvtRec: AWSLambda.SNSEventRecord;
@@ -87,6 +92,11 @@ str = apiGwEvt.requestContext.resourceId;
str = apiGwEvt.requestContext.resourcePath;
str = apiGwEvt.resource;
/* API Gateway CustomAuthorizer Event */
str = customAuthorizerEvt.type;
str = customAuthorizerEvt.authorizationToken;
str = customAuthorizerEvt.methodArn;
/* SNS Event */
snsEvtRecs = snsEvt.Records;
@@ -119,6 +129,41 @@ proxyResult.headers["example"] = b;
proxyResult.headers["example"] = num;
str = proxyResult.body;
/* API Gateway CustomAuthorizer AuthResponse */
authResponseContext = {
stringKey: str,
numberKey: num,
booleanKey: b
};
statement = {
Action: str,
Effect: str,
Resource: str
};
statement = {
Action: [str, str],
Effect: str,
Resource: [str, str]
};
policyDocument = {
Version: str,
Statement: [statement]
};
authResponse = {
principalId: str,
policyDocument: policyDocument,
context: authResponseContext
};
authResponse = {
principalId: str,
policyDocument: policyDocument
};
/* Context */
b = context.callbackWaitsForEmptyEventLoop;
str = context.functionName;
@@ -170,6 +215,14 @@ function proxyCallback(cb: AWSLambda.ProxyCallback) {
cb(null, proxyResult);
}
/* CustomAuthorizerCallback */
function customAuthorizerCallback(cb: AWSLambda.CustomAuthorizerCallback) {
cb();
cb(null);
cb(error);
cb(null, authResponse);
}
/* Compatibility functions */
context.done();
context.done(error);
@@ -183,3 +236,4 @@ context.fail(str);
/* Handler */
let handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { };
let proxyHandler: AWSLambda.ProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.ProxyCallback) => { };
let CustomAuthorizerHandler: AWSLambda.CustomAuthorizerHandler = (event: AWSLambda.CustomAuthorizerEvent, context: AWSLambda.Context, cb: AWSLambda.CustomAuthorizerCallback) => { };
+46
View File
@@ -39,6 +39,13 @@ interface APIGatewayEvent {
resource: string;
}
// API Gateway CustomAuthorizer "event"
interface CustomAuthorizerEvent {
type: string;
authorizationToken: string;
methodArn: string;
}
// SNS "event"
interface SNSMessageAttribute {
Type: string;
@@ -180,6 +187,43 @@ interface ProxyResult {
body: string;
}
/**
* API Gateway CustomAuthorizer AuthResponse.
* http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output
*/
interface AuthResponse {
principalId: string;
policyDocument: PolicyDocument;
context?: AuthResponseContext;
}
/**
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.
* http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output
*/
interface PolicyDocument {
Version: string;
Statement: [Statement];
}
/**
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement.
* http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output
*/
interface Statement {
Action: string | [string];
Effect: string;
Resource: string | [string];
}
/**
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement.
* http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output
*/
interface AuthResponseContext {
[name: string]: string | number | boolean;
}
/**
* AWS Lambda handler function.
* http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html
@@ -190,6 +234,7 @@ interface ProxyResult {
*/
export type Handler = (event: any, context: Context, callback?: Callback) => void;
export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?: ProxyCallback) => void;
export type CustomAuthorizerHandler = (event: CustomAuthorizerEvent, context: Context, callback?: CustomAuthorizerCallback) => void;
/**
* Optional callback parameter.
@@ -200,5 +245,6 @@ export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?:
*/
export type Callback = (error?: Error, result?: any) => void;
export type ProxyCallback = (error?: Error, result?: ProxyResult) => void;
export type CustomAuthorizerCallback = (error?: Error, result?: AuthResponse) => void;
export as namespace AWSLambda;
-422
View File
@@ -1,422 +0,0 @@
import AWS = require('aws-sdk');
var str: string;
var creds: AWS.Credentials;
creds = new AWS.Credentials(str, str);
creds = new AWS.Credentials(str, str, str);
str = creds.accessKeyId;
/*
* ECS
*/
var ecs:AWS.ECS
ecs = new AWS.ECS();
ecs = new AWS.ECS({apiVersion: '2012-11-05'});
ecs.describeClusters({
clusters: ['STRING_VALUE', 'STRING_VALUE']
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
ecs.describeTasks({
cluster: 'STRING_VALUE',
tasks: ['STRING_VALUE', 'STRING_VALUE']
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
/*
* SQS
*/
var sqs:AWS.SQS
//Default constructor
sqs = new AWS.SQS();
//Locking the API Version
sqs = new AWS.SQS({apiVersion: '2012-11-05'});
// Locking the API Version Globally
AWS.config.apiVersions = {
sqs: '2012-11-05',
// other service API versions
};
sqs.addPermission({
AWSAccountIds: [ /* required */
'STRING_VALUE',
/* more items */
],
Actions: [ /* required */
'STRING_VALUE',
/* more items */
],
Label: 'STRING_VALUE', /* required */
QueueUrl: 'STRING_VALUE' /* required */
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.changeMessageVisibility({
QueueUrl: 'STRING_VALUE', /* required */
ReceiptHandle: 'STRING_VALUE', /* required */
VisibilityTimeout: 0 /* required */
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.changeMessageVisibilityBatch({
Entries: [ /* required */
{
Id: 'STRING_VALUE', /* required */
ReceiptHandle: 'STRING_VALUE', /* required */
VisibilityTimeout: 0
},
/* more items */
],
QueueUrl: 'STRING_VALUE' /* required */
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.createQueue({
QueueName: 'STRING_VALUE', /* required */
Attributes: {
someKey: 'STRING_VALUE',
/* anotherKey: ... */
}
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.deleteMessage({
QueueUrl: 'STRING_VALUE', /* required */
ReceiptHandle: 'STRING_VALUE' /* required */
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.deleteMessageBatch({
Entries: [ /* required */
{
Id: 'STRING_VALUE', /* required */
ReceiptHandle: 'STRING_VALUE' /* required */
},
/* more items */
],
QueueUrl: 'STRING_VALUE' /* required */
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.deleteQueue({
QueueUrl: 'STRING_VALUE' /* required */
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.getQueueAttributes({
QueueUrl: 'STRING_VALUE', /* required */
AttributeNames: [
'Policy | VisibilityTimeout | MaximumMessageSize | MessageRetentionPeriod | ApproximateNumberOfMessages | ApproximateNumberOfMessagesNotVisible | CreatedTimestamp | LastModifiedTimestamp | QueueArn | ApproximateNumberOfMessagesDelayed | DelaySeconds | ReceiveMessageWaitTimeSeconds | RedrivePolicy',
/* more items */
]
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.getQueueUrl({
QueueName: 'STRING_VALUE', /* required */
QueueOwnerAWSAccountId: 'STRING_VALUE'
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.listDeadLetterSourceQueues({
QueueUrl: 'STRING_VALUE' /* required */
}, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.listQueues({
QueueNamePrefix: 'STRING_VALUE'
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.purgeQueue({
QueueUrl: 'STRING_VALUE' /* required */
}, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.receiveMessage({
QueueUrl: 'STRING_VALUE', /* required */
AttributeNames: [
'Policy | VisibilityTimeout | MaximumMessageSize | MessageRetentionPeriod | ApproximateNumberOfMessages | ApproximateNumberOfMessagesNotVisible | CreatedTimestamp | LastModifiedTimestamp | QueueArn | ApproximateNumberOfMessagesDelayed | DelaySeconds | ReceiveMessageWaitTimeSeconds | RedrivePolicy',
/* more items */
],
MaxNumberOfMessages: 0,
MessageAttributeNames: [
'STRING_VALUE',
/* more items */
],
VisibilityTimeout: 0,
WaitTimeSeconds: 0
}, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.removePermission({
Label: 'STRING_VALUE', /* required */
QueueUrl: 'STRING_VALUE' /* required */
}, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.sendMessage({
MessageBody: 'STRING_VALUE', /* required */
QueueUrl: 'STRING_VALUE', /* required */
DelaySeconds: 0,
MessageAttributes: {
someKey: {
DataType: 'STRING_VALUE', /* required */
BinaryListValues: [
new Buffer('...') || 'STRING_VALUE',
/* more items */
],
BinaryValue: new Buffer('...') || 'STRING_VALUE',
StringListValues: [
'STRING_VALUE',
/* more items */
],
StringValue: 'STRING_VALUE'
},
/* anotherKey: ... */
}
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.sendMessageBatch({
Entries: [ /* required */
{
Id: 'STRING_VALUE', /* required */
MessageBody: 'STRING_VALUE', /* required */
DelaySeconds: 0,
MessageAttributes: {
someKey: {
DataType: 'STRING_VALUE', /* required */
BinaryListValues: [
new Buffer('...') ,
/* more items */
],
BinaryValue: new Buffer('...'),
StringListValues: [
'STRING_VALUE',
/* more items */
],
StringValue: 'STRING_VALUE'
},
/* anotherKey: ... */
}
},
/* more items */
],
QueueUrl: 'STRING_VALUE' /* required */
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
sqs.setQueueAttributes({
Attributes: { /* required */
someKey: 'STRING_VALUE',
/* anotherKey: ... */
},
QueueUrl: 'STRING_VALUE' /* required */
}, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
var dynamoDBDocClient:AWS.DynamoDB.DocumentClient;
dynamoDBDocClient = new AWS.DynamoDB.DocumentClient();
dynamoDBDocClient = new AWS.DynamoDB.DocumentClient({});
dynamoDBDocClient.createSet([1, 2, 3], { validate: true });
dynamoDBDocClient.get(
{
TableName: 'TABLE_NAME',
Key: { userId: 'abc123', email: 'abc123@abc123.com' }
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
}
);
dynamoDBDocClient.put(
{
TableName: 'TABLE_NAME',
Item: {
userId: 'abc123',
email: 'abc123@abc123.com',
firstName: 'Matt',
lastName: 'Forrester the ' + new Date().getTime()
}
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
}
);
dynamoDBDocClient.delete(
{
TableName: 'TABLE_NAME',
Key: {
userId: 'abc123',
email: 'abc123@abc123.com'
}
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
}
);
dynamoDBDocClient.update(
{
TableName: 'TABLE_NAME',
Key: {
userId: 'abc123',
email: 'abc123@abc123.com'
},
AttributeUpdates: {
thingsWithWheels: {
Action: 'PUT',
Value: dynamoDBDocClient.createSet(
[
'SkateBoard',
'Skates',
'Mountain Bike',
'Evolve Electric Skateboard'
],
{ validate: true }
)
},
age: {
Action: 'PUT',
Value: 35
}
}
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
}
);
dynamoDBDocClient.scan(
{
TableName: 'TABLE_NAME',
KeyConditions: {
age: {
ComparisonOperator: 'EQ',
AttributeValueList: [35]
}
}
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
}
);
dynamoDBDocClient.query(
{
TableName: 'TABLE_NAME',
KeyConditions: {
userId: {
ComparisonOperator: 'EQ',
AttributeValueList: ['abc123']
}
}
},
function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
}
);
var kinesis = new AWS.Kinesis();
var putRecordParam = {
Data: new Buffer('...') || 'STRING_VALUE', /* required */
PartitionKey: 'STRING_VALUE', /* required */
StreamName: 'STRING_VALUE', /* required */
ExplicitHashKey: 'STRING_VALUE',
SequenceNumberForOrdering: 'STRING_VALUE'
};
kinesis.putRecord(putRecordParam, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
var putRecordParams = {
Records: [ /* required */
{
Data: new Buffer('...') || 'STRING_VALUE', /* required */
PartitionKey: 'STRING_VALUE', /* required */
ExplicitHashKey: 'STRING_VALUE'
},
/* more items */
],
StreamName: 'STRING_VALUE' /* required */
};
kinesis.putRecords(putRecordParams, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
var increaseStreamRetentionPeriodParams = {
RetentionPeriodHours: 0, /* required */
StreamName: 'STRING_VALUE' /* required */
};
kinesis.increaseStreamRetentionPeriod(increaseStreamRetentionPeriodParams, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
-2606
View File
File diff suppressed because it is too large Load Diff
-23
View File
@@ -1,23 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"aws-sdk-tests.ts"
]
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
-90
View File
@@ -1,90 +0,0 @@
var context:any = document
var $fixture:any = {}
// axe.a11yCheck config
axe.a11yCheck(context, {}, (results) => {
// axe's results object
console.log(results.passes.length)
console.log(results.violations.length)
});
// axe.a11yCheck include/exclude
axe.a11yCheck({include: [['#id1'], ['#id2']]}, {}, (results) => {
console.log(results)
})
axe.a11yCheck({exclude: [$fixture[0]]}, {}, (results) => {
console.log(results)
})
var tagConfigRunOnly: axe.RunOnly = {
type: 'tag',
values: ['wcag2a']
}
var tagConfig = {
runOnly: tagConfigRunOnly
}
axe.a11yCheck(context, tagConfig, (results) => {
console.log(results)
})
var includeExcludeTagsRunOnly: axe.RunOnly = {
type: 'tags',
value: {
include: ['wcag2a', 'wcag2aa'],
exclude: ['experimental']
}
}
var includeExcludeTagsConfig = {
runOnly: includeExcludeTagsRunOnly
}
axe.a11yCheck(context, includeExcludeTagsConfig, (results) => {
console.log(results)
})
var someRulesConfig = {
rules: {
"color-contrast": {enabled: 'false'},
"heading-order": {enabled: 'true'}
}
}
axe.a11yCheck(context, someRulesConfig, (results) => {
console.log(results)
})
// axe.configure
var spec: axe.Spec = {
branding: {
brand: 'foo',
application: 'bar'
},
reporter: 'v1',
checks: [{
id: 'custom-check',
evaluate: function() {
return true
}
}],
rules: [{
id: 'custom-rule',
any: ['custom-check']
}]
}
axe.configure(spec)
axe.reset()
axe.getRules(['wcag2aa'])
typeof axe.getRules() === 'object'
// Plugins
var pluginSrc: axe.AxePlugin = {
id: 'doStuff',
run: (data:any, callback:Function) => {
callback()
},
commands: [{
id: 'run-doStuff',
callback: (data:any, callback:Function) => {
axe.plugins['doStuff'].run(data, callback)
}
}]
}
axe.registerPlugin(pluginSrc)
axe.cleanup()
-159
View File
@@ -1,159 +0,0 @@
// Type definitions for axe-core 2.0.5
// Project: https://github.com/dequelabs/axe-core
// Definitions by: Marcy Sutton <https://github.com/marcysutton>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace axe {
export type ImpactValue = "minor" | "moderate" | "serious" | "critical";
export type TagValue = "wcag2a" | "wcag2aa" | "section508" | "best-practice";
export type ReporterVersion = "v1" | "v2";
export type RunOnlyType = "rule" | "rules" | "tag" | "tags";
export interface ElementContext {
node?: Object,
selector?: string,
include?: any[],
exclude?: any[]
}
export interface RunOnly {
type: RunOnlyType,
value?: {
include?: string[],
exclude?: string[]
}
values?: TagValue[]
}
export interface AxeResults {
url: string,
timestamp: string,
passes: Pass[],
violations: Violation[]
}
export interface Pass {
description: string,
help: string,
helpUrl: string,
id: string,
impact: ImpactValue,
tags: TagValue[],
nodes: NodeResult[]
}
export interface Violation {
description: string,
help: string,
helpUrl: string,
id: string,
impact: ImpactValue,
tags: TagValue[],
nodes: NodeResult[]
}
export interface NodeResult {
html: string,
impact: ImpactValue,
target: string[],
any: CheckResult[],
all: CheckResult[],
none: CheckResult[]
}
export interface CheckResult {
id: string,
impact: string,
message: string,
data: any,
relatedNodes?: RelatedNode[]
}
export interface RelatedNode {
target: string[],
html: string
}
export interface Spec {
branding?: {
brand: string,
application: string
},
reporter?: ReporterVersion,
checks?: Check[],
rules?: Rule[]
}
export interface Check {
id: string,
evaluate: Function,
after?: Function,
options?: any,
matches?: string,
enabled?: boolean
}
export interface Rule {
id: string,
selector?: string,
excludeHidden?: boolean,
enabled?: boolean,
pageLevel?: boolean,
any?: string[],
all?: string[],
none?: string[],
tags?: string[],
matches?: string
}
export interface AxePlugin {
id: string,
run(...args:any[]): any,
commands: {
id: string,
callback(...args:any[]): void
}[],
cleanup?(callback:Function): void
}
export let plugins: any
/**
* Starts analysis on the current document and its subframes
*
* @param {Object} context The `Context` specification object @see Context
* @param {Array} options Options passed into rules or checks, temporarily modifyint them.
* @param {Function} callback The function to invoke when analysis is complete.
* @returns {Object} results The aXe results object
*/
export function a11yCheck(context: ElementContext, options: {runOnly?: RunOnly, rules?: Object}, callback: (results:AxeResults) => void): AxeResults
/**
* Method for configuring the data format used by aXe. Helpful for adding new
* rules, which must be registered with the library to execute.
* @param {Spec} Spec Object with valid `branding`, `reporter`, `checks` and `rules` data
*/
export function configure(spec: Spec): void
/**
* Searches and returns rules that contain a tag in the list of tags.
* @param {Array} tags Optional array of tags
* @return {Array} Array of rules
*/
export function getRules(tags?: string[]): Object[]
/**
* Restores the default axe configuration
*/
export function reset(): void
/**
* Function to register a plugin configuration in document and its subframes
* @param {Object} plugin A plugin configuration object
*/
export function registerPlugin(plugin: AxePlugin): void
/**
* Function to clean up plugin configuration in document and its subframes
*/
export function cleanup(): void
}
// axe is also available as a module
declare module "axe-core" {
export = axe;
}
-23
View File
@@ -1,23 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"axe-core-tests.ts"
]
}
@@ -1,125 +0,0 @@
import express = require('express');
import mobileApps = require('azure-mobile-apps');
import logger = require('azure-mobile-apps/src/logger');
import queries = require('azure-mobile-apps/src/query');
var app = express(),
mobileApp = mobileApps();
// various configuration permutations
mobileApps({
debug: true,
data: {
provider: 'mssql',
server: '',
user: '',
database: '',
password: ''
},
webhook: { url: 'http://localhost/' }
});
mobileApps({
data: {
provider: 'memory'
}
})
// it would be nice to integrate with winston
mobileApps({ logging: { level: 'silly', transports: [{}] } })
// various custom middleware syntaxes
mobileApp.use(function (req: any, res: any, next: any) { next(); });
mobileApp.use([function () {}, function () {}]);
mobileApp.use(function () {}, function () {});
mobileApp.use(function () {}).use(function () {});
// basic syntax for tables and api
mobileApp.tables.add('todoitem');
mobileApp.tables.add('todoitem', { authorize: true });
mobileApp.tables.add('todoitem', mobileApps.table());
mobileApp.tables.import('tables');
mobileApp.api.add('api', { authorize: true, get: function () {}, delete: function () {} });
mobileApp.api.import('api');
// ensure the mobile app instance can be correctly mounted as an express router
app.use(mobileApp);
// Express.Table, instantiated from the mobile app
var table = mobileApp.table()
table.use(function (req: Express.Request, res: Express.Response, next: any) {
next(new Error());
});
table.use([function () {}, function () {}]);
table.read(function (context: Azure.MobileApps.Context) {
context.query.where({ p1: 'test' });
return context.execute()
.then(function (result: any) {
return result;
})
.catch(function (error: any) { })
.then(function () {});
});
table.insert(function (context: Azure.MobileApps.Context) {
context.query.id = 'anotherId';
context.query.single = true;
context.item.userId = context.user.id;
context.push.send('tag', {}, function (error, result) {});
context.push.gcm.send('tag', {}, function (error, result) {});
context.push.apns.send('tag', { payload: { } }, function (error, result) {});
context.push.wns.sendToastText01('tag', '', { headers: { } }, function (error, result) {});
context.next(new Error());
context.next('An error occurred');
});
table.read.use(function () {});
table.read.use([function () {}, function () {}]);
table.read.use(function () {}, function () {});
table.use(function () {}).use(function () {}).read(function () {}).use(function () {});
table.access = undefined;
table.access = 'authenticated';
table.read.access = 'anonymous';
table.update.access = 'disabled';
table.delete.access = 'authenticated';
table.insert.access = 'authenticated';
table.filters = [function (query, context) { }];
table.transforms = [function (item, context) { }];
table.hooks = [function (results, context) { }];
table.perUser = true;
table.recordsExpire = { milliseconds: 1, seconds: 1, minutes: 1, hours: 1, days: 1, weeks: 1, months: 1, years: 1 };
table.webhook = { url: 'http://localhost/' }
table.webhook = true;
// Express.Table, instantiated from the static require('azure-mobile-apps').table()
// This is going to be interesting if we ever support more than one provider
var table2 = mobileApps.table();
table2.read(function (context: Azure.MobileApps.Context) {});
// ApiDefinition, from the static require('azure-mobile-apps').api()
var api2 = mobileApps.api({
get: function (req, res, next) { }
});
api2.post = function (req, res, next) {};
// Logger
logger.silly('test', 'message');
logger.error('Something happened', new Error());
mobileApps.logger.debug('a debug message')
// Query
queries.create('table').where({ x: 10 }).select('col1,col2').includeDeleted().includeTotalCount();
mobileApps.query.create('table');
// Custom SQL query
mobileApp.api.add('query', { authorize: true, get: (req, res, next) => {
req.azureMobile.data.execute({
sql: "SELECT * FROM TODOITEM WHERE COMPLETE = :complete",
parameters: [
{ name: 'complete', value: 1 }
]
}).then(x => {});
}, delete: function () {} });
-326
View File
@@ -1,326 +0,0 @@
// Type definitions for azure-mobile-apps v2.1.7
// Project: https://github.com/Azure/azure-mobile-apps-node/
// Definitions by: Microsoft Azure <https://github.com/Azure/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="azure-sb" />
declare module "azure-mobile-apps" {
interface AzureMobileApps {
(configuration?: Azure.MobileApps.Configuration): Azure.MobileApps.Platforms.Express.MobileApp;
table(): Azure.MobileApps.Platforms.Express.Table;
api(definition?: Azure.MobileApps.ApiDefinition): Azure.MobileApps.ApiDefinition;
logger: Azure.MobileApps.Logger;
query: Azure.MobileApps.Query;
}
var out: AzureMobileApps;
export = out;
}
declare module "azure-mobile-apps/src/logger" {
var logger: Azure.MobileApps.Logger;
export = logger;
}
declare module "azure-mobile-apps/src/query" {
var query: Azure.MobileApps.Query;
export = query;
}
declare namespace Azure.MobileApps {
// the additional Platforms namespace is required to avoid collisions with the main Express namespace
export module Platforms {
export module Express {
interface MobileApp extends Middleware {
configuration: Configuration;
tables: Tables;
table(): Table;
api: Api;
use(...middleware: Middleware[]): MobileApp;
use(middleware: Middleware[]): MobileApp;
}
interface Api {
add(name: string, definition: ApiDefinition): void;
import(fileOrFolder: string): void;
}
interface Table extends TableDefinition {
use(...middleware: Middleware[]): Table;
use(middleware: Middleware[]): Table;
read: TableOperation;
update: TableOperation;
insert: TableOperation;
delete: TableOperation;
undelete: TableOperation;
}
interface TableOperation {
(operationHandler: (context: Context) => void): Table;
use(...middleware: Middleware[]): Table;
use(middleware: Middleware[]): Table;
access?: AccessType;
}
interface Tables {
configuration: Configuration;
add(name: string, definition?: Table | TableDefinition): void;
import(fileOrFolder: string): void;
initialize(): Thenable<any>;
}
}
}
export module Data {
interface Table {
read(query: QueryJs): Thenable<any[]>;
update(item: any, query: QueryJs): Thenable<any>;
insert(item: any): Thenable<any>;
delete(query: QueryJs, version: string): Thenable<any>;
undelete(query: QueryJs, version: string): Thenable<any>;
truncate(): Thenable<void>;
initialize(): Thenable<void>;
schema(): Thenable<Column[]>;
}
interface Column {
name: string;
type: string;
}
}
// auth
interface User {
id: string;
claims: any[];
token: string;
getIdentity(provider: string): Thenable<any>;
}
interface Auth {
validate(token: string): Thenable<User>;
decode(token: string): User;
sign(payload: any): string;
}
// configuration
interface Configuration {
platform?: string;
basePath?: string;
configFile?: string;
promiseConstructor?: (resolve: (result: any) => void, reject: (error: any) => void) => Thenable<any>;
apiRootPath?: string;
tableRootPath?: string;
notificationRootPath?: string;
swaggerPath?: string;
authStubRoute?: string;
debug?: boolean;
version?: string;
apiVersion?: string;
homePage?: boolean;
swagger?: boolean;
maxTop?: number;
pageSize?: number;
logging?: Configuration.Logging;
data?: Configuration.Data;
auth?: Configuration.Auth;
cors?: Configuration.Cors;
notifications?: Configuration.Notifications;
webhook?: Webhook;
}
export module Configuration {
// it would be nice to have the config for various providers in separate interfaces,
// but this is the simplest solution to support variations of the current setup
interface Data {
provider: string;
user?: string;
password?: string;
server?: string;
port?: number;
database?: string;
connectionTimeout?: string;
options?: { encrypt: boolean };
schema?: string;
dynamicSchema?: boolean;
filename?: string;
}
interface Auth {
secret: string;
validateTokens?: boolean;
}
interface Logging {
level?: string;
transports?: LoggingTransport[];
}
interface LoggingTransport { }
interface Cors {
exposeHeaders: string;
maxAge?: number;
hostnames: string[];
}
interface Notifications {
hubName: string;
connectionString?: string;
endpoint?: string;
sharedAccessKeyName?: string;
sharedAccessKeyValue?: string;
}
}
// query
interface Query {
create(tableName: string): QueryJs;
fromRequest(req: Express.Request): QueryJs;
toOData(query: QueryJs): OData;
}
interface QueryJs {
includeTotalCount(): QueryJs;
includeDeleted(): QueryJs;
orderBy(properties: string): QueryJs;
orderByDescending(properties: string): QueryJs;
select(properties: string): QueryJs;
skip(count: number): QueryJs;
take(count: number): QueryJs;
where(filter: any): QueryJs;
// these are properties added by the SDK
id?: string | number;
single?: boolean;
}
interface OData {
table: string;
filters?: string;
ordering?: string;
orderClauses?: string;
skip?: number;
take?: number;
selections?: string;
includeTotalCount?: boolean;
}
// general
var nh: Azure.ServiceBus.NotificationHubService;
interface Context {
query: QueryJs;
id: string | number;
item: any;
req: Express.Request;
res: Express.Response;
data: ContextData;
tables: (tableName: string) => Data.Table;
user: User;
push: typeof nh;
logger: Logger;
execute(): Thenable<any>;
next(error: string|Error): any;
}
interface ContextData {
(table: TableDefinition): Data.Table;
execute(q: SqlQueryDefinition): Thenable<any>;
}
interface SqlQueryDefinition {
sql: string;
parameters?: SqlParameterDefinition[];
}
interface SqlParameterDefinition {
name: string;
value: any;
}
interface TableDefinition {
access?: AccessType;
authorize?: boolean;
autoIncrement?: boolean;
columns?: any;
databaseTableName?: string;
dynamicSchema?: boolean;
maxTop?: number;
name?: string;
pageSize?: number;
schema?: string;
softDelete?: boolean;
userIdColumn?: string;
filters?: [(query: QueryJs, context: Context) => void | QueryJs];
transforms?: [(item: any, context: Context) => void | any];
hooks?: [(results: any, context: Context) => void];
perUser?: boolean;
recordsExpire?: Duration;
webhook?: Webhook | boolean;
}
type AccessType = 'anonymous' | 'authenticated' | 'disabled';
interface Duration {
milliseconds?: number;
seconds?: number;
minutes?: number;
hours?: number;
days?: number;
weeks?: number;
months?: number;
years?: number;
}
interface Webhook {
url: string;
}
interface ApiDefinition {
authorize?: boolean;
get?: Middleware | Middleware[];
post?: Middleware | Middleware[];
patch?: Middleware | Middleware[];
put?: Middleware | Middleware[];
delete?: Middleware | Middleware[];
}
interface Thenable<R> {
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
catch<U>(onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
catch<U>(onRejected?: (error: any) => void): Thenable<U>;
}
interface Logger {
log(level: string, ...message: any[]): void;
silly(...message: any[]): void;
debug(...message: any[]): void;
verbose(...message: any[]): void;
info(...message: any[]): void;
warn(...message: any[]): void;
error(...message: any[]): void;
}
interface Middleware {
(req: Express.Request, res: Express.Response, next: NextMiddleware): void;
}
interface NextMiddleware {
(error?: any): void;
}
}
// additions to the Express modules
declare namespace Express {
interface Request {
azureMobile: Azure.MobileApps.Context
}
interface Response {
results?: any;
}
}
-22
View File
@@ -1,22 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"azure-mobile-apps-tests.ts"
]
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
-1
View File
@@ -1 +0,0 @@
-7260
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"no-misused-new": false
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1,3 +1,3 @@
{
"extends": "../tslint.json"
"extends": "dtslint/dt.json"
}
+17 -8
View File
@@ -11,15 +11,24 @@
*
* 2. How to use it?
*
* Add `bluebird-global` to the `types` array in your `tsconfig.json` like this:
* It should just work, but there are a couple of points to be wary about:
*
* {
* "compilerOptions": {
* "types": [
* "bluebird-global"
* ],
* }
* }
* a) If you already use `compilerOptions.types` in your `tsconfig.json`, then add `bluebird-global`
* to the list:
*
* {
* "compilerOptions": {
* "types": [
* (other types ...)
*
* "bluebird-global"
* ],
* }
* }
*
* b) Be aware, that you still need to get the global Promise symbol to be replaced with bluebird.js
* in the runtime. Do this by either importing bluebird.js via a `<script />` tag in your html or
* via importing it in your js entry file AND assigning it to the global Promise symbol.
*
* 3. Why so much effort?
*
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"max-line-length": false,
"no-empty-interface": false,
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"max-line-length": false
}
+36 -3
View File
@@ -1,8 +1,41 @@
import Boom = require('boom');
var bo = Boom.wrap(new Error('test'), 400, 'some message');
var a: string = bo.output.headers['some header'];
Boom.create(500, 'Internal server error', { timestamp: Date.now() });
Boom.wrap(new Error('test'), 400);
Boom.badRequest('Invalid cookies');
Boom.badRequest('message', {some: 'data'});
Boom.unauthorized('message', <string | string[]> 'scheme', {some: 'data'});
Boom.unauthorized(null, <string | string[]> 'scheme', 'data');
Boom.paymentRequired('message', {some: 'data'});
Boom.forbidden('message', {some: 'data'});
Boom.notFound('message', {some: 'data'});
Boom.methodNotAllowed('message', {some: 'data'});
Boom.notAcceptable('message', {some: 'data'});
Boom.proxyAuthRequired('message', {some: 'data'});
Boom.clientTimeout('message', {some: 'data'});
Boom.conflict('message', {some: 'data'});
Boom.resourceGone('message', {some: 'data'});
Boom.lengthRequired('message', {some: 'data'});
Boom.preconditionFailed('message', {some: 'data'});
Boom.entityTooLarge('message', {some: 'data'});
Boom.uriTooLong('message', {some: 'data'});
Boom.unsupportedMediaType('message', {some: 'data'});
Boom.rangeNotSatisfiable('message', {some: 'data'});
Boom.expectationFailed('message', {some: 'data'});
Boom.teapot('message', {some: 'data'});
Boom.badData('message', {some: 'data'});
Boom.locked('message', {some: 'data'});
Boom.preconditionRequired('message', {some: 'data'});
Boom.tooManyRequests('message', {some: 'data'});
Boom.illegal('message', {some: 'data'});
Boom.badImplementation('message', {some: 'data'});
Boom.notImplemented('message', {some: 'data'});
Boom.badGateway('message', {some: 'data'});
Boom.serverUnavailable('message', {some: 'data'});
Boom.gatewayTimeout('message', {some: 'data'});
Boom.unauthorized() as Error;
+251 -10
View File
@@ -1,6 +1,6 @@
// Type definitions for boom
// Type definitions for boom 4.3
// Project: http://github.com/hapijs/boom
// Definitions by: Igor Rogatty <http://github.com/rogatty>
// Definitions by: Igor Rogatty <http://github.com/rogatty>, AJP <http://github.com/AJamesPhillips>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -9,53 +9,294 @@ export = Boom;
declare namespace Boom {
export interface BoomError {
data: any;
reformat: () => void;
/**
* boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties:
* @see {@link https://github.com/hapijs/boom#boom}
*/
export interface BoomError extends Error {
/** isBoom - if true, indicates this is a Boom object instance. */
isBoom: boolean;
/** isServer - convenience bool indicating status code >= 500. */
isServer: boolean;
/** message - the error message. */
message: string;
/** output - the formatted response. Can be directly manipulated after object construction to return a custom error response. Allowed root keys: */
output: Output;
name: string;
/** reformat() - rebuilds error.output using the other object properties. */
reformat: () => string;
}
export interface Output {
/** statusCode - the HTTP status code (typically 4xx or 5xx). */
statusCode: number;
headers: any;
payload: any;
/** headers - an object containing any HTTP headers where each key is a header name and value is the header content. (Limited value type to string https://github.com/hapijs/boom/issues/151 ) */
headers: {[index: string]: string};
/** payload - the formatted object used as the response payload (stringified). Can be directly manipulated but any changes will be lost if reformat() is called. Any content allowed and by default includes the following content: */
payload: {
/** statusCode - the HTTP status code, derived from error.output.statusCode. */
statusCode: number;
/** error - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from statusCode. */
error: string;
/** message - the error message derived from error.message. */
message: string;
}
}
/**
* Decorates an error with the boom properties
* @param error the error object to wrap. If error is already a boom object, returns back the same object.
* @param statusCode optional HTTP status code. Defaults to 500.
* @param message optional message string. If the error already has a message, it adds the message as a prefix. Defaults to no message.
* @see {@link https://github.com/hapijs/boom#wraperror-statuscode-message}
*/
export function wrap(error: Error, statusCode?: number, message?: string): BoomError;
/**
* Generates an Error object with the boom decorations
* @param statusCode an HTTP error code number. Must be greater or equal 400.
* @param message optional message string.
* @param data additional error data set to error.data property.
* @see {@link https://github.com/hapijs/boom#createstatuscode-message-data}
*/
export function create(statusCode: number, message?: string, data?: any): BoomError;
// 4xx
/**
* Returns a 400 Bad Request error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boombadrequestmessage-data}
*/
export function badRequest(message?: string, data?: any): BoomError;
export function unauthorized(message?: string, scheme?: any, attributes?: any): BoomError;
/**
* Returns a 401 Unauthorized error
* @param message optional message.
* @param scheme can be one of the following:
* * an authentication scheme name
* * an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header.
* @param attributes an object of values to use while setting the 'WWW-Authenticate' header. This value is only used when scheme is a string, otherwise it is ignored. Every key/value pair will be included in the 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the attributes key. Alternatively value can be a string which is use to set the value of the scheme, for example setting the token value for negotiate header. If string is used message parameter must be null. null and undefined will be replaced with an empty string. If attributes is set, message will be used as the 'error' segment of the 'WWW-Authenticate' header. If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object.
* @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes}
*/
export function unauthorized(message?: string, scheme?: string | string[], attributes?: {[index: string]: string}): BoomError;
export function unauthorized(message?: null, scheme?: string | string[], attributes?: string): BoomError;
/**
* Returns a 402 Payment Required error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boompaymentrequiredmessage-data}
*/
export function paymentRequired(message?: string, data?: any): BoomError;
/**
* Returns a 403 Forbidden error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomforbiddenmessage-data}
*/
export function forbidden(message?: string, data?: any): BoomError;
/**
* Returns a 404 Not Found error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomnotfoundmessage-data}
*/
export function notFound(message?: string, data?: any): BoomError;
export function methodNotAllowed(message?: string, data?: any): BoomError;
/**
* Returns a 405 Method Not Allowed error
* @param message optional message.
* @param data optional additional error data.
* @param allow optional string or array of strings (to be combined and separated by ', ') which is set to the 'Allow' header.
* @see {@link https://github.com/hapijs/boom#boommethodnotallowedmessage-data-allow}
*/
export function methodNotAllowed(message?: string, data?: any, allow?: string | string[]): BoomError;
/**
* Returns a 406 Not Acceptable error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomnotacceptablemessage-data}
*/
export function notAcceptable(message?: string, data?: any): BoomError;
/**
* Returns a 407 Proxy Authentication Required error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomproxyauthrequiredmessage-data}
*/
export function proxyAuthRequired(message?: string, data?: any): BoomError;
/**
* Returns a 408 Request Time-out error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomclienttimeoutmessage-data}
*/
export function clientTimeout(message?: string, data?: any): BoomError;
/**
* Returns a 409 Conflict error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomconflictmessage-data}
*/
export function conflict(message?: string, data?: any): BoomError;
/**
* Returns a 410 Gone error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomresourcegonemessage-data}
*/
export function resourceGone(message?: string, data?: any): BoomError;
/**
* Returns a 411 Length Required error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomlengthrequiredmessage-data}
*/
export function lengthRequired(message?: string, data?: any): BoomError;
/**
* Returns a 412 Precondition Failed error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boompreconditionfailedmessage-data}
*/
export function preconditionFailed(message?: string, data?: any): BoomError;
/**
* Returns a 413 Request Entity Too Large error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomentitytoolargemessage-data}
*/
export function entityTooLarge(message?: string, data?: any): BoomError;
/**
* Returns a 414 Request-URI Too Large error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomuritoolongmessage-data}
*/
export function uriTooLong(message?: string, data?: any): BoomError;
/**
* Returns a 415 Unsupported Media Type error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomunsupportedmediatypemessage-data}
*/
export function unsupportedMediaType(message?: string, data?: any): BoomError;
/**
* Returns a 416 Requested Range Not Satisfiable error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomrangenotsatisfiablemessage-data}
*/
export function rangeNotSatisfiable(message?: string, data?: any): BoomError;
/**
* Returns a 417 Expectation Failed error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomexpectationfailedmessage-data}
*/
export function expectationFailed(message?: string, data?: any): BoomError;
/**
* Returns a 418 I'm a Teapot error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomteapotmessage-data}
*/
export function teapot(message?: string, data?: any): BoomError;
/**
* Returns a 422 Unprocessable Entity error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boombaddatamessage-data}
*/
export function badData(message?: string, data?: any): BoomError;
/**
* Returns a 423 Locked error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomlockedmessage-data}
*/
export function locked(message?: string, data?: any): BoomError;
/**
* Returns a 428 Precondition Required error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boompreconditionrequiredmessage-data}
*/
export function preconditionRequired(message?: string, data?: any): BoomError;
/**
* Returns a 429 Too Many Requests error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomtoomanyrequestsmessage-data}
*/
export function tooManyRequests(message?: string, data?: any): BoomError;
/**
* Returns a 451 Unavailable For Legal Reasons error
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomillegalmessage-data}
*/
export function illegal(message?: string, data?: any): BoomError;
// 5xx
/**
* Returns a 500 Internal Server Error error
* Only 500 errors will hide your message from the end user. Your message is recorded in the server log.
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal}
*/
export function badImplementation(message?: string, data?: any): BoomError;
/**
* Returns a 501 Not Implemented error with your error message to the user
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomnotimplementedmessage-data}
*/
export function notImplemented(message?: string, data?: any): BoomError;
/**
* Returns a 502 Bad Gateway error with your error message to the user
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boombadgatewaymessage-data}
*/
export function badGateway(message?: string, data?: any): BoomError;
/**
* Returns a 503 Service Unavailable error with your error message to the user
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomserverunavailablemessage-data}
*/
export function serverUnavailable(message?: string, data?: any): BoomError;
/**
* Returns a 504 Gateway Time-out error with your error message to the user
* @param message optional message.
* @param data optional additional error data.
* @see {@link https://github.com/hapijs/boom#boomgatewaytimeoutmessage-data}
*/
export function gatewayTimeout(message?: string, data?: any): BoomError;
}
+8
View File
@@ -0,0 +1,8 @@
import Boom = require('boom');
Boom.create(500, 'Internal server error', { timestamp: Date.now() });
Boom.wrap(new Error('test'), 400);
Boom.badRequest('Invalid cookies');
Boom.unauthorized() as Error;
+61
View File
@@ -0,0 +1,61 @@
// Type definitions for boom 3.2
// Project: http://github.com/hapijs/boom
// Definitions by: Igor Rogatty <http://github.com/rogatty>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export = Boom;
declare namespace Boom {
export interface BoomError {
data: any;
reformat: () => void;
isBoom: boolean;
isServer: boolean;
message: string;
output: Output;
name: string;
}
export interface Output {
statusCode: number;
headers: any;
payload: any;
}
export function wrap(error: Error, statusCode?: number, message?: string): BoomError;
export function create(statusCode: number, message?: string, data?: any): BoomError;
// 4xx
export function badRequest(message?: string, data?: any): BoomError;
export function unauthorized(message?: string, scheme?: any, attributes?: any): BoomError;
export function forbidden(message?: string, data?: any): BoomError;
export function notFound(message?: string, data?: any): BoomError;
export function methodNotAllowed(message?: string, data?: any): BoomError;
export function notAcceptable(message?: string, data?: any): BoomError;
export function proxyAuthRequired(message?: string, data?: any): BoomError;
export function clientTimeout(message?: string, data?: any): BoomError;
export function conflict(message?: string, data?: any): BoomError;
export function resourceGone(message?: string, data?: any): BoomError;
export function lengthRequired(message?: string, data?: any): BoomError;
export function preconditionFailed(message?: string, data?: any): BoomError;
export function entityTooLarge(message?: string, data?: any): BoomError;
export function uriTooLong(message?: string, data?: any): BoomError;
export function unsupportedMediaType(message?: string, data?: any): BoomError;
export function rangeNotSatisfiable(message?: string, data?: any): BoomError;
export function expectationFailed(message?: string, data?: any): BoomError;
export function badData(message?: string, data?: any): BoomError;
export function locked(message?: string, data?: any): BoomError;
export function preconditionRequired(message?: string, data?: any): BoomError;
export function tooManyRequests(message?: string, data?: any): BoomError;
export function illegal(message?: string, data?: any): BoomError;
// 5xx
export function badImplementation(message?: string, data?: any): BoomError;
export function notImplemented(message?: string, data?: any): BoomError;
export function badGateway(message?: string, data?: any): BoomError;
export function serverUnavailable(message?: string, data?: any): BoomError;
export function gatewayTimeout(message?: string, data?: any): BoomError;
}
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
@@ -14,8 +13,8 @@
],
"types": [],
"paths": {
"devextreme": [
"devextreme/v15"
"boom": [
"boom/v3"
]
},
"noEmit": true,
@@ -23,6 +22,6 @@
},
"files": [
"index.d.ts",
"devextreme-tests.ts"
"boom-tests.ts"
]
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+2 -2
View File
@@ -16,7 +16,7 @@ import * as moment from "moment";
export as namespace BootstrapV3DatetimePicker;
type InputParser = (input: string | Date | moment.Moment) => moment.Moment;
export type InputParser = (input: string | Date | moment.Moment) => moment.Moment;
export interface Datetimepicker {
/** Clears the datepicker by setting the value to null */
@@ -576,7 +576,7 @@ export interface UpdateEvent extends JQueryEventObject {
viewDate: moment.Moment;
}
type EventName = "dp.show" | "dp.hide" | "dp.error";
export type EventName = "dp.show" | "dp.hide" | "dp.error";
declare global {
interface JQuery {
@@ -1,6 +1,6 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"quotemark": [true, "double", "avoid-escape"]
}
}
}
+1 -1
View File
@@ -61,7 +61,7 @@ interface CarouselOptions {
interval?: number;
pause?: string;
wrap?: boolean;
keybord?: boolean;
keyboard?: boolean;
}
interface TypeaheadOptions {
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+10 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for bson 1.0
// Type definitions for bson 1.0.4
// Project: https://github.com/mongodb/js-bson
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi/>
// Federico Caselli <https://github.com/CaselIT>
@@ -107,6 +107,14 @@ export class Long {
toString(radix?: number): string;
xor(other: Long): Long;
}
export class Decimal128 {
static fromString(s: string): Decimal128;
constructor(bytes: Buffer);
toJSON(): string;
toString(): string;
}
export class MaxKey {
constructor();
}
@@ -135,7 +143,7 @@ export class ObjectID {
static createFromTime(time: number): ObjectID;
/**
* Checks if a value is a valid bson ObjectID
*
*
* @return {boolean} return true if the value is a valid bson ObjectID, return false otherwise.
*/
static isValid(id: string | number | ObjectID): boolean;
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
-27
View File
@@ -1,27 +0,0 @@
Bugsnag.apiKey = "API-KEY";
Bugsnag.releaseStage = "beta";
Bugsnag.appVersion = "2.4.56";
Bugsnag.user = <BugsnagUser>{
name: "Robert K. User",
email: "robbie@example.com"
};
Bugsnag.metaData = {
account: {
name: "Acme Co",
plan: "hacker"
}
}
Bugsnag.notifyException(new Error("Something broke"));
Bugsnag.notify("Serious Problem", "We are out of cookies");
Bugsnag.notify("Serious Problem",
"We are out of cookies",
{ remaining_snacks: ["carrots", "biscuits"] },
"error");
-90
View File
@@ -1,90 +0,0 @@
// Type definitions for Bugsnag v2.5.0
// Project: https://github.com/bugsnag/bugsnag-js
// Definitions by: Delisa Mason <https://github.com/kattrali>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface BugsnagUser {
id?: string,
name?: string,
email?: string
}
interface BugsnagStatic {
/** Bugsnag project API key */
apiKey: string;
/** The client application version */
appVersion: string;
/** true if Bugsnag should be automatically notified of errors which are
* sent to `window.onerror`
*/
autoNotify: boolean;
/** Callback run before error reports are sent to Bugsnag.
* Payload and metadata information can be altered or removed altogether.
* To cancel sending the report, return false from this function.
*/
beforeNotify: (payload: any, metaData: any) => boolean;
/** The pathname of the current page, not including the fragment identifier
* nor search parameters
*/
context: string;
/** Disables console-based logging. Defaults to false. */
disableLog: boolean;
/** The address used to send errors to Bugsnag. The default is
* `https://notify.bugsnag.com/js`
*/
endpoint: string;
/** Enables sending inline scripts on the page to Bugsnag to assist with
* debugging. Defaults to true
*/
inlineScript: boolean;
/** The maximum depth to parse the error stack */
maxDepth: number;
/** Additional metadata to send to Bugsnag with every error. */
metaData: any;
/** The method used for the notify request. The default is a temporary
* JavaScript image object, however Chrome apps/extensions and other
* applications where XHR is needed can use `xhr` instead.
*/
notifyHandler: string;
/** The releases stages during which Bugsnag will be notified of errors. */
notifyReleaseStages: string[];
/** The recorded root of the project. The default is the current host
* address (protocol and domain).
*/
projectRoot: string;
/** Current phase of the application release process. The default is
* `production`
*/
releaseStage: string;
/** Information about the current user which is sent to Bugsnag with
* exception reports
*/
user: BugsnagUser;
/** Continue catching exceptions after the page error limit is reached.
* Useful for long-running single-page apps
*/
refresh(): void;
/** Remove Bugsnag from the window object and restore the previous
* binding
*/
noConflict(): BugsnagStatic;
/** Send caught exceptions to Bugsnag. Valid severity values are `info`,
* `warning`, and `error`, in order of increasing severity.
*/
notifyException(exception: Error, name?: string, metaData?: any,
severity?: string): void;
/** Send custom errors to Bugsnag */
notify(name: string, message: string, metaData?: any,
severity?: string): void;
}
declare var Bugsnag: BugsnagStatic;
declare module "Bugsnag" {
export = Bugsnag;
}
-22
View File
@@ -1,22 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"bugsnag-tests.ts"
]
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"no-single-declare-module": false
}
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1 +1 @@
{ "extends": "../tslint.json" }
{ "extends": "dtslint/dt.json" }
+499 -889
View File
File diff suppressed because it is too large Load Diff
+930 -95
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../tslint.json",
"extends": "dtslint/dt.json",
"rules": {
"ban-types": false
}

Some files were not shown because too many files have changed in this diff Show More