mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped
This commit is contained in:
@@ -35,3 +35,4 @@ node_modules
|
||||
|
||||
.sublimets
|
||||
.settings/launch.json
|
||||
yarn.lock
|
||||
|
||||
+3
-1
@@ -401,6 +401,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](egg.js/egg.js.d.ts) [Egg.js](https://github.com/mikeflynn/egg.js) by [Markus Peloso](https://github.com/ToastHawaii)
|
||||
* [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000)
|
||||
* [:link:](ejs/ejs.d.ts) [ejs.js](http://ejs.co) by [Ben Liddicott](https://github.com/benliddicott/DefinitelyTyped)
|
||||
* [:link:](ejson/ejson.d.ts) [ejson](https://www.npmjs.com/package/ejson) by [Shantanu Bhadoria](https://github.com/shantanubhadoria)
|
||||
* [:link:](elasticsearch/elasticsearch.d.ts) [elasticsearch](https://www.elastic.co) by [Casper Skydt](https://github.com/CasperSkydt/DefinitelyTyped), [Blake Smith](https://github.com/bfsmith/DefinitelyTyped)
|
||||
* [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan)
|
||||
* [:link:](github-electron/github-electron.d.ts) [Electron](http://electron.atom.io) by [jedmao](https://github.com/jedmao), [rhysd](https://rhysd.github.io), [Milan Burda](https://github.com/miniak)
|
||||
* [:link:](electron-builder/electron-builder.d.ts) [electron-builder](https://github.com/loopline-systems/electron-builder) by [Maxime LUCE](https://github.com/SomaticIT)
|
||||
@@ -1188,7 +1190,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
|
||||
* [:link:](ng-stomp/ng-stomp.d.ts) [ngStomp](https://github.com/beevelop/ng-stomp) by [Lukasz Potapczuk](https://github.com/lpotapczuk)
|
||||
* [:link:](ngstorage/ngstorage.d.ts) [ngstorage](https://github.com/gsklee/ngStorage) by [Jakub Pistek](https://github.com/kubiq)
|
||||
* [:link:](nightmare/nightmare.d.ts) [Nightmare](https://github.com/segmentio/nightmare) by [horiuchi](https://github.com/horiuchi)
|
||||
* [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook), [Hans Bakker](https://github.com/wind-rider)
|
||||
* [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook), [Hans Bakker](https://github.com/wind-rider), [Shantanu Bhadoria](https://github.com/shantanubhadoria)
|
||||
* [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici)
|
||||
* [:link:](node-imap/imap.d.ts) [node imap](https://github.com/mscdex/node-imap) by [Steve Fenton](https://github.com/Steve-Fenton)
|
||||
* [:link:](oauth2-server/oauth2-server.d.ts) [Node OAuth2 Server](https://github.com/thomseddon/node-oauth2-server) by [Robbie Van Gorkom](https://github.com/vangorra)
|
||||
|
||||
Vendored
+4
-3
@@ -8,10 +8,11 @@ interface HeadroomOptions {
|
||||
tolerance?: any;
|
||||
classes?: {
|
||||
initial?: string;
|
||||
pinned?: string;
|
||||
unpinned?: string;
|
||||
top?: string;
|
||||
notBottom?:string;
|
||||
notTop?: string;
|
||||
pinned?: string;
|
||||
top?: string;
|
||||
unpinned?: string;
|
||||
};
|
||||
scroller?: Element;
|
||||
onPin?: () => void;
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
case 1. Add a new type definition.
|
||||
- [ ] checked compilation succeeds with `--target es6` and `--noImplicitAny` options.
|
||||
- [ ] has correct [naming convention](http://definitelytyped.org/guides/contributing.html#naming-the-file)
|
||||
- [ ] has a [test file](http://definitelytyped.org/guides/contributing.html#tests) with the suffix of `-tests.ts` or `-tests.tsx`.
|
||||
Please fill in this template.
|
||||
|
||||
case 2. Improvement to existing type definition.
|
||||
- documentation or source code reference which provides context for the suggested changes. url http://api.jquery.com/html .
|
||||
- it has been reviewed by a DefinitelyTyped member.
|
||||
- [ ] Prefer to make your PR against the `types-2.0` branch.
|
||||
- [ ] The package does not provide its own types, and you can not add them.
|
||||
- [ ] Test the change in your own code.
|
||||
- [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped#make-a-pull-request).
|
||||
- [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped#common-mistakes).
|
||||
|
||||
If adding a new definition:
|
||||
- [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
|
||||
- [ ] Run `tsc` without errors.
|
||||
- [ ] Include the required [files](https://github.com/DefinitelyTyped/DefinitelyTyped#create-a-new-package) and header.
|
||||
|
||||
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.
|
||||
|
||||
@@ -4,36 +4,229 @@
|
||||
|
||||
> The repository for *high quality* TypeScript type definitions.
|
||||
|
||||
For more information see the [definitelytyped.org](http://definitelytyped.org) website.
|
||||
Also see the [definitelytyped.org](http://definitelytyped.org) website, although information in this README is more up-to-date.
|
||||
|
||||
## Usage
|
||||
|
||||
Include a line like this:
|
||||
## What are declaration files?
|
||||
|
||||
```typescript
|
||||
/// <reference path="jquery.d.ts" />
|
||||
See the [TypeScript handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html).
|
||||
|
||||
|
||||
## How do I get them?
|
||||
|
||||
### npm
|
||||
|
||||
This is the preferred method. This is only available for TypeScript 2.0+ users. For example:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @types/node
|
||||
```
|
||||
|
||||
## Contributions
|
||||
The types should then be automatically included by the compiler.
|
||||
See more in the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html).
|
||||
|
||||
For an NPM package "foo", typings for it will be at "@types/foo".
|
||||
If you can't find your package, look for it on [TypeSearch](https://microsoft.github.io/TypeSearch/).
|
||||
|
||||
If you still can't find it, check if it [bundles](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) its own typings.
|
||||
This is usually provided in a `"types"` or `"typings"` field in the `package.json`,
|
||||
or just look for any ".d.ts" files in the package and manually include them with a `/// <reference path="" />`.
|
||||
|
||||
|
||||
### Other methods
|
||||
|
||||
These can be used by TypeScript 1.0.
|
||||
|
||||
* [Typings](https://github.com/typings/typings)
|
||||
* [NuGet](http://nuget.org/Tpackages?q=DefinitelyTyped)
|
||||
* Manually download from the `master` branch of this repository
|
||||
|
||||
You may need to add manual [references](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html).
|
||||
|
||||
|
||||
## How can I contribute?
|
||||
|
||||
DefinitelyTyped only works because of contributions by users like you!
|
||||
|
||||
Please see the [contribution guide](http://definitelytyped.org/guides/contributing.html) on how to contribute to DefinitelyTyped.
|
||||
### Test
|
||||
|
||||
## How to get the definitions
|
||||
Before you share your improvement with the world, use it yourself.
|
||||
|
||||
* Directly from the GitHub repos
|
||||
* [NuGet packages](http://nuget.org/packages?q=DefinitelyTyped)
|
||||
* [Typings - TypeScript Definition Manager](https://github.com/typings/typings)
|
||||
#### Test editing an exiting package
|
||||
|
||||
## List of definitions
|
||||
To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html).
|
||||
You can also directly edit the types in `node_modules/@types/foo/index.d.ts`,
|
||||
or copy them from there and paste inside of `declarations.d.ts` and follow the steps below.
|
||||
|
||||
* See [CONTRIBUTORS.md](CONTRIBUTORS.md)
|
||||
|
||||
## Requested definitions
|
||||
#### Test a new package
|
||||
|
||||
* Add a new file `declarations.d.ts` to your project.
|
||||
* Add it to the compilation, through `"includes"` or `"files"` in your [tsconfig](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html),
|
||||
or through a `/// <reference path="" />` declaration in your code.
|
||||
* Inside `declarations.d.ts`, write `declare module "foo" { }`, then write the module declaration inside.
|
||||
* Test that your code works.
|
||||
* *Then*, once you've tested your definitions, make a PR contributing the definition.
|
||||
|
||||
|
||||
### Make a pull request
|
||||
|
||||
Once you've tested your package, you can share it on DefinitelyTyped.
|
||||
|
||||
First, [fork](https://guides.github.com/activities/forking/) this repository.
|
||||
Then inside your repository:
|
||||
|
||||
* `git checkout types-2.0`
|
||||
|
||||
New work should generally be done on the `types-2.0` branch.
|
||||
If you want your changes to be available to `typings` users, then you may edit `master` instead.
|
||||
|
||||
|
||||
#### Edit an existing package
|
||||
|
||||
* `cd 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.
|
||||
* `npm install -g typescript@2.0` and run `tsc`.
|
||||
|
||||
When you make a PR to edit an existing package, `dt-bot` should @-mention previous authors.
|
||||
If it doesn't, you can do so yourself in the comment associated with the PR.
|
||||
|
||||
|
||||
#### Create a new package
|
||||
|
||||
If you are the library author, or can make a pull request to the library, [bundle](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) types instead of publishing to DefinitelyTyped.
|
||||
|
||||
If you are adding typings for an NPM package, create a directory with the same name.
|
||||
If the package you are adding typings for is not on NPM, make sure the name you choose for it does not conflict with the name of a package on NPM.
|
||||
(You can use `npm info foo` to check for the existence of the `foo` package.)
|
||||
|
||||
Your package should have this structure:
|
||||
|
||||
| File | Purpose |
|
||||
| --- | --- |
|
||||
| index.d.ts | This contains the typings for the package. |
|
||||
| foo-tests.ts | This contains sample code which tests the typings. This code does *not* run, but it is type-checked. |
|
||||
| tsconfig.json | This allows you to run `tsc` within the package. |
|
||||
|
||||
`index.d.ts` should start with a header looking like:
|
||||
|
||||
```ts
|
||||
// Type definitions for foo 1.2
|
||||
// Project: https://github.com/baz/foo
|
||||
// Definitions by: My Self <https://github.com/me>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
```
|
||||
|
||||
The `Project` link does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.
|
||||
|
||||
`tsconfig.json` should look like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"foo-tests.ts"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
These should be identical accross projects except that `foo-tests` will be replaced with the name of your test file,
|
||||
and you may also add the `"jsx"` compiler option if your library needs it.
|
||||
|
||||
DefinitelyTyped members routinely monitor for new PRs, though keep in mind that the number of other PRs may slow things down.
|
||||
|
||||
For a good example package, see [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/base64-js).
|
||||
|
||||
#### Common mistakes
|
||||
|
||||
* First, follow advice from the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html).
|
||||
* Formatting: Either use all tabs, or always use 4 spaces. Also, always use semicolons, and use egyptian braces.
|
||||
* `interface X {}`: An empty interface is essentially the `{}` type: it places no constraints on an object.
|
||||
* `interface IFoo {}`: Don't add `I` to the front of an interface name.
|
||||
* `interface Foo { new(): Foo; }`:
|
||||
This defines a type of objects that are new-able. You probably want `declare class Foo { constructor(); }
|
||||
* `const Class: { new(): IClass; }`:
|
||||
Prefer to use a class declaration `class Class { constructor(); }` instead of a new-able constant.
|
||||
* `namespace foo {}`:
|
||||
Do not add a namespace just so that the `import * as foo` syntax will work.
|
||||
If it is commonJs module with a single export, you should use the `import foo = require("foo")` syntax.
|
||||
See more explanation [here](https://stackoverflow.com/questions/39415661/why-cant-i-import-a-class-or-function-with-import-as-x-from-y).
|
||||
* `getMeAT<T>(): T`:
|
||||
If a type parameter does not appear in the types of any parameters, you don't really have a generic function, you just have a disguised type assertion.
|
||||
Prefer to use a real type assertion, e.g. `getMeAT() as number`.
|
||||
Example where a type parameter is acceptable: `function id<T>(value: T): T;`.
|
||||
Example where it is not acceptable: `function parseJson<T>(json: string): T;`.
|
||||
Exception: `new Map<string, number>()` is OK.
|
||||
|
||||
|
||||
#### Removing a package
|
||||
|
||||
When a package [bundles](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) its own types, types should be removed from DefinitelyTyped to avoid confusion.
|
||||
Make a PR doing the following:
|
||||
* Delete the directory.
|
||||
* Add a new entry to `notNeededPackages.json`.
|
||||
- `libraryName`: Descriptive name of the library, e.g. "Angular 2" instead of "angular2". (May be identical to "typingsPackageName".)
|
||||
- `typingsPackageName`: This is the name of the directory you just deleted.
|
||||
- `sourceRepoURL`: This should point to the repository that contains the typings.
|
||||
- `asOfVersion`: A stub will be published to `@types/foo` with this version. Should be higher than any currently published version.
|
||||
* Any other packages in DefinitelyTyped that referenced the deleted package should be updated to reference the bundled types.
|
||||
To do this, add a `package.json` with `"dependencies": { "foo": "x.y.z" }`.
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
#### What exactly is the relationship between this repository and the `@types` packages on NPM?
|
||||
|
||||
The `types-2.0` branch is automatically published to the `@types` scope on NPM thanks to [types-publisher](https://github.com/Microsoft/types-publisher).
|
||||
This usually happens within an hour of changes being merged.
|
||||
|
||||
Changes to the `master` branch are also manually merged into the `types-2.0` branch, but this takes longer.
|
||||
|
||||
#### I'm writing a definition that depends on another definition. Should I use `<reference types="" />` or an import?
|
||||
|
||||
If the module you're referencing is an external module (uses `export`), use an import.
|
||||
If the module you're referenceing is an ambient module (uses `declare module`, or just declares globals), use `<reference types="" />`.
|
||||
|
||||
#### What do I do about older versions of typings?
|
||||
|
||||
Currently we don't support this, though it is [planned](https://github.com/Microsoft/types-publisher/issues/3).
|
||||
If you're adding a new major version of a library, you can copy `index.d.ts` to `foo-v2.3.d.ts` and edit `index.d.ts` to be the new version.
|
||||
|
||||
#### I notice some packages having a `package.json` here.
|
||||
|
||||
Usually you won't need this. When publishing a package we will normally automatically create a `package.json` for it.
|
||||
A `package.json` may be included for the sake of specifying dependencies. Here's an [example](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/types-2.0/pikaday/package.json).
|
||||
We do not allow other fields, such as `"description"`, to be defined manually.
|
||||
Also, if you need to reference an older version of typings, you must do that by adding `"dependencies": { "@types/foo": "x.y.z" }` to the package.json.
|
||||
|
||||
#### I notice some `tsconfig.json` are missing `"noImplicitAny": true` or `"strictNullChecks": true`.
|
||||
|
||||
Then they are wrong. You can help by submitting a pull request to fix them.
|
||||
|
||||
#### Definitions in types-2.0 seem written differently than in master.
|
||||
|
||||
If you're targeting types-2.0, write it like the types-2.0 definitions.
|
||||
If you're targeting master, we may change it to the new style when merging from master to types-2.0.
|
||||
|
||||
#### Can I request a definition?
|
||||
|
||||
Here are the [currently requested definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT license.
|
||||
|
||||
Vendored
+2
-2
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../bluebird/bluebird.d.ts" />
|
||||
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
|
||||
/// <reference path='../node/node.d.ts'/>
|
||||
|
||||
/// <reference path='../redis/redis.d.ts'/>
|
||||
@@ -20,7 +20,7 @@ declare module "acl" {
|
||||
type Callback = (err: Error) => any;
|
||||
type AnyCallback = (err: Error, obj: any) => any;
|
||||
type AllowedCallback = (err: Error, allowed: boolean) => any;
|
||||
type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => Value;
|
||||
type GetUserId = (req: http.IncomingMessage, res: http.ServerResponse) => Value;
|
||||
|
||||
interface AclStatic {
|
||||
new (backend: Backend<any>, logger: Logger, options: Option): Acl;
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/// <reference path="ajv.d.ts" />
|
||||
|
||||
import * as Ajv from 'ajv';
|
||||
var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true}
|
||||
var validate = ajv.compile({});
|
||||
var valid = validate({});
|
||||
if (!valid) console.log(validate.errors);
|
||||
|
||||
var valid = ajv.validate({}, {});
|
||||
if (!valid) console.log(ajv.errors);
|
||||
|
||||
ajv.addSchema({}, 'mySchema');
|
||||
var valid = ajv.validate('mySchema', {});
|
||||
if (!valid) console.log(ajv.errorsText());
|
||||
|
||||
ajv.addKeyword('range', {
|
||||
type: 'number', compile: function (sch, parentSchema) {
|
||||
var min: any = sch[0];
|
||||
var max: any = sch[1];
|
||||
|
||||
return parentSchema.exclusiveRange === true
|
||||
? function (data) { return data > min && data < max; }
|
||||
: function (data) { return data >= min && data <= max; }
|
||||
}
|
||||
});
|
||||
|
||||
var schema = { "range": [2, 4], "exclusiveRange": true };
|
||||
var validate = ajv.compile(schema);
|
||||
console.log(validate(2.01)); // true
|
||||
console.log(validate(3.99)); // true
|
||||
console.log(validate(2)); // false
|
||||
console.log(validate(4)); // false
|
||||
|
||||
declare var request: any;
|
||||
function loadSchema(uri: any, callback: any) {
|
||||
request.json(uri, function (err: any, res: any, body: any) {
|
||||
if (err || res.statusCode >= 400)
|
||||
callback(err || new Error('Loading error: ' + res.statusCode));
|
||||
else
|
||||
callback(null, body);
|
||||
});
|
||||
}
|
||||
var ajv = new Ajv({ loadSchema: loadSchema });
|
||||
|
||||
ajv.compileAsync(schema, function (err, validate) {
|
||||
if (err) return;
|
||||
var valid = validate({});
|
||||
});
|
||||
|
||||
declare var knex: any;
|
||||
function checkIdExists(schema: any, data: any) {
|
||||
return knex(schema.table)
|
||||
.select('id')
|
||||
.where('id', data)
|
||||
.then(function (rows: any) {
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
var validate = ajv.compile(schema);
|
||||
|
||||
(validate({ userId: 1, postId: 19 }) as PromiseLike<boolean>)
|
||||
.then(function (valid) {
|
||||
// "valid" is always true here
|
||||
console.log('Data is valid');
|
||||
}, function (err) {
|
||||
if (!(err instanceof Ajv.ValidationError)) throw err;
|
||||
// data is invalid
|
||||
console.log('Validation errors:', err.errors);
|
||||
});
|
||||
|
||||
var ajv = new Ajv({ /* async: 'es7', */ transpile: 'nodent' });
|
||||
var validate = ajv.compile(schema); // transpiled es7 async function
|
||||
(validate({}) as PromiseLike<any>).then(() => { }, () => { });
|
||||
Vendored
+112
@@ -0,0 +1,112 @@
|
||||
// Type definitions for ajv
|
||||
// Project: https://github.com/epoberezkin/ajv
|
||||
// Definitions by: York Yao <https://github.com/plantain-00/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "ajv" {
|
||||
class Ajv {
|
||||
/**
|
||||
* Create Ajv instance.
|
||||
*/
|
||||
constructor(options?: Ajv.AjvOptions);
|
||||
/**
|
||||
* Generate validating function and cache the compiled schema for future use.
|
||||
*/
|
||||
compile(schema: any): Ajv.AjvValidate;
|
||||
/**
|
||||
* Asyncronous version of compile method that loads missing remote schemas using asynchronous function in options.loadSchema.
|
||||
*/
|
||||
compileAsync(schema: any, callback: (error: Error, validate: Ajv.AjvValidate) => void): void;
|
||||
/**
|
||||
* Validate data using passed schema (it will be compiled and cached).
|
||||
*/
|
||||
validate(schema: any, data: any): boolean | PromiseLike<boolean>;
|
||||
errors: Ajv.ValidationError[];
|
||||
/**
|
||||
* Add schema(s) to validator instance.
|
||||
*/
|
||||
addSchema(schema: any, key: string): void;
|
||||
/**
|
||||
* Adds meta schema(s) that can be used to validate other schemas.
|
||||
* That function should be used instead of addSchema because there may be instance options that would compile a meta schema incorrectly (at the moment it is removeAdditional option).
|
||||
*/
|
||||
addMetaSchema(schema: any, key: string): void;
|
||||
/**
|
||||
* Validates schema.
|
||||
* This method should be used to validate schemas rather than validate due to the inconsistency of uri format in JSON-Schema standard.
|
||||
*/
|
||||
validateSchema(schema: any): Boolean;
|
||||
/**
|
||||
* Retrieve compiled schema previously added with addSchema by the key passed to addSchema or by its full reference (id).
|
||||
* Returned validating function has schema property with the reference to the original schema.
|
||||
*/
|
||||
getSchema(key: string): Ajv.AjvValidate;
|
||||
/**
|
||||
* Remove added/cached schema.
|
||||
* Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references.
|
||||
*/
|
||||
removeSchema(schema: any): void;
|
||||
/**
|
||||
* Add custom format to validate strings. It can also be used to replace pre-defined formats for Ajv instance.
|
||||
*/
|
||||
addFormat(name: string, format: any): void;
|
||||
/**
|
||||
* Add custom validation keyword to Ajv instance.
|
||||
*/
|
||||
addKeyword(keyword: string, definition: Ajv.AjxKeywordDefinition): void;
|
||||
errorsText(): any;
|
||||
static ValidationError: Function;
|
||||
}
|
||||
namespace Ajv {
|
||||
type AjvOptions = {
|
||||
v5?: boolean;
|
||||
allErrors?: boolean;
|
||||
verbose?: boolean;
|
||||
jsonPointers?: boolean;
|
||||
uniqueItems?: boolean;
|
||||
unicode?: boolean;
|
||||
format?: string;
|
||||
formats?: any;
|
||||
schemas?: any;
|
||||
missingRefs?: boolean;
|
||||
loadSchema?(uri: string, callback: (error: Error, body: any) => void): void;
|
||||
removeAdditional?: boolean;
|
||||
useDefaults?: boolean;
|
||||
coerceTypes?: boolean;
|
||||
async?: any;
|
||||
transpile?: string;
|
||||
meta?: boolean;
|
||||
validateSchema?: boolean;
|
||||
addUsedSchema?: boolean;
|
||||
inlineRefs?: boolean;
|
||||
passContext?: boolean;
|
||||
loopRequired?: number;
|
||||
ownProperties?: boolean;
|
||||
multipleOfPrecision?: boolean;
|
||||
errorDataPath?: string,
|
||||
messages?: boolean;
|
||||
beautify?: boolean;
|
||||
cache?: any;
|
||||
}
|
||||
type AjvValidate = ((data: any) => boolean | PromiseLike<boolean>) & {
|
||||
errors: ValidationError[];
|
||||
}
|
||||
type AjxKeywordDefinition = {
|
||||
async?: boolean;
|
||||
type: string;
|
||||
compile?: (schema: any, parentsSchema: any) => ((data: any) => boolean | PromiseLike<boolean>);
|
||||
validate?: (schema: any, data: any) => boolean;
|
||||
}
|
||||
type ValidationError = {
|
||||
keyword: string;
|
||||
dataPath: string;
|
||||
schemaPath: string;
|
||||
params: any;
|
||||
message: string;
|
||||
schema: any;
|
||||
parentSchema: any;
|
||||
data: any;
|
||||
}
|
||||
}
|
||||
export = Ajv;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/// <reference path="../node/node.d.ts"/>
|
||||
/// <reference path="./alexa-sdk.d.ts" />
|
||||
|
||||
import * as Alexa from "alexa-sdk";
|
||||
|
||||
exports.handler = function(event: Alexa.RequestBody, context: Alexa.Context, callback: Function) {
|
||||
let alexa = Alexa.handler(event, context);
|
||||
alexa.registerHandlers(handlers);
|
||||
alexa.execute();
|
||||
};
|
||||
|
||||
let handlers: Alexa.Handlers = {
|
||||
'LaunchRequest': function () {
|
||||
var self: Alexa.Handler = this;
|
||||
self.emit('SayHello');
|
||||
},
|
||||
'HelloWorldIntent': function () {
|
||||
var self: Alexa.Handler = this;
|
||||
self.emit('SayHello');
|
||||
},
|
||||
'SayHello': function () {
|
||||
var self: Alexa.Handler = this;
|
||||
self.emit(':tell', 'Hello World!');
|
||||
}
|
||||
};
|
||||
Vendored
+132
@@ -0,0 +1,132 @@
|
||||
// Type definitions for Alexa SDK for Node.js v1.0.3
|
||||
// Project: https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs
|
||||
// Definitions by: Pete Beegle <https://github.com/petebeegle>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'alexa-sdk' {
|
||||
export function handler(event: RequestBody, context: Context, callback?: Function): AlexaObject;
|
||||
export function CreateStateHandler(state: string, obj: any): any;
|
||||
export var StateString: string;
|
||||
|
||||
interface AlexaObject {
|
||||
_event: any;
|
||||
_context: any;
|
||||
_callback: any;
|
||||
state: any;
|
||||
appId: any;
|
||||
response: any;
|
||||
dynamoDBTableName: any;
|
||||
saveBeforeResponse: boolean;
|
||||
registerHandlers: (...handlers: Handlers[]) => any;
|
||||
execute: () => void;
|
||||
}
|
||||
|
||||
interface Handlers {
|
||||
[intent: string]: () => void;
|
||||
}
|
||||
|
||||
interface Handler {
|
||||
on: any;
|
||||
emit(event: string, ...args: any[]): boolean;
|
||||
emitWithState: any;
|
||||
state: any;
|
||||
handler: any;
|
||||
event: RequestBody;
|
||||
attributes: any;
|
||||
context: any;
|
||||
name: any;
|
||||
isOverriden: any;
|
||||
}
|
||||
|
||||
interface Context {
|
||||
callbackWaitsForEmptyEventLoop: boolean;
|
||||
logGroupName: string;
|
||||
logStreamName: string;
|
||||
functionName: string;
|
||||
memoryLimitInMB: string;
|
||||
functionVersion: string;
|
||||
invokeid: string;
|
||||
awsRequestId: string;
|
||||
}
|
||||
|
||||
interface RequestBody {
|
||||
version: string;
|
||||
session: Session;
|
||||
request: LaunchRequest | IntentRequest | SessionEndedRequest;
|
||||
}
|
||||
|
||||
interface Session {
|
||||
new: boolean;
|
||||
sessionId: string;
|
||||
attributes: any;
|
||||
application: SessionApplication;
|
||||
user: SessionUser;
|
||||
}
|
||||
|
||||
interface SessionApplication {
|
||||
applicationId: string;
|
||||
}
|
||||
|
||||
interface SessionUser {
|
||||
userId: string;
|
||||
accessToken: string;
|
||||
}
|
||||
|
||||
interface LaunchRequest extends IRequest {}
|
||||
|
||||
interface IntentRequest extends IRequest {
|
||||
intent: Intent;
|
||||
}
|
||||
|
||||
interface Intent {
|
||||
name: string;
|
||||
slots: any;
|
||||
}
|
||||
|
||||
interface SessionEndedRequest extends IRequest{
|
||||
reason: string;
|
||||
}
|
||||
|
||||
interface IRequest {
|
||||
type: "LaunchRequest" | "IntentRequest" | "SessionEndedRequest";
|
||||
requestId: string;
|
||||
timeStamp: string;
|
||||
}
|
||||
|
||||
interface ResponseBody {
|
||||
version: string;
|
||||
sessionAttributes?: any;
|
||||
response: Response;
|
||||
}
|
||||
|
||||
interface Response {
|
||||
outputSpeech?: OutputSpeech;
|
||||
card?: Card;
|
||||
reprompt?: Reprompt;
|
||||
shouldEndSession: boolean;
|
||||
}
|
||||
|
||||
interface OutputSpeech {
|
||||
type: "PlainText" | "SSML";
|
||||
text?: string;
|
||||
ssml?: string;
|
||||
}
|
||||
|
||||
interface Card {
|
||||
type: "Simple" | "Standard" | "LinkAccount";
|
||||
title?: string;
|
||||
content?: string;
|
||||
text?: string;
|
||||
image?: Image;
|
||||
}
|
||||
|
||||
interface Image {
|
||||
smallImageUrl: string;
|
||||
largeImageUrl: string;
|
||||
}
|
||||
|
||||
interface Reprompt {
|
||||
outputSpeech: OutputSpeech;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
///<reference path="./algoliasearch-client-js.d.ts"/>
|
||||
|
||||
var algoliasearch = require('algoliasearch');
|
||||
|
||||
var _clientOptions: ClientOptions = {
|
||||
timeout : 12,
|
||||
protocol: "",
|
||||
httpAgent: ""
|
||||
};
|
||||
|
||||
var _synonymOption: SynonymOption = {
|
||||
forwardToSlaves: false,
|
||||
replaceExistingSynonyms: false
|
||||
};
|
||||
|
||||
var _algoliaUserKeyOptions : AlgoliaUserKeyOptions = {
|
||||
validity: 0,
|
||||
maxQueriesPerIPPerHour: 0,
|
||||
indexes: [""],
|
||||
queryParameters: { attributesToRetrieve: ["algolia"] },
|
||||
description: ""
|
||||
};
|
||||
|
||||
var _searchSynonymOptions : SearchSynonymOptions = {
|
||||
query: "",
|
||||
page: 0,
|
||||
type: "",
|
||||
hitsPerPage: 0
|
||||
};
|
||||
|
||||
var _algoliaSecuredApiOptions: AlgoliaSecuredApiOptions = {
|
||||
filters: "",
|
||||
validUntil: 0,
|
||||
restrictIndices: "",
|
||||
userToken: ""
|
||||
};
|
||||
|
||||
var _algoliaIndexSettings : AlgoliaIndexSettings = {
|
||||
attributesToIndex: [""],
|
||||
attributesforFaceting: [""],
|
||||
unretrievableAttributes: [""],
|
||||
attributesToRetrieve: [""],
|
||||
ranking: [""],
|
||||
customRanking: [""],
|
||||
slaves: [""],
|
||||
maxValuesPerFacet: '',
|
||||
attributesToHighlight: [""],
|
||||
attributesToSnippet: [""],
|
||||
highlightPreTag: '',
|
||||
highlightPostTag: '',
|
||||
snippetEllipsisText: '',
|
||||
restrictHighlightAndSnippetArrays: false,
|
||||
hitsPerPage: 0,
|
||||
minWordSizefor1Typo: 0,
|
||||
minWordSizefor2Typos: 0,
|
||||
typoTolerance: false,
|
||||
allowTyposOnNumericTokens: false,
|
||||
ignorePlurals: false,
|
||||
disableTypoToleranceOnAttributes: '',
|
||||
separatorsToIndex: '',
|
||||
queryType: '',
|
||||
removeWordsIfNoResults: '',
|
||||
advancedSyntax: false,
|
||||
optionalWords: [""],
|
||||
removeStopWords: [""],
|
||||
disablePrefixOnAttributes: [""],
|
||||
disableExactOnAttributes: [""],
|
||||
exactOnSingleWordQuery: '',
|
||||
alternativesAsExact: false,
|
||||
attributeForDistinct: "",
|
||||
distinct: false,
|
||||
numericAttributesToIndex: [""],
|
||||
allowCompressionOfIntegerArray: false,
|
||||
altCorrections: [{}],
|
||||
minProximity: 0,
|
||||
placeholders: ''
|
||||
};
|
||||
|
||||
var _algoliaQueryParameters : AlgoliaQueryParameters = {
|
||||
query: '',
|
||||
filters: '',
|
||||
attributesToRetrieve: [""],
|
||||
restrictSearchableAttributes: [""],
|
||||
facets: '',
|
||||
maxValuesPerFacet: '',
|
||||
attributesToHighlight: [''],
|
||||
attributesToSnippet: [''],
|
||||
highlightPreTag: '',
|
||||
highlightPostTag: '',
|
||||
snippetEllipsisText: '',
|
||||
restrictHighlightAndSnippetArrays: false,
|
||||
hitsPerPage: 0,
|
||||
page: 0,
|
||||
offset: 0,
|
||||
length: 0,
|
||||
minWordSizefor1Typo: 0,
|
||||
minWordSizefor2Typos: 0,
|
||||
typoTolerance: false,
|
||||
allowTyposOnNumericTokens: false,
|
||||
ignorePlurals: false,
|
||||
disableTypoToleranceOnAttributes: '',
|
||||
aroundLatLng: '',
|
||||
aroundLatLngViaIP: '',
|
||||
aroundRadius: '',
|
||||
aroundPrecision: 0,
|
||||
minimumAroundRadius: 0,
|
||||
insideBoundingBox: '',
|
||||
queryType: '',
|
||||
insidePolygon: '',
|
||||
removeWordsIfNoResults: '',
|
||||
advancedSyntax: false,
|
||||
optionalWords: [''],
|
||||
removeStopWords: [''],
|
||||
disableExactOnAttributes: [''],
|
||||
exactOnSingleWordQuery: '',
|
||||
alternativesAsExact: true,
|
||||
distinct: 0,
|
||||
getRankingInfo: false,
|
||||
numericAttributesToIndex: [''],
|
||||
numericFilters: [''],
|
||||
tagFilters: '',
|
||||
facetFilters: '',
|
||||
analytics: false,
|
||||
analyticsTags: [''],
|
||||
synonyms: true,
|
||||
replaceSynonymsInHighlight: false,
|
||||
minProximity: 0
|
||||
};
|
||||
|
||||
var index: AlgoliaIndex = algoliasearch('', '').initIndex('');
|
||||
|
||||
var search = index.search({query: ""});
|
||||
index.search({query: ""}, function(err, res){});
|
||||
|
||||
|
||||
+1571
File diff suppressed because it is too large
Load Diff
Vendored
+2
-2
@@ -53,8 +53,8 @@ declare namespace AltJS {
|
||||
export type Source = {[name:string]: () => SourceModel<any>};
|
||||
|
||||
export interface SourceModel<S> {
|
||||
local(state:any):any;
|
||||
remote(state:any):Promise<S>;
|
||||
local(state:any, ...args: any[]):any;
|
||||
remote(state:any, ...args: any[]):Promise<S>;
|
||||
shouldFetch?(fetchFn:(...args:Array<any>) => boolean):void;
|
||||
loading?:(args:any) => void;
|
||||
success?:(state:S) => void;
|
||||
|
||||
Vendored
+23
-1
@@ -26,6 +26,22 @@ declare namespace AmCharts {
|
||||
|
||||
/** Clears all the charts on page, removes listeners and intervals. */
|
||||
function clear();
|
||||
|
||||
/** Handle ready event */
|
||||
function ready(Function): void;
|
||||
|
||||
/** Create chart by params. */
|
||||
function makeChart(selector: string, params: any, delay?: number): AmChart;
|
||||
|
||||
/** Set a method to be called before initializing the chart.
|
||||
* When the method is called, the chart instance is passed as an attribute.
|
||||
* You can use this feature to preprocess chart data or do some other things you need
|
||||
* before initializing the chart.
|
||||
* @param {Function} handler - The method to be called.
|
||||
* @param {string[]} types - Which chart types should call this method. Defaults to all
|
||||
* if none is passed.
|
||||
*/
|
||||
function addInitHandler(handler: Function, types: string[]);
|
||||
|
||||
/** AmPieChart class creates pie/donut chart. In order to display pie chart you need to set at least three properties - dataProvider, titleField and valueField.
|
||||
@example
|
||||
@@ -948,6 +964,10 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
@Default 150
|
||||
*/
|
||||
hideBalloonTime: number;
|
||||
/** Allows changing language easily.
|
||||
* Note, you should include the language.js file from amcharts/lang or ammap/lang folder and then use variable name used in this file, like chart.language = "de";
|
||||
* Note, for maps this works differently - you use language only for country names, as there are no other strings in the maps application. */
|
||||
language: string;
|
||||
/** Legend of a chart. */
|
||||
legend: AmLegend;
|
||||
/** Reference to the div of the legend. */
|
||||
@@ -976,6 +996,8 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
prefixesOfBigNumbers: any[];
|
||||
/** Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e-24, prefix:"y"},{number:1e-21, prefix:"z"},{number:1e-18, prefix:"a"},{number:1e-15, prefix:"f"},{number:1e-12, prefix:"p"},{number:1e-9, prefix:"n"},{number:1e-6, prefix:"μ"},{number:1e-3, prefix:"m"}] */
|
||||
prefixesOfSmallNumbers: any[];
|
||||
/** A config object for Responsive plugin. */
|
||||
responsive: any;
|
||||
/** Theme of a chart. Config files of themes can be found in amcharts/themes/ folder. More info about using themes. */
|
||||
theme: string;
|
||||
/** Thousands separator.
|
||||
@@ -1003,7 +1025,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
bold - specifies if text is bold (true/false),
|
||||
url - url
|
||||
*/
|
||||
addLabel(x: number, y: number, text: string, align: string, size: number, color: string, rotation: number, alpha: number, bold: boolean, url: string);
|
||||
addLabel(x: number|string, y: number|string, text: string, align: string, size?: number, color?: string, rotation?: number, alpha?: number, bold?: boolean, url?: string);
|
||||
/** Adds a legend to the chart.
|
||||
By default, you don't need to create div for your legend, however if you want it to be positioned in some different way, you can create div anywhere you want and pass id or reference to your div as a second parameter.
|
||||
(NOTE: This method will not work on StockPanel.)
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
// Tests for Amplitude SDK TypeScript definitions
|
||||
|
||||
/// <reference path="amplitude-js.d.ts" />
|
||||
|
||||
module Amplitude.Tests {
|
||||
function all() {
|
||||
amplitude.init('YOUR_API_KEY_HERE', null, {
|
||||
// optional configuration options
|
||||
saveEvents: true,
|
||||
includeUtm: true,
|
||||
includeReferrer: true,
|
||||
batchEvents: true,
|
||||
eventUploadThreshold: 50
|
||||
});
|
||||
amplitude.init('YOUR_API_KEY_HERE', 'USER_ID_HERE', null, () => {});
|
||||
|
||||
amplitude.logEvent('EVENT_IDENTIFIER_HERE');
|
||||
amplitude.setUserId('USER_ID_HERE');
|
||||
amplitude.init('YOUR_API_KEY_HERE', 'USER_ID_HERE');
|
||||
amplitude.setUserId(null); // not string 'null'
|
||||
amplitude.setVersionName('VERSION_NAME_HERE');
|
||||
|
||||
amplitude.regenerateDeviceId();
|
||||
amplitude.setDeviceId('CUSTOM_DEVICE_ID');
|
||||
|
||||
amplitude.logEvent('EVENT_IDENTIFIER_HERE', {
|
||||
'color': 'blue',
|
||||
'age': 20,
|
||||
'key': 'value'
|
||||
});
|
||||
amplitude.logEvent("EVENT_IDENTIFIER_HERE", null, (httpCode, response) => { });
|
||||
|
||||
let identify = new amplitude.Identify().set('gender', 'female').set('age', 20);
|
||||
amplitude.identify(identify);
|
||||
|
||||
identify = new amplitude.Identify().setOnce('sign_up_date', '08/24/2015');
|
||||
amplitude.identify(identify);
|
||||
|
||||
identify = new amplitude.Identify().setOnce('sign_up_date', '09/14/2015');
|
||||
amplitude.identify(identify);
|
||||
|
||||
identify = new amplitude.Identify().unset('gender').unset('age');
|
||||
amplitude.identify(identify);
|
||||
|
||||
identify = new amplitude.Identify().add('karma', 1).add('friends', 1);
|
||||
amplitude.identify(identify);
|
||||
|
||||
identify = new amplitude.Identify().append('ab-tests', 'new-user-test').append('some_list', [1, 2, 3, 4, 'values']);
|
||||
amplitude.identify(identify);
|
||||
|
||||
identify = new amplitude.Identify().prepend('ab-tests', 'new-user-test').prepend('some_list', [1, 2, 3, 4, 'values']);
|
||||
amplitude.identify(identify);
|
||||
|
||||
identify = new amplitude.Identify()
|
||||
.set('karma', 10)
|
||||
.add('karma', 1)
|
||||
.unset('karma');
|
||||
amplitude.identify(identify);
|
||||
|
||||
identify = new amplitude.Identify()
|
||||
.set('colors', ['rose', 'gold'])
|
||||
.append('ab-tests', 'campaign_a')
|
||||
.append('existing_list', [4, 5]);
|
||||
amplitude.identify(identify);
|
||||
|
||||
amplitude.setUserProperties({
|
||||
gender: 'female',
|
||||
age: 20
|
||||
});
|
||||
|
||||
amplitude.clearUserProperties();
|
||||
|
||||
amplitude.setOptOut(true);
|
||||
amplitude.setOptOut(false);
|
||||
|
||||
amplitude.setGroup('orgId', '15');
|
||||
amplitude.setGroup('sport', ['soccer', 'tennis']);
|
||||
|
||||
// TODO: Implement those.
|
||||
/*
|
||||
var revenue = new amplitude.Revenue().setProductId('com.company.productId').setPrice(3.99).setQuantity(3);
|
||||
amplitude.logRevenueV2(revenue);
|
||||
|
||||
amplitude.logEventWithGroups('initialize_game', { 'key': 'value' }, { 'sport': 'soccer' });
|
||||
*/
|
||||
}
|
||||
}
|
||||
Vendored
+61
@@ -0,0 +1,61 @@
|
||||
// Type definitions for Amplitude SDK 2.12.1
|
||||
// Project: https://github.com/amplitude/Amplitude-Javascript
|
||||
// Definitions by: Arvydas Sidorenko <https://github.com/Asido>
|
||||
// Definitions: https://github.com/Asido/DefinitelyTyped
|
||||
|
||||
declare module amplitude {
|
||||
interface Config {
|
||||
batchEvents?: boolean;
|
||||
cookieExpiration?: number;
|
||||
cookieName?: string;
|
||||
deviceId?: string;
|
||||
domain?: string;
|
||||
eventUploadPeriodMillis?: number;
|
||||
eventUploadThreshold?: number;
|
||||
includeReferrer?: boolean;
|
||||
includeUtm?: boolean;
|
||||
language?: string;
|
||||
optOut?: boolean;
|
||||
platform?: string;
|
||||
saveEvents?: boolean;
|
||||
savedMaxCount?: number;
|
||||
sessionTimeout?: number;
|
||||
uploadBatchSize?: number;
|
||||
}
|
||||
|
||||
export class Identify {
|
||||
set(key: string, value: any): Identify;
|
||||
setOnce(key: string, value: any): Identify;
|
||||
add(key: string, value: number): Identify;
|
||||
append(key: string, value: any): Identify;
|
||||
prepend(key: string, value: any): Identify;
|
||||
|
||||
unset(key: string): Identify;
|
||||
}
|
||||
|
||||
export function init(apiKey: string): void;
|
||||
export function init(apiKey: string, userId: string): void;
|
||||
export function init(apiKey: string, userId: string, options: Config): void;
|
||||
export function init(apiKey: string, userId: string, options: Config, callback: () => void): void;
|
||||
|
||||
export function setVersionName(version: string): void;
|
||||
export function setUserId(userId: string): void;
|
||||
|
||||
export function setDeviceId(id: string): void;
|
||||
export function regenerateDeviceId(): void;
|
||||
|
||||
export function identify(identify: Identify): void;
|
||||
|
||||
export function setUserProperties(properties: Object): void;
|
||||
export function clearUserProperties(): void;
|
||||
|
||||
export function setOptOut(optOut: boolean): void;
|
||||
|
||||
export function setGroup(groupType: string, groupName: string | string[]): void;
|
||||
|
||||
export function logEvent(event: string): void;
|
||||
export function logEvent(event: string, data: Object): void;
|
||||
export function logEvent(event: string, data: Object, callback: (httpCode: number, response: any) => void): void;
|
||||
|
||||
export var options: Config;
|
||||
}
|
||||
+2
-2
@@ -14,7 +14,7 @@ declare namespace angular.ui {
|
||||
/**
|
||||
* Override the parent state (only for the breadcrumb)
|
||||
**/
|
||||
parent?: string;
|
||||
parent?: string|Function;
|
||||
/**
|
||||
* When defined to true, the state is never included in the chain of states and never appears in the breadcrumb
|
||||
**/
|
||||
@@ -76,4 +76,4 @@ declare namespace ncy {
|
||||
**/
|
||||
getLastStep(): angular.ui.IState;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ declare namespace angular.dynamicLocale {
|
||||
interface tmhDynamicLocaleProvider extends angular.IServiceProvider {
|
||||
localeLocationPattern(location: string): tmhDynamicLocaleProvider;
|
||||
localeLocationPattern(): string;
|
||||
storageKey(storageKey: string): void;
|
||||
useStorage(storageName: string): void;
|
||||
useCookieStorage(): void;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
/// <reference path="./angular-es.d.ts" />
|
||||
|
||||
//
|
||||
// @Component
|
||||
//
|
||||
import { Component } from 'angular-es';
|
||||
@Component({
|
||||
selector: '',
|
||||
template: ''
|
||||
})
|
||||
class MyComponentController {
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// @Config
|
||||
//
|
||||
import { Config } from 'angular-es';
|
||||
|
||||
@Config()
|
||||
class MyConfig {
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// @Constant
|
||||
//
|
||||
import { Constant } from 'angular-es';
|
||||
|
||||
@Constant('MyConstant')
|
||||
class MyConstant {
|
||||
foo = 'foo';
|
||||
bar = 'bar';
|
||||
}
|
||||
|
||||
//
|
||||
// @Controller
|
||||
//
|
||||
import { Controller } from 'angular-es';
|
||||
|
||||
@Controller('MyController')
|
||||
class MyController {
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// @Decorator
|
||||
//
|
||||
import { Decorator } from 'angular-es';
|
||||
|
||||
@Decorator('MyServiceDecorator')
|
||||
class MyServiceDecorator {
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// @Directive
|
||||
//
|
||||
import { Directive } from 'angular-es';
|
||||
|
||||
@Directive('MyDirective')
|
||||
class MyDirective {
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// @Factory
|
||||
//
|
||||
import { Factory } from 'angular-es';
|
||||
|
||||
@Factory('MyFactory')
|
||||
class MyFactory {
|
||||
}
|
||||
|
||||
//
|
||||
// @Filter
|
||||
//
|
||||
import { Filter } from 'angular-es';
|
||||
|
||||
@Filter('MyFilter')
|
||||
class MyFilter {
|
||||
}
|
||||
|
||||
//
|
||||
// @Inject
|
||||
//
|
||||
import { Inject } from 'angular-es';
|
||||
|
||||
@Inject('fooBar')
|
||||
class MyFooService {
|
||||
|
||||
@Inject('bazBar')
|
||||
myMethod(bazBar: Object) {
|
||||
}
|
||||
|
||||
constructor(fooBar: Object) {
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// @InjectAsProperty
|
||||
//
|
||||
import { InjectAsProperty } from 'angular-es';
|
||||
|
||||
@InjectAsProperty('fooBar')
|
||||
class MyFooBarService {
|
||||
fooBar: Object;
|
||||
|
||||
myMethod() {
|
||||
this.fooBar !== undefined;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// @Module
|
||||
//
|
||||
import { Module } from 'angular-es';
|
||||
|
||||
@Module('my.module')
|
||||
@Service('MyModuleService')
|
||||
class MyModuleService {
|
||||
}
|
||||
|
||||
//
|
||||
// @Provider
|
||||
//
|
||||
import { Provider } from 'angular-es';
|
||||
|
||||
@Provider('MyProvider')
|
||||
class MyProvider {
|
||||
}
|
||||
|
||||
//
|
||||
// @Run
|
||||
//
|
||||
import { Run } from 'angular-es';
|
||||
|
||||
@Run()
|
||||
class MyRunBlock {
|
||||
}
|
||||
|
||||
//
|
||||
// @Service
|
||||
//
|
||||
import { Service } from 'angular-es';
|
||||
|
||||
@Service('MyService')
|
||||
class MyService {
|
||||
}
|
||||
//
|
||||
// @Value
|
||||
//
|
||||
import { Value } from 'angular-es';
|
||||
|
||||
@Value('MyValue')
|
||||
class MyValue {
|
||||
}
|
||||
Vendored
+187
@@ -0,0 +1,187 @@
|
||||
// Type definitions for angular-es v0.0.3
|
||||
// Project: https://github.com/mbutsykin/angular-es
|
||||
// Definitions by: mbutsykin <https://github.com/mbutsykin/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'angular-es' {
|
||||
|
||||
interface ClassDecorator {
|
||||
<TFunction extends Function>(target: TFunction): TFunction|void;
|
||||
}
|
||||
|
||||
interface MethodDecorator {
|
||||
<T>(target: Object, propertyKey: string|symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>|void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorated target
|
||||
*/
|
||||
interface ngESDecorator extends ClassDecorator, MethodDecorator {
|
||||
(target: Object|Function,
|
||||
ngName?: string,
|
||||
ngArguments?: Array<any>,
|
||||
ngType?: string,
|
||||
injectAsProperty?: Array<string>): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Component interface
|
||||
* @see https://docs.angularjs.org/guide/component
|
||||
*/
|
||||
interface iComponent {
|
||||
template: string,
|
||||
selector: string,
|
||||
controllerAs?: string,
|
||||
require?: string,
|
||||
templateUrl?: string,
|
||||
transclude?: string,
|
||||
bindings?: Object
|
||||
}
|
||||
|
||||
/**
|
||||
* Register component
|
||||
*
|
||||
* @param {Object<iComponent>} component - component config
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Component(component: iComponent): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register config block
|
||||
*/
|
||||
function Config(): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register constant
|
||||
*
|
||||
* @param {string} name - constant name
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Constant(name: string): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register controller
|
||||
*
|
||||
* @param {string} name - controller name
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Controller(name: string): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register decorator
|
||||
*
|
||||
* @param {string} name - provider name to decorate
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Decorator(name: string): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register directive
|
||||
*
|
||||
* @param {string} name - directive selector, can be in hyphen-case
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Directive(name: string): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register factory
|
||||
*
|
||||
* @param {string} name - factory name
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Factory(name: string): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register filter
|
||||
*
|
||||
* @param {string} name - filter name
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Filter(name: string): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Add $inject property to target
|
||||
*
|
||||
* @param {Array<string>} dependencies - dependencies to inject
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Inject(...dependencies: Array<string>): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Inject dependencies as properties to target
|
||||
*
|
||||
* @param {Array<string>} dependencies - dependencies to inject
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function InjectAsProperty(...dependencies: Array<string>): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Attach target to the specified module
|
||||
*
|
||||
* @param {string} name - module name
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Module(name: string): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register provider
|
||||
*
|
||||
* @param {string} name - provider name
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Provider(name: string): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register run block
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Run(): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register service
|
||||
*
|
||||
* @param {string} name - service name
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Service(name: string): ngESDecorator;
|
||||
|
||||
/**
|
||||
* Register value
|
||||
*
|
||||
* @param {string} name - value name
|
||||
*
|
||||
* @returns {ngESDecorator} - decorated class
|
||||
*/
|
||||
function Value(name: string): ngESDecorator;
|
||||
|
||||
export {
|
||||
Component,
|
||||
Config,
|
||||
Constant,
|
||||
Controller,
|
||||
Decorator,
|
||||
Directive,
|
||||
Factory,
|
||||
Filter,
|
||||
Inject,
|
||||
InjectAsProperty,
|
||||
Module,
|
||||
Provider,
|
||||
Run,
|
||||
Service,
|
||||
Value,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/// <reference path="angular-feature-flags.d.ts" />
|
||||
|
||||
let myApp = angular.module('myApp', ['feature-flags']);
|
||||
|
||||
const flagsData: Array<angular.featureflags.FlagData> = [
|
||||
{
|
||||
key: '1',
|
||||
active: true,
|
||||
name: 'flag1',
|
||||
description: 'This is the first flag'
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
active: false,
|
||||
name: 'flag2',
|
||||
description: 'This is the second flag'
|
||||
}
|
||||
];
|
||||
|
||||
myApp.config(function (featureFlagsProvider: angular.featureflags.FeatureFlagsProvider) {
|
||||
featureFlagsProvider.setInitialFlags(flagsData);
|
||||
});
|
||||
|
||||
myApp.run(function ($q: angular.IQService, $http: angular.IHttpService, featureFlags: angular.featureflags.FeatureFlagsService) {
|
||||
let deferred = $q.defer();
|
||||
deferred.resolve(flagsData);
|
||||
|
||||
featureFlags.set(deferred.promise);
|
||||
|
||||
featureFlags.set($http.get('/data/flags.json'));
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
// Type definitions for angular-feature-flags 1.4.0
|
||||
// Project: https://github.com/mjt01/angular-feature-flags
|
||||
// Definitions by: Borislav Zhivkov <https://github.com/borislavjivkov/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare namespace angular.featureflags {
|
||||
export interface FlagData {
|
||||
/**
|
||||
* Unique key that is used from the markup to resolve whether a flag is active or not.
|
||||
*/
|
||||
key: string;
|
||||
|
||||
/**
|
||||
* Boolean value for enabling/disabling the feature
|
||||
*/
|
||||
active: boolean;
|
||||
|
||||
/**
|
||||
* A short name of the flag (only visible in the list of flags)
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* A long description of the flag to further explain the feature being toggled (only visible in the list of flags)
|
||||
*/
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface FeatureFlagsProvider {
|
||||
setInitialFlags(flags: Array<FlagData>): void;
|
||||
}
|
||||
|
||||
export interface FeatureFlagsService {
|
||||
set(flagsPromise: angular.IPromise<FlagData> | angular.IHttpPromise<FlagData>): void;
|
||||
}
|
||||
}
|
||||
Vendored
+3
-3
@@ -51,12 +51,12 @@ declare namespace angular.gettext {
|
||||
/** Get the correct pluralized (but untranslated) string for the value of n. */
|
||||
getStringForm(string: string, n: number): string;
|
||||
|
||||
/** Translate a string with the given context. Uses Angular.JS interpolation, so something like this will do what you expect:
|
||||
/** Translate a string with the given scope. Uses Angular.JS interpolation, so something like this will do what you expect:
|
||||
* var hello = gettextCatalog.getString("Hello {{name}}!", { name: "Ruben" });
|
||||
* // var hello will be "Hallo Ruben!" in Dutch.
|
||||
* The context parameter is optional: pass null (or don't pass anything) if you're not using it: this skips interpolation and is a lot faster.
|
||||
* The scope parameter is optional: pass null (or don't pass anything) if you're not using it: this skips interpolation and is a lot faster.
|
||||
*/
|
||||
getString(string: string, context?: any): string;
|
||||
getString(string: string, scope?: any, context?: string): string;
|
||||
|
||||
/** Translate a plural string with the given context. */
|
||||
getPlural(n: number, string: string, stringPlural: string, context?: any): string;
|
||||
|
||||
@@ -15,3 +15,18 @@ var $jwtInterceptor: ng.jwt.IJwtInterceptor;
|
||||
$jwtInterceptor.tokenGetter = () => {
|
||||
return expToken;
|
||||
}
|
||||
|
||||
|
||||
var authManager: ng.jwt.IAuthManagerServiceProvider;
|
||||
|
||||
// Indicate the user is authenticated
|
||||
authManager.authenticate();
|
||||
|
||||
// Indicate the user is unauthenticated
|
||||
authManager.unauthenticate();
|
||||
|
||||
// Keep the user authenticated
|
||||
authManager.checkAuthOnRefresh();
|
||||
|
||||
// Redirect the user on unauthorized requests
|
||||
authManager.redirectWhenUnauthenticated();
|
||||
Vendored
+7
@@ -27,4 +27,11 @@ declare namespace angular.jwt {
|
||||
interface IJwtInterceptor {
|
||||
tokenGetter(...params : any[]): string;
|
||||
}
|
||||
|
||||
interface IAuthManagerServiceProvider {
|
||||
authenticate(): void;
|
||||
unauthenticate(): void;
|
||||
checkAuthOnRefresh(): void;
|
||||
redirectWhenUnauthenticated(): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,13 @@ myApp.config((
|
||||
.warnPalette('red')
|
||||
.dark(true);
|
||||
|
||||
var browserColors: ng.material.IBrowserColors = {
|
||||
theme: 'default',
|
||||
palette: 'neonRed',
|
||||
hue: '500'
|
||||
};
|
||||
$mdThemingProvider.enableBrowserColor(browserColors);
|
||||
|
||||
$mdIconProvider
|
||||
.defaultIconSet('my/app/icons.svg') // Register a default set of SVG icons
|
||||
.iconSet('social', 'my/app/social.svg') // Register a named icon set of SVGs
|
||||
@@ -41,6 +48,25 @@ myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng
|
||||
$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();
|
||||
|
||||
$scope['applyThemeColors'] = () => {
|
||||
$mdColor.applyThemeColors(element, colorExpression);
|
||||
};
|
||||
$scope['getThemeColor'] = () => {
|
||||
$mdColor.getThemeColor('default-neonRed')
|
||||
};
|
||||
$scope['hasTheme'] = () => {
|
||||
$mdColor.hasTheme();
|
||||
};
|
||||
});
|
||||
|
||||
myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.IDialogService) => {
|
||||
$scope['openDialog'] = () => {
|
||||
$mdDialog.show({
|
||||
@@ -127,15 +153,33 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
|
||||
instance.isOpen();
|
||||
instance.isLockedOpen();
|
||||
});
|
||||
|
||||
$scope['onClose'] = $mdSidenav(componentId).onClose(() => {});
|
||||
});
|
||||
|
||||
myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => {
|
||||
$scope['openToast'] = () => $mdToast.show($mdToast.simple().textContent('Hello!'));
|
||||
$scope['openToast'] = () => {
|
||||
$mdToast.show($mdToast.simple().textContent('Hello!'));
|
||||
$mdToast.updateTextContent('New Content');
|
||||
}
|
||||
|
||||
$scope['customToast'] = () => {
|
||||
var options = {
|
||||
hideDelay: 3000,
|
||||
position: 'top right',
|
||||
controller : 'ToastCtrl',
|
||||
templateUrl : 'toast-template.html',
|
||||
toastClass: 'my-class'
|
||||
};
|
||||
|
||||
$mdToast.show(options);
|
||||
}
|
||||
});
|
||||
|
||||
myApp.controller('PanelController', ($scope: ng.IScope, $mdPanel: ng.material.IPanelService) => {
|
||||
$scope['createPanel'] = () => {
|
||||
var config = {
|
||||
id: 'myPanel',
|
||||
template: '<h1>Hello!</h1>',
|
||||
hasBackdrop: true,
|
||||
disableParentScroll: true,
|
||||
|
||||
+79
-17
@@ -22,7 +22,7 @@ declare namespace angular.material {
|
||||
clickOutsideToClose?: boolean;
|
||||
disableBackdrop?: boolean;
|
||||
escapeToClose?: boolean;
|
||||
resolve?: {[index: string]: angular.IPromise<any>};
|
||||
resolve?: {[index: string]: () => angular.IPromise<any>};
|
||||
controllerAs?: string;
|
||||
parent?: Function|string|Object; // default: root node
|
||||
disableParentScroll?: boolean; // default: true
|
||||
@@ -53,7 +53,7 @@ declare namespace angular.material {
|
||||
controller(controller?: string|Function): T;
|
||||
locals(locals?: {[index: string]: any}): T;
|
||||
bindToController(bindToController?: boolean): T; // default: false
|
||||
resolve(resolve?: {[index: string]: angular.IPromise<any>}): T;
|
||||
resolve(resolve?: {[index: string]: () => angular.IPromise<any>}): T;
|
||||
controllerAs(controllerAs?: string): T;
|
||||
parent(parent?: string|Element|JQuery): T; // default: root node
|
||||
onComplete(onComplete?: Function): T;
|
||||
@@ -73,6 +73,16 @@ declare namespace angular.material {
|
||||
initialValue(initialValue: string): IPromptDialog;
|
||||
}
|
||||
|
||||
interface IColorExpression {
|
||||
[cssPropertyName: string]: string
|
||||
}
|
||||
|
||||
interface IColorService {
|
||||
applyThemeColors(element: Element|JQuery, colorExpression: IColorExpression): void;
|
||||
getThemeColor(expression: string): string;
|
||||
hasTheme(): boolean;
|
||||
}
|
||||
|
||||
interface IDialogOptions {
|
||||
templateUrl?: string;
|
||||
template?: string;
|
||||
@@ -91,7 +101,7 @@ declare namespace angular.material {
|
||||
controller?: string|Function;
|
||||
locals?: {[index: string]: any};
|
||||
bindToController?: boolean; // default: false
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
resolve?: {[index: string]: () => angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: string|Element|JQuery; // default: root node
|
||||
onShowing?: Function;
|
||||
@@ -132,6 +142,7 @@ declare namespace angular.material {
|
||||
close(): angular.IPromise<void>;
|
||||
isOpen(): boolean;
|
||||
isLockedOpen(): boolean;
|
||||
onClose(onClose: Function): void;
|
||||
}
|
||||
|
||||
interface ISidenavService {
|
||||
@@ -149,6 +160,7 @@ declare namespace angular.material {
|
||||
hideDelay(delay: number): T;
|
||||
position(position: string): T;
|
||||
parent(parent?: string|Element|JQuery): T; // default: root node
|
||||
toastClass(toastClass: string): T;
|
||||
}
|
||||
|
||||
interface ISimpleToastPreset extends IToastPreset<ISimpleToastPreset> {
|
||||
@@ -162,10 +174,11 @@ declare namespace angular.material {
|
||||
preserveScope?: boolean; // default: false
|
||||
hideDelay?: number; // default (ms): 3000
|
||||
position?: string; // any combination of 'bottom'/'left'/'top'/'right'/'fit'; default: 'bottom left'
|
||||
toastClass?: string;
|
||||
controller?: string|Function;
|
||||
locals?: {[index: string]: any};
|
||||
bindToController?: boolean; // default: false
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
resolve?: {[index: string]: () => angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: string|Element|JQuery; // default: root node
|
||||
}
|
||||
@@ -175,7 +188,8 @@ declare namespace angular.material {
|
||||
showSimple(content: string): angular.IPromise<any>;
|
||||
simple(): ISimpleToastPreset;
|
||||
build(): IToastPreset<any>;
|
||||
updateContent(): void;
|
||||
updateContent(newContent: string): void;
|
||||
updateTextContent(newContent: string): void
|
||||
hide(response?: any): void;
|
||||
cancel(response?: any): void;
|
||||
}
|
||||
@@ -213,6 +227,12 @@ declare namespace angular.material {
|
||||
hues: IThemeHues;
|
||||
}
|
||||
|
||||
interface IBrowserColors{
|
||||
theme: string;
|
||||
palette: string;
|
||||
hue: string;
|
||||
}
|
||||
|
||||
interface IThemeColors {
|
||||
accent: IThemePalette;
|
||||
background: IThemePalette;
|
||||
@@ -242,12 +262,14 @@ declare namespace angular.material {
|
||||
}
|
||||
|
||||
interface IThemingProvider {
|
||||
theme(name: string, inheritFrom?: string): ITheme;
|
||||
definePalette(name: string, palette: IPalette): IThemingProvider;
|
||||
extendPalette(name: string, palette: IPalette): IPalette;
|
||||
setDefaultTheme(theme: string): void;
|
||||
alwaysWatchTheme(alwaysWatch: boolean): void;
|
||||
definePalette(name: string, palette: IPalette): IThemingProvider;
|
||||
enableBrowserColor(browserColors: IBrowserColors): Function;
|
||||
extendPalette(name: string, palette: IPalette): IPalette;
|
||||
registerStyles(styles: String): void;
|
||||
setDefaultTheme(theme: string): void;
|
||||
setNonce(nonce: string): void;
|
||||
theme(name: string, inheritFrom?: string): ITheme;
|
||||
}
|
||||
|
||||
interface IDateLocaleProvider {
|
||||
@@ -291,14 +313,16 @@ declare namespace angular.material {
|
||||
}
|
||||
|
||||
interface IPanelConfig {
|
||||
id?: string;
|
||||
template?: string;
|
||||
templateUrl?: string;
|
||||
controller?: string|Function;
|
||||
controllerAs?: string;
|
||||
bindToController?: boolean; // default: true
|
||||
locals?: {[index: string]: any};
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
resolve?: {[index: string]: () => angular.IPromise<any>}
|
||||
attachTo?: string|JQuery|Element;
|
||||
propagateContainerEvents?: boolean;
|
||||
panelClass?: string;
|
||||
zIndex?: number; // default: 80
|
||||
position?: IPanelPosition;
|
||||
@@ -315,6 +339,7 @@ declare namespace angular.material {
|
||||
onRemoving?: Function;
|
||||
onDomRemoved?: Function;
|
||||
origin?: string|JQuery|Element;
|
||||
onCloseSuccess?: ((panel: IPanelRef, closeReason: string) => any);
|
||||
}
|
||||
|
||||
interface IPanelRef {
|
||||
@@ -331,22 +356,27 @@ declare namespace angular.material {
|
||||
addClass(newClass: string): void;
|
||||
removeClass(oldClass: string): void;
|
||||
toggleClass(toggleClass: string): void;
|
||||
focusOnOpen(): void;
|
||||
updatePosition(position: IPanelPosition): void;
|
||||
registerInterceptor(type: string, callback: () => angular.IPromise<any>): IPanelRef;
|
||||
removeInterceptor(type: string, callback: () => angular.IPromise<any>): IPanelRef;
|
||||
removeAllInterceptors(type?: string): IPanelRef;
|
||||
}
|
||||
|
||||
interface IPanelPosition {
|
||||
absolute(): IPanelPosition;
|
||||
relativeTo(someElement: string|JQuery|Element): IPanelPosition;
|
||||
top(opt_top: string): IPanelPosition; // default: '0'
|
||||
bottom(opt_bottom: string): IPanelPosition; // default: '0'
|
||||
left(opt_left: string): IPanelPosition; // default: '0'
|
||||
right(opt_right: string): IPanelPosition; // default: '0'
|
||||
top(top?: string): IPanelPosition; // default: '0'
|
||||
bottom(bottom?: string): IPanelPosition; // default: '0'
|
||||
start(start?: string): IPanelPosition; // default: '0'
|
||||
end(end?: string): IPanelPosition; // default: '0'
|
||||
left(left?: string): IPanelPosition; // default: '0'
|
||||
right(right?: string): IPanelPosition; // default: '0'
|
||||
centerHorizontally(): IPanelPosition;
|
||||
centerVertically(): IPanelPosition;
|
||||
center(): IPanelPosition;
|
||||
addPanelPosition(xPosition: string, yPosition: string): IPanelPosition;
|
||||
withOffsetX(offsetX: string): IPanelPosition;
|
||||
withOffsetY(offsetY: string): IPanelPosition;
|
||||
withOffsetX(offsetX: string|((panel: IPanelPosition) => string)): IPanelPosition;
|
||||
withOffsetY(offsetY: string|((panel: IPanelPosition) => string)): IPanelPosition;
|
||||
}
|
||||
|
||||
interface IPanelAnimation {
|
||||
@@ -360,5 +390,37 @@ declare namespace angular.material {
|
||||
open(opt_config: IPanelConfig): angular.IPromise<IPanelRef>;
|
||||
newPanelPosition(): IPanelPosition;
|
||||
newPanelAnimation(): IPanelAnimation;
|
||||
xPosition: {
|
||||
CENTER: string,
|
||||
ALIGN_START: string,
|
||||
ALIGN_END: string,
|
||||
OFFSET_START: string,
|
||||
OFFSET_END: string,
|
||||
};
|
||||
yPosition: {
|
||||
CENTER: string,
|
||||
ALIGN_TOPS: string,
|
||||
ALIGN_BOTTOMS: string,
|
||||
ABOVE: string,
|
||||
BELOW: string,
|
||||
};
|
||||
animation: {
|
||||
SLIDE: string,
|
||||
SCALE: string,
|
||||
FADE: string,
|
||||
};
|
||||
interceptorTypes: {
|
||||
CLOSE: string,
|
||||
};
|
||||
closeReasons: {
|
||||
CLICK_OUTSIDE: string,
|
||||
ESCAPE: string,
|
||||
};
|
||||
absPosition: {
|
||||
TOP: string,
|
||||
RIGHT: string,
|
||||
BOTTOM: string,
|
||||
LEFT: string,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/// <reference path="./angular-permission.d.ts" />
|
||||
|
||||
import permission = angular.permission;
|
||||
import permissionNamespace = angular.permission;
|
||||
import { permission, ngPermission, uiPermission } from "angular-permission";
|
||||
|
||||
angular
|
||||
.module('fooModule', ['permission', 'user'])
|
||||
.run(function (PermissionStore: permission.PermissionStore, User: any) {
|
||||
.module('fooModule', [permission, ngPermission, uiPermission, 'user'])
|
||||
.run(function (PermissionStore: permissionNamespace.PermissionStore, User: any) {
|
||||
// Define anonymous permission
|
||||
PermissionStore
|
||||
.definePermission('anonymous', function (stateParams) {
|
||||
@@ -22,8 +23,8 @@ angular
|
||||
hasPermissionDefinition(permission: string) : angular.IPromise<any>;
|
||||
}
|
||||
|
||||
angular.module('barModule', ['permission', 'user'])
|
||||
.run(function (PermissionStore: permission.PermissionStore, User: BackendUserService, $q: angular.IQService) {
|
||||
angular.module('barModule', [permission, 'user'])
|
||||
.run(function (PermissionStore: permissionNamespace.PermissionStore, User: BackendUserService, $q: angular.IQService) {
|
||||
PermissionStore
|
||||
// Define user permission calling back-end
|
||||
.definePermission('user', function (stateParams) {
|
||||
@@ -64,14 +65,14 @@ angular
|
||||
|
||||
PermissionStore.removePermissionDefinition('user');
|
||||
|
||||
let permissions: Array<permission.Permission> = PermissionStore.getStore();
|
||||
let permissions: Array<permissionNamespace.Permission> = PermissionStore.getStore();
|
||||
|
||||
|
||||
});
|
||||
|
||||
angular
|
||||
.module('fooModule', ['permission', 'user'])
|
||||
.run(function (RoleStore: permission.RoleStore, User: any) {
|
||||
.module('fooModule', [permission, 'user'])
|
||||
.run(function (RoleStore: permissionNamespace.RoleStore, User: any) {
|
||||
RoleStore
|
||||
// Permission array validated role
|
||||
// Library will internally validate if 'user' and 'editor' permissions are valid when checking if role is valid
|
||||
@@ -88,5 +89,5 @@ angular
|
||||
|
||||
RoleStore.removeRoleDefinition('user');
|
||||
|
||||
let roles: Array<permission.Role> = RoleStore.getStore();
|
||||
let roles: Array<permissionNamespace.Role> = RoleStore.getStore();
|
||||
});
|
||||
|
||||
+6
@@ -173,3 +173,9 @@ declare namespace angular.permission {
|
||||
options?: angular.ui.IStateOptions;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "angular-permission" {
|
||||
export var permission: string;
|
||||
export var ngPermission: string;
|
||||
export var uiPermission: string;
|
||||
}
|
||||
|
||||
+3
-3
@@ -1829,8 +1829,8 @@ declare namespace protractor {
|
||||
function wrapDriver(webdriver: webdriver.WebDriver, opt_baseUrl?: string, opt_rootElement?: string): Protractor;
|
||||
}
|
||||
|
||||
interface cssSelectorHelper {
|
||||
(cssLocator: string): protractor.ElementFinder;
|
||||
interface selectorHelper {
|
||||
(cssLocator: string | Function | HTMLElement | Document | Array<any>): protractor.ElementFinder;
|
||||
}
|
||||
|
||||
interface cssArraySelectorHelper {
|
||||
@@ -1841,7 +1841,7 @@ declare var browser: protractor.IBrowser;
|
||||
declare var by: protractor.IProtractorLocatorStrategy;
|
||||
declare var By: protractor.IProtractorLocatorStrategy;
|
||||
declare var element: protractor.Element;
|
||||
declare var $: cssSelectorHelper;
|
||||
declare var $: selectorHelper;
|
||||
declare var $$: cssArraySelectorHelper;
|
||||
|
||||
declare module 'protractor' {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/// <reference path='angular-signalr-hub.d.ts' />
|
||||
/// <reference path='../angularjs/angular.d.ts' />
|
||||
/// <reference path='angular-signalr-hub.d.ts' />
|
||||
|
||||
angular
|
||||
.module('app', ['SignalR'])
|
||||
|
||||
@@ -3,8 +3,14 @@
|
||||
// Definitions by: Adam Santaniello <https://github.com/AdamSantaniello>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path='../angularjs/angular.d.ts' />
|
||||
/// <reference path='../signalr/signalr.d.ts' />
|
||||
|
||||
declare module "angular-signalr-hub" {
|
||||
let _: string;
|
||||
export = _;
|
||||
}
|
||||
|
||||
declare namespace ngSignalr {
|
||||
interface HubFactory {
|
||||
/**
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/// <reference path='angular-touchspin.d.ts' />
|
||||
|
||||
angular
|
||||
.module('touchspin-tests', ['lm.touchspin'])
|
||||
.config(function(touchspinConfigProvider: angularTouchSpin.ITouchSpinConfigProvider) {
|
||||
touchspinConfigProvider.defaults(<angularTouchSpin.ITouchSpinOptions>{
|
||||
.module('touchspin-tests', ['nk.touchspin'])
|
||||
.config(function(touchspinConfigProvider: angular.touchspin.ITouchSpinConfigProvider) {
|
||||
touchspinConfigProvider.defaults(<angular.touchspin.ITouchSpinOptions>{
|
||||
min: 0,
|
||||
max: 0,
|
||||
step: 0,
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ declare module "angular-touchspin" {
|
||||
export = _;
|
||||
}
|
||||
|
||||
declare namespace angularTouchSpin {
|
||||
declare namespace angular.touchspin {
|
||||
interface ITouchSpinOptions {
|
||||
min?: number;
|
||||
max?: number;
|
||||
|
||||
+11
@@ -400,6 +400,17 @@ declare namespace angular.ui.bootstrap {
|
||||
* @default 'body'
|
||||
*/
|
||||
appendTo?: angular.IAugmentedJQuery;
|
||||
|
||||
/**
|
||||
* A string reference to the component to be rendered that is registered with Angular's compiler. If using a directive, the directive must have `restrict: 'E'` and a template or templateUrl set.
|
||||
*
|
||||
* It supports these bindings:
|
||||
* - `close` - A method that can be used to close a modal, passing a result. The result must be passed in this format: `{$value: myResult}`
|
||||
* - `dismiss` - A method that can be used to dismiss a modal, passing a result. The result must be passed in this format: `{$value: myRejectedResult}`
|
||||
* - `modalInstance` - The modal instance. This is the same `$uibModalInstance` injectable found when using `controller`.
|
||||
* - `resolve` - An object of the modal resolve values. See [UI Router resolves] for details.
|
||||
*/
|
||||
component?: string;
|
||||
}
|
||||
|
||||
interface IModalStackService {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/// <reference path="angular-ui-notification.d.ts" />
|
||||
|
||||
function TestNotifications(NotificationProvider: angular.uiNotification.INotificationProvider, Notification: angular.uiNotification.INotificationService) {
|
||||
NotificationProvider.setOptions({
|
||||
delay: 10000,
|
||||
startTop: 20,
|
||||
startRight: 10,
|
||||
verticalSpacing: 20,
|
||||
horizontalSpacing: 20,
|
||||
positionX: 'left',
|
||||
positionY: 'bottom'
|
||||
});
|
||||
|
||||
Notification.primary('Primary notification');
|
||||
Notification('Primary notification');
|
||||
|
||||
Notification.success('Success notification');
|
||||
|
||||
Notification({message: 'Warning notification'}, 'warning');
|
||||
|
||||
Notification({message: 'Primary notification', title: 'Primary notification'});
|
||||
|
||||
Notification.error({message: 'Error notification 1s', delay: 1000});
|
||||
|
||||
Notification.success({message: 'Success notification<br>Some other <b>content</b><br><a href="https://github.com/alexcrack/angular-ui-notification">This is a link</a><br><img src="https://angularjs.org/img/AngularJS-small.png">', title: 'Html content'});
|
||||
|
||||
Notification.error({message: 'Error Bottom Right', positionY: 'bottom', positionX: 'right'});
|
||||
|
||||
Notification.error({message: 'Error notification 1s', replaceMessage: true});
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Type definitions for angular-ui-notification
|
||||
// Project: https://github.com/alexcrack/angular-ui-notification
|
||||
// Definitions by: Kamil Rojewski <https://github.com/krojew/DefinitelyTyped>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace angular.uiNotification {
|
||||
// Taken from angular to avoid dependency
|
||||
interface IPromise<T> {
|
||||
/**
|
||||
* Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
|
||||
* The successCallBack may return IPromise<void> for when a $q.reject() needs to be returned
|
||||
* This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
|
||||
*/
|
||||
then<TResult>(successCallback: (promiseValue: T) => IPromise<TResult>|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
|
||||
/**
|
||||
* Shorthand for promise.then(null, errorCallback)
|
||||
*/
|
||||
catch<TResult>(onRejected: (reason: any) => IPromise<TResult>|TResult): IPromise<TResult>;
|
||||
|
||||
/**
|
||||
* Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information.
|
||||
*
|
||||
* Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible.
|
||||
*/
|
||||
finally(finallyCallback: () => any): IPromise<T>;
|
||||
}
|
||||
|
||||
type XPosition = 'right'|'left'|'center';
|
||||
type YPosition = 'top'|'bottom';
|
||||
|
||||
type MessageType = 'primary'|'info'|'success'|'warning'|'error';
|
||||
|
||||
interface IGlobalMessageOptions {
|
||||
delay?: number;
|
||||
startTop?: number;
|
||||
startRight?: number;
|
||||
verticalSpacing?: number;
|
||||
horizontalSpacing?: number;
|
||||
positionX?: XPosition;
|
||||
positionY?: YPosition;
|
||||
replaceMessage?: boolean;
|
||||
templateUrl?: string;
|
||||
onClose?: (element: any) => any;
|
||||
closeOnClick?: boolean;
|
||||
maxCount?: number;
|
||||
}
|
||||
|
||||
interface IMessageOptions {
|
||||
title?: string;
|
||||
message?: string;
|
||||
templateUrl?: string;
|
||||
delay?: number;
|
||||
type?: MessageType;
|
||||
positionX?: XPosition;
|
||||
positionY?: YPosition;
|
||||
replaceMessage?: boolean;
|
||||
closeOnClick?: boolean;
|
||||
}
|
||||
|
||||
interface INotificationScope {
|
||||
kill(isHard: boolean): void;
|
||||
}
|
||||
|
||||
interface INotificationProvider {
|
||||
setOptions(options: IGlobalMessageOptions): void;
|
||||
}
|
||||
|
||||
type Message = string|IMessageOptions;
|
||||
|
||||
interface INotificationService {
|
||||
primary(message: Message): IPromise<INotificationScope>;
|
||||
info(message: Message): IPromise<INotificationScope>;
|
||||
success(message: Message): IPromise<INotificationScope>;
|
||||
warning(message: Message): IPromise<INotificationScope>;
|
||||
error(message: Message): IPromise<INotificationScope>;
|
||||
|
||||
clearAll(): void;
|
||||
|
||||
(message: Message, type?: MessageType): IPromise<INotificationScope>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/// <reference path="./angular-ui-router-default.d.ts" />
|
||||
|
||||
angular.module("test", [
|
||||
"ui.router",
|
||||
"ui.router.default"
|
||||
])
|
||||
.config(function($stateProvider: angular.ui.IStateProvider) {
|
||||
$stateProvider
|
||||
.state('concrete', {
|
||||
// no abstract or default
|
||||
})
|
||||
.state('string', {
|
||||
abstract: true,
|
||||
default: 'concrete'
|
||||
})
|
||||
.state('func_str', {
|
||||
abstract: true,
|
||||
default: function($rootScope): string { return $rootScope.test; }
|
||||
})
|
||||
.state('func_promise', {
|
||||
abstract: true,
|
||||
default: function($q: ng.IQService): ng.IPromise<string> {
|
||||
return $q.when("concrete");
|
||||
}
|
||||
})
|
||||
.state('injection_str', {
|
||||
abstract: true,
|
||||
default: ["$rootScope", function($rootScope) {
|
||||
return $rootScope.test;
|
||||
}]
|
||||
})
|
||||
.state('injection_promise', {
|
||||
abstract: true,
|
||||
default: ["$q", function($q: ng.IQService) {
|
||||
return $q.when("concrete");
|
||||
}]
|
||||
})
|
||||
;
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
// Type definitions for angular-ui-router-default 0.5+
|
||||
// Project: https://github.com/nonplus/angular-ui-router-default
|
||||
// Definitions by: Stepan Riha <https://github.com/nonplus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angular-ui-router/angular-ui-router.d.ts" />
|
||||
|
||||
declare namespace angular.ui {
|
||||
export type StateDefaultSpecifier = string
|
||||
| ((...args: any[]) => string)
|
||||
| ((...args: any[]) => ng.IPromise<string>)
|
||||
| (string | ((...args: any[]) => string))[]
|
||||
| (string | ((...args: any[]) => ng.IPromise<string>))[];
|
||||
interface IState {
|
||||
default?: StateDefaultSpecifier
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/// <reference path="./angular-ui-router-uib-modal.d.ts" />
|
||||
|
||||
angular.module("test", [
|
||||
"ui.bootstrap",
|
||||
"ui.router",
|
||||
"ui.router.default"
|
||||
])
|
||||
.config(function($stateProvider: angular.ui.IStateProvider) {
|
||||
$stateProvider
|
||||
.state('contacts', {
|
||||
// no modal
|
||||
resolve: {
|
||||
a: function() {
|
||||
return "a";
|
||||
},
|
||||
b: function() {
|
||||
return ["a", "b"];
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('contacts.contact', {
|
||||
// boolean modal
|
||||
modal: true
|
||||
})
|
||||
.state('contacts.contact.edit', {
|
||||
// string[] modal
|
||||
modal: ["a", "b"]
|
||||
})
|
||||
;
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
// Type definitions for angular-ui-uib-modal 0.11+ (ui.router module)
|
||||
// Project: https://github.com/nonplus/angular-ui-router-uib-modal
|
||||
// Definitions by: Stepan Riha <https://github.com/nonplus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angular-ui-router/angular-ui-router.d.ts" />
|
||||
|
||||
declare namespace angular.ui {
|
||||
interface IState {
|
||||
modal?: boolean | string[];
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
/// <reference path="angular-ui-router.d.ts" />
|
||||
|
||||
var myApp = angular.module('testModule');
|
||||
import uiRouterModule from "angular-ui-router";
|
||||
var myApp = angular.module("testModule", [uiRouterModule]);
|
||||
|
||||
interface MyAppScope extends ng.IScope {
|
||||
items: string[];
|
||||
@@ -141,7 +142,7 @@ class UrlLocatorTestService implements IUrlLocatorTestService {
|
||||
private $state: ng.ui.IStateService
|
||||
) {
|
||||
$rootScope.$on("$locationChangeSuccess", (event: ng.IAngularEvent) => this.onLocationChangeSuccess(event));
|
||||
$rootScope.$on('$stateNotFound', (event: ng.IAngularEvent, unfoundState: ng.ui.IUnfoundState, fromState: ng.ui.IState, fromParams: {}) =>
|
||||
$rootScope.$on('$stateNotFound', (event: ng.IAngularEvent, unfoundState: ng.ui.IUnfoundState, fromState: ng.ui.IState, fromParams: {}) =>
|
||||
this.onStateNotFound(event, unfoundState, fromState, fromParams));
|
||||
}
|
||||
|
||||
@@ -164,14 +165,14 @@ class UrlLocatorTestService implements IUrlLocatorTestService {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private onStateNotFound(event: ng.IAngularEvent,
|
||||
unfoundState: ng.ui.IUnfoundState,
|
||||
fromState: ng.ui.IState,
|
||||
fromParams: {}) {
|
||||
var unfoundTo: string = unfoundState.to;
|
||||
var unfoundToParams: {} = unfoundState.toParams;
|
||||
var unfoundOptions: ng.ui.IStateOptions = unfoundState.options
|
||||
var unfoundOptions: ng.ui.IStateOptions = unfoundState.options
|
||||
}
|
||||
|
||||
private stateServiceTest() {
|
||||
|
||||
+2
-8
@@ -7,13 +7,7 @@
|
||||
|
||||
// Support for AMD require and CommonJS
|
||||
declare module 'angular-ui-router' {
|
||||
// Since angular-ui-router adds providers for a bunch of
|
||||
// injectable dependencies, it doesn't really return any
|
||||
// actual data except the plain string 'ui.router'.
|
||||
//
|
||||
// As such, I don't think anybody will ever use the actual
|
||||
// default value of the module. So I've only included the
|
||||
// the types. (@xogeny)
|
||||
export default "ui.router";
|
||||
export type IState = angular.ui.IState;
|
||||
export type IStateProvider = angular.ui.IStateProvider;
|
||||
export type IUrlMatcher = angular.ui.IUrlMatcher;
|
||||
@@ -109,7 +103,7 @@ declare namespace angular.ui {
|
||||
toParams: {},
|
||||
options: IStateOptions
|
||||
}
|
||||
|
||||
|
||||
interface IStateProvider extends angular.IServiceProvider {
|
||||
state(name:string, config:IState): IStateProvider;
|
||||
state(config:IState): IStateProvider;
|
||||
|
||||
+3
-2
@@ -42,9 +42,10 @@ declare namespace angular.ui {
|
||||
*/
|
||||
topVisibleScope: ng.IRepeatScope;
|
||||
/**
|
||||
* calling this method reinitializes and reloads the scroller content.
|
||||
* calling this method reinitializes and reloads the scroller content.
|
||||
* @param startIndex is an integer indicating what item index the scroller will use to start the load process.
|
||||
*/
|
||||
reload(): void;
|
||||
reload(startIndex?: number): void;
|
||||
/**
|
||||
* Replaces the item in the buffer at the given index with the new items.
|
||||
*
|
||||
|
||||
+1
-1
@@ -476,7 +476,7 @@ declare namespace angular {
|
||||
// Supplement IComponentOptions from angular.d.ts with router-specific
|
||||
// fields.
|
||||
interface IComponentOptions {
|
||||
$canActivate?: () => boolean;
|
||||
$canActivate?: (...args: any[]) => boolean | angular.IPromise<boolean>;
|
||||
$routeConfig?: RouteDefinition[];
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+14
-3
@@ -42,15 +42,20 @@ declare namespace angular.resource {
|
||||
(url: string, paramDefaults?: any,
|
||||
/** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
|
||||
where deleteDescriptor : IActionDescriptor */
|
||||
actions?: any, options?: IResourceOptions): IResourceClass<IResource<any>>;
|
||||
actions?: IActionHash, options?: IResourceOptions): IResourceClass<IResource<any>>;
|
||||
<T, U>(url: string, paramDefaults?: any,
|
||||
/** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
|
||||
where deleteDescriptor : IActionDescriptor */
|
||||
actions?: any, options?: IResourceOptions): U;
|
||||
actions?: IActionHash, options?: IResourceOptions): U;
|
||||
<T>(url: string, paramDefaults?: any,
|
||||
/** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
|
||||
where deleteDescriptor : IActionDescriptor */
|
||||
actions?: any, options?: IResourceOptions): IResourceClass<T>;
|
||||
actions?: IActionHash, options?: IResourceOptions): IResourceClass<T>;
|
||||
}
|
||||
|
||||
// Hash of action descriptors allows custom action names
|
||||
interface IActionHash {
|
||||
[action: string]: IActionDescriptor
|
||||
}
|
||||
|
||||
// Just a reference to facilitate describing new actions
|
||||
@@ -186,6 +191,12 @@ declare namespace angular {
|
||||
/** creating a resource service factory */
|
||||
factory(name: string, resourceServiceFactoryFunction: angular.resource.IResourceServiceFactoryFunction<any>): IModule;
|
||||
}
|
||||
|
||||
namespace auto {
|
||||
interface IInjectorService {
|
||||
get(name: '$resource'): ng.resource.IResourceService;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface Array<T>
|
||||
|
||||
@@ -1,10 +1,32 @@
|
||||
/// <reference path="angular-sanitize.d.ts" />
|
||||
|
||||
var shouldBeString: string;
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Variables
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
let shouldBeString: string;
|
||||
let testInputText: string = 'TEST';
|
||||
|
||||
declare var $sanitizeService: ng.sanitize.ISanitizeService;
|
||||
shouldBeString = $sanitizeService(shouldBeString);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Test sanitize service
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
declare let $sanitizeService: ng.sanitize.ISanitizeService;
|
||||
shouldBeString = $sanitizeService(testInputText);
|
||||
|
||||
declare var $linky: ng.sanitize.filter.ILinky;
|
||||
shouldBeString = $linky(shouldBeString);
|
||||
shouldBeString = $linky(shouldBeString, shouldBeString);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Test `linky` filter
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
declare let $linky: ng.sanitize.filter.ILinky;
|
||||
|
||||
// Should be string for simple text and target parameters
|
||||
shouldBeString = $linky(testInputText, testInputText);
|
||||
|
||||
// Should be string for simple text, target and attributes parameters
|
||||
let attributesAsFunction = () => {
|
||||
};
|
||||
shouldBeString = $linky(shouldBeString, testInputText, {
|
||||
"attributeKey1": "attributeValue1",
|
||||
"attributeKey2": "attributeValue2"
|
||||
});
|
||||
shouldBeString = $linky(shouldBeString, testInputText, (url: string) => {
|
||||
return {"attributeKey1": "attributeValue1"}
|
||||
});
|
||||
Vendored
+18
-5
@@ -29,12 +29,25 @@ declare namespace angular.sanitize {
|
||||
// see https://github.com/angular/angular.js/tree/v1.2.0/src/ngSanitize/filter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
export module filter {
|
||||
|
||||
// Finds links in text input and turns them into html links.
|
||||
// Supports http/https/ftp/mailto and plain email address links.
|
||||
// see http://code.angularjs.org/1.2.0/docs/api/ngSanitize.filter:linky
|
||||
/**
|
||||
* Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and plain email address links.
|
||||
* @param text Input text.
|
||||
* @param target ILinkyTargetType Window (_blank|_self|_parent|_top) or named frame to open links in.
|
||||
* @param attributes Add custom attributes to the link element.
|
||||
* @return Html-linkified and sanitized text.
|
||||
* see https://docs.angularjs.org/api/ngSanitize/filter/linky
|
||||
*/
|
||||
interface ILinky {
|
||||
(text: string, target?: string): string;
|
||||
(text: string, target: string, attributes?: { [attribute: string]: string } | ((url: string) => { [attribute: string]: string })): string;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Extend angular $filter declarations to include filters from angular.sanitize module
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
declare namespace angular {
|
||||
interface IFilterService {
|
||||
(name: 'linky'): angular.sanitize.filter.ILinky;
|
||||
}
|
||||
}
|
||||
+96
-11
@@ -180,25 +180,68 @@ namespace My.Namespace {
|
||||
|
||||
// IModule Registering Test
|
||||
var mod = angular.module('tests', []);
|
||||
mod.controller('name', function ($scope: ng.IScope) { })
|
||||
mod.controller('name', ['$scope', <any>function ($scope: ng.IScope) { }])
|
||||
mod.controller(My.Namespace);
|
||||
mod.directive('name', <any>function ($scope: ng.IScope) { })
|
||||
mod.directive('name', ['$scope', <any>function ($scope: ng.IScope) { }])
|
||||
mod.directive(My.Namespace);
|
||||
mod.controller('name', function ($scope: ng.IScope) { });
|
||||
mod.controller('name', ['$scope', function ($scope: ng.IScope) { }]);
|
||||
mod.controller('name', class {
|
||||
// Uncommenting the next line should lead to a type error because this signature isn't compatible
|
||||
// with the signature of the `$onChanges` hook:
|
||||
// $onChanges(x: number) { }
|
||||
});
|
||||
mod.controller({
|
||||
MyCtrl: class{},
|
||||
MyCtrl2: function() {},
|
||||
MyCtrl3: ['$fooService', function($fooService: any) { }]
|
||||
});
|
||||
mod.directive('myDirectiveA', ($rootScope: ng.IRootScopeService) => {
|
||||
return (scope, el, attrs) => {
|
||||
let foo = 'none';
|
||||
el.click(e => {
|
||||
foo = e.type;
|
||||
$rootScope.$apply();
|
||||
});
|
||||
scope.$watch(() => foo, () => el.text(foo));
|
||||
};
|
||||
});
|
||||
mod.directive('myDirectiveB', ['$rootScope', function ($rootScope: ng.IRootScopeService) {
|
||||
return {
|
||||
link(scope, el, attrs) {
|
||||
el.click(e => {
|
||||
el.hide();
|
||||
});
|
||||
}
|
||||
};
|
||||
}]);
|
||||
mod.directive({
|
||||
myFooDir: () => ({
|
||||
template: 'my-foo-dir.tpl.html'
|
||||
}),
|
||||
myBarDir: ['$fooService', ($fooService: any) => ({
|
||||
template: 'my-bar-dir.tpl.html'
|
||||
})]
|
||||
});
|
||||
mod.factory('name', function ($scope: ng.IScope) { })
|
||||
mod.factory('name', ['$scope', <any>function ($scope: ng.IScope) { }])
|
||||
mod.factory(My.Namespace);
|
||||
mod.factory('name', ['$scope', function ($scope: ng.IScope) { }])
|
||||
mod.factory({
|
||||
name1: function (foo: any) { },
|
||||
name2: ['foo', function (foo: any) { }]
|
||||
});
|
||||
mod.filter('name', function ($scope: ng.IScope) { })
|
||||
mod.filter('name', ['$scope', <any>function ($scope: ng.IScope) { }])
|
||||
mod.filter(My.Namespace);
|
||||
mod.filter('name', ['$scope', function ($scope: ng.IScope) { }])
|
||||
mod.filter({
|
||||
name1: function (foo: any) { },
|
||||
name2: ['foo', function (foo: any) { }]
|
||||
});
|
||||
mod.provider('name', function ($scope: ng.IScope) { return { $get: () => { } } })
|
||||
mod.provider('name', TestProvider);
|
||||
mod.provider('name', ['$scope', <any>function ($scope: ng.IScope) { }])
|
||||
mod.provider(My.Namespace);
|
||||
mod.service('name', function ($scope: ng.IScope) { })
|
||||
mod.service('name', ['$scope', <any>function ($scope: ng.IScope) { }])
|
||||
mod.service(My.Namespace);
|
||||
mod.service({
|
||||
MyCtrl: class{},
|
||||
MyCtrl2: function() {},
|
||||
MyCtrl3: ['$fooService', function($fooService: any) { }]
|
||||
});
|
||||
mod.constant('name', 23);
|
||||
mod.constant('name', "23");
|
||||
mod.constant(My.Namespace);
|
||||
@@ -253,8 +296,14 @@ namespace TestQ {
|
||||
b: string;
|
||||
c: boolean;
|
||||
}
|
||||
interface TValue {
|
||||
e: number;
|
||||
f: boolean;
|
||||
}
|
||||
var tResult: TResult;
|
||||
var promiseTResult: angular.IPromise<TResult>;
|
||||
var tValue: TValue;
|
||||
var promiseTValue: angular.IPromise<TValue>;
|
||||
|
||||
var $q: angular.IQService;
|
||||
var promiseAny: angular.IPromise<any>;
|
||||
@@ -323,6 +372,22 @@ namespace TestQ {
|
||||
let result: angular.IPromise<TResult>;
|
||||
result = $q.when<TResult>(tResult);
|
||||
result = $q.when<TResult>(promiseTResult);
|
||||
|
||||
result = $q.when<TResult, TValue>(tValue, (result: TValue) => tResult);
|
||||
result = $q.when<TResult, TValue>(tValue, (result: TValue) => tResult, (any) => any);
|
||||
result = $q.when<TResult, TValue>(tValue, (result: TValue) => tResult, (any) => any, (any) => any);
|
||||
|
||||
result = $q.when<TResult, TValue>(promiseTValue, (result: TValue) => tResult);
|
||||
result = $q.when<TResult, TValue>(promiseTValue, (result: TValue) => tResult, (any) => any);
|
||||
result = $q.when<TResult, TValue>(promiseTValue, (result: TValue) => tResult, (any) => any, (any) => any);
|
||||
|
||||
result = $q.when<TResult, TValue>(tValue, (result: TValue) => promiseTResult);
|
||||
result = $q.when<TResult, TValue>(tValue, (result: TValue) => promiseTResult, (any) => any);
|
||||
result = $q.when<TResult, TValue>(tValue, (result: TValue) => promiseTResult, (any) => any, (any) => any);
|
||||
|
||||
result = $q.when<TResult, TValue>(promiseTValue, (result: TValue) => promiseTResult);
|
||||
result = $q.when<TResult, TValue>(promiseTValue, (result: TValue) => promiseTResult, (any) => any);
|
||||
result = $q.when<TResult, TValue>(promiseTValue, (result: TValue) => promiseTResult, (any) => any, (any) => any);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -867,6 +932,26 @@ angular.module('docsTabsExample', [])
|
||||
};
|
||||
});
|
||||
|
||||
angular.module('multiSlotTranscludeExample', [])
|
||||
.directive('dropDownMenu', function() {
|
||||
return {
|
||||
transclude: {
|
||||
button: 'button',
|
||||
list: 'ul',
|
||||
},
|
||||
link: function(scope, element, attrs, ctrl, transclude) {
|
||||
// without scope
|
||||
transclude().appendTo(element);
|
||||
transclude(clone => clone.appendTo(element));
|
||||
|
||||
// with scope
|
||||
transclude(scope, clone => clone.appendTo(element));
|
||||
transclude(scope, clone => clone.appendTo(element), element, 'button');
|
||||
transclude(scope, null, element, 'list').addClass('drop-down-list').appendTo(element);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
angular.module('componentExample', [])
|
||||
.component('counter', {
|
||||
require: {'ctrl': '^ctrl'},
|
||||
|
||||
Vendored
+101
-107
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Angular JS 1.5
|
||||
// Project: http://angularjs.org
|
||||
// Definitions by: Diego Vilar <http://github.com/diegovilar>
|
||||
// Definitions by: Diego Vilar <http://github.com/diegovilar>, Georgii Dolzhykov <http://github.com/thorn0>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ declare module 'angular' {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
declare namespace angular {
|
||||
|
||||
type Injectable<T extends Function> = T | (string | T)[];
|
||||
|
||||
// not directly implemented, but ensures that constructed class implements $get
|
||||
interface IServiceProviderClass {
|
||||
new (...args: any[]): IServiceProvider;
|
||||
@@ -118,14 +120,15 @@ declare namespace angular {
|
||||
fromJson(json: string): any;
|
||||
identity<T>(arg?: T): T;
|
||||
injector(modules?: any[], strictDi?: boolean): auto.IInjectorService;
|
||||
isArray(value: any): boolean;
|
||||
isDate(value: any): boolean;
|
||||
isArray(value: any): value is Array<any>;
|
||||
isDate(value: any): value is Date;
|
||||
isDefined(value: any): boolean;
|
||||
isElement(value: any): boolean;
|
||||
isFunction(value: any): boolean;
|
||||
isNumber(value: any): boolean;
|
||||
isObject(value: any): boolean;
|
||||
isString(value: any): boolean;
|
||||
isFunction(value: any): value is Function;
|
||||
isNumber(value: any): value is number;
|
||||
isObject(value: any): value is Object;
|
||||
isObject<T>(value: any): value is T;
|
||||
isString(value: any): value is string;
|
||||
isUndefined(value: any): boolean;
|
||||
lowercase(str: string): string;
|
||||
|
||||
@@ -213,50 +216,26 @@ declare namespace angular {
|
||||
* @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
|
||||
* @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
|
||||
*/
|
||||
controller(name: string, controllerConstructor: Function): IModule;
|
||||
/**
|
||||
* The $controller service is used by Angular to create new controllers.
|
||||
*
|
||||
* This provider allows controller registration via the register method.
|
||||
*
|
||||
* @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
|
||||
* @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
|
||||
*/
|
||||
controller(name: string, inlineAnnotatedConstructor: any[]): IModule;
|
||||
controller(object: Object): IModule;
|
||||
controller(name: string, controllerConstructor: Injectable<IControllerConstructor>): IModule;
|
||||
controller(object: {[name: string]: Injectable<IControllerConstructor>}): IModule;
|
||||
/**
|
||||
* Register a new directive with the compiler.
|
||||
*
|
||||
* @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
|
||||
* @param directiveFactory An injectable directive factory function.
|
||||
*/
|
||||
directive(name: string, directiveFactory: IDirectiveFactory): IModule;
|
||||
/**
|
||||
* Register a new directive with the compiler.
|
||||
*
|
||||
* @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
|
||||
* @param directiveFactory An injectable directive factory function.
|
||||
*/
|
||||
directive(name: string, inlineAnnotatedFunction: any[]): IModule;
|
||||
directive(object: Object): IModule;
|
||||
directive(name: string, directiveFactory: Injectable<IDirectiveFactory>): IModule;
|
||||
directive(object: {[directiveName: string]: Injectable<IDirectiveFactory>}): IModule;
|
||||
/**
|
||||
* Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
|
||||
*
|
||||
* @param name The name of the instance.
|
||||
* @param $getFn The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
|
||||
*/
|
||||
factory(name: string, $getFn: Function): IModule;
|
||||
/**
|
||||
* Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
|
||||
*
|
||||
* @param name The name of the instance.
|
||||
* @param inlineAnnotatedFunction The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
|
||||
*/
|
||||
factory(name: string, inlineAnnotatedFunction: any[]): IModule;
|
||||
factory(object: Object): IModule;
|
||||
filter(name: string, filterFactoryFunction: Function): IModule;
|
||||
filter(name: string, inlineAnnotatedFunction: any[]): IModule;
|
||||
filter(object: Object): IModule;
|
||||
factory(name: string, $getFn: Injectable<Function>): IModule;
|
||||
factory(object: {[name: string]: Injectable<Function>}): IModule;
|
||||
filter(name: string, filterFactoryFunction: Injectable<Function>): IModule;
|
||||
filter(object: {[name: string]: Injectable<Function>}): IModule;
|
||||
provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule;
|
||||
provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule;
|
||||
provider(name: string, inlineAnnotatedConstructor: any[]): IModule;
|
||||
@@ -265,26 +244,15 @@ declare namespace angular {
|
||||
/**
|
||||
* Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
|
||||
*/
|
||||
run(initializationFunction: Function): IModule;
|
||||
/**
|
||||
* Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
|
||||
*/
|
||||
run(inlineAnnotatedFunction: any[]): IModule;
|
||||
run(initializationFunction: Injectable<Function>): IModule;
|
||||
/**
|
||||
* Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function.
|
||||
*
|
||||
* @param name The name of the instance.
|
||||
* @param serviceConstructor An injectable class (constructor function) that will be instantiated.
|
||||
*/
|
||||
service(name: string, serviceConstructor: Function): IModule;
|
||||
/**
|
||||
* Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function.
|
||||
*
|
||||
* @param name The name of the instance.
|
||||
* @param inlineAnnotatedConstructor An injectable class (constructor function) that will be instantiated.
|
||||
*/
|
||||
service(name: string, inlineAnnotatedConstructor: any[]): IModule;
|
||||
service(object: Object): IModule;
|
||||
service(name: string, serviceConstructor: Injectable<Function>): IModule;
|
||||
service(object: {[name: string]: Injectable<Function>}): IModule;
|
||||
/**
|
||||
* Register a value service with the $injector, such as a string, a number, an array, an object or a function. This is short for registering a service where its provider's $get property is a factory function that takes no arguments and returns the value service.
|
||||
|
||||
@@ -301,8 +269,7 @@ declare namespace angular {
|
||||
* @param name The name of the service to decorate
|
||||
* @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
|
||||
*/
|
||||
decorator(name:string, decoratorConstructor: Function): IModule;
|
||||
decorator(name:string, inlineAnnotatedConstructor: any[]): IModule;
|
||||
decorator(name: string, decorator: Injectable<Function>): IModule;
|
||||
|
||||
// Properties
|
||||
name: string;
|
||||
@@ -387,6 +354,7 @@ declare namespace angular {
|
||||
$invalid: boolean;
|
||||
$submitted: boolean;
|
||||
$error: any;
|
||||
$name: string;
|
||||
$pending: any;
|
||||
$addControl(control: INgModelController | IFormController): void;
|
||||
$removeControl(control: INgModelController | IFormController): void;
|
||||
@@ -611,11 +579,11 @@ declare namespace angular {
|
||||
/**
|
||||
* calling stopPropagation function will cancel further event propagation (available only for events that were $emit-ed).
|
||||
*/
|
||||
stopPropagation?: Function;
|
||||
stopPropagation?(): void;
|
||||
/**
|
||||
* calling preventDefault sets defaultPrevented flag to true.
|
||||
*/
|
||||
preventDefault: Function;
|
||||
preventDefault(): void;
|
||||
/**
|
||||
* true if preventDefault was called.
|
||||
*/
|
||||
@@ -1073,6 +1041,7 @@ declare namespace angular {
|
||||
* @param value Value or a promise
|
||||
*/
|
||||
when<T>(value: IPromise<T>|T): IPromise<T>;
|
||||
when<TResult, T>(value: IPromise<T>|T, successCallback: (promiseValue: T) => IPromise<TResult>|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
/**
|
||||
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
|
||||
*/
|
||||
@@ -1219,19 +1188,12 @@ declare namespace angular {
|
||||
// see http://docs.angularjs.org/api/ng.$compileProvider
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface ICompileService {
|
||||
(element: string, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
|
||||
(element: Element, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
|
||||
(element: JQuery, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
|
||||
(element: string | Element | JQuery, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
|
||||
}
|
||||
|
||||
interface ICompileProvider extends IServiceProvider {
|
||||
directive(name: string, directiveFactory: Function): ICompileProvider;
|
||||
directive(directivesMap: Object, directiveFactory: Function): ICompileProvider;
|
||||
directive(name: string, inlineAnnotatedFunction: any[]): ICompileProvider;
|
||||
directive(directivesMap: Object, inlineAnnotatedFunction: any[]): ICompileProvider;
|
||||
|
||||
// Undocumented, but it is there...
|
||||
directive(directivesMap: any): ICompileProvider;
|
||||
directive(name: string, directiveFactory: Injectable<IDirectiveFactory>): ICompileProvider;
|
||||
directive(object: {[directiveName: string]: Injectable<IDirectiveFactory>}): ICompileProvider;
|
||||
|
||||
component(name: string, options: IComponentOptions): ICompileProvider;
|
||||
|
||||
@@ -1241,7 +1203,8 @@ declare namespace angular {
|
||||
imgSrcSanitizationWhitelist(): RegExp;
|
||||
imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider;
|
||||
|
||||
debugInfoEnabled(enabled?: boolean): any;
|
||||
debugInfoEnabled(): boolean;
|
||||
debugInfoEnabled(enabled: boolean): ICompileProvider;
|
||||
}
|
||||
|
||||
interface ICloneAttachFunction {
|
||||
@@ -1254,12 +1217,16 @@ declare namespace angular {
|
||||
(scope: IScope, cloneAttachFn?: ICloneAttachFunction): JQuery;
|
||||
}
|
||||
|
||||
// This corresponds to $transclude (and also the transclude function passed to link).
|
||||
/**
|
||||
* This corresponds to $transclude passed to controllers and to the transclude function passed to link functions.
|
||||
* https://docs.angularjs.org/api/ng/service/$compile#-controller-
|
||||
* http://teropa.info/blog/2015/06/09/transclusion.html
|
||||
*/
|
||||
interface ITranscludeFunction {
|
||||
// If the scope is provided, then the cloneAttachFn must be as well.
|
||||
(scope: IScope, cloneAttachFn: ICloneAttachFunction): JQuery;
|
||||
(scope: IScope, cloneAttachFn: ICloneAttachFunction, futureParentElement?: JQuery, slotName?: string): JQuery;
|
||||
// If one argument is provided, then it's assumed to be the cloneAttachFn.
|
||||
(cloneAttachFn?: ICloneAttachFunction): JQuery;
|
||||
(cloneAttachFn?: ICloneAttachFunction, futureParentElement?: JQuery, slotName?: string): JQuery;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -1410,6 +1377,16 @@ declare namespace angular {
|
||||
* Absolute or relative URL of the resource that is being requested.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* Event listeners to be bound to the XMLHttpRequest object.
|
||||
* To bind events to the XMLHttpRequest upload object, use uploadEventHandlers. The handler will be called in the context of a $apply block.
|
||||
*/
|
||||
eventHandlers?: { [type: string]: EventListenerOrEventListenerObject };
|
||||
/**
|
||||
* Event listeners to be bound to the XMLHttpRequest upload object.
|
||||
* To bind events to the XMLHttpRequest object, use eventHandlers. The handler will be called in the context of a $apply block.
|
||||
*/
|
||||
uploadEventHandlers?: { [type: string]: EventListenerOrEventListenerObject };
|
||||
}
|
||||
|
||||
interface IHttpHeadersGetter {
|
||||
@@ -1537,7 +1514,7 @@ declare namespace angular {
|
||||
* Register service factories (names or implementations) for interceptors which are called before and after
|
||||
* each request.
|
||||
*/
|
||||
interceptors: (string|IHttpInterceptorFactory|(string|IHttpInterceptorFactory)[])[];
|
||||
interceptors: (string | Injectable<IHttpInterceptorFactory>)[];
|
||||
useApplyAsync(): boolean;
|
||||
useApplyAsync(value: boolean): IHttpProvider;
|
||||
|
||||
@@ -1685,11 +1662,10 @@ declare namespace angular {
|
||||
* controller if passed as a string. Empty function by default.
|
||||
* Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection)
|
||||
*/
|
||||
controller?: string | Function | (string | Function)[] | IComponentController;
|
||||
controller?: string | Injectable<IControllerConstructor>;
|
||||
/**
|
||||
* An identifier name for a reference to the controller. If present, the controller will be published to scope under
|
||||
* the controllerAs name. If not present, this will default to be the same as the component name.
|
||||
* @default "$ctrl"
|
||||
* An identifier name for a reference to the controller. If present, the controller will be published to its scope under
|
||||
* the specified name. If not present, this will default to '$ctrl'.
|
||||
*/
|
||||
controllerAs?: string;
|
||||
/**
|
||||
@@ -1700,24 +1676,24 @@ declare namespace angular {
|
||||
* $attrs - Current attributes object for the element
|
||||
* Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection)
|
||||
*/
|
||||
template?: string | Function | (string | Function)[];
|
||||
template?: string | Injectable<(...args: any[]) => string>;
|
||||
/**
|
||||
* path or function that returns a path to an html template that should be used as the contents of this component.
|
||||
* Path or function that returns a path to an html template that should be used as the contents of this component.
|
||||
* If templateUrl is a function, then it is injected with the following locals:
|
||||
* $element - Current element
|
||||
* $attrs - Current attributes object for the element
|
||||
* Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection)
|
||||
*/
|
||||
templateUrl?: string | Function | (string | Function)[];
|
||||
templateUrl?: string | Injectable<(...args: any[]) => string>;
|
||||
/**
|
||||
* Define DOM attribute binding to component properties. Component properties are always bound to the component
|
||||
* controller and not to the scope.
|
||||
*/
|
||||
bindings?: {[binding: string]: string};
|
||||
bindings?: {[boundProperty: string]: string};
|
||||
/**
|
||||
* Whether transclusion is enabled. Enabled by default.
|
||||
* Whether transclusion is enabled. Disabled by default.
|
||||
*/
|
||||
transclude?: boolean | string | {[slot: string]: string};
|
||||
transclude?: boolean | {[slot: string]: string};
|
||||
/**
|
||||
* Requires the controllers of other directives and binds them to this component's controller.
|
||||
* The object keys specify the property names under which the required controllers (object values) will be bound.
|
||||
@@ -1727,16 +1703,18 @@ declare namespace angular {
|
||||
require?: {[controller: string]: string};
|
||||
}
|
||||
|
||||
interface IComponentTemplateFn {
|
||||
( $element?: JQuery, $attrs?: IAttributes ): string;
|
||||
}
|
||||
type IControllerConstructor =
|
||||
(new (...args: any[]) => IController) |
|
||||
// Instead of classes, plain functions are often used as controller constructors, especially in examples.
|
||||
((...args: any[]) => (void | IController));
|
||||
|
||||
/**
|
||||
* Components have a well-defined lifecycle Each component can implement "lifecycle hooks". These are methods that
|
||||
* will be called at certain points in the life of the component.
|
||||
* @url https://docs.angularjs.org/guide/component
|
||||
* Directive controllers have a well-defined lifecycle. Each controller can implement "lifecycle hooks". These are methods that
|
||||
* will be called by Angular at certain points in the life cycle of the directive.
|
||||
* https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
|
||||
* https://docs.angularjs.org/guide/component
|
||||
*/
|
||||
interface IComponentController {
|
||||
interface IController {
|
||||
/**
|
||||
* Called on each controller after all the controllers on an element have been constructed and had their bindings
|
||||
* initialized (and before the pre & post linking functions for the directives on this element). This is a good
|
||||
@@ -1744,12 +1722,21 @@ declare namespace angular {
|
||||
*/
|
||||
$onInit?(): void;
|
||||
/**
|
||||
* Called whenever one-way bindings are updated. The changesObj is a hash whose keys are the names of the bound
|
||||
* properties that have changed, and the values are an {@link IChangesObject} object of the form
|
||||
* Called on each turn of the digest cycle. Provides an opportunity to detect and act on changes.
|
||||
* Any actions that you wish to take in response to the changes that you detect must be invoked from this hook;
|
||||
* implementing this has no effect on when `$onChanges` is called. For example, this hook could be useful if you wish
|
||||
* to perform a deep equality check, or to check a `Dat`e object, changes to which would not be detected by Angular's
|
||||
* change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments; if detecting changes,
|
||||
* you must store the previous value(s) for comparison to the current values.
|
||||
*/
|
||||
$doCheck?(): void;
|
||||
/**
|
||||
* Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound
|
||||
* properties that have changed, and the values are an {@link IChangesObject} object of the form
|
||||
* { currentValue, previousValue, isFirstChange() }. Use this hook to trigger updates within a component such as
|
||||
* cloning the bound value to prevent accidental mutation of the outer value.
|
||||
*/
|
||||
$onChanges?(changesObj: {[property:string]: IChangesObject}): void;
|
||||
$onChanges?(onChangesObj: IOnChangesObject): void;
|
||||
/**
|
||||
* Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources,
|
||||
* watches and event handlers.
|
||||
@@ -1766,9 +1753,13 @@ declare namespace angular {
|
||||
$postLink?(): void;
|
||||
}
|
||||
|
||||
interface IChangesObject {
|
||||
currentValue: any;
|
||||
previousValue: any;
|
||||
interface IOnChangesObject {
|
||||
[property: string]: IChangesObject<any>;
|
||||
}
|
||||
|
||||
interface IChangesObject<T> {
|
||||
currentValue: T;
|
||||
previousValue: T;
|
||||
isFirstChange(): boolean;
|
||||
}
|
||||
|
||||
@@ -1779,7 +1770,7 @@ declare namespace angular {
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
interface IDirectiveFactory {
|
||||
(...args: any[]): IDirective;
|
||||
(...args: any[]): IDirective | IDirectiveLinkFn;
|
||||
}
|
||||
|
||||
interface IDirectiveLinkFn {
|
||||
@@ -1787,8 +1778,8 @@ declare namespace angular {
|
||||
scope: IScope,
|
||||
instanceElement: JQuery,
|
||||
instanceAttributes: IAttributes,
|
||||
controller: {},
|
||||
transclude: ITranscludeFunction
|
||||
controller?: IController | IController[] | {[key: string]: IController},
|
||||
transclude?: ITranscludeFunction
|
||||
): void;
|
||||
}
|
||||
|
||||
@@ -1808,23 +1799,21 @@ declare namespace angular {
|
||||
* that is passed to the link function instead.
|
||||
*/
|
||||
transclude: ITranscludeFunction
|
||||
): void | IDirectivePrePost;
|
||||
): void | IDirectiveLinkFn | IDirectivePrePost;
|
||||
}
|
||||
|
||||
interface IDirective {
|
||||
compile?: IDirectiveCompileFn;
|
||||
controller?: any;
|
||||
controller?: string | Injectable<IControllerConstructor>;
|
||||
controllerAs?: string;
|
||||
/**
|
||||
* @deprecated
|
||||
* Deprecation warning: although bindings for non-ES6 class controllers are currently bound to this before
|
||||
* the controller constructor is called, this use is now deprecated. Please place initialization code that
|
||||
* relies upon bindings inside a $onInit method on the controller, instead.
|
||||
*/
|
||||
bindToController?: boolean | Object;
|
||||
bindToController?: boolean | {[boundProperty: string]: string};
|
||||
link?: IDirectiveLinkFn | IDirectivePrePost;
|
||||
multiElement?: boolean;
|
||||
name?: string;
|
||||
priority?: number;
|
||||
/**
|
||||
* @deprecated
|
||||
@@ -1832,12 +1821,12 @@ declare namespace angular {
|
||||
replace?: boolean;
|
||||
require?: string | string[] | {[controller: string]: string};
|
||||
restrict?: string;
|
||||
scope?: boolean | Object;
|
||||
template?: string | Function;
|
||||
scope?: boolean | {[boundProperty: string]: string};
|
||||
template?: string | ((tElement: JQuery, tAttrs: IAttributes) => string);
|
||||
templateNamespace?: string;
|
||||
templateUrl?: string | Function;
|
||||
templateUrl?: string | ((tElement: JQuery, tAttrs: IAttributes) => string);
|
||||
terminal?: boolean;
|
||||
transclude?: boolean | string | {[slot: string]: string};
|
||||
transclude?: boolean | 'element' | {[slot: string]: string};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1850,6 +1839,11 @@ declare namespace angular {
|
||||
interface IAugmentedJQueryStatic extends JQueryStatic {}
|
||||
interface IAugmentedJQuery extends JQuery {}
|
||||
|
||||
/**
|
||||
* Same as IController. Keeping it for compatibility with older versions of these type definitions.
|
||||
*/
|
||||
interface IComponentController extends IController {}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// AUTO module (angular.js)
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Gorgi Kosev <https://github.com/spion>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../bluebird/bluebird.d.ts" />
|
||||
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
|
||||
/// <reference path="../anydb-sql/anydb-sql.d.ts" />
|
||||
|
||||
declare module "anydb-sql-migrations" {
|
||||
@@ -31,4 +31,4 @@ declare module "anydb-sql-migrations" {
|
||||
items: MigrationTask[];
|
||||
}) => any) => Promise<any>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -137,6 +137,7 @@ declare module "apn" {
|
||||
}
|
||||
export interface NotificationAlertOptions {
|
||||
title?:string;
|
||||
subtitle?:string;
|
||||
body:string;
|
||||
"title-loc-key"?:string;
|
||||
"title-loc-args"?:string[];
|
||||
|
||||
+4
-4
@@ -346,24 +346,24 @@ interface Client {
|
||||
* Log an incoming http request to your server. The request data will be tracked during the response "finish" event if it is successful or the request "error"
|
||||
* event if it fails. The request duration is automatically calculated as the timespan between when the trackRequest method was called, and when the response "finish"
|
||||
* or request "error" events were fired.
|
||||
* @param request The http.ServerRequest object to track
|
||||
* @param request The http.IncomingMessage object to track
|
||||
* @param response The http.ServerResponse object for this request
|
||||
* @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty.
|
||||
*/
|
||||
trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: {
|
||||
trackRequest(request: any /* http.IncomingMessage */, response: any /* http.ServerResponse */, properties?: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
|
||||
/**
|
||||
* Log an incoming http request to your server. The request data is tracked synchronously rather than waiting for the response "finish"" or request "error"" events.
|
||||
* Use this if you need your request telemetry to respect custom app insights operation and user context (for example if you set any appInsights.client.context.tags).
|
||||
* @param request The http.ServerRequest object to track
|
||||
* @param request The http.IncomingMessage object to track
|
||||
* @param response The http.ServerResponse object for this request
|
||||
* @param ellapsedMilliseconds The duration for this request. Defaults to 0.
|
||||
* @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty.
|
||||
* @param error An error that was returned for this request if it was unsuccessful. Defaults to null.
|
||||
*/
|
||||
trackRequestSync(request: any /*http.ServerRequest */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: {
|
||||
trackRequestSync(request: any /*http.IncomingMessage */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: {
|
||||
[key: string]: string;}, error?: any) : void;
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+435
-45
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ArcGIS API for JavaScript v3.17
|
||||
// Type definitions for ArcGIS API for JavaScript v3.18
|
||||
// Project: http://js.arcgis.com
|
||||
// Definitions by: Esri <http://www.esri.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -44,6 +44,7 @@ declare module "esri" {
|
||||
import QueryTask = require("esri/tasks/QueryTask");
|
||||
import TextSymbol = require("esri/symbols/TextSymbol");
|
||||
import StandardGeographyQueryTask = require("esri/tasks/geoenrichment/StandardGeographyQueryTask");
|
||||
import WCSConnection = require("esri/layers/WCSConnection");
|
||||
import WMSLayerInfo = require("esri/layers/WMSLayerInfo");
|
||||
import WMTSLayerInfo = require("esri/layers/WMTSLayerInfo");
|
||||
|
||||
@@ -483,12 +484,14 @@ declare module "esri" {
|
||||
featureLayers: FeatureLayer[];
|
||||
/** Reference to the map object. */
|
||||
map?: Map;
|
||||
/** The point feature layer containing the origin points. */
|
||||
originsLayer: FeatureLayer;
|
||||
/** The point feature layers containing the origin points. */
|
||||
originsLayers: FeatureLayer[];
|
||||
/** The name of the output layer to be shown in the Result layer name input box. */
|
||||
outputLayerName?: string;
|
||||
/** The url to the ArcGIS.com site or in-house portal where the GP server is hosted. */
|
||||
portalUrl?: string;
|
||||
/** Indicates whether to display a drop down menu listing valid input analysis layers. */
|
||||
showSelectAnalysisLayer?: boolean;
|
||||
}
|
||||
export interface CoordinatesLocationProviderOptions {
|
||||
/** The attribute field in the graphic object that contains the longitude (X) values. */
|
||||
@@ -563,12 +566,14 @@ declare module "esri" {
|
||||
export interface CreateWatershedsOptions {
|
||||
/** The URL to the GPServer used to execute an analysis job. */
|
||||
analysisGpServer?: string;
|
||||
/** The feature layer containing input points used for calculating watersheds. */
|
||||
inputLayer: FeatureLayer;
|
||||
/** The feature layers containing input points used for calculating watersheds. */
|
||||
inputLayers: FeatureLayer[];
|
||||
/** Reference to the map object. */
|
||||
map?: Map;
|
||||
/** The url to the ArcGIS.com site or in-house portal where the GP server is hosted. */
|
||||
portalUrl?: string;
|
||||
/** Indicates whether to display a drop down menu listing valid input analysis layers. */
|
||||
showSelectAnalysisLayer?: boolean;
|
||||
}
|
||||
export interface CutOptions {
|
||||
/** The feature(s) added to the feature layer by the cut operation. */
|
||||
@@ -939,6 +944,10 @@ declare module "esri" {
|
||||
outFields?: string[];
|
||||
/** Displays or hides the attachment column. */
|
||||
showAttachments?: boolean;
|
||||
/** Displays or hides tooltips for column headers. */
|
||||
showColumnHeaderTooltips?: boolean;
|
||||
/** Shows or hides cyclical relationship. */
|
||||
showCyclicalRelationships?: boolean;
|
||||
/** Displays the data type of the field right under the field label. */
|
||||
showDataTypes?: boolean;
|
||||
/** Displays or hides total number of features and selected number of features in the grid header. */
|
||||
@@ -947,6 +956,8 @@ declare module "esri" {
|
||||
showGridHeader?: boolean;
|
||||
/** Displays or hides 'Options' drop-down menu of the FeatureTable. */
|
||||
showGridMenu?: boolean;
|
||||
/** Displays or hides the option to show related records in a table if the layer has pre-established relationship. */
|
||||
showRelatedRecords?: boolean;
|
||||
/** Displays or hides the 'Statistics' option in column menus for numeric fields. */
|
||||
showStatistics?: boolean;
|
||||
/** Enables an interaction between the map and the feature table. */
|
||||
@@ -1996,6 +2007,30 @@ declare module "esri" {
|
||||
/** The URL to use for connecting to a socket. */
|
||||
socketUrl?: string;
|
||||
}
|
||||
export interface StretchFilterOptions {
|
||||
/** Indicates whether to perform dynamic range adjustment using the current pixel data. */
|
||||
dra?: boolean;
|
||||
/** An array of gamma values, for example [0.8, 0.8, 0.8]. */
|
||||
gamma?: number[];
|
||||
/** The maximum value of stretched pixels. */
|
||||
max?: number;
|
||||
/** Percent of pixels clipped on the right histogram tail, for example 0.25. */
|
||||
maxPercent?: number;
|
||||
/** The minimum value of stretched pixels. */
|
||||
min?: number;
|
||||
/** Percent of pixels clipped on the left histogram tail, for example 1.5. */
|
||||
minPercent?: number;
|
||||
/** The number of standard deviations for StandardDeviation stretch, for example 2.5. */
|
||||
numberOfStandardDeviations?: number;
|
||||
/** The output pixel type. */
|
||||
outputPixelType?: string;
|
||||
/** An array of arrays containing custom statistics objects. */
|
||||
statistics?: any[][];
|
||||
/** See the constants table for a list of possible stretchType values. */
|
||||
stretchType?: number;
|
||||
/** Indicates whether to perform non-linear gamma stretch. */
|
||||
useGamma?: boolean;
|
||||
}
|
||||
export interface SummarizeNearbyOptions {
|
||||
/** The URL to the GPServer used to execute an analysis job. */
|
||||
analysisGpServer?: string;
|
||||
@@ -2023,6 +2058,8 @@ declare module "esri" {
|
||||
showCredits?: boolean;
|
||||
/** When true, the help links will be shown. */
|
||||
showHelp?: boolean;
|
||||
/** Indicates whether to display a drop down menu listing valid input analysis layers. */
|
||||
showSelectAnalysisLayer?: boolean;
|
||||
/** When true, the select folder dropdown will be shown. */
|
||||
showSelectFolder?: boolean;
|
||||
/** An array of possible statistics attribute field names and summary types that you wish to calculate for all nearby features. */
|
||||
@@ -2031,8 +2068,8 @@ declare module "esri" {
|
||||
summaryLayer?: FeatureLayer;
|
||||
/** An array of possible feature layers summarizing toward. */
|
||||
summaryLayers: FeatureLayer[];
|
||||
/** The point, line, or polygon feature layer from which distances will be measured to features in summarizeLayer. */
|
||||
sumNearbyLayer: FeatureLayer;
|
||||
/** The point, line, or polygon feature layers from which distances will be measured to features in summarizeLayer. */
|
||||
sumNearbyLayers: FeatureLayer[];
|
||||
/** If true. */
|
||||
sumShape?: boolean;
|
||||
/** Type of units shown as the defeault value in the Find nearest features using a option. */
|
||||
@@ -2184,27 +2221,37 @@ declare module "esri" {
|
||||
/** Region of preview scale thumbnails. */
|
||||
region?: string;
|
||||
}
|
||||
export interface WCSConnectionOptions {
|
||||
/** The coverage identifier, defaults to the first coverage. */
|
||||
coverageId?: string;
|
||||
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
|
||||
version?: string;
|
||||
}
|
||||
export interface WCSLayerOptions {
|
||||
/** The coverage identifier, defaults to the first coverage. */
|
||||
coverageId?: string;
|
||||
/** Sets the layer's draw mode. */
|
||||
drawMode?: boolean;
|
||||
/** Sets the context of the Canvas. */
|
||||
drawType?: string;
|
||||
/** A function that takes a pixelData object as input and processes it. */
|
||||
pixelFilter?: Function;
|
||||
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
|
||||
version?: string;
|
||||
/** A WCS Connection object. */
|
||||
wcsConnection?: WCSConnection;
|
||||
}
|
||||
export interface WFSLayerOptions {
|
||||
/** Full WFS body request sent to WFS server via POST method. */
|
||||
getFeatureRequest?: string;
|
||||
/** URL used when executing getFeature request. */
|
||||
getFeatureUrl?: string;
|
||||
/** Use this to append custom parameters to WFS requests. */
|
||||
customParameters?: any;
|
||||
/** The template that defines the content to display in the map info window when the user clicks on a feature. */
|
||||
infoTemplate?: InfoTemplate;
|
||||
/** For "ondemand" mode only. */
|
||||
inverseFilter?: boolean;
|
||||
/** When true, the XY coordinates should be swapped (this is required for some WFS vendors, versions, and WKIDS). */
|
||||
inverseResponse?: boolean;
|
||||
/** Specifies the maximum number of features to return in one response. */
|
||||
maxFeatures?: number;
|
||||
/** The query mode for the WFS layer. */
|
||||
mode?: string;
|
||||
/** For "ondemand" mode only. */
|
||||
nsGeometryFieldName?: string;
|
||||
/** The full layer name including the namespace as a prefix. */
|
||||
nsLayerName?: string;
|
||||
/** When true, more details will be printed to console when the first connection to a WFS server is established. */
|
||||
showDetails?: boolean;
|
||||
/** The simple layer name (excluding the namespace). */
|
||||
name?: string;
|
||||
/** URL to the WFS server. */
|
||||
url: string;
|
||||
/** OGC WFS version number. */
|
||||
@@ -2235,6 +2282,10 @@ declare module "esri" {
|
||||
title?: string;
|
||||
}
|
||||
export interface WMSLayerOptions {
|
||||
/** The customLayerParameters object used for the WMS Layer. */
|
||||
customLayerParameters?: any;
|
||||
/** The customParameters object used for the WMS Layer. */
|
||||
customParameters?: any;
|
||||
/** Specify the map image format, valid options are png,jpg,bmp,gif,svg. */
|
||||
format?: string;
|
||||
/** An optional resourceInfo object. */
|
||||
@@ -2267,6 +2318,10 @@ declare module "esri" {
|
||||
title?: string;
|
||||
}
|
||||
export interface WMTSLayerOptions {
|
||||
/** The customLayerParameters object used for the WMTS Layer. */
|
||||
customLayerParameters?: any;
|
||||
/** The customParameters object used for the WMTS Layer. */
|
||||
customParameters?: any;
|
||||
/** A WMTSLayerInfo object that when ResourceInfo options are not specified the map will display the first layer in the WMTS capabilities that matches the properties specified by WMTSLayerInfo. */
|
||||
layerInfo?: WMTSLayerInfo;
|
||||
/** When true, tile resampling is enabled. */
|
||||
@@ -2783,7 +2838,7 @@ declare module "esri/TimeExtent" {
|
||||
* Returns a new time extent indicating the intersection between "this" and the argument time extent.
|
||||
* @param timeExtent The input time extent.
|
||||
*/
|
||||
intersection(timeExtent: number): TimeExtent;
|
||||
intersection(timeExtent: TimeExtent): TimeExtent;
|
||||
/**
|
||||
* Returns a new time extent with the given offset from "this' time extent.
|
||||
* @param offsetValue The length of time to offset from "this" time extent.
|
||||
@@ -2946,7 +3001,7 @@ declare module "esri/arcgis/Portal" {
|
||||
/** The prefix selected by the organization's administrator to be used with the customBaseURL. */
|
||||
urlKey: string;
|
||||
/** User information for the accessing user is returned only when a token is passed in. */
|
||||
user: any;
|
||||
user: PortalUser;
|
||||
/** If true, only simple where clauses that are complaint with SQL92 can be used when querying layers and tables. */
|
||||
useStandardizedQuery: boolean;
|
||||
/**
|
||||
@@ -3951,6 +4006,8 @@ declare module "esri/dijit/ElevationProfile" {
|
||||
startup(): void;
|
||||
/** Fires when the elevation profile is cleared. */
|
||||
on(type: "clear-profile", listener: (event: { target: ElevationProfile }) => void): esri.Handle;
|
||||
/** Fires after the profile is generated. */
|
||||
on(type: "elevation-values", listener: (event: { data: any; target: ElevationProfile }) => void): esri.Handle;
|
||||
/** Fires when the widget has fully loaded. */
|
||||
on(type: "load", listener: (event: { target: ElevationProfile }) => void): esri.Handle;
|
||||
/** Fires when the title of the elevation profile is changed */
|
||||
@@ -3967,6 +4024,7 @@ declare module "esri/dijit/FeatureTable" {
|
||||
import FeatureLayer = require("esri/layers/FeatureLayer");
|
||||
import Map = require("esri/map");
|
||||
import FeatureEditResult = require("esri/layers/FeatureEditResult");
|
||||
import Graphic = require("esri/graphic");
|
||||
|
||||
/** Creates an instance of the FeatureTable widget within the provided DOM node. */
|
||||
class FeatureTable {
|
||||
@@ -4012,6 +4070,10 @@ declare module "esri/dijit/FeatureTable" {
|
||||
selectedRows: any[];
|
||||
/** Displays or hides the attachment column. */
|
||||
showAttachments: boolean;
|
||||
/** Displays or hides tooltips for column headers. */
|
||||
showColumnHeaderTooltips: boolean;
|
||||
/** Relies on showRelatedRecords property. */
|
||||
showCyclicalRelationships: boolean;
|
||||
/** Displays or hides the data type of the field right under the field label in the column header. */
|
||||
showDataTypes: boolean;
|
||||
/** Displays or hides total number of features and selected number of features in the grid header. */
|
||||
@@ -4020,6 +4082,8 @@ declare module "esri/dijit/FeatureTable" {
|
||||
showGridHeader: boolean;
|
||||
/** Displays or hides 'Options' drop-down menu of the FeatureTable. */
|
||||
showGridMenu: boolean;
|
||||
/** Displays or hides the option to show related records in a table if the layer has pre-established relationship. */
|
||||
showRelatedRecords: boolean;
|
||||
/** Displays or hides the 'Statistics' option in column menus for numeric fields. */
|
||||
showStatistics: boolean;
|
||||
/** Enables an interaction between the map and the feature table. */
|
||||
@@ -4032,35 +4096,55 @@ declare module "esri/dijit/FeatureTable" {
|
||||
* @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into.
|
||||
*/
|
||||
constructor(params: esri.FeatureTableOptions, srcNodeRef: Node | string);
|
||||
/** Removes all current selections including subsets from filterSelectedRecords(). */
|
||||
/** Centers the map on combined extent of selected rows. */
|
||||
centerOnSelection(): void;
|
||||
/** Removes all filters and selections in the table. */
|
||||
clearFilter(): void;
|
||||
/** Removes all selections. */
|
||||
clearSelection(): void;
|
||||
/** Destroys the FeatureTable widget. */
|
||||
destroy(): void;
|
||||
/**
|
||||
* Allows users to see the sub-set of currently selected records (uses dGrid.query).
|
||||
* @param toggle When true only a subset of currently selected features will be displayed in the FeatureTable.
|
||||
* Filters the table based on the provided row ids.
|
||||
* @param ids Array of row ids.
|
||||
*/
|
||||
filterSelectedRecords(toggle: boolean): void;
|
||||
filterRecordsByIds(ids: number[]): void;
|
||||
/** Allows users to see the sub-set of records. */
|
||||
filterSelectedRecords(): void;
|
||||
/**
|
||||
* Queries and gets selected features from the FeatureLayer instead of the store.
|
||||
* @param id Array of row ids
|
||||
* @param id Row id or an array of row ids
|
||||
*/
|
||||
getFeatureDataById(id: number[]): any;
|
||||
getFeatureDataById(id: number | number[]): any;
|
||||
/**
|
||||
* Gets row object by the row ID.
|
||||
* @param id row ID
|
||||
*/
|
||||
getRowDataById(id: number): any;
|
||||
/** Refreshes the data in the grid. */
|
||||
/** Refreshes the data in the table. */
|
||||
refresh(): void;
|
||||
/** Resizes the grid's container. */
|
||||
resize(): void;
|
||||
/**
|
||||
* Allows users to select rows(s) based on row id(s).
|
||||
* @param ids Row id or an array of row ids
|
||||
* @param scrollToRow Indicates whether the table should scroll to selected rows.
|
||||
*/
|
||||
selectRows(ids: number | number[], scrollToRow?: boolean): void;
|
||||
/**
|
||||
* Sorts a given field in ascending or descending order.
|
||||
* @param field Name of the field
|
||||
* @param descending Defines whether the specified field will be sorted in ascending or descending order.
|
||||
*/
|
||||
sort(field: string, descending?: boolean): void;
|
||||
/** Finalizes the creation of the widget. */
|
||||
startup(): void;
|
||||
/** This event fires in response to clearSelection() method. */
|
||||
on(type: "clear-selection", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when the grid column is resized. */
|
||||
on(type: "column-resize", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
on(type: "column-resize", listener: (event: { resizeEvent: any; target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when a column is hidden or shown via 'Options' drop-down menu. */
|
||||
on(type: "column-state-change", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
on(type: "column-state-change", listener: (event: { stateChangeEvent: any; target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when grid editor field loses focus after being changed. */
|
||||
on(type: "data-change", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when grid editor is hidden. */
|
||||
@@ -4072,19 +4156,23 @@ declare module "esri/dijit/FeatureTable" {
|
||||
/** Fires when an error occurs in the grid. */
|
||||
on(type: "error", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when grid is filtered. */
|
||||
on(type: "filter", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
on(type: "filter", listener: (event: { ids: number[]; target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when the FeatureTable is loaded. */
|
||||
on(type: "load", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when the grid is refreshed. */
|
||||
on(type: "refresh", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when a row is deselected. */
|
||||
on(type: "row-deselect", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
on(type: "row-deselect", listener: (event: { event: any; target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when a row is selected. */
|
||||
on(type: "row-select", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
on(type: "row-select", listener: (event: { event: any; target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when attachment is displayed in the table. */
|
||||
on(type: "show-attachments", listener: (event: { attachments: any; dialog: any; featureId: number; target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when related records are displayed in the table. */
|
||||
on(type: "show-related-records", listener: (event: { features: Graphic[]; relationship: any; row: any; target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when the statistics dialog box shows the calculated statistics on a column with numeric data. */
|
||||
on(type: "show-statistics", listener: (event: { statistics: any; target: FeatureTable }) => void): esri.Handle;
|
||||
/** Fires when a column is sorted. */
|
||||
on(type: "sort", listener: (event: { target: FeatureTable }) => void): esri.Handle;
|
||||
on(type: "sort", listener: (event: { sortEvent: any; target: FeatureTable }) => void): esri.Handle;
|
||||
on(type: string, listener: (event: any) => void): esri.Handle;
|
||||
}
|
||||
export = FeatureTable;
|
||||
@@ -4168,7 +4256,7 @@ declare module "esri/dijit/Geocoder" {
|
||||
import GraphicsLayer = require("esri/layers/GraphicsLayer");
|
||||
import Symbol = require("esri/symbols/Symbol");
|
||||
|
||||
/** Starting with version 3.13, the Search Widget supersedes the Geocoder Widget and is deprecated. */
|
||||
/** The Geocoder widget was deprecated in version 3.13 and replaced by the Search widget. */
|
||||
class Geocoder {
|
||||
/** Currently selected locator object. */
|
||||
activeGeocoder: any;
|
||||
@@ -9403,6 +9491,8 @@ declare module "esri/layers/FeatureLayer" {
|
||||
labelingInfo: LabelClass[];
|
||||
/** Unique ID of the layer that the FeatureLayer was constructed against. */
|
||||
layerId: number;
|
||||
/** The maximum allowable offset, only applicable for layers that are not editable. */
|
||||
maxAllowableOffset: number;
|
||||
/** The maximum number of results that will be returned from a query. */
|
||||
maxRecordCount: number;
|
||||
/** Maximum visible scale for the layer. */
|
||||
@@ -10914,7 +11004,7 @@ declare module "esri/layers/VectorTileLayer" {
|
||||
import SpatialReference = require("esri/SpatialReference");
|
||||
import TileInfo = require("esri/layers/TileInfo");
|
||||
|
||||
/** A VectorTileLayer accesses cached tiles of data and renders it in vector format. */
|
||||
/** A VectorTileLayer renders cached tiles of data. */
|
||||
class VectorTileLayer extends Layer {
|
||||
/** The full extent of the layer. */
|
||||
fullExtent: Extent;
|
||||
@@ -10946,6 +11036,224 @@ declare module "esri/layers/VectorTileLayer" {
|
||||
export = VectorTileLayer;
|
||||
}
|
||||
|
||||
declare module "esri/layers/WCSConnection" {
|
||||
import esri = require("esri");
|
||||
import WCSCoverageDescription = require("esri/layers/WCSCoverageDescription");
|
||||
import DimensionalDefinition = require("esri/layers/DimensionalDefinition");
|
||||
|
||||
/** (Currently in beta), a helper class to discover available coverages in an OGC Web Coverage Service. */
|
||||
class WCSConnection {
|
||||
/** Resamples pixel by bilinear interpolation. */
|
||||
static INTERPOLATION_BILINEAR: any;
|
||||
/** Resamples pixel by cubic convolution. */
|
||||
static INTERPOLATION_CUBICCONVOLUTION: any;
|
||||
/** Resamples pixel by nearest neighbor. */
|
||||
static INTERPOLATION_NEARESTNEIGHBOR: any;
|
||||
/** An array of coverages offered by the WCS server. */
|
||||
coverages: WCSCoverageDescription[];
|
||||
/** Multiple dimensional definitions are usually used to filter data. */
|
||||
multidimensionalDefinition: DimensionalDefinition[];
|
||||
/** The name of the WCS server. */
|
||||
name: string;
|
||||
/** Key-value pairs for URLs of different WCS operations: GetCapabilitiesDescribeCoverage */
|
||||
onlineResources: any;
|
||||
/** An array of string values indicating WCS 2.0.1 profiles. */
|
||||
profiles: string[];
|
||||
/** An array of supported formats by the server. */
|
||||
supportedFormats: string[];
|
||||
/** The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. */
|
||||
supportedInterpolations: number[];
|
||||
/** An array of supported WCS versions by the server. */
|
||||
supportedVersions: string[];
|
||||
/** URL to a WCS Server endpoint. */
|
||||
url: string;
|
||||
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
|
||||
version: string;
|
||||
/**
|
||||
* Creates a new WCSConnection.
|
||||
* @param url URL to a WCS Server endpoint.
|
||||
* @param options Optional parameters.
|
||||
*/
|
||||
constructor(url: string, options?: esri.WCSConnectionOptions);
|
||||
/** Triggered when successfully retrieved list of coverages. */
|
||||
on(type: "onConnected", listener: (event: { target: WCSConnection }) => void): esri.Handle;
|
||||
/** Triggered when an error occurred. */
|
||||
on(type: "onConnectionFailed", listener: (event: { error: Error; target: WCSConnection }) => void): esri.Handle;
|
||||
on(type: string, listener: (event: any) => void): esri.Handle;
|
||||
}
|
||||
export = WCSConnection;
|
||||
}
|
||||
|
||||
declare module "esri/layers/WCSCoverageDescription" {
|
||||
import Extent = require("esri/geometry/Extent");
|
||||
import Point = require("esri/geometry/Point");
|
||||
import TimeInfo = require("esri/layers/TimeInfo");
|
||||
|
||||
/** (Currently in beta), the WCSCoverageDescription models the coverage properties offered by the WCS Server. */
|
||||
class WCSCoverageDescription {
|
||||
/** Resamples pixel by bilinear interpolation. */
|
||||
static INTERPOLATION_BILINEAR: any;
|
||||
/** Resamples pixel by cubic convolution. */
|
||||
static INTERPOLATION_CUBICCONVOLUTION: any;
|
||||
/** Resamples pixel by nearest neighbor. */
|
||||
static INTERPOLATION_NEARESTNEIGHBOR: any;
|
||||
/** An array of band names. */
|
||||
bandInfo: string[];
|
||||
/** Number of columns at the source resolution. */
|
||||
columns: number;
|
||||
/** The coverage description text. */
|
||||
description: string;
|
||||
/** Coverage extent in the native spatial reference. */
|
||||
extent: Extent;
|
||||
/** The coverage id. */
|
||||
id: string;
|
||||
/** Coverage extent in WGS84. */
|
||||
lonLatEnvelope: Extent;
|
||||
/** A parsed multidimensional object that describes variables and dimensions. */
|
||||
multiDimensionalInfo: any;
|
||||
/** A parsed coverage description object in a structure similar to WCS Coverage Description schema. */
|
||||
nativeCoverageDescription: any;
|
||||
/** Coverage's source resolution. */
|
||||
resolution: Point;
|
||||
/** Number of rows at the source resolution. */
|
||||
rows: number;
|
||||
/** Generalized from the following properties:SupportedFormats for WCS 1.0.0 and 1.1.xserviceParameters.supportedFormats for WCS 2.0.1. */
|
||||
supportedFormats: string[];
|
||||
/** The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. */
|
||||
supportedInterpolations: number[];
|
||||
/** Temporal information for the layer, such as time extent. */
|
||||
timeInfo: TimeInfo;
|
||||
/** The current version of the coverage. */
|
||||
version: string;
|
||||
/**
|
||||
* Creates a new WCSCoverageDescription.
|
||||
* @param coverageDocument The coverage description XML.
|
||||
* @param version The version of the coverage description document.
|
||||
*/
|
||||
constructor(coverageDocument: string, version: string);
|
||||
}
|
||||
export = WCSCoverageDescription;
|
||||
}
|
||||
|
||||
declare module "esri/layers/WCSLayer" {
|
||||
import esri = require("esri");
|
||||
import WCSCoverageDescription = require("esri/layers/WCSCoverageDescription");
|
||||
import Extent = require("esri/geometry/Extent");
|
||||
import DimensionalDefinition = require("esri/layers/DimensionalDefinition");
|
||||
import TimeInfo = require("esri/layers/TimeInfo");
|
||||
import WCSConnection = require("esri/layers/WCSConnection");
|
||||
import Point = require("esri/geometry/Point");
|
||||
import Layer = require("esri/layers/layer");
|
||||
|
||||
/** (Currently in beta) The WCSLayer works with OGC Web Coverage Services. */
|
||||
class WCSLayer {
|
||||
/** Resamples pixel by bilinear interpolation. */
|
||||
static INTERPOLATION_BILINEAR: any;
|
||||
/** Resamples pixel by cubic convolution. */
|
||||
static INTERPOLATION_CUBICCONVOLUTION: any;
|
||||
/** Resamples pixel by nearest neighbor. */
|
||||
static INTERPOLATION_NEARESTNEIGHBOR: any;
|
||||
/** Zero-based array of current band selections. */
|
||||
bandIds: number[];
|
||||
/** A reference to a WCSCoverageDescription object. */
|
||||
coverageDescription: WCSCoverageDescription;
|
||||
/** The coverage identifier, defaults to the first coverage. */
|
||||
coverageId: string;
|
||||
/** The extent of the full coverage. */
|
||||
extent: Extent;
|
||||
/** Raster format of the layer. */
|
||||
format: string;
|
||||
/** Current interpolation method. */
|
||||
interpolation: number;
|
||||
/** When the layer is loaded, the value becomes "true", and layer properties can be accessed. */
|
||||
loaded: boolean;
|
||||
/** Multiple dimensional definitions are usually used to filter data. */
|
||||
multidimensionalDefinition: DimensionalDefinition[];
|
||||
/** Opacity or transparency of layer. */
|
||||
opacity: number;
|
||||
/** A function that takes a pixelData object as input and processes it. */
|
||||
pixelFilter: Function;
|
||||
/** The pixel type of the image service. */
|
||||
pixelType: string;
|
||||
/** The projected extent in the map's spatial reference. */
|
||||
projectedFullExtent: Extent;
|
||||
/** When true, the layer is suspended. */
|
||||
suspended: boolean;
|
||||
/** Temporal information for the layer, such as time extent. */
|
||||
timeInfo: TimeInfo;
|
||||
/** URL to a WCS Server endpoint. */
|
||||
url: string;
|
||||
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
|
||||
version: string;
|
||||
/** The visibility of the layer. */
|
||||
visible: boolean;
|
||||
/** A WCS Connection object. */
|
||||
wcsConnection: WCSConnection;
|
||||
/**
|
||||
* Creates a new WCSLayer.
|
||||
* @param url URL to a WCS Server endpoint.
|
||||
* @param options Optional parameters.
|
||||
*/
|
||||
constructor(url: string, options?: esri.WCSLayerOptions);
|
||||
/** Returns the context of the Canvas. */
|
||||
getContext(): any;
|
||||
/**
|
||||
* Returns an array of graphics as a Promise.
|
||||
* @param mapPoint The map point location in which to identify.
|
||||
*/
|
||||
identify(mapPoint: Point): any;
|
||||
/** Resumes layer drawing. */
|
||||
resume(): void;
|
||||
/**
|
||||
* Sets the opacity of the layer.
|
||||
* @param opacity Value from 0 to 1, where 0 is 100% transparent and 1 has no transparency.
|
||||
*/
|
||||
setOpacity(opacity: number): void;
|
||||
/**
|
||||
* Sets a pixelFilter on the layer.
|
||||
* @param pixelFilter The function defining the PixelFilter to set on the layer.
|
||||
* @param doNotRefresh When true the layer will not refresh the map image.
|
||||
*/
|
||||
setPixelFilter(pixelFilter: Function, doNotRefresh?: boolean): void;
|
||||
/**
|
||||
* Determines if the layer will update its content based on the map's current time extent.
|
||||
* @param use Use true to update the layer's content based on the map's current time extent.
|
||||
*/
|
||||
setUseMapTime(use: boolean): void;
|
||||
/**
|
||||
* Sets the visibility of the layer.
|
||||
* @param isVisible Indicate whether to set layer visibility.
|
||||
*/
|
||||
setVisibility(isVisible: boolean): void;
|
||||
/** Suspends layer drawing. */
|
||||
suspend(): void;
|
||||
/** Fires when there is a problem retrieving a layer. */
|
||||
on(type: "error", listener: (event: { error: Error; target: WCSLayer }) => void): esri.Handle;
|
||||
/** Fires after layer properties for the layer are successfully populated. */
|
||||
on(type: "load", listener: (event: { layer: Layer; target: WCSLayer }) => void): esri.Handle;
|
||||
/** Fires when the layer opacity has been changed, and returns an object with the opacity value. */
|
||||
on(type: "opacity-change", listener: (event: { opacity: number; target: WCSLayer }) => void): esri.Handle;
|
||||
/** This event is fired when the layer's refreshInterval is modified. */
|
||||
on(type: "refresh-interval-change", listener: (event: { target: WCSLayer }) => void): esri.Handle;
|
||||
/** Fires when a layer resumes drawing. */
|
||||
on(type: "resume", listener: (event: { target: WCSLayer }) => void): esri.Handle;
|
||||
/** Fires when a layer's minScale and/or maxScale is changed. */
|
||||
on(type: "scale-range-change", listener: (event: { target: WCSLayer }) => void): esri.Handle;
|
||||
/** Fires when a layer's scale visibility changes. */
|
||||
on(type: "scale-visibility-change", listener: (event: { target: WCSLayer }) => void): esri.Handle;
|
||||
/** Fires when a layer suspends drawing */
|
||||
on(type: "suspend", listener: (event: { target: WCSLayer }) => void): esri.Handle;
|
||||
/** Fires when a layer has finished updating its content. */
|
||||
on(type: "update-end", listener: (event: { error: Error; target: WCSLayer }) => void): esri.Handle;
|
||||
/** Fires when a layer begins to update its content. */
|
||||
on(type: "update-start", listener: (event: { target: WCSLayer }) => void): esri.Handle;
|
||||
/** Fires when the layer visibility has been changed, and returns an object with a Boolean visible property containing the new visibility value of the layer. */
|
||||
on(type: "visibility-change", listener: (event: { visible: boolean; target: WCSLayer }) => void): esri.Handle;
|
||||
on(type: string, listener: (event: any) => void): esri.Handle;
|
||||
}
|
||||
export = WCSLayer;
|
||||
}
|
||||
|
||||
declare module "esri/layers/WFSLayer" {
|
||||
import esri = require("esri");
|
||||
import GraphicsLayer = require("esri/layers/GraphicsLayer");
|
||||
@@ -10957,6 +11265,8 @@ declare module "esri/layers/WFSLayer" {
|
||||
|
||||
/** (Currently in beta) A layer for OGC Web Feature Services (WFS). */
|
||||
class WFSLayer extends GraphicsLayer {
|
||||
/** Use this to append custom parameters to WFS requests. */
|
||||
customParameters: any;
|
||||
/** An array of fields in the layer. */
|
||||
fields: Field[];
|
||||
/** The full extent of the layer. */
|
||||
@@ -10987,6 +11297,11 @@ declare module "esri/layers/WFSLayer" {
|
||||
redraw(): void;
|
||||
/** Refreshes the features in the WFS layer. */
|
||||
refresh(): void;
|
||||
/**
|
||||
* Sets the custom parameters used on the WFS layer.
|
||||
* @param customParameters The customParameters object used append WFS requests.
|
||||
*/
|
||||
setCustomParameters(customParameters: any): void;
|
||||
/** Sets the default line symbol to be used if no renderer is specified. */
|
||||
setLineSymbol(): void;
|
||||
/** Sets the default point symbol to be used if no renderer is specified. */
|
||||
@@ -11012,12 +11327,20 @@ declare module "esri/layers/WMSLayer" {
|
||||
allExtents: Extent[];
|
||||
/** Copyright of the WMS service. */
|
||||
copyright: string;
|
||||
/** Use this to append different custom parameters to WMS layer requests. */
|
||||
customLayerParameters: any;
|
||||
/** Use this to append custom parameters to all WMS requests. */
|
||||
customParameters: any;
|
||||
/** Description of the WMS service. */
|
||||
description: string;
|
||||
/** Extent of the WMS service. */
|
||||
extent: Extent;
|
||||
/** Feature info MIME type to request. */
|
||||
featureInfoFormat: string;
|
||||
/** The URL for the WMS GetFeatureInfo call. */
|
||||
getFeatureInfoURL: string;
|
||||
/** The URL for the WMS GetMap call. */
|
||||
getMapUrl: string;
|
||||
getMapURL: string;
|
||||
/** The map image format. */
|
||||
imageFormat: string;
|
||||
/** List of layers in the WMS service. */
|
||||
@@ -11034,12 +11357,22 @@ declare module "esri/layers/WMSLayer" {
|
||||
title: string;
|
||||
/** Version of the WMS service. */
|
||||
version: string;
|
||||
/** A list of layer names that represent the layers to include in the exported map. */
|
||||
visibleLayers: string[];
|
||||
/**
|
||||
* Creates a new WMSLayer object.
|
||||
* @param url URL to the OGC Web Map Service.
|
||||
* @param options Optional parameters.
|
||||
*/
|
||||
constructor(url: string, options?: esri.WMSLayerOptions);
|
||||
/** Returns the current map image format. */
|
||||
getImageFormat(): string;
|
||||
/**
|
||||
* Sets the custom parameters used on the WMS layer.
|
||||
* @param customParameters The customParameters object used append WMS requests.
|
||||
* @param customLayerParameters The customLayerParameters object used append specific WMS layer requests.
|
||||
*/
|
||||
setCustomParameters(customParameters: any, customLayerParameters?: any): void;
|
||||
/**
|
||||
* Set the map image format; valid values are "png", "jpg", "pdf", "bmp", "gif" and "svg".
|
||||
* @param format The image format.
|
||||
@@ -11106,6 +11439,10 @@ declare module "esri/layers/WMTSLayer" {
|
||||
class WMTSLayer extends TiledMapServiceLayer {
|
||||
/** Copyright information for the service. */
|
||||
copyright: string;
|
||||
/** Use this to append different custom parameters to a WMTS tile request. */
|
||||
customLayerParameters: any;
|
||||
/** Use this to append custom parameters to all WMTS requests. */
|
||||
customParameters: any;
|
||||
/** The description of the active layer if specified in the capabilties file or the resource info. */
|
||||
description: string;
|
||||
/** The tile format. */
|
||||
@@ -11137,6 +11474,12 @@ declare module "esri/layers/WMTSLayer" {
|
||||
* @param WMTSLayerInfo The WMTSLayerInfo for the layer to make active.
|
||||
*/
|
||||
setActiveLayer(WMTSLayerInfo: WMTSLayerInfo): void;
|
||||
/**
|
||||
* Sets the custom parameters used on the WMTS layer.
|
||||
* @param customParameters The customParameters object used append WMTS requests.
|
||||
* @param customLayerParameters The customLayerParameters object used append specific WMTS layer requests.
|
||||
*/
|
||||
setCustomParameters(customParameters: any, customLayerParameters?: any): void;
|
||||
}
|
||||
export = WMTSLayer;
|
||||
}
|
||||
@@ -11315,6 +11658,47 @@ declare module "esri/layers/layer" {
|
||||
export = Layer;
|
||||
}
|
||||
|
||||
declare module "esri/layers/pixelfilters/StretchFilter" {
|
||||
import esri = require("esri");
|
||||
|
||||
/** A stretch filter used to work with client -side pixel data to enhance raster/image appearances. */
|
||||
class StretchFilter {
|
||||
/** Indicates whether to perform dynamic range adjustment using the current pixel data. */
|
||||
dra: boolean;
|
||||
/** An array of gamma values, for example [0.8, 0.8, 0.8]. */
|
||||
gamma: number[];
|
||||
/** The maximum value of stretched pixels. */
|
||||
max: number;
|
||||
/** Percent of pixels clipped on the right histogram tail, for example 0.25. */
|
||||
maxPercent: number;
|
||||
/** The minimum value of stretched pixels. */
|
||||
min: number;
|
||||
/** Percent of pixels clipped on the left histogram tail, for example 1.5. */
|
||||
minPercent: number;
|
||||
/** The number of standard deviations for StandardDeviation stretch, for example 2.5. */
|
||||
numberOfStandardDeviations: number;
|
||||
/** The output pixel type. */
|
||||
outputPixelType: string;
|
||||
/** An array of arrays containing custom statistics objects. */
|
||||
statistics: any[][];
|
||||
/** Number indicating the various stretch types. */
|
||||
stretchType: number;
|
||||
/** Indicates whether to perform non-linear gamma stretch. */
|
||||
useGamma: boolean;
|
||||
/**
|
||||
* Creates an instance of a StretchFilter.
|
||||
* @param options Optional parameters.
|
||||
*/
|
||||
constructor(options?: esri.StretchFilterOptions);
|
||||
/**
|
||||
* It takes a pixelData object as input and processes it.
|
||||
* @param pixelData The pixelData object used as filter input.
|
||||
*/
|
||||
filter(pixelData: any): void;
|
||||
}
|
||||
export = StretchFilter;
|
||||
}
|
||||
|
||||
declare module "esri/map" {
|
||||
import esri = require("esri");
|
||||
import Attribution = require("esri/dijit/Attribution");
|
||||
@@ -11779,8 +12163,8 @@ declare module "esri/opsdashboard/ExtensionBase" {
|
||||
static POLYLINE: any;
|
||||
/** Read-only: Indicates if the host application is the Windows Operations Dashboard. */
|
||||
isNative: boolean;
|
||||
/** Read Only: It will list all of the Portal helper services. */
|
||||
portalHelperServices: string;
|
||||
/** Read-only: It will list all of the Portal helper services. */
|
||||
portalHelperServices: any;
|
||||
/** Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. */
|
||||
portalUrl: string;
|
||||
/** Get the collection of data sources from the host application. */
|
||||
@@ -11838,8 +12222,11 @@ declare module "esri/opsdashboard/ExtensionConfigurationBase" {
|
||||
class ExtensionConfigurationBase extends ExtensionBase {
|
||||
/** The object that will store the Widget/MapTool/FeatureAction configuration. */
|
||||
config: any;
|
||||
/** Indicates that the configuration is ready to be persisted or not. */
|
||||
readyToPersistConfig: boolean;
|
||||
/**
|
||||
* Indicates if the configuration is ready to be persisted or not.
|
||||
* @param ready Indicates that the configuration is ready to be persisted or not.
|
||||
*/
|
||||
readyToPersistConfig(ready: boolean): void;
|
||||
}
|
||||
export = ExtensionConfigurationBase;
|
||||
}
|
||||
@@ -14127,6 +14514,8 @@ declare module "esri/tasks/FeatureSet" {
|
||||
features: Graphic[];
|
||||
/** Set of name-value pairs for the attribute's field and alias names. */
|
||||
fieldAliases: any;
|
||||
/** The array of fields. */
|
||||
fields: any[];
|
||||
/** The geometry type of the FeatureSet. */
|
||||
geometryType: string;
|
||||
/** When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. */
|
||||
@@ -14379,7 +14768,7 @@ declare module "esri/tasks/GeometryService" {
|
||||
url: string;
|
||||
/**
|
||||
* Creates a new GeometryService object.
|
||||
* @param url URL to the ArcGIS Server REST resource that represents a GeometryService, e.g., http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer.
|
||||
* @param url URL to the ArcGIS Server REST resource that represents a GeometryService, https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer.
|
||||
*/
|
||||
constructor(url: string);
|
||||
/**
|
||||
@@ -15165,6 +15554,7 @@ declare module "esri/tasks/PrintParameters" {
|
||||
declare module "esri/tasks/PrintTask" {
|
||||
import esri = require("esri");
|
||||
import PrintParameters = require("esri/tasks/PrintParameters");
|
||||
import DataFile = require("esri/tasks/DataFile");
|
||||
|
||||
/** The PrintTask class generates a printer-ready version of the map using an Export Web Map Task available with ArGIS Server 10.1 and later. */
|
||||
class PrintTask {
|
||||
@@ -15184,7 +15574,7 @@ declare module "esri/tasks/PrintTask" {
|
||||
*/
|
||||
execute(printParameters: PrintParameters, callback?: Function, errback?: Function): any;
|
||||
/** Fired when the print operation is complete. */
|
||||
on(type: "complete", listener: (event: { url: string; target: PrintTask }) => void): esri.Handle;
|
||||
on(type: "complete", listener: (event: { result: DataFile; target: PrintTask }) => void): esri.Handle;
|
||||
/** Fired when an error occurs while executing the print task. */
|
||||
on(type: "error", listener: (event: { error: Error; target: PrintTask }) => void): esri.Handle;
|
||||
on(type: string, listener: (event: any) => void): esri.Handle;
|
||||
|
||||
@@ -11,4 +11,13 @@ var readStream = FS.createReadStream('./archiver.d.ts');
|
||||
|
||||
archiver.pipe(writeStream);
|
||||
archiver.append(readStream, {name: 'archiver.d.ts'});
|
||||
archiver.finalize();
|
||||
archiver.finalize();
|
||||
|
||||
|
||||
archiver.directory('./path', './someOtherPath');
|
||||
archiver.directory('./path', { name: "testName"} );
|
||||
|
||||
archiver.directory('./', "", {});
|
||||
archiver.directory('./', {name: 'test'}, {});
|
||||
|
||||
archiver.bulk({ mappaing: {} });
|
||||
Vendored
+5
@@ -25,6 +25,11 @@ declare module "archiver" {
|
||||
interface Archiver extends STREAM.Transform {
|
||||
pipe(writeStream: FS.WriteStream): void;
|
||||
append(source: FS.ReadStream | Buffer | string, name: nameInterface): void;
|
||||
|
||||
directory(dirpath: string, destpath: nameInterface | string): void;
|
||||
directory(dirpath: string, destpath: nameInterface | string, data: any | Function): void;
|
||||
|
||||
bulk(mappings: any): void;
|
||||
finalize(): void;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Qubo <https://github.com/tkqubo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../bluebird/bluebird.d.ts" />
|
||||
/// <reference path="../bluebird/bluebird-2.0.d.ts" />
|
||||
/// <reference path="../request/request.d.ts" />
|
||||
|
||||
declare module "asana" {
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/// <reference path="async-polling.d.ts" />
|
||||
|
||||
import * as AsyncPolling from "async-polling";
|
||||
|
||||
// Tests based on examples in https://github.com/cGuille/async-polling#readme
|
||||
|
||||
AsyncPolling(end => {
|
||||
end();
|
||||
}, 3000).run();
|
||||
|
||||
function someAsynchroneProcess(callback: (error?: Error, response?: any) => any): any {
|
||||
callback();
|
||||
}
|
||||
|
||||
let polling = AsyncPolling(end => {
|
||||
someAsynchroneProcess(function (error, response) {
|
||||
if (error) {
|
||||
end(error);
|
||||
return;
|
||||
}
|
||||
|
||||
end(null, response);
|
||||
});
|
||||
}, 3000);
|
||||
polling.on("error", (error: Error) => {});
|
||||
polling.on("result", (result: any) => {});
|
||||
polling.run();
|
||||
polling.stop();
|
||||
|
||||
AsyncPolling(function(end) {
|
||||
this.stop();
|
||||
end();
|
||||
}, 3000).run();
|
||||
|
||||
let i = 0;
|
||||
|
||||
polling = AsyncPolling(function(end) {
|
||||
++i;
|
||||
if (i === 3) {
|
||||
return end(new Error("i is " + i));
|
||||
}
|
||||
if (i >= 5) {
|
||||
this.stop();
|
||||
return end(null, `#${i} stop`);
|
||||
}
|
||||
end(null, `#${i} wait a second...`);
|
||||
}, 1000);
|
||||
|
||||
const eventNames: AsyncPolling.EventName[] = ["run", "start", "end", "schedule", "stop"];
|
||||
eventNames.forEach(eventName => {
|
||||
polling.on(eventName, () => {
|
||||
console.log("lifecycle:", eventName);
|
||||
});
|
||||
});
|
||||
|
||||
polling.on("result", (result: any) => {
|
||||
console.log("result:", result);
|
||||
});
|
||||
|
||||
polling.on("error", (error: Error) => {
|
||||
console.error("error:", error);
|
||||
});
|
||||
|
||||
polling.run();
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for AsyncPolling
|
||||
// Project: https://github.com/cGuille/async-polling
|
||||
// Definitions by: Zlatko Andonovski <https://github.com/Goldsmith42/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "async-polling" {
|
||||
module AsyncPolling {
|
||||
export type EventName = "run"|"start"|"error"|"result"|"end"|"schedule"|"stop";
|
||||
}
|
||||
|
||||
function AsyncPolling<Result>(pollingFunc: (end: (err?: Error, result?: Result) => any) => any, delay: number): {
|
||||
run: () => any;
|
||||
stop: () => any;
|
||||
on: (eventName: AsyncPolling.EventName, listener: Function) => any;
|
||||
}
|
||||
|
||||
export = AsyncPolling;
|
||||
}
|
||||
+354
-7
@@ -392,13 +392,6 @@ function (results) {
|
||||
]);
|
||||
});
|
||||
|
||||
var sys;
|
||||
var iterator = async.iterator([
|
||||
function () { sys.p('one'); },
|
||||
function () { sys.p('two'); },
|
||||
function () { sys.p('three'); }
|
||||
]);
|
||||
|
||||
async.parallel([
|
||||
async.apply(fs.writeFile, 'testfile1', 'test1'),
|
||||
async.apply(fs.writeFile, 'testfile2', 'test2'),
|
||||
@@ -442,3 +435,357 @@ async.dir(function (name, callback) {
|
||||
callback(null, { hello: name });
|
||||
}, 1000);
|
||||
}, "world");
|
||||
|
||||
// each
|
||||
|
||||
async.each<number>({
|
||||
"a": 1,
|
||||
"b": 2
|
||||
}, function(val: number, next: ErrorCallback): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.each: ${val}`);
|
||||
|
||||
next();
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err?: Error): void {
|
||||
|
||||
console.log("async.each: done.");
|
||||
|
||||
});
|
||||
|
||||
async.eachSeries<number>({
|
||||
"a": 1,
|
||||
"b": 2
|
||||
}, function(val: number, next: ErrorCallback): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.eachSeries: ${val}`);
|
||||
|
||||
next();
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err?: Error): void {
|
||||
|
||||
console.log("async.eachSeries: done.");
|
||||
|
||||
});
|
||||
|
||||
async.eachLimit<number>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3,
|
||||
"d": 4,
|
||||
"e": 5,
|
||||
"f": 6
|
||||
}, 2, function(val: number, next: ErrorCallback): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.eachLimit: ${val}`);
|
||||
|
||||
next();
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err?: Error): void {
|
||||
|
||||
console.log("async.eachLimit: done.");
|
||||
|
||||
});
|
||||
|
||||
// forEachOf/eachOf
|
||||
|
||||
async.eachOf<number>({
|
||||
"a": 1,
|
||||
"b": 2
|
||||
}, function(val: number, key: string, next: ErrorCallback): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.forEachOf/eachOf: ${key} = ${val}`);
|
||||
|
||||
next();
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err?: Error): void {
|
||||
|
||||
console.log("async.forEachOf/eachOf: done.");
|
||||
|
||||
});
|
||||
|
||||
async.forEachOfSeries<number>({
|
||||
"a": 1,
|
||||
"b": 2
|
||||
}, function(val: number, key: string, next: ErrorCallback): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.forEachOfSeries: ${key} = ${val}`);
|
||||
|
||||
next();
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err?: Error): void {
|
||||
|
||||
console.log("async.forEachOfSeries: done.");
|
||||
|
||||
});
|
||||
|
||||
async.forEachOfLimit<number>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3,
|
||||
"d": 4,
|
||||
"e": 5,
|
||||
"f": 6
|
||||
}, 2, function(val: number, key: string, next: ErrorCallback): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.forEachOfLimit: ${key} = ${val}`);
|
||||
|
||||
next();
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err?: Error): void {
|
||||
|
||||
console.log("async.forEachOfLimit: done.");
|
||||
|
||||
});
|
||||
|
||||
// map
|
||||
|
||||
async.map<number, string>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3
|
||||
}, function(val: number, next: AsyncResultCallback<string>): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.map: ${val}`);
|
||||
|
||||
next(null, val.toString());
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err: Error, results: string[]): void {
|
||||
|
||||
console.log("async.map: done with results", results);
|
||||
|
||||
});
|
||||
|
||||
async.mapSeries<number, string>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3
|
||||
}, function(val: number, next: AsyncResultCallback<string>): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.mapSeries: ${val}`);
|
||||
|
||||
next(null, val.toString());
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err: Error, results: string[]): void {
|
||||
|
||||
console.log("async.mapSeries: done with results", results);
|
||||
|
||||
});
|
||||
|
||||
async.mapLimit<number, string>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3,
|
||||
"d": 4,
|
||||
"e": 5,
|
||||
"f": 6
|
||||
}, 2, function(val: number, next: AsyncResultCallback<string>): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.mapLimit: ${val}`);
|
||||
|
||||
next(null, val.toString());
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err: Error, results: string[]): void {
|
||||
|
||||
console.log("async.mapLimit: done with results", results);
|
||||
|
||||
});
|
||||
|
||||
// mapValues
|
||||
|
||||
async.mapValues<number, string>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3
|
||||
}, function(val: number, key: string, next: AsyncResultCallback<string>): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.mapValues: ${key} = ${val}`);
|
||||
|
||||
next(null, val.toString());
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err: Error, results: string[]): void {
|
||||
|
||||
console.log("async.mapValues: done with results", results);
|
||||
|
||||
});
|
||||
|
||||
async.mapValuesSeries<number, string>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3
|
||||
}, function(val: number, key: string, next: AsyncResultCallback<string>): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.mapValuesSeries: ${key} = ${val}`);
|
||||
|
||||
next(null, val.toString());
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err: Error, results: string[]): void {
|
||||
|
||||
console.log("async.mapValuesSeries: done with results", results);
|
||||
|
||||
});
|
||||
|
||||
// filter/select/reject
|
||||
|
||||
async.filter<number>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3
|
||||
}, function(val: number, next: AsyncBooleanResultCallback): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.filter/select: ${val}`);
|
||||
|
||||
next(null, val % 2 === 0);
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err: Error, results: number[]): void {
|
||||
|
||||
console.log("async.filter/select: done with results", results);
|
||||
|
||||
});
|
||||
|
||||
async.reject<number>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3
|
||||
}, function(val: number, next: AsyncBooleanResultCallback): void {
|
||||
|
||||
setTimeout(function(): void {
|
||||
|
||||
console.log(`async.reject: ${val}`);
|
||||
|
||||
next(null, val % 2 === 0);
|
||||
|
||||
}, 500);
|
||||
|
||||
}, function(err: Error, results: number[]): void {
|
||||
|
||||
console.log("async.reject: done with results", results);
|
||||
|
||||
});
|
||||
|
||||
// concat
|
||||
|
||||
async.concat<string, string>({
|
||||
"a": "1",
|
||||
"b": "2",
|
||||
"c": "3"
|
||||
}, function(item: string, next: AsyncResultCallback<string[]>): void {
|
||||
|
||||
console.log(`async.concat: ${item}`);
|
||||
|
||||
next(null, [item, item, item]);
|
||||
|
||||
}, function(err: Error, results: string[]) {
|
||||
|
||||
console.log("async.concat: done with results", results);
|
||||
|
||||
});
|
||||
|
||||
// detect/find
|
||||
|
||||
async.detect<number>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3
|
||||
}, function(item: number, next: AsyncBooleanResultCallback): void {
|
||||
|
||||
console.log(`async.detect/find: ${item}`);
|
||||
|
||||
next(null, item > 1);
|
||||
|
||||
}, function(err: Error, result: number) {
|
||||
|
||||
if (err) {
|
||||
|
||||
console.log(err);
|
||||
|
||||
} else {
|
||||
|
||||
console.log("async.detect/find: done with result", result);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// every/all
|
||||
|
||||
async.every<number>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3
|
||||
}, function(item: number, next: AsyncBooleanResultCallback): void {
|
||||
|
||||
console.log(`async.every/all: ${item}`);
|
||||
|
||||
next(null, item > 0);
|
||||
|
||||
}, function(err: Error, result: boolean) {
|
||||
|
||||
console.log("async.every/all: done with result", result);
|
||||
|
||||
});
|
||||
|
||||
// some/any
|
||||
|
||||
async.some<number>({
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"c": 3
|
||||
}, function(item: number, next: AsyncBooleanResultCallback): void {
|
||||
|
||||
console.log(`async.some/any: ${item}`);
|
||||
|
||||
next(null, item > 2);
|
||||
|
||||
}, function(err: Error, result: boolean) {
|
||||
|
||||
console.log("async.some/any: done with result", result);
|
||||
|
||||
});
|
||||
|
||||
Vendored
+112
-52
@@ -1,11 +1,13 @@
|
||||
// Type definitions for Async 1.4.2
|
||||
// Type definitions for Async 2.0.1
|
||||
// Project: https://github.com/caolan/async
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Arseniy Maximov <https://github.com/kern0>, Joe Herman <https://github.com/Penryn>
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Arseniy Maximov <https://github.com/kern0>, Joe Herman <https://github.com/Penryn>, Angus Fenying <https://github.com/fenying>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Dictionary<T> { [key: string]: T; }
|
||||
|
||||
interface ErrorCallback { (err?: Error): void; }
|
||||
interface AsyncWaterfallCallback { (err: Error, ...args: any[]): void; }
|
||||
interface AsyncBooleanResultCallback { (err: Error, truthValue: boolean): void; }
|
||||
interface AsyncResultCallback<T> { (err: Error, result: T): void; }
|
||||
interface AsyncResultArrayCallback<T> { (err: Error, results: T[]): void; }
|
||||
interface AsyncResultObjectCallback<T> { (err: Error, results: Dictionary<T>): void; }
|
||||
@@ -15,7 +17,7 @@ interface AsyncIterator<T> { (item: T, callback: ErrorCallback): void; }
|
||||
interface AsyncForEachOfIterator<T> { (item: T, key: number|string, callback: ErrorCallback): void; }
|
||||
interface AsyncResultIterator<T, R> { (item: T, callback: AsyncResultCallback<R>): void; }
|
||||
interface AsyncMemoIterator<T, R> { (memo: R, item: T, callback: AsyncResultCallback<R>): void; }
|
||||
interface AsyncBooleanIterator<T> { (item: T, callback: (err: string, truthValue: boolean) => void): void; }
|
||||
interface AsyncBooleanIterator<T> { (item: T, callback: AsyncBooleanResultCallback): void; }
|
||||
|
||||
interface AsyncWorker<T> { (task: T, callback: ErrorCallback): void; }
|
||||
interface AsyncVoidFunction { (callback: ErrorCallback): void; }
|
||||
@@ -37,6 +39,13 @@ interface AsyncQueue<T> {
|
||||
pause(): void
|
||||
resume(): void;
|
||||
kill(): void;
|
||||
workersList(): {
|
||||
data: T,
|
||||
callback: Function
|
||||
}[];
|
||||
error(error: Error, data: any): void;
|
||||
unsaturated(): void;
|
||||
buffer: number;
|
||||
}
|
||||
|
||||
interface AsyncPriorityQueue<T> {
|
||||
@@ -54,6 +63,14 @@ interface AsyncPriorityQueue<T> {
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
kill(): void;
|
||||
workersList(): {
|
||||
data: T,
|
||||
priority: number,
|
||||
callback: Function
|
||||
}[];
|
||||
error(error: Error, data: any): void;
|
||||
unsaturated(): void;
|
||||
buffer: number;
|
||||
}
|
||||
|
||||
interface AsyncCargo {
|
||||
@@ -74,43 +91,74 @@ interface Async {
|
||||
|
||||
// Collections
|
||||
each<T>(arr: T[], iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
|
||||
eachSeries<T>(arr: T[], iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
|
||||
each<T>(arr: Dictionary<T>, iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
|
||||
eachSeries: typeof async.each;
|
||||
eachLimit<T>(arr: T[], limit: number, iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
|
||||
forEachOf(obj: any, iterator: (item: any, key: string|number, callback?: ErrorCallback) => void, callback: ErrorCallback): void;
|
||||
eachLimit<T>(arr: Dictionary<T>, limit: number, iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
|
||||
forEach: typeof async.each;
|
||||
forEachSeries: typeof async.each;
|
||||
forEachLimit: typeof async.eachLimit;
|
||||
forEachOf<T>(obj: T[], iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
|
||||
forEachOfSeries(obj: any, iterator: (item: any, key: string|number, callback?: ErrorCallback) => void, callback: ErrorCallback): void;
|
||||
forEachOfSeries<T>(obj: T[], iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
|
||||
forEachOfLimit(obj: any, limit: number, iterator: (item: any, key: string|number, callback?: ErrorCallback) => void, callback: ErrorCallback): void;
|
||||
forEachOf<T>(obj: Dictionary<T>, iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
|
||||
forEachOfSeries: typeof async.forEachOf;
|
||||
forEachOfLimit<T>(obj: T[], limit: number, iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
|
||||
map<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
|
||||
mapSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
|
||||
mapLimit<T, R>(arr: T[], limit: number, iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
|
||||
filter<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): any;
|
||||
select<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): any;
|
||||
filterSeries<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): any;
|
||||
selectSeries<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): any;
|
||||
filterLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): any;
|
||||
selectLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): any;
|
||||
reject<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): any;
|
||||
rejectSeries<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): any;
|
||||
rejectLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): any;
|
||||
reduce<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
|
||||
inject<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
|
||||
foldl<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
|
||||
reduceRight<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
|
||||
foldr<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
|
||||
detect<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): any;
|
||||
detectSeries<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): any;
|
||||
detectLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): any;
|
||||
sortBy<T, V>(arr: T[], iterator: AsyncResultIterator<T, V>, callback?: AsyncResultArrayCallback<T>): any;
|
||||
some<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
|
||||
someLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
|
||||
any<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
|
||||
every<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
|
||||
everyLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
|
||||
all<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
|
||||
concat<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): any;
|
||||
concatSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): any;
|
||||
forEachOfLimit<T>(obj: Dictionary<T>, limit: number, iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
|
||||
eachOf: typeof async.forEachOf;
|
||||
eachOfSeries: typeof async.forEachOf;
|
||||
eachOfLimit: typeof async.forEachOfLimit;
|
||||
map<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): void;
|
||||
map<T, R>(arr: Dictionary<T>, iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): void;
|
||||
mapSeries: typeof async.map;
|
||||
mapLimit<T, R>(arr: T[], limit: number, iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): void;
|
||||
mapLimit<T, R>(arr: Dictionary<T>, limit: number, iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): void;
|
||||
mapValuesLimit<T, R>(obj: Dictionary<T>, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback<R>) => void, callback: AsyncResultCallback<R[]>): void;
|
||||
mapValues<T, R>(obj: Dictionary<T>, iteratee: (value: T, key: string, callback: AsyncResultCallback<R>) => void, callback: AsyncResultCallback<R[]>): void;
|
||||
mapValuesSeries: typeof async.mapValues;
|
||||
filter<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): void;
|
||||
filter<T>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): void;
|
||||
filterSeries: typeof async.filter;
|
||||
filterLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): void;
|
||||
filterLimit<T>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultArrayCallback<T>): void;
|
||||
select: typeof async.filter;
|
||||
selectSeries: typeof async.filter;
|
||||
selectLimit: typeof async.filterLimit;
|
||||
reject: typeof async.filter;
|
||||
rejectSeries: typeof async.filter;
|
||||
rejectLimit: typeof async.filterLimit;
|
||||
reduce<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): void;
|
||||
inject: typeof async.reduce;
|
||||
foldl: typeof async.reduce;
|
||||
reduceRight: typeof async.reduce;
|
||||
foldr: typeof async.reduce;
|
||||
detect<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): void;
|
||||
detect<T>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): void;
|
||||
detectSeries: typeof async.detect;
|
||||
detectLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): void;
|
||||
detectLimit<T>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncResultCallback<T>): void;
|
||||
find: typeof async.detect;
|
||||
findSeries: typeof async.detect;
|
||||
findLimit: typeof async.detectLimit;
|
||||
sortBy<T, V>(arr: T[], iterator: AsyncResultIterator<T, V>, callback?: AsyncResultArrayCallback<T>): void;
|
||||
some<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
|
||||
some<T>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
|
||||
someSeries: typeof async.some;
|
||||
someLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
|
||||
someLimit<T>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
|
||||
any: typeof async.some;
|
||||
anySeries: typeof async.someSeries;
|
||||
anyLimit: typeof async.someLimit;
|
||||
every<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
|
||||
every<T>(arr: Dictionary<T>, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
|
||||
everySeries: typeof async.every;
|
||||
everyLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
|
||||
everyLimit<T>(arr: Dictionary<T>, limit: number, iterator: AsyncBooleanIterator<T>, callback?: AsyncBooleanResultCallback): void;
|
||||
all: typeof async.every;
|
||||
allSeries: typeof async.every;
|
||||
allLimit: typeof async.everyLimit;
|
||||
|
||||
concat<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): void;
|
||||
concat<T, R>(arr: Dictionary<T>, iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): void;
|
||||
concatSeries: typeof async.concat;
|
||||
|
||||
// Control Flow
|
||||
series<T>(tasks: AsyncFunction<T>[], callback?: AsyncResultArrayCallback<T>): void;
|
||||
@@ -119,14 +167,14 @@ interface Async {
|
||||
parallel<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
|
||||
parallelLimit<T>(tasks: Array<AsyncFunction<T>>, limit: number, callback?: AsyncResultArrayCallback<T>): void;
|
||||
parallelLimit<T>(tasks: Dictionary<AsyncFunction<T>>, limit: number, callback?: AsyncResultObjectCallback<T>): void;
|
||||
whilst(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
|
||||
doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
|
||||
until(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
|
||||
doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
|
||||
during(test: (testCallback : (error: Error, truth: boolean) => void) => void, fn: AsyncVoidFunction, callback: (err: any) => void): void;
|
||||
doDuring(fn: AsyncVoidFunction, test: (testCallback: (error: Error, truth: boolean) => void) => void, callback: (err: any) => void): void;
|
||||
forever(next: (errCallback : (err: Error) => void) => void, errBack: (err: Error) => void) : void;
|
||||
waterfall(tasks: Function[], callback?: (err: Error, results?: any) => void): void;
|
||||
whilst(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void;
|
||||
doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void;
|
||||
until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void;
|
||||
doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void;
|
||||
during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void;
|
||||
doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void;
|
||||
forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void;
|
||||
waterfall<T>(tasks: Function[], callback?: AsyncResultCallback<T>): void;
|
||||
compose(...fns: Function[]): Function;
|
||||
seq(...fns: Function[]): Function;
|
||||
applyEach(fns: Function[], argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
|
||||
@@ -134,18 +182,31 @@ interface Async {
|
||||
queue<T>(worker: AsyncWorker<T>, concurrency?: number): AsyncQueue<T>;
|
||||
priorityQueue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncPriorityQueue<T>;
|
||||
cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo;
|
||||
auto(tasks: any, callback?: (error: Error, results: any) => void): void;
|
||||
retry<T>(opts: number, task: (callback : AsyncResultCallback<T>, results: any) => void, callback: (error: Error, results: any) => void): void;
|
||||
retry<T>(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback<T>, results : any) => void, callback: (error: Error, results: any) => void): void;
|
||||
iterator(tasks: Function[]): Function;
|
||||
auto(tasks: any, concurrency?: number, callback?: AsyncResultCallback<any>): void;
|
||||
autoInject(tasks: any, callback?: AsyncResultCallback<any>): void;
|
||||
retry<T>(opts: number, task: (callback : AsyncResultCallback<T>, results: any) => void, callback: AsyncResultCallback<any>): void;
|
||||
retry<T>(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback<T>, results : any) => void, callback: AsyncResultCallback<any>): void;
|
||||
retryable<T>(opts: number | {times: number, interval: number}, task: AsyncFunction<T>): AsyncFunction<T>;
|
||||
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
|
||||
nextTick(callback: Function): void;
|
||||
setImmediate(callback: Function): void;
|
||||
nextTick(callback: Function, ...args: any[]): void;
|
||||
setImmediate: typeof async.nextTick;
|
||||
|
||||
reflect<T>(fn: AsyncFunction<T>) : (callback: (err: void, result: {error?: Error, value?: T}) => void) => void;
|
||||
reflectAll<T>(tasks: AsyncFunction<T>[]): ((callback: (err: void, result: {error?: Error, value?: T}) => void) => void)[];
|
||||
|
||||
timeout<T>(fn: AsyncFunction<T>, milliseconds: number, info: any): AsyncFunction<T>;
|
||||
|
||||
times<T> (n: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
|
||||
timesSeries<T>(n: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
|
||||
timesLimit<T>(n: number, limit: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
|
||||
|
||||
transform<T, R>(arr: T[], iteratee: (acc: R[], item: T, key: string, callback: (error?: Error) => void) => void): void;
|
||||
transform<T, R>(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: string, callback: (error?: Error) => void) => void): void;
|
||||
transform<T, R>(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: Error) => void) => void): void;
|
||||
transform<T, R>(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: Error) => void) => void): void;
|
||||
|
||||
race<T>(tasks: (AsyncFunction<T>)[], callback: AsyncResultCallback<T>) : void;
|
||||
|
||||
// Utils
|
||||
memoize(fn: Function, hasher?: Function): Function;
|
||||
unmemoize(fn: Function): Function;
|
||||
@@ -155,7 +216,6 @@ interface Async {
|
||||
wrapSync(fn: Function): Function;
|
||||
log(fn: Function, ...arguments: any[]): void;
|
||||
dir(fn: Function, ...arguments: any[]): void;
|
||||
noConflict(): Async;
|
||||
}
|
||||
|
||||
declare var async: Async;
|
||||
|
||||
Vendored
+6
@@ -946,9 +946,14 @@ declare namespace AtomCore {
|
||||
registry: any;
|
||||
repository: Object;
|
||||
scopeName: string;
|
||||
tokenizeLines: (text: string) => any;
|
||||
// TBD
|
||||
|
||||
}
|
||||
|
||||
interface IGrammars {
|
||||
grammarForScopeName(scope: string): IGrammar;
|
||||
}
|
||||
|
||||
interface IPane /* extends Theorist.Model */ {
|
||||
itemForURI: (uri:string)=>IEditor;
|
||||
@@ -1302,6 +1307,7 @@ declare namespace AtomCore {
|
||||
deserializers:IDeserializerManager;
|
||||
config: IConfig;
|
||||
commands: ICommandRegistry;
|
||||
grammars: IGrammars;
|
||||
keymaps: IKeymapManager;
|
||||
keymap: IKeymapManager;
|
||||
packages: IPackageManager;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/// <reference path="auth0-js.d.ts" />
|
||||
|
||||
var auth0 = new Auth0({
|
||||
domain: 'mine.auth0.com',
|
||||
clientID: 'dsa7d77dsa7d7',
|
||||
callbackURL: 'http://my-app.com/callback',
|
||||
callbackOnLocationHash: true
|
||||
});
|
||||
|
||||
auth0.login({
|
||||
connection: 'google-oauth2',
|
||||
popup: true,
|
||||
popupOptions: {
|
||||
width: 450,
|
||||
height: 800
|
||||
}
|
||||
}, (err, profile, idToken, accessToken, state) => {
|
||||
if (err) {
|
||||
alert("something went wrong: " + err.message);
|
||||
return;
|
||||
}
|
||||
alert('hello ' + profile.name);
|
||||
});
|
||||
Vendored
+133
@@ -0,0 +1,133 @@
|
||||
// Type definitions for Auth0.js
|
||||
// Project: https://github.com/auth0/auth0.js
|
||||
// Definitions by: Robert McLaws <https://github.com/advancedrei>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** Extensions to the browser Window object. */
|
||||
interface Window {
|
||||
/** Allows you to pass the id_token to other APIs, as specified in https://docs.auth0.com/apps-apis */
|
||||
token: string;
|
||||
}
|
||||
|
||||
/** This is the interface for the main Auth0 client. */
|
||||
interface Auth0Static {
|
||||
|
||||
new(options: Auth0ClientOptions): Auth0Static;
|
||||
changePassword(options: any, callback?: Function): void;
|
||||
decodeJwt(jwt: string): any;
|
||||
login(options: any, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
|
||||
loginWithPopup(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
|
||||
loginWithResourceOwner(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: any) => any): void;
|
||||
loginWithUsernamePassword(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
|
||||
logout(query: string): void;
|
||||
getConnections(callback?: Function): void;
|
||||
refreshToken(refreshToken: string, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void;
|
||||
getDelegationToken(targetClientId: string, id_token: string, options: any, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void;
|
||||
getProfile(id_token: string, callback?: Function): Auth0UserProfile;
|
||||
getSSOData(withActiveDirectories: any, callback?: Function): void;
|
||||
parseHash(hash: string): Auth0DecodedHash;
|
||||
signup(options: Auth0SignupOptions, callback: Function): void;
|
||||
validateUser(options: any, callback: (error?: Auth0Error, valid?: any) => any): void;
|
||||
}
|
||||
|
||||
/** Represents constructor options for the Auth0 client. */
|
||||
interface Auth0ClientOptions {
|
||||
clientID: string;
|
||||
callbackURL: string;
|
||||
callbackOnLocationHash?: boolean;
|
||||
domain: string;
|
||||
forceJSONP?: boolean;
|
||||
}
|
||||
|
||||
/** Represents a normalized UserProfile. */
|
||||
interface Auth0UserProfile {
|
||||
email: string;
|
||||
email_verified: boolean;
|
||||
family_name: string;
|
||||
gender: string;
|
||||
given_name: string;
|
||||
locale: string;
|
||||
name: string;
|
||||
nickname: string;
|
||||
picture: string;
|
||||
user_id: string;
|
||||
/** Represents one or more Identities that may be associated with the User. */
|
||||
identities: Auth0Identity[];
|
||||
user_metadata?: any;
|
||||
app_metadata?: any;
|
||||
}
|
||||
|
||||
/** Represents an Auth0UserProfile that has a Microsoft Account as the primary identity. */
|
||||
interface MicrosoftUserProfile extends Auth0UserProfile {
|
||||
emails: string[];
|
||||
}
|
||||
|
||||
/** Represents an Auth0UserProfile that has an Office365 account as the primary identity. */
|
||||
interface Office365UserProfile extends Auth0UserProfile {
|
||||
tenantid: string;
|
||||
upn: string;
|
||||
}
|
||||
|
||||
/** Represents an Auth0UserProfile that has an Active Directory account as the primary identity. */
|
||||
interface AdfsUserProfile extends Auth0UserProfile {
|
||||
issuer: string;
|
||||
}
|
||||
|
||||
/** Represents multiple identities assigned to a user. */
|
||||
interface Auth0Identity {
|
||||
access_token: string;
|
||||
connection: string;
|
||||
isSocial: boolean;
|
||||
provider: string;
|
||||
user_id: string;
|
||||
}
|
||||
|
||||
interface Auth0DecodedHash {
|
||||
access_token: string;
|
||||
id_token: string;
|
||||
profile: Auth0UserProfile;
|
||||
state: any;
|
||||
}
|
||||
|
||||
interface Auth0PopupOptions {
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
interface Auth0LoginOptions {
|
||||
auto_login?: boolean;
|
||||
connection?: string;
|
||||
email?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
popup?: boolean;
|
||||
popupOptions?: Auth0PopupOptions;
|
||||
}
|
||||
|
||||
interface Auth0SignupOptions extends Auth0LoginOptions {
|
||||
auto_login: boolean;
|
||||
}
|
||||
|
||||
interface Auth0Error {
|
||||
code: any;
|
||||
details: any;
|
||||
name: string;
|
||||
message: string;
|
||||
status: any;
|
||||
}
|
||||
|
||||
/** Represents the response from an API Token Delegation request. */
|
||||
interface Auth0DelegationToken {
|
||||
/** The length of time in seconds the token is valid for. */
|
||||
expires_in: string;
|
||||
/** The JWT for delegated access. */
|
||||
id_token: string;
|
||||
/** The type of token being returned. Possible values: "Bearer" */
|
||||
token_type: string;
|
||||
}
|
||||
|
||||
declare var Auth0: Auth0Static;
|
||||
|
||||
declare module "auth0-js" {
|
||||
export = Auth0
|
||||
}
|
||||
@@ -1,13 +1,165 @@
|
||||
/// <reference path="../auth0/auth0.d.ts" />
|
||||
/// <reference path="../auth0-js/auth0-js.d.ts" />
|
||||
/// <reference path="auth0.lock.d.ts" />
|
||||
|
||||
var lock: Auth0LockStatic = new Auth0Lock("dsa7d77dsa7d7", "mine.auth0.com");
|
||||
const CLIENT_ID = "YOUR_AUTH0_APP_CLIENTID";
|
||||
const DOMAIN = "YOUR_DOMAIN_AT.auth0.com";
|
||||
|
||||
lock.showSignin({
|
||||
connections: ["facebook", "google-oauth2", "twitter", "Username-Password-Authentication"],
|
||||
icon: "https://contoso.com/logo-32.png",
|
||||
socialBigButtons: true
|
||||
},
|
||||
() => {
|
||||
// The Auth0 Widget is now loaded.
|
||||
var lock: Auth0LockStatic = new Auth0Lock(CLIENT_ID, DOMAIN);
|
||||
|
||||
lock.show();
|
||||
lock.hide();
|
||||
lock.logout(() => {});
|
||||
|
||||
// The examples below are lifted from auth0-lock documentation on Github
|
||||
|
||||
// "on" event-driven example
|
||||
|
||||
lock.on("authenticated", function(authResult : any) {
|
||||
lock.getProfile(authResult.idToken, function(error, profile) {
|
||||
if (error) {
|
||||
// Handle error
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem("idToken", authResult.idToken);
|
||||
localStorage.setItem("profile", JSON.stringify(profile));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// test theme
|
||||
|
||||
var themeOptions : Auth0LockConstructorOptions = {
|
||||
theme: {
|
||||
logo: "https://example.com/assets/logo.png",
|
||||
primaryColor: "green"
|
||||
}
|
||||
};
|
||||
|
||||
new Auth0Lock(CLIENT_ID, DOMAIN, themeOptions);
|
||||
|
||||
// test authentication
|
||||
|
||||
var authOptions : Auth0LockConstructorOptions = {
|
||||
auth: {
|
||||
params: { state: "foo" },
|
||||
redirect: true,
|
||||
redirectUrl: "some url",
|
||||
responseType: "token",
|
||||
sso: true
|
||||
}
|
||||
};
|
||||
|
||||
new Auth0Lock(CLIENT_ID, DOMAIN, authOptions);
|
||||
|
||||
// test multi-variant example
|
||||
|
||||
var multiVariantOptions : Auth0LockConstructorOptions = {
|
||||
container: "myContainer",
|
||||
closable: false,
|
||||
languageDictionary: {
|
||||
signUpTerms: "I agree to the <a href='/terms' target='_new'>terms of service</a> ...",
|
||||
title: "My Company",
|
||||
},
|
||||
autofocus: false
|
||||
};
|
||||
|
||||
new Auth0Lock(CLIENT_ID, DOMAIN, multiVariantOptions);
|
||||
|
||||
// test text-field additional sign up field
|
||||
|
||||
var textFieldOptions : Auth0LockConstructorOptions = {
|
||||
additionalSignUpFields: [{
|
||||
name: "address",
|
||||
placeholder: "enter your address",
|
||||
// The following properties are optional
|
||||
icon: "https://example.com/assests/address_icon.png",
|
||||
prefill: "street 123",
|
||||
validator: function(input : string) {
|
||||
return {
|
||||
valid: input.length >= 10,
|
||||
hint: "Must have 10 or more chars" // optional
|
||||
};
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
new Auth0Lock(CLIENT_ID, DOMAIN, textFieldOptions);
|
||||
|
||||
// test select-field additional sign up field
|
||||
|
||||
var selectFieldOptions : Auth0LockConstructorOptions = {
|
||||
additionalSignUpFields: [{
|
||||
type: "select",
|
||||
name: "location",
|
||||
placeholder: "choose your location",
|
||||
options: [
|
||||
{value: "us", label: "United States"},
|
||||
{value: "fr", label: "France"},
|
||||
{value: "ar", label: "Argentina"}
|
||||
],
|
||||
// The following properties are optional
|
||||
icon: "https://example.com/assests/location_icon.png",
|
||||
prefill: "us"
|
||||
}]
|
||||
};
|
||||
|
||||
new Auth0Lock(CLIENT_ID, DOMAIN, selectFieldOptions);
|
||||
|
||||
// test select-field additional sign up field with callbacks for
|
||||
|
||||
var selectFieldOptionsWithCallbacks : Auth0LockConstructorOptions = {
|
||||
additionalSignUpFields: [{
|
||||
type: "select",
|
||||
name: "location",
|
||||
placeholder: "choose your location",
|
||||
options: function(cb) {
|
||||
// obtain options, in case of error you call cb with the error in the
|
||||
// first arg instead of null
|
||||
|
||||
let options = [
|
||||
{value: "us", label: "United States"},
|
||||
{value: "fr", label: "France"},
|
||||
{value: "ar", label: "Argentina"}
|
||||
];
|
||||
|
||||
cb(null, options);
|
||||
},
|
||||
icon: "https://example.com/assests/location_icon.png",
|
||||
prefill: function(cb) {
|
||||
// obtain prefill, in case of error you call cb with the error in the
|
||||
// first arg instead of null
|
||||
|
||||
let prefill = "us";
|
||||
|
||||
cb(null, prefill);
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
new Auth0Lock(CLIENT_ID, DOMAIN, selectFieldOptionsWithCallbacks);
|
||||
|
||||
// test Avatar options
|
||||
|
||||
var avatarOptions : Auth0LockConstructorOptions = {
|
||||
avatar: {
|
||||
url: (email : string, cb : Auth0LockAvatarUrlCallback) => {
|
||||
// obtain url for email, in case of error you call cb with the error in
|
||||
// the first arg instead of null
|
||||
|
||||
let url = "url";
|
||||
|
||||
cb(null, url);
|
||||
},
|
||||
displayName: (email : string, cb : Auth0LockAvatarDisplayNameCallback) => {
|
||||
// obtain displayName for email, in case of error you call cb with the
|
||||
// error in the first arg instead of null
|
||||
|
||||
let displayName = "displayName";
|
||||
|
||||
cb(null, displayName);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new Auth0Lock(CLIENT_ID, DOMAIN, avatarOptions);
|
||||
|
||||
Vendored
+99
-56
@@ -1,9 +1,69 @@
|
||||
// Type definitions for Auth0Widget.js
|
||||
// Type definitions for auth0-lock v10.0.1
|
||||
// Project: http://auth0.com
|
||||
// Definitions by: Robert McLaws <https://github.com/advancedrei>
|
||||
// Definitions by: Brian Caruso <https://github.com/carusology>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../auth0/auth0.d.ts" />
|
||||
/// <reference path="../auth0-js/auth0-js.d.ts" />
|
||||
|
||||
interface Auth0LockAdditionalSignUpFieldOption {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
type Auth0LockAdditionalSignUpFieldOptionsCallback =
|
||||
(error: Auth0Error, options: Auth0LockAdditionalSignUpFieldOption[]) => void;
|
||||
|
||||
type Auth0LockAdditionalSignUpFieldOptionsFunction =
|
||||
(callback: Auth0LockAdditionalSignUpFieldOptionsCallback) => void;
|
||||
|
||||
type Auth0LockAdditionalSignUpFieldPrefillCallback =
|
||||
(error: Auth0Error, prefill: string) => void;
|
||||
|
||||
type Auth0LockAdditionalSignUpFieldPrefillFunction =
|
||||
(callback: Auth0LockAdditionalSignUpFieldPrefillCallback) => void;
|
||||
|
||||
interface Auth0LockAdditionalSignUpField {
|
||||
icon?: string;
|
||||
name: string;
|
||||
options?: Auth0LockAdditionalSignUpFieldOption[] | Auth0LockAdditionalSignUpFieldOptionsFunction;
|
||||
placeholder: string;
|
||||
prefill?: string | Auth0LockAdditionalSignUpFieldPrefillFunction;
|
||||
type?: "select" | "text";
|
||||
validator?: (input: string) => { valid: boolean; hint?: string };
|
||||
}
|
||||
|
||||
type Auth0LockAvatarUrlCallback = (error: Auth0Error, url: string) => void;
|
||||
type Auth0LockAvatarDisplayNameCallback = (error: Auth0Error, displayName: string) => void;
|
||||
|
||||
interface Auth0LockAvatarOptions {
|
||||
url: (email: string, callback: Auth0LockAvatarUrlCallback) => void;
|
||||
displayName: (email: string, callback: Auth0LockAvatarDisplayNameCallback) => void;
|
||||
}
|
||||
|
||||
interface Auth0LockThemeOptions {
|
||||
logo?: string;
|
||||
primaryColor?: string;
|
||||
}
|
||||
|
||||
// https://auth0.com/docs/libraries/lock/v10/sending-authentication-parameters
|
||||
interface Auth0LockAuthParamsOptions {
|
||||
access_token?: any;
|
||||
connection_scopes?: any;
|
||||
device?: any;
|
||||
nonce?: any;
|
||||
protocol?: any;
|
||||
request_id?: any;
|
||||
scope?: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
interface Auth0LockAuthOptions {
|
||||
params?: Auth0LockAuthParamsOptions;
|
||||
redirect?: boolean;
|
||||
redirectUrl?: string;
|
||||
responseType?: string;
|
||||
sso?: boolean;
|
||||
}
|
||||
|
||||
interface Auth0LockPopupOptions {
|
||||
width: number;
|
||||
@@ -12,68 +72,51 @@ interface Auth0LockPopupOptions {
|
||||
top: number;
|
||||
}
|
||||
|
||||
interface Auth0LockOptions {
|
||||
authParams?: any;
|
||||
callbackURL?: string;
|
||||
connections?: string[];
|
||||
container?: string;
|
||||
closable?: boolean;
|
||||
dict?: any;
|
||||
defaultUserPasswordConnection?: string;
|
||||
defaultADUsernameFromEmailPrefix?: boolean;
|
||||
disableResetAction?: boolean;
|
||||
disableSignupAction?: boolean;
|
||||
focusInput?: boolean;
|
||||
forceJSONP?: boolean;
|
||||
gravatar?: boolean;
|
||||
integratedWindowsLogin?: boolean;
|
||||
icon?: string;
|
||||
loginAfterSignup?: boolean;
|
||||
popup?: boolean;
|
||||
popupOptions?: Auth0LockPopupOptions;
|
||||
rememberLastLogin?: boolean;
|
||||
resetLink?: string;
|
||||
responseType?: string;
|
||||
signupLink?: string;
|
||||
socialBigButtons?: boolean;
|
||||
sso?: boolean;
|
||||
theme?: string;
|
||||
usernameStyle?: any;
|
||||
}
|
||||
|
||||
interface Auth0LockConstructorOptions {
|
||||
cdn?: string;
|
||||
additionalSignUpFields?: Auth0LockAdditionalSignUpField[];
|
||||
allowedConnections?: string[];
|
||||
allowForgotPassword?: boolean;
|
||||
allowLogin?: boolean;
|
||||
allowSignUp?: boolean;
|
||||
assetsUrl?: string;
|
||||
useCordovaSocialPlugins?: boolean;
|
||||
auth?: Auth0LockAuthOptions;
|
||||
autoclose?: boolean;
|
||||
autofocus?: boolean;
|
||||
avatar?: Auth0LockAvatarOptions;
|
||||
closable?: boolean;
|
||||
container?: string;
|
||||
defaultADUsernameFromEmailPrefix?: string;
|
||||
defaultDatabaseConnection?: string;
|
||||
defaultEnterpriseConnection?: string;
|
||||
forgotPasswordLink?: string;
|
||||
initialScreen?: "login" | "signUp" | "forgotPassword";
|
||||
language?: string;
|
||||
languageDictionary?: any;
|
||||
loginAfterSignUp?: boolean;
|
||||
mustAcceptTerms?: boolean;
|
||||
popupOptions?: Auth0LockPopupOptions;
|
||||
prefill?: { email?: string, username?: string};
|
||||
rememberLastLogin?: boolean;
|
||||
signupLink?: string;
|
||||
socialButtonStyle?: "big" | "small";
|
||||
theme?: Auth0LockThemeOptions;
|
||||
usernameStyle?: string;
|
||||
}
|
||||
|
||||
interface Auth0LockStatic {
|
||||
new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic;
|
||||
getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void;
|
||||
|
||||
show(): void;
|
||||
show(options: Auth0LockOptions): void;
|
||||
show(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void;
|
||||
show(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void;
|
||||
hide(): void;
|
||||
logout(query: any): void;
|
||||
|
||||
showSignin(): void;
|
||||
showSignin(options: Auth0LockOptions): void;
|
||||
showSignin(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void;
|
||||
showSignin(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void;
|
||||
|
||||
showSignup(): void;
|
||||
showSignup(options: Auth0LockOptions): void;
|
||||
showSignup(callback: (error?: Auth0Error) => void) : void;
|
||||
showSignup(options: Auth0LockOptions, callback: (error?: Auth0Error) => void) : void;
|
||||
|
||||
showReset(): void;
|
||||
showReset(options: Auth0LockOptions): void;
|
||||
showReset(callback: (error?: Auth0Error) => void) : void;
|
||||
showReset(options: Auth0LockOptions, callback: (error?: Auth0Error) => void) : void;
|
||||
|
||||
hide(callback: () => void): void;
|
||||
logout(callback: () => void): void;
|
||||
|
||||
getClient(): Auth0Static;
|
||||
on(event: "show", callback: () => void) : void;
|
||||
on(event: "hide", callback: () => void) : void;
|
||||
on(event: "unrecoverable_error", callback: (error: Auth0Error) => void) : void;
|
||||
on(event: "authorization_error", callback: (error: Auth0Error) => void) : void;
|
||||
on(event: "authenticated", callback: (authResult: any) => void) : void;
|
||||
on(event: string, callback: (...args: any[]) => void) : void;
|
||||
}
|
||||
|
||||
declare var Auth0Lock: Auth0LockStatic;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference path="../auth0/auth0.d.ts" />
|
||||
/// <reference path="../auth0-js/auth0-js.d.ts" />
|
||||
/// <reference path="auth0.widget.d.ts" />
|
||||
|
||||
var widget: Auth0WidgetStatic = new Auth0Widget({
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Robert McLaws <https://github.com/advancedrei>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../auth0/auth0.d.ts" />
|
||||
/// <reference path="../auth0-js/auth0-js.d.ts" />
|
||||
|
||||
|
||||
interface Auth0WidgetStatic {
|
||||
|
||||
+48
-20
@@ -1,23 +1,51 @@
|
||||
/// <reference path="../auth0/auth0.d.ts" />
|
||||
/// <reference path="auth0.d.ts" />
|
||||
|
||||
var auth0 = new Auth0({
|
||||
domain: 'mine.auth0.com',
|
||||
clientID: 'dsa7d77dsa7d7',
|
||||
callbackURL: 'http://my-app.com/callback',
|
||||
callbackOnLocationHash: true
|
||||
import * as auth0 from 'auth0';
|
||||
|
||||
const management = new auth0.ManagementClient({
|
||||
token: '{YOUR_API_V2_TOKEN}',
|
||||
domain: '{YOUR_ACCOUNT}.auth0.com'
|
||||
});
|
||||
|
||||
auth0.login({
|
||||
connection: 'google-oauth2',
|
||||
popup: true,
|
||||
popupOptions: {
|
||||
width: 450,
|
||||
height: 800
|
||||
}
|
||||
}, (err, profile, idToken, accessToken, state) => {
|
||||
if (err) {
|
||||
alert("something went wrong: " + err.message);
|
||||
return;
|
||||
}
|
||||
alert('hello ' + profile.name);
|
||||
});
|
||||
const auth = new auth0.AuthenticationClient({
|
||||
domain: '{YOUR_ACCOUNT}.auth0.com',
|
||||
clientId: '{OPTIONAL_CLIENT_ID}'
|
||||
});
|
||||
|
||||
// Using a callback.
|
||||
management.getUsers((err: Error, users: auth0.User[]) => {
|
||||
if (err) {
|
||||
// Handle error.
|
||||
}
|
||||
console.log(users);
|
||||
});
|
||||
|
||||
// Using a Promise.
|
||||
management
|
||||
.getUsers()
|
||||
.then((users) => {
|
||||
console.log(users);
|
||||
})
|
||||
.catch((err) => {
|
||||
// Handle the error.
|
||||
});
|
||||
|
||||
management
|
||||
.createUser({
|
||||
connection: 'My-Connection',
|
||||
email: 'hi@me.co',
|
||||
}).then((user) => {
|
||||
console.log(user);
|
||||
}).catch((err) => {
|
||||
// Handle the error.
|
||||
});
|
||||
|
||||
auth
|
||||
.requestChangePasswordEmail({
|
||||
connection: 'My-Connection',
|
||||
email: 'hi@me.co',
|
||||
}).then((response) => {
|
||||
console.log(response);
|
||||
}).catch((err) => {
|
||||
// Handle the error.
|
||||
});
|
||||
|
||||
Vendored
+81
-117
@@ -1,131 +1,95 @@
|
||||
// Type definitions for Auth0.js
|
||||
// Project: http://auth0.com
|
||||
// Definitions by: Robert McLaws <https://github.com/advancedrei>
|
||||
// Type definitions for auth0 v2.3.1
|
||||
// Project: https://github.com/auth0/node-auth0
|
||||
// Definitions by: Seth Westphal <https://github.com/westy92>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** Extensions to the browser Window object. */
|
||||
interface Window {
|
||||
/** Allows you to pass the id_token to other APIs, as specified in https://docs.auth0.com/apps-apis */
|
||||
/// <reference path="../bluebird/bluebird.d.ts" />
|
||||
|
||||
declare module "auth0" {
|
||||
|
||||
import * as Promise from 'bluebird';
|
||||
|
||||
export interface ManagementClientOptions {
|
||||
token: string;
|
||||
}
|
||||
domain?: string;
|
||||
}
|
||||
|
||||
/** This is the interface for the main Auth0 client. */
|
||||
interface Auth0Static {
|
||||
|
||||
new(options: Auth0ClientOptions): Auth0Static;
|
||||
changePassword(options: any, callback?: Function): void;
|
||||
decodeJwt(jwt: string): any;
|
||||
login(options: any, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
|
||||
loginWithPopup(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
|
||||
loginWithResourceOwner(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: any) => any): void;
|
||||
loginWithUsernamePassword(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
|
||||
logout(query: string): void;
|
||||
getConnections(callback?: Function): void;
|
||||
getDelegationToken(targetClientId: string, id_token: string, options: any, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void;
|
||||
getProfile(id_token: string, callback?: Function): Auth0UserProfile;
|
||||
getSSOData(withActiveDirectories: any, callback?: Function): void;
|
||||
parseHash(hash: string): Auth0DecodedHash;
|
||||
signup(options: Auth0SignupOptions, callback: Function): void;
|
||||
validateUser(options: any, callback: (error?: Auth0Error, valid?: any) => any): void;
|
||||
}
|
||||
|
||||
/** Represents constructor options for the Auth0 client. */
|
||||
interface Auth0ClientOptions {
|
||||
clientID: string;
|
||||
callbackURL: string;
|
||||
callbackOnLocationHash?: boolean;
|
||||
domain: string;
|
||||
forceJSONP?: boolean;
|
||||
}
|
||||
|
||||
/** Represents a normalized UserProfile. */
|
||||
interface Auth0UserProfile {
|
||||
email: string;
|
||||
family_name: string;
|
||||
gender: string;
|
||||
given_name: string;
|
||||
locale: string;
|
||||
name: string;
|
||||
nickname: string;
|
||||
picture: string;
|
||||
user_id: string;
|
||||
/** Represents one or more Identities that may be associated with the User. */
|
||||
identities: Auth0Identity[];
|
||||
user_metadata?: any;
|
||||
app_metadata?: any;
|
||||
}
|
||||
|
||||
/** Represents an Auth0UserProfile that has a Microsoft Account as the primary identity. */
|
||||
interface MicrosoftUserProfile extends Auth0UserProfile {
|
||||
emails: string[];
|
||||
}
|
||||
|
||||
/** Represents an Auth0UserProfile that has an Office365 account as the primary identity. */
|
||||
interface Office365UserProfile extends Auth0UserProfile {
|
||||
tenantid: string;
|
||||
upn: string;
|
||||
}
|
||||
|
||||
/** Represents an Auth0UserProfile that has an Active Directory account as the primary identity. */
|
||||
interface AdfsUserProfile extends Auth0UserProfile {
|
||||
issuer: string;
|
||||
}
|
||||
|
||||
/** Represents multiple identities assigned to a user. */
|
||||
interface Auth0Identity {
|
||||
access_token: string;
|
||||
export interface UserData {
|
||||
connection: string;
|
||||
isSocial: boolean;
|
||||
provider: string;
|
||||
user_id: string;
|
||||
}
|
||||
|
||||
interface Auth0DecodedHash {
|
||||
access_token: string;
|
||||
id_token: string;
|
||||
profile: Auth0UserProfile;
|
||||
state: any;
|
||||
}
|
||||
|
||||
interface Auth0PopupOptions {
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
interface Auth0LoginOptions {
|
||||
auto_login?: boolean;
|
||||
connection?: string;
|
||||
email?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
popup?: boolean;
|
||||
popupOptions?: Auth0PopupOptions;
|
||||
}
|
||||
phone_number?: string;
|
||||
user_metadata?: {};
|
||||
email_verified?: boolean;
|
||||
app_metadata?: {};
|
||||
}
|
||||
|
||||
interface Auth0SignupOptions extends Auth0LoginOptions {
|
||||
auto_login: boolean;
|
||||
}
|
||||
export interface GetUsersData {
|
||||
per_page?: number;
|
||||
page?: number;
|
||||
include_totals?: boolean;
|
||||
sort?: string;
|
||||
connection?: string;
|
||||
fields?: string;
|
||||
include_fields?: boolean;
|
||||
q?: string;
|
||||
search_engine?: string;
|
||||
}
|
||||
|
||||
interface Auth0Error {
|
||||
code: any;
|
||||
details: any;
|
||||
name: string;
|
||||
message: string;
|
||||
status: any;
|
||||
}
|
||||
export interface User {
|
||||
email?: string;
|
||||
email_verified?: boolean;
|
||||
username?: string;
|
||||
phone_number?: string;
|
||||
phone_verified?: boolean;
|
||||
user_id?: string;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
identities?: Identity[];
|
||||
app_metadata?: {};
|
||||
user_metadata?: {};
|
||||
picture?: string;
|
||||
name?: string;
|
||||
nickname?: string;
|
||||
multifactor?: string[];
|
||||
last_ip?: string;
|
||||
last_login?: string;
|
||||
logins_count?: number;
|
||||
blocked?: boolean;
|
||||
}
|
||||
|
||||
/** Represents the response from an API Token Delegation request. */
|
||||
interface Auth0DelegationToken {
|
||||
/** The length of time in seconds the token is valid for. */
|
||||
expires_in: string;
|
||||
/** The JWT for delegated access. */
|
||||
id_token: string;
|
||||
/** The type of token being returned. Possible values: "Bearer" */
|
||||
token_type: string;
|
||||
}
|
||||
export interface Identity {
|
||||
connection: string;
|
||||
user_id: string;
|
||||
provider: string;
|
||||
isSocial: boolean;
|
||||
}
|
||||
|
||||
declare var Auth0: Auth0Static;
|
||||
export class ManagementClient {
|
||||
constructor(options: ManagementClientOptions);
|
||||
|
||||
getUsers(params?: GetUsersData): Promise<User[]>;
|
||||
getUsers(params?: GetUsersData, cb?: (err: Error, users: User[]) => void): void;
|
||||
createUser(data: UserData): Promise<User>;
|
||||
createUser(data: UserData, cb: (err: Error, data: User) => void): void;
|
||||
}
|
||||
|
||||
export interface AuthenticationClientOptions {
|
||||
clientId?: string;
|
||||
domain: string;
|
||||
}
|
||||
|
||||
export interface RequestChangePasswordEmailData {
|
||||
connection: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export class AuthenticationClient {
|
||||
constructor(options: AuthenticationClientOptions);
|
||||
|
||||
requestChangePasswordEmail(data: RequestChangePasswordEmailData): Promise<string>;
|
||||
requestChangePasswordEmail(data: RequestChangePasswordEmailData, cb: (err: Error, message: string) => void): void;
|
||||
}
|
||||
|
||||
declare module "auth0" {
|
||||
export = Auth0
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -211,7 +211,7 @@ declare namespace autobahn {
|
||||
retry_delay_jitter?: number;
|
||||
url?: string;
|
||||
protocols?: string[];
|
||||
onchallenge?: (session: Session, method: string, extra: any) => OnChallengeHandler;
|
||||
onchallenge?: OnChallengeHandler;
|
||||
realm?: string;
|
||||
authmethods?: string[];
|
||||
authid?: string;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/// <reference path="autobind-decorator.d.ts" />
|
||||
|
||||
import autobind = require('autobind-decorator');
|
||||
|
||||
class Test {
|
||||
public static what: string = 'static';
|
||||
|
||||
@autobind
|
||||
public static test(): void {
|
||||
console.log(this.what);
|
||||
}
|
||||
|
||||
public constructor(public what: string) {
|
||||
this.what = what;
|
||||
}
|
||||
|
||||
@autobind
|
||||
public test(): void {
|
||||
console.warn(this.what);
|
||||
}
|
||||
}
|
||||
|
||||
const tester: Test = new Test('bind');
|
||||
const { test } = tester;
|
||||
tester.test(); // warns 'bind'.
|
||||
test(); // warns 'bind'.
|
||||
Test.test(); // logs 'static'.
|
||||
|
||||
@autobind
|
||||
class Component {
|
||||
public constructor(private someMember: string) {
|
||||
this.someMember = someMember;
|
||||
}
|
||||
|
||||
public someMethod(): void {
|
||||
console.error(this.someMember);
|
||||
}
|
||||
}
|
||||
|
||||
const component: Component = new Component('React vs Angular2');
|
||||
const { someMethod } = component;
|
||||
component.someMethod(); // errors 'React vs Angular2'
|
||||
someMethod(); // errors 'React vs Angular2'
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// Type definitions for autobind-decorator v1.3.3
|
||||
// Project: https://github.com/andreypopp/autobind-decorator
|
||||
// Definitions by: Ivo Stratev <https://github.com/NoHomey/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'autobind-decorator' {
|
||||
function autobind<TFunction extends Function>(target: TFunction): TFunction | void;
|
||||
function autobind<T extends Function>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
|
||||
export = autobind;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--experimentalDecorators
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+559
@@ -0,0 +1,559 @@
|
||||
// Type definitions for automapper-ts
|
||||
// Project: https://github.com/loedeman/AutoMapper
|
||||
// Definitions by: Bert Loedeman <https://github.com/loedeman>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module AutoMapperJs {
|
||||
/**
|
||||
* AutoMapper implementation, for both creating maps and performing maps. Comparable usage and functionality to the original
|
||||
* .NET AutoMapper library is the pursuit of this implementation.
|
||||
*/
|
||||
class AutoMapper {
|
||||
/**
|
||||
* Initializes the mapper with the supplied configuration.
|
||||
* @param {(config: IConfiguration) => void} Configuration function to call.
|
||||
*/
|
||||
initialize(configFunction: (config: IConfiguration) => void): void;
|
||||
|
||||
/**
|
||||
* Create a createMap curry function which expects only a destination key.
|
||||
* @param {string} sourceKey The map source key.
|
||||
* @returns {(destinationKey: string) => ICreateMapFluentFunctions}
|
||||
*/
|
||||
createMap(sourceKey: string | (new() => any)): (destinationKey: string | (new() => any)) => ICreateMapFluentFunctions;
|
||||
|
||||
/**
|
||||
* Create a mapping profile.
|
||||
* @param {string} sourceKey The map source key.
|
||||
* @param {string} destinationKey The map destination key.
|
||||
* @returns {Core.ICreateMapFluentFunctions}
|
||||
*/
|
||||
createMap(sourceKey: string | (new() => any), destinationKey: string | (new() => any)): ICreateMapFluentFunctions;
|
||||
|
||||
/**
|
||||
* Create a map curry function which expects a destination key and a source object.
|
||||
* @param sourceKey Source key, for instance the source type name.
|
||||
* @returns {(destinationKey: string, sourceObject: any) => any}
|
||||
*/
|
||||
map(sourceKey: string | (new() => any)): (destinationKey: string | (new() => any), sourceObject: any) => any;
|
||||
|
||||
/**
|
||||
* Create a map curry function which expects only a source object.
|
||||
* @param sourceKey Source key, for instance the source type name.
|
||||
* @param destinationKey Destination key, for instance the destination type name.
|
||||
* @returns {(sourceObject: any) => any}
|
||||
*/
|
||||
map(sourceKey: string | (new() => any), destinationKey: string | (new() => any)): (sourceObject: any) => any;
|
||||
|
||||
/**
|
||||
* Execute a mapping from the source object to a new destination object with explicit mapping configuration and supplied mapping options (using createMap).
|
||||
* @param sourceKey Source key, for instance the source type name.
|
||||
* @param destinationKey Destination key, for instance the destination type name.
|
||||
* @param sourceObject The source object to map.
|
||||
* @returns {any} Destination object.
|
||||
*/
|
||||
map(sourceKey: string | (new() => any), destinationKey: string | (new() => any), sourceObject: any): any;
|
||||
|
||||
/**
|
||||
* Create a mapAsync curry function which expects a destination key, a source object and a callback function.
|
||||
* @param sourceKey Source key, for instance the source type name.
|
||||
* @returns {(destinationKey: string, sourceObject: any, callback: IMapCallback) => void}
|
||||
*/
|
||||
mapAsync(sourceKey: string | (new() => any)): (destinationKey: string | (new() => any), sourceObject: any, callback: IMapCallback) => void;
|
||||
|
||||
/**
|
||||
* Create a map curry function which expects only a source object and a callback function.
|
||||
* @param sourceKey Source key, for instance the source type name.
|
||||
* @param destinationKey Destination key, for instance the destination type name.
|
||||
* @param sourceObject The source object to map.
|
||||
* @returns {(callback: IMapCallback) => void}
|
||||
*/
|
||||
mapAsync(sourceKey: string | (new() => any), destinationKey: string | (new() => any), sourceObject: any): (callback: IMapCallback) => void;
|
||||
|
||||
/**
|
||||
* Create a map curry function which expects only a source object and a callback function.
|
||||
* @param sourceKey Source key, for instance the source type name.
|
||||
* @param destinationKey Destination key, for instance the destination type name.
|
||||
* @returns {(sourceObject: any, callback: IMapCallback) => void}
|
||||
*/
|
||||
mapAsync(sourceKey: string | (new() => any), destinationKey: string | (new() => any)): (sourceObject: any, callback: IMapCallback) => void;
|
||||
|
||||
/**
|
||||
* Execute an asynchronous mapping from the source object to a new destination object with explicit mapping configuration and supplied mapping options (using createMap).
|
||||
* @param sourceKey Source key, for instance the source type name.
|
||||
* @param destinationKey Destination key, for instance the destination type name.
|
||||
* @param sourceObject The source object to map.
|
||||
* @param {IMapCallback} callback The callback to call when asynchronous mapping is complete.
|
||||
*/
|
||||
mapAsync(sourceKey: string | (new() => any), destinationKey: string | (new() => any), sourceObject: any, callback: IMapCallback): void;
|
||||
|
||||
/**
|
||||
* Validates mapping configuration by dry-running. Since JS does not
|
||||
* fully support typing, it only checks if properties match on both
|
||||
* sides. The function needs IMapping.sourceTypeClass and
|
||||
* IMapping.destinationTypeClass to function.
|
||||
* @param {boolean} strictMode Whether or not to fail when properties
|
||||
* sourceTypeClass or destinationTypeClass
|
||||
* are unavailable.
|
||||
*/
|
||||
assertConfigurationIsValid(strictMode?: boolean): void;
|
||||
}
|
||||
|
||||
class AsyncAutoMapper {
|
||||
/* For Test Purposes Only */
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts source type to destination type instead of normal member mapping
|
||||
*/
|
||||
class TypeConverter implements ITypeConverter {
|
||||
/**
|
||||
* Performs conversion from source to destination type.
|
||||
* @param {IResolutionContext} resolutionContext Resolution context.
|
||||
* @returns {any} Destination object.
|
||||
*/
|
||||
convert(resolutionContext: IResolutionContext): any;
|
||||
}
|
||||
|
||||
export class Profile implements IProfile {
|
||||
/** Profile name */
|
||||
public profileName: string;
|
||||
|
||||
/** Naming convention for source members */
|
||||
public sourceMemberNamingConvention: INamingConvention;
|
||||
|
||||
/** Naming convention for destination members */
|
||||
public destinationMemberNamingConvention: INamingConvention;
|
||||
|
||||
/**
|
||||
* Create a createMap curry function which expects only a destination key.
|
||||
* @param {string} sourceKey The map source key.
|
||||
* @returns {(destinationKey: string) => ICreateMapFluentFunctions}
|
||||
*/
|
||||
protected createMap(sourceKey: string): (destinationKey: string) => ICreateMapFluentFunctions;
|
||||
|
||||
/**
|
||||
* Create a mapping profile.
|
||||
* @param {string} sourceKey The map source key.
|
||||
* @param {string} destinationKey The map destination key.
|
||||
* @returns {Core.ICreateMapFluentFunctions}
|
||||
*/
|
||||
protected createMap(sourceKey: string, destinationKey: string): ICreateMapFluentFunctions;
|
||||
|
||||
/**
|
||||
* Implement this method in a derived class and call the CreateMap method to associate that map with this profile.
|
||||
* Avoid calling the AutoMapper class / automapper instance from this method.
|
||||
*/
|
||||
public configure(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the PascalCase naming convention strategy.
|
||||
*/
|
||||
class PascalCaseNamingConvention implements INamingConvention {
|
||||
/** Regular expression on how to tokenize a member. */
|
||||
splittingExpression: RegExp;
|
||||
|
||||
/** Character to separate on. */
|
||||
separatorCharacter: string;
|
||||
|
||||
/**
|
||||
* Transformation function called when this convention is the destination naming convention.
|
||||
* @param {string[]} sourcePropertyNameParts Array containing tokenized source property name parts.
|
||||
* @returns {string} Destination property name
|
||||
*/
|
||||
transformPropertyName(sourcePropertyNameParts: string[]): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the camelCase naming convention strategy.
|
||||
*/
|
||||
class CamelCaseNamingConvention implements INamingConvention {
|
||||
/** Regular expression on how to tokenize a member. */
|
||||
splittingExpression: RegExp;
|
||||
|
||||
/** Character to separate on. */
|
||||
separatorCharacter: string;
|
||||
|
||||
/**
|
||||
* Transformation function called when this convention is the destination naming convention.
|
||||
* @param {string[]} sourcePropertyNameParts Array containing tokenized source property name parts.
|
||||
* @returns {string} Destination property name
|
||||
*/
|
||||
transformPropertyName(sourcePropertyNameParts: string[]): string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
interface IProperty {
|
||||
name: string;
|
||||
metadata: IPropertyMetadata;
|
||||
level: number;
|
||||
sourceMapping: boolean;
|
||||
ignore: boolean;
|
||||
async: boolean;
|
||||
children?: IProperty[];
|
||||
destinations?: IProperty[];
|
||||
conversionValuesAndFunctions: any[];
|
||||
conditionFunction?: (sourceObject: any) => boolean;
|
||||
}
|
||||
|
||||
interface IPropertyMetadata {
|
||||
mapping: IMapping;
|
||||
root: IProperty;
|
||||
parent: IProperty;
|
||||
destinations: {[name: string]: IPropertyDestinationMetadata};
|
||||
destinationCount: number;
|
||||
}
|
||||
|
||||
interface IPropertyDestinationMetadata {
|
||||
source: IProperty;
|
||||
destination: IProperty;
|
||||
}
|
||||
|
||||
interface IMemberMappingMetaData {
|
||||
destination: string;
|
||||
source: string;
|
||||
sourceMapping: boolean;
|
||||
ignore: boolean;
|
||||
async: boolean;
|
||||
condition: (sourceObject: any) => boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Member mapping properties.
|
||||
*/
|
||||
interface IForMemberMapping {
|
||||
/** The source member property name. */
|
||||
sourceProperty: string;
|
||||
/** The destination member property name parts for nested property support (e.g. 'type.name'). */
|
||||
destinationProperty: string;
|
||||
/** Source or destination mapping. */
|
||||
sourceMapping: boolean;
|
||||
/** All mapping values and/or functions resulting from stacked for(Source)Member calls. */
|
||||
mappingValuesAndFunctions: Array<any>;
|
||||
/** Whether or not this destination property must be ignored. */
|
||||
ignore: boolean;
|
||||
/** Whether or not this member mapping has an asynchronous mapping function. */
|
||||
async: boolean;
|
||||
/**
|
||||
* The object will only be mapped when the condition is met.
|
||||
* @param {any} sourceObject The source object to check.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
conditionFunction: (sourceObject: any) => boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for returning an object with available 'sub' functions to enable method chaining (e.g. automapper.createMap().forMember().forMember() ...)
|
||||
*/
|
||||
interface ICreateMapFluentFunctions {
|
||||
/**
|
||||
* Customize configuration for an individual destination member.
|
||||
* @param sourceProperty The destination member property name.
|
||||
* @param valueOrFunction The value or function to use for this individual member.
|
||||
* @returns {IAutoMapperCreateMapChainingFunctions}
|
||||
*/
|
||||
forMember: (sourceProperty: string, valueOrFunction: any |
|
||||
((opts: IMemberConfigurationOptions) => any) |
|
||||
((opts: IMemberConfigurationOptions, cb: IMemberCallback) => void)) => ICreateMapFluentFunctions;
|
||||
|
||||
/**
|
||||
* Customize configuration for an individual source member.
|
||||
* @param sourceProperty The source member property name.
|
||||
* @param sourceMemberConfigFunction The function to use for this individual member.
|
||||
* @returns {IAutoMapperCreateMapChainingFunctions}
|
||||
*/
|
||||
forSourceMember: (sourceProperty: string,
|
||||
sourceMemberConfigFunction: ((opts: ISourceMemberConfigurationOptions) => any) |
|
||||
((opts: ISourceMemberConfigurationOptions, cb: IMemberCallback) => void)
|
||||
) => ICreateMapFluentFunctions;
|
||||
|
||||
/**
|
||||
* Customize configuration for all destination members.
|
||||
* @param func The function to use for this individual member.
|
||||
* @returns {IAutoMapperCreateMapChainingFunctions}
|
||||
*/
|
||||
forAllMembers: (func: (destinationObject: any, destinationPropertyName: string, value: any) => void) => ICreateMapFluentFunctions;
|
||||
|
||||
/**
|
||||
* Ignore all members not specified explicitly.
|
||||
*/
|
||||
ignoreAllNonExisting: () => ICreateMapFluentFunctions;
|
||||
|
||||
/**
|
||||
* Skip normal member mapping and convert using a custom type converter (instantiated during mapping).
|
||||
* @param typeConverterClassOrFunction The converter class or function to use when converting.
|
||||
*/
|
||||
convertUsing: (typeConverterClassOrFunction: ((resolutionContext: IResolutionContext) => any) |
|
||||
((resolutionContext: IResolutionContext, callback: IMapCallback) => void) |
|
||||
ITypeConverter |
|
||||
(new() => ITypeConverter)
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* Specify to which class type AutoMapper should convert. When specified, AutoMapper will create an instance of the given type, instead of returning a new object literal.
|
||||
* @param typeClass The destination type class.
|
||||
* @returns {IAutoMapperCreateMapChainingFunctions}
|
||||
*/
|
||||
convertToType: (typeClass: new () => any) => ICreateMapFluentFunctions;
|
||||
|
||||
/**
|
||||
* Specify which profile should be used when mapping.
|
||||
* @param {string} profileName The profile name.
|
||||
* @returns {IAutoMapperCreateMapChainingFunctions}
|
||||
*/
|
||||
withProfile: (profileName: string) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The mapping configuration for the current mapping keys/types.
|
||||
*/
|
||||
interface IMapping {
|
||||
/** The mapping source key. */
|
||||
sourceKey: string;
|
||||
|
||||
/** The mapping destination key. */
|
||||
destinationKey: string;
|
||||
|
||||
/** The mappings for forAllMembers functions. */
|
||||
forAllMemberMappings: Array<(destinationObject: any, destinationPropertyName: string, value: any) => void>;
|
||||
|
||||
properties: IProperty[];
|
||||
|
||||
/**
|
||||
* Skip normal member mapping and convert using a type converter.
|
||||
* @param resolutionContext Context information regarding resolution of a destination value
|
||||
* @returns {any} Destination object.
|
||||
*/
|
||||
typeConverterFunction: ((resolutionContext: IResolutionContext) => any) |
|
||||
((resolutionContext: IResolutionContext, callback: IMapCallback) => void);
|
||||
|
||||
/** The source type class to convert from. */
|
||||
sourceTypeClass: any;
|
||||
|
||||
/** The destination type class to convert to. */
|
||||
destinationTypeClass: any;
|
||||
|
||||
/** The profile used when mapping. */
|
||||
profile?: IProfile;
|
||||
|
||||
/** Whether or not to ignore all properties not specified using createMap. */
|
||||
ignoreAllNonExisting?: boolean;
|
||||
|
||||
/** Whether or not an mapping has to be asynchronous. */
|
||||
async: boolean;
|
||||
|
||||
/*
|
||||
* PERFORMANCE ENHANCEMENTS
|
||||
*/
|
||||
|
||||
/**
|
||||
* Item mapping function to use.
|
||||
*/
|
||||
mapItemFunction: IMapItemFunction | IAsyncMapItemFunction;
|
||||
}
|
||||
|
||||
// export interface IMappingMapOptimized extends IMapping {
|
||||
// final: boolean;
|
||||
// forMemberMappingsArray: Array<IForMemberMapping>;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Context information regarding resolution of a destination value
|
||||
*/
|
||||
export interface IResolutionContext {
|
||||
/** Source value */
|
||||
sourceValue: any;
|
||||
|
||||
/** Destination value */
|
||||
destinationValue: any;
|
||||
|
||||
/** Source property name */
|
||||
sourcePropertyName?: string;
|
||||
|
||||
/** Destination property name */
|
||||
destinationPropertyName?: string;
|
||||
|
||||
/** Index of current collection mapping */
|
||||
arrayIndex?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration options for forMember mapping function.
|
||||
*/
|
||||
interface IMemberConfigurationOptions {
|
||||
/**
|
||||
* Map from a custom source property name.
|
||||
* @param sourcePropertyName The source property to map.
|
||||
*/
|
||||
mapFrom: (sourcePropertyName: string) => void;
|
||||
|
||||
/**
|
||||
* When this configuration function is used, the (destination) property is ignored
|
||||
* when mapping.
|
||||
*/
|
||||
ignore?: () => void;
|
||||
|
||||
/**
|
||||
* If specified, the property will only be mapped when the condition is fulfilled.
|
||||
*/
|
||||
condition: (predicate: ((sourceObject: any) => boolean)) => void;
|
||||
|
||||
/** The source object to map. */
|
||||
sourceObject: any;
|
||||
|
||||
/** The source property to map. */
|
||||
sourcePropertyName: string;
|
||||
|
||||
/**
|
||||
* The intermediate destination property value, used for stacking multiple for(Source)Member calls
|
||||
* while elaborating the intermediate result.
|
||||
*/
|
||||
intermediatePropertyValue: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration options for forSourceMember mapping function.
|
||||
*/
|
||||
interface ISourceMemberConfigurationOptions {
|
||||
/**
|
||||
* When this configuration function is used, the source property is ignored
|
||||
* when mapping.
|
||||
*/
|
||||
ignore: () => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Member callback interface
|
||||
*/
|
||||
interface IMemberCallback {
|
||||
/**
|
||||
* Callback function to call when the async operation is executed.
|
||||
* @param {any} callbackValue Callback value to be used as output for the for(Source)Member call.
|
||||
*/
|
||||
(callbackValue: any): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Member callback interface
|
||||
*/
|
||||
interface IMapCallback {
|
||||
/**
|
||||
* Callback function to call when the async operation is executed.
|
||||
* @param {any} result Callback value to be used as output for the mapAsync call.
|
||||
*/
|
||||
(result: any): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts source type to destination type instead of normal member mapping
|
||||
*/
|
||||
export interface ITypeConverter {
|
||||
/**
|
||||
* Performs conversion from source to destination type.
|
||||
* @param {IResolutionContext} resolutionContext Resolution context.
|
||||
* @returns {any} Destination object.
|
||||
*/
|
||||
convert: (resolutionContext: IResolutionContext) => any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a naming convention strategy.
|
||||
*/
|
||||
export interface INamingConvention {
|
||||
/** Regular expression on how to tokenize a member. */
|
||||
splittingExpression: RegExp;
|
||||
|
||||
/** Character to separate on. */
|
||||
separatorCharacter: string;
|
||||
|
||||
/**
|
||||
* Transformation function called when this convention is the destination naming convention.
|
||||
* @param {string[]} sourcePropertyNameParts Array containing tokenized source property name parts.
|
||||
* @returns {string} Destination property name
|
||||
*/
|
||||
transformPropertyName: (sourcePropertyNameParts: string[]) => string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration for profile-specific maps.
|
||||
*/
|
||||
export interface IConfiguration {
|
||||
/**
|
||||
* Add an existing profile
|
||||
* @param profile {IProfile} Profile to add.
|
||||
*/
|
||||
addProfile(profile: IProfile): void;
|
||||
|
||||
/**
|
||||
* Create a createMap curry function which expects only a destination key.
|
||||
* @param {string} sourceKey The map source key.
|
||||
* @returns {(destinationKey: string) => IAutoMapperCreateMapChainingFunctions}
|
||||
*/
|
||||
createMap?(sourceKey: string): (destinationKey: string) => ICreateMapFluentFunctions;
|
||||
|
||||
/**
|
||||
* Create a mapping profile.
|
||||
* @param {string} sourceKey The map source key.
|
||||
* @param {string} destinationKey The map destination key.
|
||||
* @returns {Core.IAutoMapperCreateMapChainingFunctions}
|
||||
*/
|
||||
createMap?(sourceKey: string, destinationKey: string): ICreateMapFluentFunctions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a named configuration for maps. Naming conventions become scoped per profile.
|
||||
*/
|
||||
export interface IProfile {
|
||||
/** Profile name */
|
||||
profileName: string;
|
||||
|
||||
/** Naming convention for source members */
|
||||
sourceMemberNamingConvention: INamingConvention;
|
||||
|
||||
/** Naming convention for destination members */
|
||||
destinationMemberNamingConvention: INamingConvention;
|
||||
|
||||
/**
|
||||
* Implement this method in a derived class and call the CreateMap method to associate that map with this profile.
|
||||
* Avoid calling the AutoMapper class / automapper instance from this method.
|
||||
*/
|
||||
configure: () => void;
|
||||
}
|
||||
|
||||
export interface IMapItemFunction {
|
||||
(mapping: IMapping, sourceObject: any, destinationObject: any): any;
|
||||
}
|
||||
|
||||
export interface IAsyncMapItemFunction {
|
||||
(mapping: IMapping, sourceObject: any, destinationObject: any, callback: IMapCallback): void;
|
||||
}
|
||||
|
||||
interface ICreateMapParameters {
|
||||
mapping: IMapping;
|
||||
destinationProperty: string;
|
||||
conversionValueOrFunction: any;
|
||||
sourceMapping: boolean;
|
||||
fluentFunctions: ICreateMapFluentFunctions;
|
||||
}
|
||||
|
||||
interface IGetOrCreatePropertyParameters {
|
||||
propertyNameParts: string[];
|
||||
mapping: IMapping;
|
||||
parent?: IProperty;
|
||||
propertyArray: IProperty[];
|
||||
destination?: string;
|
||||
sourceMapping: boolean;
|
||||
}
|
||||
|
||||
interface ICreatePropertyParameters {
|
||||
name: string;
|
||||
mapping: IMapping;
|
||||
parent: IProperty;
|
||||
propertyArray: IProperty[];
|
||||
sourceMapping: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare var automapper: AutoMapperJs.AutoMapper;
|
||||
@@ -0,0 +1,10 @@
|
||||
/// <reference path="autosize.d.ts" />
|
||||
|
||||
// from a NodeList
|
||||
autosize(document.querySelectorAll('textarea'));
|
||||
|
||||
// from a single Node
|
||||
autosize(document.querySelector('textarea'));
|
||||
|
||||
// from a single element
|
||||
autosize(document.getElementById('my-textarea'));
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for jquery.autosize 3.0.7
|
||||
// Project: http://www.jacklmoore.com/autosize/
|
||||
// Definitions by: Aaron T. King <https://github.com/kingdango>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace autosize {
|
||||
interface AutosizeStatic {
|
||||
(el: Element): void;
|
||||
(el: NodeList): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare var autosize: autosize.AutosizeStatic;
|
||||
|
||||
declare module 'autosize' {
|
||||
export = autosize;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/// <reference path="awesomplete.d.ts" />
|
||||
|
||||
var input = document.getElementById("myinput");
|
||||
new Awesomplete(input, {list: "#mylist"});
|
||||
|
||||
new Awesomplete(input, {list: document.querySelector("#mylist")});
|
||||
|
||||
new Awesomplete(input, {
|
||||
list: ["Ada", "Java", "JavaScript", "LOLCODE", "Node.js", "Ruby on Rails"]
|
||||
});
|
||||
|
||||
var awesomplete = new Awesomplete(input);
|
||||
awesomplete.list = ["Ada", "Java", "JavaScript", "LOLCODE", "Node.js", "Ruby on Rails"];
|
||||
|
||||
new Awesomplete(input, {
|
||||
list: [
|
||||
{ label: "Belarus", value: "BY" },
|
||||
{ label: "China", value: "CN" },
|
||||
{ label: "United States", value: "US" }
|
||||
]
|
||||
});
|
||||
|
||||
// Same with arrays:
|
||||
new Awesomplete(input, {
|
||||
list: [
|
||||
[ "Belarus", "BY" ],
|
||||
[ "China", "CN" ],
|
||||
[ "United States", "US" ]
|
||||
]
|
||||
});
|
||||
|
||||
new Awesomplete('input[type="email"]', {
|
||||
list: ["aol.com", "att.net", "comcast.net", "facebook.com", "gmail.com", "gmx.com", "googlemail.com", "google.com", "hotmail.com", "hotmail.co.uk", "mac.com", "me.com", "mail.com", "msn.com", "live.com", "sbcglobal.net", "verizon.net", "yahoo.com", "yahoo.co.uk"],
|
||||
data: function (text: string, input: any) {
|
||||
return input.slice(0, input.indexOf("@")) + "@" + text;
|
||||
},
|
||||
filter: Awesomplete.FILTER_STARTSWITH
|
||||
});
|
||||
|
||||
new Awesomplete('input[data-multiple]', {
|
||||
filter: function(text: string, input: any) {
|
||||
return Awesomplete.FILTER_CONTAINS(text, input.match(/[^,]*$/)[0]);
|
||||
},
|
||||
|
||||
replace: function(text: string) {
|
||||
var before = this.input.value.match(/^.+,\s*|/)[0];
|
||||
this.input.value = before + text + ", ";
|
||||
}
|
||||
});
|
||||
|
||||
var ajax = new XMLHttpRequest();
|
||||
ajax.open("GET", "https://restcountries.eu/rest/v1/lang/fr", true);
|
||||
ajax.onload = function() {
|
||||
var list = JSON.parse(ajax.responseText).map(function(i: any) { return i.name; });
|
||||
new Awesomplete(document.querySelector("#ajax-example input"),{ list: list });
|
||||
};
|
||||
ajax.send();
|
||||
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
// Type definitions for Awesomplete v1.1.0
|
||||
// Project: https://leaverou.github.io/awesomplete/
|
||||
// Definitions by: webbiesdk <https://github.com/webbiesdk/>, Ben Dixon <https://github.com/bmdixon/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class Awesomplete {
|
||||
constructor(input: Element | HTMLElement | string, o?: AwesompleteOptions);
|
||||
static all: Array<any>;
|
||||
static $$: (expr: string | NodeSelector, con?: any) => NodeList;
|
||||
static ITEM: (text: string, input: string) => HTMLElement;
|
||||
static $: {
|
||||
(expr: string|Element, con?: NodeSelector): string | Element;
|
||||
regExpEscape: (s: { replace: (arg0: RegExp, arg1: string) => void }) => any;
|
||||
create: (tag: string, o: any) => HTMLElement;
|
||||
fire: (target: EventTarget, type: string, properties: any) => any;
|
||||
siblingIndex: (el: Element) => number;
|
||||
};
|
||||
static FILTER_STARTSWITH: (text: string, input: string) => boolean;
|
||||
static FILTER_CONTAINS: (text: string, input: string) => boolean;
|
||||
static SORT_BYLENGTH: (a: number | any[], b: number | any[]) => number;
|
||||
static REPLACE: (text: any) => void;
|
||||
next: () => void;
|
||||
container: HTMLElement;
|
||||
select: (selected?: HTMLElement, originalTarget?: HTMLElement) => void;
|
||||
previous: () => void;
|
||||
index: number;
|
||||
opened: number;
|
||||
list: string | string[] | Element | { label: string, value: any }[] | [string, string][];
|
||||
input: HTMLElement | string;
|
||||
goto: (i: number) => void;
|
||||
ul: HTMLElement;
|
||||
close: () => void;
|
||||
evaluate: () => void;
|
||||
selected: boolean;
|
||||
open: () => void;
|
||||
status: HTMLElement;
|
||||
}
|
||||
|
||||
interface AwesompleteOptions {
|
||||
list?: string | string[] | Element | { label: string, value: any }[] | [string, string][];
|
||||
minChars?: Number;
|
||||
maxItems?: Number;
|
||||
autoFirst?: boolean;
|
||||
data?: Function;
|
||||
filter?: Function;
|
||||
sort?: Function;
|
||||
item?: Function;
|
||||
replace?: Function;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/// <reference path="aws-lambda.d.ts" />
|
||||
|
||||
import lambda = require('aws-lambda');
|
||||
|
||||
var str: string = "any string";
|
||||
var date: Date = new Date();
|
||||
var anyObj: any = { abc: 123 };
|
||||
var num: number = 5;
|
||||
var identity: lambda.CognitoIdentity;
|
||||
var error: Error = new Error();
|
||||
var b: boolean = true;
|
||||
var clientCtx: lambda.ClientContext;
|
||||
|
||||
/* Context */
|
||||
var context: lambda.Context;
|
||||
|
||||
b = context.callbackWaitsForEmptyEventLoop;
|
||||
str = context.functionName;
|
||||
str = context.functionVersion;
|
||||
str = context.invokedFunctionArn;
|
||||
num = context.memoryLimitInMB;
|
||||
str = context.awsRequestId;
|
||||
str = context.logGroupName;
|
||||
str = context.logStreamName;
|
||||
identity = context.identity;
|
||||
clientCtx = context.clientContext;
|
||||
|
||||
/* CognitoIdentity */
|
||||
var identity: lambda.CognitoIdentity;
|
||||
|
||||
str = identity.cognitoIdentityId;
|
||||
str = identity.cognitoIdentityPoolId;
|
||||
|
||||
/* Callback */
|
||||
function callback(cb: lambda.Callback) {
|
||||
cb();
|
||||
cb(null);
|
||||
cb(error);
|
||||
cb(null, anyObj);
|
||||
}
|
||||
|
||||
/* Compatibility functions */
|
||||
context.done();
|
||||
context.done(error);
|
||||
context.done(error, anyObj);
|
||||
context.succeed(str);
|
||||
context.succeed(anyObj);
|
||||
context.succeed(str, anyObj);
|
||||
context.fail(error);
|
||||
context.fail(str);
|
||||
Vendored
+70
@@ -0,0 +1,70 @@
|
||||
// Type definitions for AWS Lambda
|
||||
// Project: http://docs.aws.amazon.com/lambda
|
||||
// Definitions by: James Darbyshire <https://github.com/darbio/aws-lambda-typescript>, Michael Skarum <https://github.com/skarum>, Stef Heyenrath <https://github.com/StefH/DefinitelyTyped>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "aws-lambda" {
|
||||
// Context
|
||||
// http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html
|
||||
interface Context {
|
||||
// Properties
|
||||
callbackWaitsForEmptyEventLoop: boolean;
|
||||
functionName: string;
|
||||
functionVersion: string;
|
||||
invokedFunctionArn: string;
|
||||
memoryLimitInMB: number;
|
||||
awsRequestId: string;
|
||||
logGroupName: string;
|
||||
logStreamName: string;
|
||||
identity?: CognitoIdentity;
|
||||
clientContext?: ClientContext;
|
||||
|
||||
// Functions
|
||||
getRemainingTimeInMillis(): number;
|
||||
|
||||
// Functions for compatibility with earlier Node.js Runtime v0.10.42
|
||||
// For more details see http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html#nodejs-prog-model-oldruntime-context-methods
|
||||
done(error?: Error, result?: any): void;
|
||||
fail(error: Error): void;
|
||||
fail(message: string): void;
|
||||
succeed(message: string): void;
|
||||
succeed(object: any): void;
|
||||
succeed(message: string, object: any): void;
|
||||
}
|
||||
|
||||
interface CognitoIdentity {
|
||||
cognitoIdentityId: string;
|
||||
cognitoIdentityPoolId: string;
|
||||
}
|
||||
|
||||
interface ClientContext {
|
||||
client: ClientContextClient;
|
||||
Custom?: any;
|
||||
env: ClientContextEnv;
|
||||
}
|
||||
|
||||
interface ClientContextClient {
|
||||
installationId: string;
|
||||
appTitle: string;
|
||||
appVersionName: string;
|
||||
appVersionCode: string;
|
||||
appPackageName: string;
|
||||
}
|
||||
|
||||
interface ClientContextEnv {
|
||||
platformVersion: string;
|
||||
platform: string;
|
||||
make: string;
|
||||
model: string;
|
||||
locale: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional callback parameter.
|
||||
* http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html
|
||||
*
|
||||
* @param error – an optional parameter that you can use to provide results of the failed Lambda function execution.
|
||||
* @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible.
|
||||
*/
|
||||
export type Callback = (error?: Error, result?: any) => void;
|
||||
}
|
||||
Vendored
+826
-8
@@ -22,6 +22,27 @@ declare module "aws-sdk" {
|
||||
constructor(profile: string);
|
||||
}
|
||||
|
||||
export module CognitoIdentity {
|
||||
export interface CognitoIdentityCredentialsParams {
|
||||
IdentityPoolId?: string;
|
||||
AccountId?: string;
|
||||
Logins?: {[k: string]: any};
|
||||
|
||||
RoleArn?: string;
|
||||
RoleSessionName?: string;
|
||||
WebIdentityToken?: string;
|
||||
ProviderId?: string;
|
||||
Policy?: string;
|
||||
DurationSeconds?: number;
|
||||
|
||||
IdentityId?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export class CognitoIdentityCredentials extends Credentials {
|
||||
constructor(params: CognitoIdentity.CognitoIdentityCredentialsParams);
|
||||
}
|
||||
|
||||
export interface Logger {
|
||||
write?: (chunk: any, encoding?: string, callback?: () => void) => void;
|
||||
log?: (...messages: any[]) => void;
|
||||
@@ -49,6 +70,51 @@ declare module "aws-sdk" {
|
||||
stack: string;
|
||||
}
|
||||
|
||||
export interface RetryDelayOption {
|
||||
base?: number;
|
||||
customBackoff?: (retryCount: number) => number;
|
||||
}
|
||||
|
||||
export interface Ebs {
|
||||
SnapshotId?: string;
|
||||
VolumeSize?: number;
|
||||
VolumeType?: string;
|
||||
DeleteOnTermination?: boolean;
|
||||
Iops?: number;
|
||||
Encrypted?: boolean;
|
||||
}
|
||||
|
||||
export interface BlockDeviceMapping {
|
||||
VirtualName?: string;
|
||||
DeviceName: string;
|
||||
Ebs?: Ebs;
|
||||
NoDevice?: boolean;
|
||||
}
|
||||
|
||||
export interface InstanceMonitoring {
|
||||
SpotPrice?: string;
|
||||
Enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface Filter {
|
||||
Name?: string;
|
||||
Values?: boolean;
|
||||
}
|
||||
|
||||
export interface StepAdjustment {
|
||||
scalingAdjustment: number;
|
||||
metricIntervalLowerBound?: number;
|
||||
metricIntervalUpperBound?: number;
|
||||
}
|
||||
|
||||
export interface Tags {
|
||||
resourceId?: string;
|
||||
resourceType?: string;
|
||||
key: string;
|
||||
value?: string;
|
||||
propagateAtLaunch?: boolean;
|
||||
}
|
||||
|
||||
export interface Services {
|
||||
autoscaling?: any;
|
||||
cloudformation?: any;
|
||||
@@ -118,6 +184,37 @@ declare module "aws-sdk" {
|
||||
region: string;
|
||||
}
|
||||
|
||||
export class CloudFormation {
|
||||
constructor(options?: CloudFormation.Options);
|
||||
endpoint: Endpoint;
|
||||
|
||||
cancelUpdateStack(params: CloudFormation.CancelUpdateStackParams, callback: (err: AwsError, data: any) => void): void;
|
||||
continueUpdateRollback(params: CloudFormation.ContinueUpdateRollbackParams, callback: (err: AwsError, data: any) => void): void;
|
||||
createChangeSet(params: CloudFormation.CreateChangeSetParams, callback: (err: AwsError, data: any) => void): void;
|
||||
createStack(params: CloudFormation.CreateStackParams, callback: (err: AwsError, data: any) => void): void;
|
||||
deleteChangeSet(params: CloudFormation.DeleteChangeSetParams, callback: (err: AwsError, data: any) => void): void;
|
||||
deleteStack(params: CloudFormation.DeleteStackParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeAccountLimits(params: CloudFormation.DescribeAccountLimitsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeChangeSet(params: CloudFormation.DescribeChangeSetParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeStackEvents(params: CloudFormation.DescribeStackEventsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeStackResource(params: CloudFormation.DescribeStackResourceParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeStackResources(params: CloudFormation.DescribeStackResourcesParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeStacks(params: CloudFormation.DescribeStacksParams, callback: (err: AwsError, data: any) => void): void;
|
||||
estimateTemplateCost(params: CloudFormation.EstimateTemplateCostParams, callback: (err: AwsError, data: any) => void): void;
|
||||
executeChangeSet(params: CloudFormation.ExecuteChangeSetParams, callback: (err: AwsError, data: any) => void): void;
|
||||
getStackPolicy(params: CloudFormation.GetStackPolicyParams, callback: (err: AwsError, data: any) => void): void;
|
||||
getTemplate(params: CloudFormation.GetTemplateParams, callback: (err: AwsError, data: any) => void): void;
|
||||
getTemplateSummary(params: CloudFormation.GetTemplateSummaryParams, callback: (err: AwsError, data: any) => void): void;
|
||||
listChangeSets(params: CloudFormation.ListChangeSetsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
listStackResources(params: CloudFormation.ListStackResourcesParams, callback: (err: AwsError, data: any) => void): void;
|
||||
listStacks(params: CloudFormation.ListStacksParams, callback: (err: AwsError, data: any) => void): void;
|
||||
setStackPolicy(params: CloudFormation.SetStackPolicyParams, callback: (err: AwsError, data: any) => void): void;
|
||||
signalResource(params: CloudFormation.SignalResourceParams, callback: (err: AwsError, data: any) => void): void;
|
||||
updateStack(params: CloudFormation.UpdateStackParams, callback: (err: AwsError, data: any) => void): void;
|
||||
validateTemplate(params: CloudFormation.ValidateTemplateParams, callback: (err: AwsError, data: any) => void): void;
|
||||
waitFor(state: string, params: CloudFormation.WaitForParams, callback: (err: AwsError, data: any) => void): void;
|
||||
}
|
||||
|
||||
export class Lambda {
|
||||
constructor(options?: any);
|
||||
endpoint: Endpoint;
|
||||
@@ -147,6 +244,64 @@ declare module "aws-sdk" {
|
||||
updateFunctionConfiguration(params: Lambda.UpdateFunctionConfigurationParams, callback: (err: AwsError, data: any) => void): void;
|
||||
}
|
||||
|
||||
export class AutoScaling {
|
||||
constructor(options?: any);
|
||||
endpoint: Endpoint;
|
||||
|
||||
attachInstances(params: AutoScaling.AttachInstancesParams, callback: (err: AwsError, data: any) => void): void;
|
||||
attachLoadBalancers(params: AutoScaling.AttachLoadBalancersParams, callback: (err: AwsError, data: any) => void): void;
|
||||
attachLoadBalancerTargetGroups(param: AutoScaling.AttachLoadBalancerTargetGroupsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
completeLifecycleAction(param: AutoScaling.CompleteLifecycleActionParams, callback: (err: AwsError, data: any) => void): void;
|
||||
createAutoScalingGroup(param: AutoScaling.CreateAutoScalingGroupParams, callback: (err: AwsError, data: any) => void): void;
|
||||
createLaunchConfiguration(param: AutoScaling.CreateLaunchConfigurationParams, callback: (err: AwsError, data: any) => void): void;
|
||||
createOrUpdateTags(param: AutoScaling.CreateOrUpdateTagsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
deleteAutoScalingGroup(param: AutoScaling.DeleteAutoScalingGroupParams, callback: (err: AwsError, data: any) => void): void;
|
||||
deleteLaunchConfiguration(param: AutoScaling.DeleteLaunchConfigurationParams, callback: (err: AwsError, data: any) => void): void;
|
||||
deleteLifecycleHook(param: AutoScaling.DeleteLifecycleHookParams, callback: (err: AwsError, data: any) => void): void;
|
||||
deleteNotificationConfiguration(param: AutoScaling.DeleteNotificationConfigurationParams, callback: (err: AwsError, data: any) => void): void;
|
||||
deletePolicy(param: AutoScaling.DeletePolicyParams, callback: (err: AwsError, data: any) => void): void;
|
||||
deleteScheduledAction(param: AutoScaling.DeleteScheduledActionParams, callback: (err: AwsError, data: any) => void): void;
|
||||
deleteTags(param: AutoScaling.DeleteTagsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeAccountLimits(callback: (err: AwsError, data: any) => void): void;
|
||||
describeAdjustmentTypes(callback: (err: AwsError, data: any) => void): void;
|
||||
describeAutoScalingGroups(param: AutoScaling.DescribeAutoScalingGroupsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeAutoScalingInstances(param: AutoScaling.DescribeAutoScalingInstancesParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeAutoScalingNotificationTypes(callback: (err: AwsError, data: any) => void): void;
|
||||
describeLaunchConfigurations(param: AutoScaling.DescribeLaunchConfigurationsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeLifecycleHooks(param: AutoScaling.DescribeLifecycleHooksParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeLifecycleHookTypes(callback: (err: AwsError, data: any) => void): void;
|
||||
describeLoadBalancers(param: AutoScaling.DescribeLoadBalancersParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeLoadBalancerTargetGroups(param: AutoScaling.DescribeLoadBalancerTargetGroupsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeMetricCollectionTypes(callback: (err: AwsError, data: any) => void): void;
|
||||
describeNotificationConfigurations(param: AutoScaling.DescribeNotificationConfigurationsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describePolicies(param: AutoScaling.DescribePoliciesParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeScalingActivities(param: AutoScaling.DescribeScalingActivitiesParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeScalingProcessTypes(callback: (err: AwsError, data: any) => void): void;
|
||||
describeScheduledActions(param: AutoScaling.DescribeScheduledActionsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeTags(param: AutoScaling.DescribeTagsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
describeTerminationPolicyTypes(callback: (err: AwsError, data: any) => void): void;
|
||||
detachInstances(param: AutoScaling.DetachInstancesParams, callback: (err: AwsError, data: any) => void): void;
|
||||
detachLoadBalancers(param: AutoScaling.DetachLoadBalancersParams, callback: (err: AwsError, data: any) => void): void;
|
||||
detachLoadBalancerTargetGroups(param: AutoScaling.DetachLoadBalancerTargetGroupsParams, callback: (err: AwsError, data: any) => void): void;
|
||||
disableMetricsCollection(param: AutoScaling.DisableMetricsCollectionParams, callback: (err: AwsError, data: any) => void): void;
|
||||
enableMetricsCollection(param: AutoScaling.EnableMetricsCollectionParams, callback: (err: AwsError, data: any) => void): void;
|
||||
enterStandby(param: AutoScaling.EnterStandbyParams, callback: (err: AwsError, data: any) => void): void;
|
||||
executePolicy(param: AutoScaling.ExecutePolicyParams, callback: (err: AwsError, data: any) => void): void;
|
||||
exitStandby(param: AutoScaling.ExitStandbyParams, callback: (err: AwsError, data: any) => void): void;
|
||||
putLifecycleHook(param: AutoScaling.PutLifecycleHookParams, callback: (err: AwsError, data: any) => void): void;
|
||||
putNotificationConfiguration(param: AutoScaling.PutNotificationConfigurationParams, callback: (err: AwsError, data: any) => void): void;
|
||||
putScalingPolicy(param: AutoScaling.PutScalingPolicyParams, callback: (err: AwsError, data: any) => void): void;
|
||||
putScheduledUpdateGroupAction(param: AutoScaling.PutScheduledUpdateGroupActionParams, callback: (err: AwsError, data: any) => void): void;
|
||||
recordLifecycleActionHeartbeat(params: AutoScaling.RecordLifecycleActionHeartbeatParams, callback: (err: AwsError, data: any) => void): void;
|
||||
resumeProcesses(params: AutoScaling.ResumeProcessesParams, callback: (err: AwsError, data: any) => void): void;
|
||||
setDesiredCapacity(params: AutoScaling.SetDesiredCapacityParams, callback: (err: AwsError, data: any) => void): void;
|
||||
setInstanceHealth(params: AutoScaling.SetInstanceHealthParams, callback: (err: AwsError, data: any) => void): void;
|
||||
setInstanceProtection(params: AutoScaling.SetInstanceProtectionParams, callback: (err: AwsError, data: any) => void): void;
|
||||
suspendProcesses(params: AutoScaling.SuspendProcessesParams, callback: (err: AwsError, data: any) => void): void;
|
||||
terminateInstanceInAutoScalingGroup(params: AutoScaling.TerminateInstanceInAutoScalingGroupParams, callback: (err: AwsError, data: any) => void): void;
|
||||
updateAutoScalingGroup(params: AutoScaling.UpdateAutoScalingGroupParams, callback: (err: AwsError, data: any) => void): void;
|
||||
}
|
||||
|
||||
export class SQS {
|
||||
constructor(options?: any);
|
||||
endpoint: Endpoint;
|
||||
@@ -226,13 +381,22 @@ declare module "aws-sdk" {
|
||||
constructor(options?: any);
|
||||
endpoint: Endpoint;
|
||||
|
||||
getObject(params: s3.GetObjectRequest, callback: (err: Error, data: any) => void): void;
|
||||
putObject(params: s3.PutObjectRequest, callback: (err: Error, data: any) => void): void;
|
||||
getObject(params: s3.GetObjectRequest, callback?: (err: Error, data: any) => void): any;
|
||||
putObject(params: s3.PutObjectRequest, callback?: (err: Error, data: any) => void): any;
|
||||
copyObject(params: s3.CopyObjectRequest, callback?: (err: Error, data: any) => void): any;
|
||||
deleteObject(params: s3.DeleteObjectRequest, callback: (err: Error, data: any) => void): void;
|
||||
headObject(params: s3.HeadObjectRequest, callback: (err: Error, data: any) => void): void;
|
||||
getSignedUrl(operation: string, params: any): string;
|
||||
getSignedUrl(operation: string, params: any, callback: (err: Error, url: string) => void): void;
|
||||
upload(params?: s3.PutObjectRequest, options?: s3.UploadOptions, callback?: (err: Error, data: any) => void): void;
|
||||
listObjects(params: s3.ListObjectRequest, callback: (err: Error, data: s3.ListObjectResponse) => void): void;
|
||||
listObjectsV2(params: s3.ListObjectV2Request, callback: (err: Error, data: s3.ListObjectV2Response) => void): void;
|
||||
waitFor(state: string, params: s3.HeadObjectRequest, callback: (err: Error, data: any) => void): void;
|
||||
|
||||
createMultipartUpload(params: any, callback: (err: Error, data: any) => void): void;
|
||||
uploadPart(params: any, callback: (err: Error, data: any) => void): void;
|
||||
listParts(params: any, callback: (err: Error, data: any) => void): void;
|
||||
completeMultipartUpload(params: any, callback: (err: Error, data: any) => void): void;
|
||||
}
|
||||
|
||||
export class STS {
|
||||
@@ -317,7 +481,8 @@ declare module "aws-sdk" {
|
||||
export class DynamoDB {
|
||||
constructor(options?: any);
|
||||
endpoint: Endpoint;
|
||||
|
||||
createTable(params: any, next: (err: any, data: any) => void): void;
|
||||
deleteTable(params: any, next: (err: any, data: any) => void): void;
|
||||
}
|
||||
|
||||
// ==========================================================
|
||||
@@ -326,7 +491,7 @@ declare module "aws-sdk" {
|
||||
|
||||
interface _DDBDC_Generic {
|
||||
TableName: string;
|
||||
ExpressionAttributeNames?: string[];
|
||||
ExpressionAttributeNames?: { [someKey: string]: string };
|
||||
ReturnConsumedCapacity?: "INDEXES" | "TOTAL" | "NONE";
|
||||
}
|
||||
|
||||
@@ -353,17 +518,18 @@ declare module "aws-sdk" {
|
||||
ConditionalOperator?: "AND" | "OR";
|
||||
Expected?: {
|
||||
[someKey: string]: {
|
||||
AttributeValueList: any[];
|
||||
ComparisonOperator: _DDBDC_ComparisonOperator;
|
||||
AttributeValueList?: any[];
|
||||
ComparisonOperator?: _DDBDC_ComparisonOperator;
|
||||
Exists: boolean;
|
||||
Value: any;
|
||||
Value?: any;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface UpdateParam extends _DDBDC_Writer {
|
||||
Key: _DDBDC_Keys;
|
||||
AttributeUpdates: {
|
||||
UpdateExpression?: string;
|
||||
AttributeUpdates?: {
|
||||
[someKey: string]: {
|
||||
Action: "PUT" | "ADD" | "DELETE";
|
||||
Value: any
|
||||
@@ -420,6 +586,214 @@ declare module "aws-sdk" {
|
||||
|
||||
// ===========================================================
|
||||
|
||||
export module CloudFormation {
|
||||
|
||||
export interface CancelUpdateStackParams {
|
||||
StackName: string;
|
||||
}
|
||||
|
||||
export interface ContinueUpdateRollbackParams {
|
||||
StackName: string;
|
||||
}
|
||||
|
||||
export interface CreateChangeSetParams {
|
||||
StackName: string;
|
||||
TemplateBody?: string; // specify either TemplateBody or TemplateURL
|
||||
TemplateURL?: string; // specify either TemplateBody or TemplateURL
|
||||
UsePreviousTemplate?: boolean;
|
||||
Parameters?: CloudFormation.Parameter[];
|
||||
Capabilities?: string[]; // CAPABILITY_IAM | CAPABILITY_NAMED_IAM
|
||||
ResourceTypes?: string[];
|
||||
NotificationARNs?: string[];
|
||||
Tags?: CloudFormation.Tag[];
|
||||
ChangeSetName: string;
|
||||
ClientToken?: string;
|
||||
Description?: string;
|
||||
}
|
||||
|
||||
export interface CreateStackParams {
|
||||
StackName: string;
|
||||
TemplateBody?: string; // specify either TemplateBody or TemplateURL
|
||||
TemplateURL?: string; // specify either TemplateBody or TemplateURL
|
||||
Parameters?: CloudFormation.Parameter[];
|
||||
DisableRollback?: boolean; // cannot specify both DisableRollback and OnFailure
|
||||
TimeoutInMinutes?: number;
|
||||
NotificationARNs?: string[];
|
||||
Capabilities?: string[];
|
||||
ResourceTypes?: string[];
|
||||
OnFailure?: string[]; // cannot specify both DisableRollback and OnFailure
|
||||
// DO_NOTHING | ROLLBACK | DELETE
|
||||
StackPolicyBody?: string[]; // cannot specify both StackPolicyBody and StackPolicyURL
|
||||
StackPolicyURL?: string[]; // cannot specify both StackPolicyBody and StackPolicyURL
|
||||
Tags?: CloudFormation.Tag[];
|
||||
}
|
||||
|
||||
export interface DeleteChangeSetParams {
|
||||
ChangeSetName: string;
|
||||
StackName?: string;
|
||||
}
|
||||
|
||||
export interface DeleteStackParams {
|
||||
StackName: string;
|
||||
RetainResources?: string[];
|
||||
}
|
||||
|
||||
export interface DescribeAccountLimitsParams {
|
||||
NextToken?: string;
|
||||
}
|
||||
|
||||
export interface DescribeChangeSetParams {
|
||||
ChangeSetName: string;
|
||||
StackName?: string;
|
||||
NextToken?: string;
|
||||
}
|
||||
|
||||
export interface DescribeStackEventsParams {
|
||||
StackName?: string;
|
||||
NextToken?: string;
|
||||
}
|
||||
|
||||
export interface DescribeStackResourceParams {
|
||||
StackName: string;
|
||||
LogicalResourceId: string;
|
||||
}
|
||||
|
||||
export interface DescribeStackResourcesParams {
|
||||
StackName?: string; // must specify either StackName or PhysicalResourceId
|
||||
LogicalResourceId?: string;
|
||||
PhysicalResourceId?: string; // must specify either StackName or PhysicalResourceId
|
||||
}
|
||||
|
||||
export interface DescribeStacksParams {
|
||||
StackName?: string;
|
||||
NextToken?: string;
|
||||
}
|
||||
|
||||
export interface EstimateTemplateCostParams {
|
||||
TemplateBody?: string; // must specify either TemplateBody or TemplateURL
|
||||
// if both are passed, only TemplateBody is used
|
||||
TemplateURL?: string; // must specify either TemplateBody or TemplateURL
|
||||
Parameters?: CloudFormation.Parameter[];
|
||||
}
|
||||
|
||||
export interface ExecuteChangeSetParams {
|
||||
ChangeSetName: string;
|
||||
StackName?: string;
|
||||
}
|
||||
|
||||
export interface GetStackPolicyParams {
|
||||
StackName: string;
|
||||
}
|
||||
|
||||
export interface GetTemplateParams {
|
||||
StackName: string;
|
||||
}
|
||||
|
||||
export interface GetTemplateSummaryParams {
|
||||
// must specify one of the three
|
||||
TemplateBody?: string;
|
||||
TemplateURL?: string;
|
||||
StackName?: string;
|
||||
}
|
||||
|
||||
export interface ListChangeSetsParams {
|
||||
StackName: string;
|
||||
NextToken?: string;
|
||||
}
|
||||
|
||||
export interface ListStackResourcesParams {
|
||||
StackName: string;
|
||||
NextToken?: string;
|
||||
}
|
||||
|
||||
export interface ListStacksParams {
|
||||
NextToken?: string;
|
||||
StackStatusFilter?: string[];
|
||||
}
|
||||
|
||||
export interface SetStackPolicyParams {
|
||||
StackName: string;
|
||||
StackPolicyBody?: string; // cannot set both StackPolicyBody and StackPolicyURL
|
||||
StackPolicyURL?: string; // cannot set both StackPolicyBody and StackPolicyURL
|
||||
}
|
||||
|
||||
export interface SignalResourceParams {
|
||||
StackName: string;
|
||||
LogicalResourceId: string;
|
||||
UniqueId: string;
|
||||
Status: string; // SUCCESS | FAILURE
|
||||
}
|
||||
|
||||
export interface UpdateStackParams {
|
||||
StackName: string;
|
||||
TemplateBody?: string; // specify either TemplateBody or TemplateURL, not both
|
||||
TemplateURL?: string; // specify either TemplateBody or TemplateURL, not both
|
||||
UsePreviousTemplate?: boolean;
|
||||
StackPolicyDuringUpdateBody?: string; // cannot set both StackPolicyDuringUpdateBody and StackPolicyDuringUpdateURL
|
||||
StackPolicyDuringUpdateURL?: string; // cannot set both StackPolicyDuringUpdateBody and StackPolicyDuringUpdateURL
|
||||
Parameters?: CloudFormation.Parameter[];
|
||||
Capabilities?: string[]; // CAPABILITY_IAM | CAPABILITY_NAMED_IAM
|
||||
ResourceTypes?: string[];
|
||||
StackPolicyBody?: string; // cannot set both StackPolicyBody and StackPolicyURL
|
||||
StackPolicyURL?: string; // cannot set both StackPolicyBody and StackPolicyURL
|
||||
NotificationARNs?: string[];
|
||||
Tags?: CloudFormation.Tag[];
|
||||
}
|
||||
|
||||
export interface ValidateTemplateParams {
|
||||
TemplateBody?: string; // must pass either TemplateBody or TemplateURL
|
||||
// if both are specified, only TemplateBody is used
|
||||
TemplateURL?: string; // must pass either TemplateBody or TemplateURL
|
||||
}
|
||||
|
||||
export interface WaitForParams {
|
||||
StackName: string;
|
||||
NextToken?: string;
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
params?: any;
|
||||
endpoint?: string;
|
||||
accessKeyId?: string;
|
||||
secretAccessKey?: string;
|
||||
sessionToken?: any;
|
||||
credentials?: any;
|
||||
credentialProvider?: any;
|
||||
region?: string;
|
||||
maxRetries?: number;
|
||||
maxRedirects?: number;
|
||||
sslEnabled?: boolean;
|
||||
paramValidation?: any;
|
||||
computeChecksums?: boolean;
|
||||
convertResponseTypes?: boolean;
|
||||
correctClockSkew?: boolean;
|
||||
s3ForcePathStyle?: boolean;
|
||||
s3BucketEndpoint?: boolean;
|
||||
s3DisableBodySigning?: boolean;
|
||||
retryDelayOptions?: any;
|
||||
httpOptions?: any;
|
||||
apiVersion?: any;
|
||||
apiVersions?: any;
|
||||
logger?: any;
|
||||
systemClockOffset?: number;
|
||||
signatureVersion?: string;
|
||||
signatureCache?: boolean;
|
||||
}
|
||||
|
||||
export interface Parameter {
|
||||
ParameterKey: string;
|
||||
ParameterValue: string;
|
||||
UsePreviousValue?: boolean; // if you specify true, do not specify ParameterValue
|
||||
}
|
||||
|
||||
export interface Tag {
|
||||
Key: string;
|
||||
Value: string;
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================
|
||||
|
||||
export module Lambda {
|
||||
|
||||
export interface AddPermissionParams {
|
||||
@@ -589,6 +963,355 @@ declare module "aws-sdk" {
|
||||
}
|
||||
}
|
||||
|
||||
export module AutoScaling {
|
||||
export interface AutoScalingOptions {
|
||||
params?: any;
|
||||
endpoint?: string;
|
||||
accessKeyId?: string;
|
||||
secretAccessKey?: string;
|
||||
sessionToken?: Credentials;
|
||||
credentials?: Credentials;
|
||||
credentialProvider?: any;
|
||||
region?: string;
|
||||
maxRetries?: number;
|
||||
maxRedirects?: number;
|
||||
sslEnabled?: boolean;
|
||||
paramValidation?: boolean;
|
||||
computeChecksums?: boolean;
|
||||
convertResponseTypes?: boolean;
|
||||
correctClockSkew?: boolean;
|
||||
s3ForcePathStyle?: boolean;
|
||||
s3BucketEndpoint?: boolean;
|
||||
s3DisableBodySigning?: boolean;
|
||||
retryDelayOptions?: RetryDelayOption;
|
||||
httpOptions?: HttpOptions;
|
||||
apiVersion?: string;
|
||||
apiVersions?: { [serviceName: string]: string };
|
||||
logger?: Logger;
|
||||
systemClockOffset?: number;
|
||||
signatureVersion?: string;
|
||||
signatureCache?: boolean;
|
||||
}
|
||||
|
||||
export interface AttachInstancesParams {
|
||||
AutoScalingGroupName: string;
|
||||
InstanceIds: string[];
|
||||
}
|
||||
|
||||
export interface AttachLoadBalancersParams {
|
||||
AutoScalingGroupName: string;
|
||||
LoadBalancerNames: string[];
|
||||
}
|
||||
|
||||
export interface AttachLoadBalancerTargetGroupsParams {
|
||||
AutoScalingGroupName: string;
|
||||
TargetGroupARNs: string[];
|
||||
}
|
||||
|
||||
export interface CompleteLifecycleActionParams {
|
||||
AutoScalingGroupName: string;
|
||||
LifecycleActionResult: string;
|
||||
LifecycleHookName: string;
|
||||
lifecycleActionToken?: string;
|
||||
InstanceId?: string;
|
||||
}
|
||||
|
||||
export interface CreateAutoScalingGroupParams {
|
||||
AutoScalingGroupName: string;
|
||||
MinSize: number;
|
||||
MaxSize: number;
|
||||
LaunchConfigurationName?: string;
|
||||
InstanceId?: string;
|
||||
DesiredCapacity?: number;
|
||||
DefaultCooldown?: number;
|
||||
AvailabilityZones?: string[];
|
||||
LoadBalancerNames?: string[];
|
||||
TargetGroupARNs?: string[];
|
||||
HealthCheckType?: string;
|
||||
HealthCheckGracePeriod?: number;
|
||||
PlacementGroup?: string;
|
||||
VPCZoneIdentifier?: string;
|
||||
TerminationPolicies?: string;
|
||||
NewInstancesProtectedFromScaleIn?: boolean;
|
||||
Tags?: Tags;
|
||||
}
|
||||
|
||||
export interface CreateLaunchConfigurationParams {
|
||||
LaunchConfigurationName: string;
|
||||
AssociatePublicIpAddress?: boolean;
|
||||
ImageId?: string;
|
||||
KeyName?: string;
|
||||
SecurityGroups?: string[];
|
||||
ClassicLinkVPCId?: string;
|
||||
ClassicLinkVPCSecurityGroups?: string[];
|
||||
UserData?: string;
|
||||
InstanceId?: string;
|
||||
InstanceType?: string;
|
||||
KernelId?: string;
|
||||
RamdiskId?: string;
|
||||
BlockDeviceMappings?: BlockDeviceMapping[];
|
||||
InstanceMonitoring?: InstanceMonitoring;
|
||||
SpotPrice?: string;
|
||||
IamInstanceProfile?: string;
|
||||
EbsOptimized?: boolean;
|
||||
PlacementTenancy?: string;
|
||||
}
|
||||
|
||||
export interface CreateOrUpdateTagsParams {
|
||||
Tags: Tags[];
|
||||
}
|
||||
|
||||
export interface DeleteAutoScalingGroupParams {
|
||||
AutoScalingGroupName: string;
|
||||
ForceDelete?: boolean;
|
||||
}
|
||||
|
||||
export interface DeleteLaunchConfigurationParams {
|
||||
LaunchConfigurationName: string;
|
||||
}
|
||||
|
||||
export interface DeleteLifecycleHookParams {
|
||||
AutoScalingGroupName: string;
|
||||
LifecycleHookName: string;
|
||||
}
|
||||
|
||||
export interface DeleteNotificationConfigurationParams {
|
||||
AutoScalingGroupName: string;
|
||||
TopicARN: string;
|
||||
}
|
||||
|
||||
export interface DeletePolicyParams {
|
||||
PolicyName: string;
|
||||
AutoScalingGroupName?: string;
|
||||
}
|
||||
|
||||
export interface DeleteScheduledActionParams {
|
||||
AutoScalingGroupName: string;
|
||||
ScheduledActionName: string;
|
||||
}
|
||||
|
||||
export interface DeleteTagsParams {
|
||||
Tags: Tags[];
|
||||
}
|
||||
|
||||
export interface DescribeAutoScalingGroupsParams {
|
||||
AutoScalingGroupName?: string;
|
||||
NextToken?: string;
|
||||
MaxRecords?: number;
|
||||
}
|
||||
|
||||
export interface DescribeAutoScalingInstancesParams {
|
||||
InstanceIds?: string[];
|
||||
NextToken?: string;
|
||||
MaxRecords?: number;
|
||||
}
|
||||
|
||||
export interface DescribeLaunchConfigurationsParams {
|
||||
LaunchConfigurationNames?: string[];
|
||||
NextToken?: string;
|
||||
MaxRecords?: number;
|
||||
}
|
||||
|
||||
export interface DescribeLifecycleHooksParams {
|
||||
AutoScalingGroupName: string;
|
||||
LifecycleHookNames?: string[];
|
||||
}
|
||||
|
||||
export interface DescribeLoadBalancersParams {
|
||||
AutoScalingGroupName: string;
|
||||
NextToken?: string;
|
||||
MaxRecords?: number;
|
||||
}
|
||||
|
||||
export interface DescribeLoadBalancerTargetGroupsParams {
|
||||
AutoScalingGroupName: string;
|
||||
NextToken?: string;
|
||||
MaxRecords?: number;
|
||||
}
|
||||
|
||||
export interface DescribeNotificationConfigurationsParams {
|
||||
AutoScalingGroupName?: string;
|
||||
NextToken?: string;
|
||||
MaxRecords?: number;
|
||||
}
|
||||
|
||||
export interface DescribePoliciesParams {
|
||||
AutoScalingGroupName?: string;
|
||||
PolicyNames?: string[];
|
||||
PolicyTypes?: string[];
|
||||
NextToken?: string;
|
||||
MaxRecords?: number;
|
||||
}
|
||||
|
||||
export interface DescribeScalingActivitiesParams {
|
||||
AutoScalingGroupName?: string;
|
||||
ActivityIds?: string[];
|
||||
NextToken?: string;
|
||||
MaxRecords?: number;
|
||||
}
|
||||
|
||||
export interface DescribeScheduledActionsParams {
|
||||
AutoScalingGroupName?: string;
|
||||
ScheduledActionNames?: string[];
|
||||
StartTime?: Date;
|
||||
EndTime?: Date;
|
||||
NextToken?: string;
|
||||
MaxRecords?: number;
|
||||
}
|
||||
|
||||
export interface DescribeTagsParams {
|
||||
Filters?: Filter[];
|
||||
NextToken?: string;
|
||||
MaxRecords?: number;
|
||||
}
|
||||
|
||||
export interface DetachInstancesParams {
|
||||
AutoScalingGroupName: string;
|
||||
ShouldDecrementDesiredCapacity: boolean;
|
||||
InstanceIds?: string[];
|
||||
}
|
||||
|
||||
export interface DetachLoadBalancersParams {
|
||||
AutoScalingGroupName: string;
|
||||
LoadBalancerNames: string;
|
||||
}
|
||||
|
||||
export interface DetachLoadBalancerTargetGroupsParams {
|
||||
AutoScalingGroupName: string;
|
||||
TargetGroupARNs: string[];
|
||||
}
|
||||
|
||||
export interface DisableMetricsCollectionParams {
|
||||
AutoScalingGroupName: string;
|
||||
Metrics?: string[];
|
||||
}
|
||||
|
||||
export interface EnableMetricsCollectionParams {
|
||||
AutoScalingGroupName: string;
|
||||
Granularity: string;
|
||||
Metrics?: string[];
|
||||
}
|
||||
|
||||
export interface EnterStandbyParams {
|
||||
AutoScalingGroupName: string;
|
||||
ShouldDecrementDesiredCapacity: boolean;
|
||||
InstanceIds?: string[];
|
||||
}
|
||||
|
||||
export interface ExecutePolicyParams {
|
||||
PolicyName: string;
|
||||
AutoScalingGroupName?: string;
|
||||
HonorCooldown?: boolean;
|
||||
MetricValue?: number;
|
||||
BreachThreshold?: number;
|
||||
}
|
||||
|
||||
export interface ExitStandbyParams {
|
||||
AutoScalingGroupName: string;
|
||||
InstanceIds?: string[];
|
||||
}
|
||||
|
||||
export interface PutLifecycleHookParams {
|
||||
AutoScalingGroupName: string;
|
||||
LifecycleHookName: string;
|
||||
LifecycleTransition?: string;
|
||||
RoleARN?: string;
|
||||
NotificationTargetARN?: string;
|
||||
NotificationMetadata?: string;
|
||||
HeartbeatTimeout?: number;
|
||||
DefaultResult?: string;
|
||||
}
|
||||
|
||||
export interface PutNotificationConfigurationParams {
|
||||
AutoScalingGroupName: string;
|
||||
NotificationTypes: string[];
|
||||
TopicARN: string;
|
||||
}
|
||||
|
||||
export interface PutScalingPolicyParams {
|
||||
AutoScalingGroupName: string;
|
||||
AdjustmentType: string;
|
||||
PolicyName: string;
|
||||
PolicyType?: string;
|
||||
MinAdjustmentStep?: number;
|
||||
MinAdjustmentMagnitude?: number;
|
||||
ScalingAdjustment?: number;
|
||||
Cooldown?: number;
|
||||
MetricAggregationType?: string;
|
||||
StepAdjustments?: StepAdjustment[];
|
||||
EstimatedInstanceWarmup: number;
|
||||
}
|
||||
|
||||
export interface PutScheduledUpdateGroupActionParams {
|
||||
AutoScalingGroupName: string;
|
||||
ScheduledActionName: string;
|
||||
Time?: Date;
|
||||
StartTime?: Date;
|
||||
EndTime?: Date;
|
||||
Recurrence?: string;
|
||||
MinSize?: number;
|
||||
MaxSize?: number;
|
||||
DesiredCapacity?: number;
|
||||
}
|
||||
|
||||
export interface RecordLifecycleActionHeartbeatParams {
|
||||
AutoScalingGroupName: string;
|
||||
LifecycleHookName: string;
|
||||
LifecycleActionToken?: string;
|
||||
InstanceId?: string;
|
||||
}
|
||||
|
||||
export interface ResumeProcessesParams {
|
||||
AutoScalingGroupName: string;
|
||||
ScalingProcesses?: string[];
|
||||
}
|
||||
|
||||
export interface SetDesiredCapacityParams {
|
||||
AutoScalingGroupName: string;
|
||||
DesiredCapacity: number;
|
||||
HonorCooldown?: boolean;
|
||||
}
|
||||
|
||||
export interface SetInstanceHealthParams {
|
||||
HealthStatus: string;
|
||||
InstanceId: string;
|
||||
ShouldRespectGracePeriod?: boolean;
|
||||
}
|
||||
|
||||
export interface SetInstanceProtectionParams {
|
||||
AutoScalingGroupName: string;
|
||||
InstanceIds: string[];
|
||||
ProtectedFromScaleIn: boolean;
|
||||
}
|
||||
|
||||
export interface SuspendProcessesParams {
|
||||
AutoScalingGroupName: string;
|
||||
ScalingProcesses?: string[];
|
||||
}
|
||||
|
||||
export interface TerminateInstanceInAutoScalingGroupParams {
|
||||
InstanceId: string;
|
||||
ShouldDecrementDesiredCapacity: boolean;
|
||||
}
|
||||
|
||||
export interface UpdateAutoScalingGroupParams {
|
||||
AutoScalingGroupName: string;
|
||||
LaunchConfigurationName: string;
|
||||
MinSize: number;
|
||||
MaxSize: number;
|
||||
DesiredCapacity: number;
|
||||
DefaultCooldown: number;
|
||||
AvailabilityZones: string[];
|
||||
HealthCheckType: string;
|
||||
HealthCheckGracePeriod: number;
|
||||
PlacementGroup: string;
|
||||
VPCZoneIdentifier: string;
|
||||
TerminationPolicies: string[];
|
||||
NewInstancesProtectedFromScaleIn?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export module SQS {
|
||||
|
||||
export interface SqsOptions {
|
||||
@@ -1479,6 +2202,45 @@ declare module "aws-sdk" {
|
||||
}
|
||||
|
||||
export module s3 {
|
||||
interface Owner {
|
||||
DisplayName: string;
|
||||
ID: string;
|
||||
}
|
||||
|
||||
interface ObjectKeyPrefix {
|
||||
Prefix: string;
|
||||
}
|
||||
|
||||
export interface ListObjectContent {
|
||||
Key: string;
|
||||
LastModified: Date;
|
||||
ETag: string;
|
||||
Size: number;
|
||||
StorageClass: "STANDARD" | "REDUCED_REDUNDANCY" | "GLACIER";
|
||||
Owner?: Owner
|
||||
}
|
||||
|
||||
// This private interface contains the common parts between v1 and v2 of the API Request and is exposed via V1 and V2 subclasses
|
||||
interface ListObjectRequestBase {
|
||||
Bucket: string;
|
||||
Delimiter?: string;
|
||||
EncodingType?: 'url';
|
||||
MaxKeys?: number;
|
||||
Prefix?: string;
|
||||
}
|
||||
|
||||
// This private interface contains the common parts between v1 and v2 of the API Response and is exposed via V1 and V2 subclasses
|
||||
interface ListObjectResponseBase {
|
||||
IsTruncated: boolean;
|
||||
Contents: ListObjectContent[];
|
||||
Name: string;
|
||||
Prefix?: string;
|
||||
Delimiter?: string;
|
||||
MaxKeys: number;
|
||||
CommonPrefixes?: ObjectKeyPrefix[];
|
||||
EncodingType?: "url";
|
||||
}
|
||||
|
||||
export interface PutObjectRequest {
|
||||
ACL?: string;
|
||||
Body?: any;
|
||||
@@ -1502,6 +2264,40 @@ declare module "aws-sdk" {
|
||||
WebsiteRedirectLocation?: string;
|
||||
}
|
||||
|
||||
export interface CopyObjectRequest {
|
||||
Bucket: string;
|
||||
CopySource: string;
|
||||
Key: string;
|
||||
ACL?: string;
|
||||
CacheControl?: string;
|
||||
ContentDisposition?: string;
|
||||
ContentEncoding?: string;
|
||||
ContentLanguage?: string;
|
||||
ContentType?: string;
|
||||
CopySourceIfMatch?: string;
|
||||
CopySourceIfModifiedSince?: any;
|
||||
CopySourceIfNoneMatch?: string;
|
||||
CopySourceIfUnmodifiedSince?: any;
|
||||
CopySourceSSECustomerAlgorithm?: string;
|
||||
CopySourceSSECustomerKey?: any;
|
||||
CopySourceSSECustomerKeyMD5?: string;
|
||||
Expires?: any;
|
||||
GrantFullControl?: string;
|
||||
GrantRead?: string;
|
||||
GrantReadACP?: string;
|
||||
GrantWriteACP?: string;
|
||||
Metadata?: { [key: string]: string; };
|
||||
MetadataDirective?: string;
|
||||
RequestPayer?: string;
|
||||
SSECustomerAlgorithm?: string;
|
||||
SSECustomerKey?: any;
|
||||
SSECustomerKeyMD5?: string;
|
||||
SSEKMSKeyId?: string;
|
||||
ServerSideEncryption?: string;
|
||||
StorageClass?: string;
|
||||
WebsiteRedirectLocation?: string;
|
||||
}
|
||||
|
||||
export interface GetObjectRequest {
|
||||
Bucket: string;
|
||||
IfMatch?: string;
|
||||
@@ -1546,6 +2342,28 @@ declare module "aws-sdk" {
|
||||
partSize?: number;
|
||||
queueSize?: number;
|
||||
}
|
||||
|
||||
export interface ListObjectRequest extends ListObjectRequestBase {
|
||||
Marker?: string;
|
||||
}
|
||||
|
||||
export interface ListObjectV2Request extends ListObjectRequestBase {
|
||||
ContinuationToken?: string;
|
||||
FetchOwner?: boolean;
|
||||
StartAfter?: string;
|
||||
}
|
||||
|
||||
export interface ListObjectResponse extends ListObjectResponseBase {
|
||||
Marker?: string;
|
||||
NextMarker?: string;
|
||||
}
|
||||
|
||||
export interface ListObjectV2Response extends ListObjectResponseBase {
|
||||
KeyCount: number;
|
||||
ContinuationToken?: string;
|
||||
NextContinuationToken?: string;
|
||||
StartAfter?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export module ecs {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/// <reference path="./aws-serverless-express.d.ts" />
|
||||
/// <reference path="../express/express.d.ts"/>
|
||||
|
||||
import * as awsServerlessExpress from 'aws-serverless-express';
|
||||
import * as express from 'express';
|
||||
|
||||
const app = express();
|
||||
const server = awsServerlessExpress.createServer(app, () => {});
|
||||
|
||||
const mockEvent = {
|
||||
key: 'value'
|
||||
};
|
||||
|
||||
const mockContext = {
|
||||
callbackWaitsForEmptyEventLoop: true,
|
||||
functionName: 'testFunction',
|
||||
functionVersion: '1',
|
||||
invokedFunctionArn: 'arn',
|
||||
memoryLimitInMB: 128,
|
||||
awsRequestId: 'id',
|
||||
logGroupName: 'group',
|
||||
logStreamName: 'stream',
|
||||
getRemainingTimeInMillis: () => 2000,
|
||||
done: () => false,
|
||||
fail: (error: any) => false,
|
||||
succeed: (message: string) => false
|
||||
};
|
||||
|
||||
awsServerlessExpress.proxy(server, mockEvent, mockContext);
|
||||
@@ -0,0 +1,24 @@
|
||||
// Type definitions for aws-serverless-express
|
||||
// Project: https://github.com/awslabs/aws-serverless-express
|
||||
// Definitions by: Ben Speakman <https://github.com/threesquared>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts"/>
|
||||
/// <reference path="../aws-lambda/aws-lambda.d.ts"/>
|
||||
|
||||
declare module 'aws-serverless-express' {
|
||||
|
||||
import * as http from 'http';
|
||||
import * as lambda from 'aws-lambda';
|
||||
|
||||
export function createServer(
|
||||
requestListener: (request: http.IncomingMessage, response: http.ServerResponse) => http.Server,
|
||||
serverListenCallback?: () => any
|
||||
): http.Server;
|
||||
|
||||
export function proxy(
|
||||
server: http.Server,
|
||||
event: any,
|
||||
context: lambda.Context
|
||||
): void;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/// <reference path="axe-core.d.ts" />
|
||||
|
||||
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()
|
||||
Vendored
+159
@@ -0,0 +1,159 @@
|
||||
// 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;
|
||||
}
|
||||
@@ -69,6 +69,10 @@ axios.post("http://example.com/", {
|
||||
]
|
||||
});
|
||||
|
||||
var config: Axios.AxiosXHRConfigBase<any> = {headers: {}};
|
||||
config.headers['X-Custom-Header'] = 'baz';
|
||||
axios.post("http://example.com/", config);
|
||||
|
||||
var getRepoIssue = axios.get<Issue>("https://api.github.com/repos/mzabriskie/axios/issues/1");
|
||||
|
||||
var axiosInstance = axios.create({
|
||||
|
||||
Vendored
+1
-1
@@ -39,7 +39,7 @@ declare namespace Axios {
|
||||
/**
|
||||
* custom headers to be sent
|
||||
*/
|
||||
headers?: Object;
|
||||
headers?: {[key: string]: any};
|
||||
|
||||
/**
|
||||
* URL parameters to be sent with the request
|
||||
|
||||
@@ -8,7 +8,7 @@ import queries = require('azure-mobile-apps/src/query');
|
||||
var app = express(),
|
||||
mobileApp = mobileApps();
|
||||
|
||||
// various configuration permutations
|
||||
// various configuration permutations
|
||||
mobileApps({
|
||||
debug: true,
|
||||
data: {
|
||||
@@ -17,7 +17,8 @@ mobileApps({
|
||||
user: '',
|
||||
database: '',
|
||||
password: ''
|
||||
}
|
||||
},
|
||||
webhook: { url: 'http://localhost/' }
|
||||
});
|
||||
|
||||
mobileApps({
|
||||
@@ -29,7 +30,7 @@ mobileApps({
|
||||
// it would be nice to integrate with winston
|
||||
mobileApps({ logging: { level: 'silly', transports: [{}] } })
|
||||
|
||||
// various custom middleware syntaxes
|
||||
// various custom middleware syntaxes
|
||||
mobileApp.use(function (req: any, res: any, next: any) { next(); });
|
||||
mobileApp.use([function () {}, function () {}]);
|
||||
mobileApp.use(function () {}, function () {});
|
||||
@@ -43,6 +44,9 @@ 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) {
|
||||
@@ -61,21 +65,45 @@ table.read(function (context: Azure.MobileApps.Context) {
|
||||
table.insert(function (context: Azure.MobileApps.Context) {
|
||||
context.query.id = 'anotherId';
|
||||
context.query.single = true;
|
||||
context.item.userId = context.user.id;
|
||||
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.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) {})
|
||||
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');
|
||||
@@ -83,5 +111,15 @@ logger.error('Something happened', new Error());
|
||||
mobileApps.logger.debug('a debug message')
|
||||
|
||||
// Query
|
||||
queries.create('table').where({ x: 10 }).select('col1,col2');
|
||||
mobileApps.query.create('table');
|
||||
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 () {} });
|
||||
|
||||
+62
-15
@@ -1,4 +1,4 @@
|
||||
// Type definitions for azure-mobile-apps v2.0.0-beta3
|
||||
// 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
|
||||
@@ -10,6 +10,7 @@ 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;
|
||||
}
|
||||
@@ -31,7 +32,7 @@ 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 {
|
||||
interface MobileApp extends Middleware {
|
||||
configuration: Configuration;
|
||||
tables: Tables;
|
||||
table(): Table;
|
||||
@@ -45,14 +46,7 @@ declare namespace Azure.MobileApps {
|
||||
import(fileOrFolder: string): void;
|
||||
}
|
||||
|
||||
interface Table {
|
||||
authorize?: boolean;
|
||||
autoIncrement?: boolean;
|
||||
dynamicSchema?: boolean;
|
||||
name: string;
|
||||
columns?: any;
|
||||
schema: string;
|
||||
|
||||
interface Table extends TableDefinition {
|
||||
use(...middleware: Middleware[]): Table;
|
||||
use(middleware: Middleware[]): Table;
|
||||
read: TableOperation;
|
||||
@@ -66,6 +60,7 @@ declare namespace Azure.MobileApps {
|
||||
(operationHandler: (context: Context) => void): Table;
|
||||
use(...middleware: Middleware[]): Table;
|
||||
use(middleware: Middleware[]): Table;
|
||||
access?: AccessType;
|
||||
}
|
||||
|
||||
interface Tables {
|
||||
@@ -132,6 +127,7 @@ declare namespace Azure.MobileApps {
|
||||
auth?: Configuration.Auth;
|
||||
cors?: Configuration.Cors;
|
||||
notifications?: Configuration.Notifications;
|
||||
webhook?: Webhook;
|
||||
}
|
||||
|
||||
export module Configuration {
|
||||
@@ -148,6 +144,7 @@ declare namespace Azure.MobileApps {
|
||||
options?: { encrypt: boolean };
|
||||
schema?: string;
|
||||
dynamicSchema?: boolean;
|
||||
filename?: string;
|
||||
}
|
||||
|
||||
interface Auth {
|
||||
@@ -163,8 +160,9 @@ declare namespace Azure.MobileApps {
|
||||
interface LoggingTransport { }
|
||||
|
||||
interface Cors {
|
||||
exposeHeaders: string;
|
||||
maxAge?: number;
|
||||
origins: string[];
|
||||
hostnames: string[];
|
||||
}
|
||||
|
||||
interface Notifications {
|
||||
@@ -184,7 +182,8 @@ declare namespace Azure.MobileApps {
|
||||
}
|
||||
|
||||
interface QueryJs {
|
||||
includeTotalCount?: boolean;
|
||||
includeTotalCount(): QueryJs;
|
||||
includeDeleted(): QueryJs;
|
||||
orderBy(properties: string): QueryJs;
|
||||
orderByDescending(properties: string): QueryJs;
|
||||
select(properties: string): QueryJs;
|
||||
@@ -209,27 +208,75 @@ declare namespace Azure.MobileApps {
|
||||
|
||||
// general
|
||||
var nh: Azure.ServiceBus.NotificationHubService;
|
||||
|
||||
interface Context {
|
||||
query: QueryJs;
|
||||
id: string | number;
|
||||
item: any;
|
||||
req: Express.Request;
|
||||
res: Express.Response;
|
||||
data: (table: TableDefinition) => Data.Table;
|
||||
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;
|
||||
dynamicSchema?: boolean;
|
||||
name?: string;
|
||||
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 {
|
||||
|
||||
@@ -17,7 +17,7 @@ declare namespace Microsoft.WindowsAzure {
|
||||
login(provider: string, token: string): asyncPromise;
|
||||
login(provider: string, callback: (error: any, user: User) => void ): void;
|
||||
login(provider: string): asyncPromise;
|
||||
logout(): void;
|
||||
logout(): asyncPromise;
|
||||
getTable(tableName: string): MobileServiceTable;
|
||||
withFilter(serviceFilter: (request: any, next: (request: any, callback: (error: any, response: any) => void) => void, callback: (error: any, response: any) => void) => void): MobileServiceClient;
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -346,7 +346,7 @@ declare module "babel-traverse" {
|
||||
|
||||
getData(key: string, def?: any): any;
|
||||
|
||||
buildCodeFrameError(msg: string, Error: Error): Error;
|
||||
buildCodeFrameError<TError extends Error>(msg: string, Error?: new (msg: string) => TError): TError;
|
||||
|
||||
traverse(visitor: Visitor, state?: any): void;
|
||||
|
||||
|
||||
@@ -329,32 +329,32 @@ var CORE_PARSER_TESTS: ParserTest[] = [
|
||||
}
|
||||
},
|
||||
// {
|
||||
// description: "Comment with non-default character",
|
||||
// input: 'a,b,c\n!Comment goes here\nd,e,f',
|
||||
// config: { comments: '!' },
|
||||
// expected: {
|
||||
// data: [['a', 'b', 'c'], ['d', 'e', 'f']],
|
||||
// errors: []
|
||||
// }
|
||||
// description: "Comment with non-default character",
|
||||
// input: 'a,b,c\n!Comment goes here\nd,e,f',
|
||||
// config: { comments: '!' },
|
||||
// expected: {
|
||||
// data: [['a', 'b', 'c'], ['d', 'e', 'f']],
|
||||
// errors: []
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// description: "Bad comments value specified",
|
||||
// notes: "Should silently disable comment parsing",
|
||||
// input: 'a,b,c\n5comment\nd,e,f',
|
||||
// config: { comments: 5 },
|
||||
// expected: {
|
||||
// data: [['a', 'b', 'c'], ['5comment'], ['d', 'e', 'f']],
|
||||
// errors: []
|
||||
// }
|
||||
// description: "Bad comments value specified",
|
||||
// notes: "Should silently disable comment parsing",
|
||||
// input: 'a,b,c\n5comment\nd,e,f',
|
||||
// config: { comments: 5 },
|
||||
// expected: {
|
||||
// data: [['a', 'b', 'c'], ['5comment'], ['d', 'e', 'f']],
|
||||
// errors: []
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// description: "Multi-character comment string",
|
||||
// input: 'a,b,c\n=N(Comment)\nd,e,f',
|
||||
// config: { comments: "=N(" },
|
||||
// expected: {
|
||||
// data: [['a', 'b', 'c'], ['d', 'e', 'f']],
|
||||
// errors: []
|
||||
// }
|
||||
// description: "Multi-character comment string",
|
||||
// input: 'a,b,c\n=N(Comment)\nd,e,f',
|
||||
// config: { comments: "=N(" },
|
||||
// expected: {
|
||||
// data: [['a', 'b', 'c'], ['d', 'e', 'f']],
|
||||
// errors: []
|
||||
// }
|
||||
// },
|
||||
{
|
||||
description: "Input with only a commented line",
|
||||
@@ -419,13 +419,13 @@ var CORE_PARSER_TESTS: ParserTest[] = [
|
||||
}
|
||||
},
|
||||
// {
|
||||
// description: "Fast mode with comments",
|
||||
// input: '// Commented line\na,b,c',
|
||||
// config: { fastMode: true, comments: "//" },
|
||||
// expected: {
|
||||
// data: [['a', 'b', 'c']],
|
||||
// errors: []
|
||||
// }
|
||||
// description: "Fast mode with comments",
|
||||
// input: '// Commented line\na,b,c',
|
||||
// config: { fastMode: true, comments: "//" },
|
||||
// expected: {
|
||||
// data: [['a', 'b', 'c']],
|
||||
// errors: []
|
||||
// }
|
||||
// },
|
||||
{
|
||||
description: "Fast mode with preview",
|
||||
@@ -1091,7 +1091,7 @@ function compare(actualData: any[], actualErrors: any[], expected: ParserTestExp
|
||||
}
|
||||
}
|
||||
|
||||
if (passed) // final check will catch any other differences
|
||||
if (passed) // final check will catch any other differences
|
||||
passed = JSON.stringify(actual) == JSON.stringify(expected);
|
||||
|
||||
// We pass back an object right now, even though it only contains
|
||||
@@ -1228,3 +1228,11 @@ var parser = new Baby.Parser({})
|
||||
parser.getCharIndex();
|
||||
parser.abort();
|
||||
parser.parse("");
|
||||
|
||||
/**
|
||||
* Parse Files
|
||||
*/
|
||||
Baby.parseFiles('example.csv')
|
||||
Baby.parseFiles('example.csv', {encoding: 'utf-8'})
|
||||
Baby.parseFiles(['example1.csv', 'example2.txt'])
|
||||
Baby.parseFiles(['example1.csv', 'example2.txt'], {encoding: 'utf-8'})
|
||||
Vendored
+10
@@ -9,6 +9,11 @@ declare namespace BabyParse {
|
||||
* Parse a csv string or a csv file
|
||||
*/
|
||||
parse(csvString: string, config?: ParseConfig): ParseResult;
|
||||
|
||||
/**
|
||||
* Parse single file or multiple files
|
||||
*/
|
||||
parseFiles(input: string | string[] | FileObject | FileObject[], config?: ParseConfig): ParseResult;
|
||||
|
||||
/**
|
||||
* Unparses javascript data objects and returns a csv string
|
||||
@@ -86,6 +91,11 @@ declare namespace BabyParse {
|
||||
data: string | Array<any>;
|
||||
}
|
||||
|
||||
interface FileObject {
|
||||
file: string
|
||||
config?: ParseConfig
|
||||
}
|
||||
|
||||
interface ParseError {
|
||||
type: string; // A generalization of the error
|
||||
code: string; // Standardized error code
|
||||
|
||||
Vendored
+26
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Backbone 1.0.0
|
||||
// Type definitions for Backbone 1.3.3
|
||||
// Project: http://backbonejs.org/
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Natan Vivo <https://github.com/nvivo/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -109,9 +109,15 @@ declare namespace Backbone {
|
||||
|
||||
attributes: any;
|
||||
changed: any[];
|
||||
cidPrefix: string;
|
||||
cid: string;
|
||||
collection: Collection<any>;
|
||||
|
||||
private _changing: boolean;
|
||||
private _previousAttributes : any;
|
||||
private _pending: boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Default attributes for the model. It can be an object hash or a method returning an object hash.
|
||||
* For assigning an object hash, do it like this: this.defaults = <any>{ attribute: value, ... };
|
||||
@@ -147,7 +153,14 @@ declare namespace Backbone {
|
||||
/*private*/ set(attributeName: string, value: any, options?: ModelSetOptions): Model;
|
||||
set(obj: any, options?: ModelSetOptions): Model;
|
||||
|
||||
changedAttributes(attributes?: any): any[];
|
||||
/**
|
||||
* Return an object containing all the attributes that have changed, or
|
||||
* false if there are no changed attributes. Useful for determining what
|
||||
* parts of a view need to be updated and/or what attributes need to be
|
||||
* persisted to the server. Unset attributes will be set to undefined.
|
||||
* You can also pass an attributes object to diff against the model,
|
||||
* determining if there *would be* a change. */
|
||||
changedAttributes(attributes?: any): any;
|
||||
clear(options?: Silenceable): any;
|
||||
clone(): Model;
|
||||
destroy(options?: ModelDestroyOptions): any;
|
||||
@@ -178,6 +191,7 @@ declare namespace Backbone {
|
||||
omit(fn: (value: any, key: any, object: any) => any): any;
|
||||
chain(): any;
|
||||
isEmpty(): boolean;
|
||||
matches(attrs: any): boolean;
|
||||
}
|
||||
|
||||
class Collection<TModel extends Model> extends ModelBase {
|
||||
@@ -208,6 +222,7 @@ declare namespace Backbone {
|
||||
* Get a model from a collection, specified by an id, a cid, or by passing in a model.
|
||||
**/
|
||||
get(id: number|string|Model): TModel;
|
||||
has(key: number|string|Model): boolean;
|
||||
create(attributes: any, options?: ModelSaveOptions): TModel;
|
||||
pluck(attribute: string): any[];
|
||||
push(model: TModel, options?: AddOptions): TModel;
|
||||
@@ -221,10 +236,12 @@ declare namespace Backbone {
|
||||
unshift(model: TModel, options?: AddOptions): TModel;
|
||||
where(properties: any): TModel[];
|
||||
findWhere(properties: any): TModel;
|
||||
modelId(attrs: any) : any
|
||||
|
||||
private _prepareModel(attributes?: any, options?: any): any;
|
||||
private _removeReference(model: TModel): void;
|
||||
private _onModelEvent(event: string, model: TModel, collection: Collection<TModel>, options: any): void;
|
||||
private _isModel(obj: any) : obj is Model;
|
||||
|
||||
/**
|
||||
* Return a shallow copy of this collection's models, using the same options as native Array#slice.
|
||||
@@ -314,6 +331,8 @@ declare namespace Backbone {
|
||||
navigate(fragment: string, options?: NavigateOptions): Router;
|
||||
navigate(fragment: string, trigger?: boolean): Router;
|
||||
|
||||
execute(callback: Function, args: any[], name: string) : void;
|
||||
|
||||
private _bindRoutes(): void;
|
||||
private _routeToRegExp(route: string): RegExp;
|
||||
private _extractParameters(route: RegExp, fragment: string): string[];
|
||||
@@ -330,9 +349,14 @@ declare namespace Backbone {
|
||||
|
||||
getHash(window?: Window): string;
|
||||
getFragment(fragment?: string): string;
|
||||
decodeFragment(fragment: string): string;
|
||||
getSearch(): string;
|
||||
stop(): void;
|
||||
route(route: string, callback: Function): number;
|
||||
checkUrl(e?: any): void;
|
||||
getPath(): string;
|
||||
matchRoot(): boolean;
|
||||
atRoot(): boolean;
|
||||
loadUrl(fragmentOverride?: string): boolean;
|
||||
navigate(fragment: string, options?: any): boolean;
|
||||
static started: boolean;
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Backbone 1.0.0
|
||||
// Type definitions for Backbone 1.3.3
|
||||
// Project: http://backbonejs.org/
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Natan Vivo <https://github.com/nvivo/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/// <reference path="backlog-js.d.ts" />
|
||||
|
||||
import * as backlogjs from 'backlog-js';
|
||||
|
||||
const host = 'example.backlog.jp';
|
||||
const apiKey = 'apiKey';
|
||||
const clientId = 'clientId';
|
||||
const clientSecret = 'clientSecret';
|
||||
const redirectUri = 'redirectUri';
|
||||
const state = 'state';
|
||||
const code = 'code';
|
||||
const refreshToken = 'refreshToken';
|
||||
const configure = { host, apiKey }
|
||||
const credentials = { clientId, clientSecret }
|
||||
|
||||
const oauth2 = new backlogjs.OAuth2(credentials);
|
||||
oauth2.getAuthorizationURL({ host, redirectUri, state });
|
||||
oauth2.getAccessToken({ host, code, redirectUri }).then(data => {}).catch(err => {});
|
||||
oauth2.refreshAccessToken({ host, refreshToken }).then(data => {}).catch(err => {});
|
||||
|
||||
const backlog = new backlogjs.Backlog(configure);
|
||||
backlog.getSpace().then(data => { }).catch(err => { });
|
||||
backlog.getSpaceActivities({
|
||||
activityTypeId: [
|
||||
backlogjs.Option.ActivityType.IssueCreated,
|
||||
backlogjs.Option.ActivityType.IssueUpdated
|
||||
],
|
||||
minId: 1,
|
||||
maxId: 2,
|
||||
count: 3,
|
||||
order: "asc"
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getSpaceDiskUsage().then(data => { }).catch(err => { });
|
||||
backlog.getSpaceIcon().then(data => { }).catch(err => { });
|
||||
backlog.postSpaceAttachment(new FormData()).then(data => { }).catch(err => { });
|
||||
backlog.getUsers().then(data => { }).catch(err => { });
|
||||
backlog.getUser(1).then(data => { }).catch(err => { });
|
||||
backlog.postUser({
|
||||
userId: 'string',
|
||||
password: 'string',
|
||||
name: 'string',
|
||||
mailAddress: 'string',
|
||||
roleType: backlogjs.Option.User.RoleType.Admin
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.patchUser(1, {
|
||||
password: 'string',
|
||||
name: 'string',
|
||||
mailAddress: 'string',
|
||||
roleType: backlogjs.Option.User.RoleType.Admin
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.deleteUser(1).then(data => { }).catch(err => { });
|
||||
backlog.getMyself().then(data => { }).catch(err => { });
|
||||
backlog.getUserActivities(1, {
|
||||
activityTypeId: [
|
||||
backlogjs.Option.ActivityType.IssueCreated,
|
||||
backlogjs.Option.ActivityType.IssueUpdated
|
||||
],
|
||||
minId: 1,
|
||||
maxId: 2,
|
||||
count: 3,
|
||||
order: "asc"
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getUserStars(1, {
|
||||
minId: 1,
|
||||
maxId: 2,
|
||||
count: 3,
|
||||
order: "asc"
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getUserStarsCount(1, {
|
||||
since: 'YYYY-MM-DD',
|
||||
until: 'YYYY-MM-DD'
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getRecentlyViewedIssues({
|
||||
order: 'asc',
|
||||
offset: 1,
|
||||
count: 2
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getRecentlyViewedProjects({
|
||||
order: 'asc',
|
||||
offset: 1,
|
||||
count: 2
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getRecentlyViewedWikis({
|
||||
order: 'asc',
|
||||
offset: 1,
|
||||
count: 2
|
||||
}).then(data => { }).catch(err => { });
|
||||
backlog.getUserIcon(1).then(data => {}).catch(err => {});
|
||||
Vendored
+695
@@ -0,0 +1,695 @@
|
||||
// Type definitions for backlog-js 0.9.0
|
||||
// Project: https://github.com/nulab/backlog-js
|
||||
// Definitions by: Yuichi Watanabe <https://github.com/vvatanabe>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../isomorphic-fetch/isomorphic-fetch.d.ts" />
|
||||
/// <reference path="../node_modules/typescript/lib/lib.es6.d.ts" />
|
||||
|
||||
declare module 'backlog-js' {
|
||||
|
||||
class Request {
|
||||
private configure;
|
||||
constructor(configure: {
|
||||
host: string;
|
||||
apiKey?: string;
|
||||
accessToken?: string;
|
||||
timeout?: number;
|
||||
});
|
||||
get<T>(path: string, params?: any): Promise<T>;
|
||||
post<T>(path: string, params?: any): Promise<T>;
|
||||
put<T>(path: string, params: any): Promise<T>;
|
||||
patch<T>(path: string, params: any): Promise<T>;
|
||||
delete<T>(path: string, params?: any): Promise<T>;
|
||||
request(options: {
|
||||
method: string;
|
||||
path: string;
|
||||
params?: Params | FormData;
|
||||
}): Promise<IResponse>;
|
||||
checkStatus(response: IResponse): Promise<IResponse>;
|
||||
parseJSON<T>(response: IResponse): Promise<T>;
|
||||
private toFormData(params);
|
||||
private toQueryString(params);
|
||||
webAppBaseURL: string;
|
||||
restBaseURL: string;
|
||||
}
|
||||
|
||||
type Params = {
|
||||
[index: string]: number | string | number[] | string[];
|
||||
};
|
||||
|
||||
export class Backlog extends Request {
|
||||
constructor(configure: {
|
||||
host: string;
|
||||
apiKey?: string;
|
||||
accessToken?: string;
|
||||
timeout?: number;
|
||||
});
|
||||
getSpace(): Promise<any>;
|
||||
getSpaceActivities(params: Option.Space.GetActivitiesParams): Promise<any>;
|
||||
getSpaceNotification(): Promise<any>;
|
||||
putSpaceNotification(params: Option.Space.PutSpaceNotificationParams): Promise<any>;
|
||||
getSpaceDiskUsage(): Promise<any>;
|
||||
getSpaceIcon(): Promise<Entity.File.FileData>;
|
||||
postSpaceAttachment(form: FormData): Promise<IResponse>;
|
||||
getUsers(): Promise<any>;
|
||||
getUser(userId: number): Promise<any>;
|
||||
postUser(params: Option.User.PostUserParams): Promise<any>;
|
||||
patchUser(userId: number, params: Option.User.PatchUserParams): Promise<any>;
|
||||
deleteUser(userId: number): Promise<any>;
|
||||
getMyself(): Promise<any>;
|
||||
getUserActivities(userId: number, params: Option.User.GetUserActivitiesParams): Promise<any>;
|
||||
getUserStars(userId: number, params: Option.User.GetUserStarsParams): Promise<any>;
|
||||
getUserStarsCount(userId: number, params: Option.User.GetUserStarsCountParams): Promise<any>;
|
||||
getRecentlyViewedIssues(params: Option.User.GetRecentlyViewedParams): Promise<any>;
|
||||
getRecentlyViewedProjects(params: Option.User.GetRecentlyViewedParams): Promise<any>;
|
||||
getRecentlyViewedWikis(params: Option.User.GetRecentlyViewedParams): Promise<any>;
|
||||
getUserIcon(userId: number): Promise<Entity.File.FileData>;
|
||||
getGroups(params: Option.Group.GetGroupsParams): Promise<any>;
|
||||
postGroups(params: Option.Group.PostGroupsParams): Promise<any>;
|
||||
getGroup(groupId: number): Promise<any>;
|
||||
patchGroup(groupId: number, params: Option.Group.PatchGroupParams): Promise<any>;
|
||||
deleteGroup(groupId: number): Promise<any>;
|
||||
getStatuses(): Promise<any>;
|
||||
getResolutions(): Promise<any>;
|
||||
getPriorities(): Promise<any>;
|
||||
postProject(params: Option.Project.PostProjectParams): Promise<any>;
|
||||
getProjects(params?: Option.Project.GetProjectsParams): Promise<any>;
|
||||
getProject(projectIdOrKey: string): Promise<any>;
|
||||
patchProject(projectIdOrKey: string, params: Option.Project.PatchProjectParams): Promise<any>;
|
||||
deleteProject(projectIdOrKey: string): Promise<any>;
|
||||
getProjectActivities(projectIdOrKey: string, params: Option.Space.GetActivitiesParams): Promise<any>;
|
||||
getProjectUsers(projectIdOrKey: string): Promise<any>;
|
||||
deleteProjectUsers(projectIdOrKey: string, params: Option.Project.DeleteProjectUsersParams): Promise<any>;
|
||||
postProjectAdministrators(projectIdOrKey: string, params: Option.Project.PostProjectAdministrators): Promise<any>;
|
||||
getProjectAdministrators(projectIdOrKey: string): Promise<any>;
|
||||
deleteProjectAdministrators(projectIdOrKey: string, params: Option.Project.DeleteProjectAdministrators): Promise<any>;
|
||||
getIssueTypes(projectIdOrKey: string): Promise<any>;
|
||||
postIssueType(projectIdOrKey: string, params: Option.Project.PostIssueTypeParams): Promise<any>;
|
||||
patchIssueType(projectIdOrKey: string, id: number, params: Option.Project.PatchIssueTypeParams): Promise<any>;
|
||||
deleteIssueType(projectIdOrKey: string, id: number, params: Option.Project.DeleteIssueTypeParams): Promise<any>;
|
||||
getCategories(projectIdOrKey: string): Promise<any>;
|
||||
postCategories(projectIdOrKey: string, params: Option.Project.PostCategoriesParams): Promise<any>;
|
||||
patchCategories(projectIdOrKey: string, id: number, params: Option.Project.PatchCategoriesParams): Promise<any>;
|
||||
deleteCategories(projectIdOrKey: string, id: number): Promise<any>;
|
||||
getVersions(projectIdOrKey: string): Promise<any>;
|
||||
postVersions(projectIdOrKey: string, params: Option.Project.PostVersionsParams): Promise<any>;
|
||||
patchVersions(projectIdOrKey: string, id: number, params: Option.Project.PatchVersionsParams): Promise<any>;
|
||||
deleteVersions(projectIdOrKey: string, id: number): Promise<any>;
|
||||
getCustomFields(projectIdOrKey: string): Promise<any>;
|
||||
postCustomField(projectIdOrKey: string, params: Option.Project.PostCustomFieldParams | Option.Project.PostCustomFieldWithNumericParams | Option.Project.PostCustomFieldWithDateParams | Option.Project.PostCustomFieldWithListParams): Promise<any>;
|
||||
patchCustomField(projectIdOrKey: string, id: number, params: Option.Project.PatchCustomFieldParams | Option.Project.PatchCustomFieldWithNumericParams | Option.Project.PatchCustomFieldWithDateParams | Option.Project.PatchCustomFieldWithListParams): Promise<any>;
|
||||
deleteCustomField(projectIdOrKey: string, id: number): Promise<any>;
|
||||
postCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise<any>;
|
||||
patchCustomFieldItem(projectIdOrKey: string, id: number, itemId: number, params: Option.Project.PatchCustomFieldItemParams): Promise<any>;
|
||||
deleteCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise<any>;
|
||||
getSharedFiles(projectIdOrKey: string, path: string, params: Option.Project.GetSharedFilesParams): Promise<any>;
|
||||
getProjectsDiskUsage(projectIdOrKey: string): Promise<any>;
|
||||
getWebhooks(projectIdOrKey: string): Promise<any>;
|
||||
postWebhook(projectIdOrKey: string, params: Option.Project.PostWebhookParams): Promise<any>;
|
||||
getWebhook(projectIdOrKey: string, webhookId: string): Promise<any>;
|
||||
patchWebhook(projectIdOrKey: string, webhookId: string, params: Option.Project.PatchWebhookParams): Promise<any>;
|
||||
deleteWebhook(projectIdOrKey: string, webhookId: string): Promise<any>;
|
||||
postIssue(params: Option.Issue.PostIssueParams): Promise<any>;
|
||||
patchIssue(issueIdOrKey: string, params: Option.Issue.PatchIssueParams): Promise<any>;
|
||||
getIssues(params?: Option.Issue.GetIssuesParams): Promise<any>;
|
||||
getIssue(issueIdOrKey: string): Promise<any>;
|
||||
getIssuesCount(params?: Option.Issue.GetIssuesParams): Promise<any>;
|
||||
deleteIssuesCount(issueIdOrKey: string): Promise<any>;
|
||||
getIssueComments(issueIdOrKey: string, params: Option.Issue.GetIssueCommentsParams): Promise<any>;
|
||||
postIssueComments(issueIdOrKey: string, params: Option.Issue.PostIssueCommentsParams): Promise<any>;
|
||||
getIssueCommentsCount(issueIdOrKey: string): Promise<any>;
|
||||
getIssueComment(issueIdOrKey: string, commentId: number): Promise<any>;
|
||||
patchIssueComment(issueIdOrKey: string, commentId: number, params: Option.Issue.PatchIssueCommentParams): Promise<any>;
|
||||
getIssueCommentNotifications(issueIdOrKey: string, commentId: number): Promise<any>;
|
||||
postIssueCommentNotifications(issueIdOrKey: string, commentId: number, prams: Option.Issue.IssueCommentNotifications): Promise<any>;
|
||||
getIssueAttachments(issueIdOrKey: string): Promise<any>;
|
||||
deleteIssueAttachment(issueIdOrKey: string, attachmentId: string): Promise<any>;
|
||||
getIssueSharedFiles(issueIdOrKey: string): Promise<any>;
|
||||
linkIssueSharedFiles(issueIdOrKey: string, params: Option.Issue.LinkIssueSharedFilesParams): Promise<any>;
|
||||
unlinkIssueSharedFile(issueIdOrKey: string, id: number): Promise<any>;
|
||||
getWikis(projectIdOrKey: number): Promise<any>;
|
||||
getWikisCount(projectIdOrKey: number): Promise<any>;
|
||||
getWikisTags(projectIdOrKey: number): Promise<any>;
|
||||
postWiki(params: Option.Wiki.PostWikiParams): Promise<any>;
|
||||
getWiki(wikiId: number): Promise<any>;
|
||||
patchWiki(wikiId: number, params: Option.Wiki.PatchWikiParams): Promise<any>;
|
||||
deleteWiki(wikiId: number, mailNotify: boolean): Promise<any>;
|
||||
getWikisAttachments(wikiId: number): Promise<any>;
|
||||
postWikisAttachments(wikiId: number, attachmentId: number[]): Promise<any>;
|
||||
deleteWikisAttachments(wikiId: number, attachmentId: number): Promise<any>;
|
||||
getWikisSharedFiles(wikiId: number): Promise<any>;
|
||||
linkWikisSharedFiles(wikiId: number, fileId: number[]): Promise<any>;
|
||||
unlinkWikisSharedFiles(wikiId: number, id: number): Promise<any>;
|
||||
getWikisHistory(wikiId: number, params: Option.Wiki.GetWikisHistoryParams): Promise<any>;
|
||||
getWikisStars(wikiId: number): Promise<any>;
|
||||
postStar(params: Option.Project.PostStarParams): Promise<any>;
|
||||
getNotifications(params: Option.Notification.GetNotificationsParams): Promise<any>;
|
||||
getNotificationsCount(params: Option.Notification.GetNotificationsCountParams): Promise<any>;
|
||||
resetNotificationsMarkAsRead(): Promise<any>;
|
||||
markAsReadNotification(id: number): Promise<any>;
|
||||
getGitRepositories(projectIdOrKey: string): Promise<any>;
|
||||
getGitRepository(projectIdOrKey: string, repoIdOrName: string): Promise<any>;
|
||||
getPullRequests(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise<any>;
|
||||
getPullRequestsCount(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise<any>;
|
||||
postPullRequest(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.PostPullRequestParams): Promise<any>;
|
||||
getPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
|
||||
patchPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PatchPullRequestParams): Promise<any>;
|
||||
getPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.GetPullRequestCommentsParams): Promise<any>;
|
||||
postPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PostPullRequestCommentsParams): Promise<any>;
|
||||
getPullRequestCommentsCount(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
|
||||
patchPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, commentId: number, params: Option.PullRequest.PatchPullRequestCommentsParams): Promise<any>;
|
||||
getPullRequestAttachments(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
|
||||
deletePullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise<any>;
|
||||
getProjectIcon(projectIdOrKey: string): Promise<Entity.File.FileData>;
|
||||
getSharedFile(projectIdOrKey: string, sharedFileId: number): Promise<Entity.File.FileData>;
|
||||
getIssueAttachment(issueIdOrKey: string, attachmentId: number): Promise<Entity.File.FileData>;
|
||||
getWikiAttachment(wikiId: number, attachmentId: number): Promise<Entity.File.FileData>;
|
||||
getPullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise<Entity.File.FileData>;
|
||||
private download(path);
|
||||
private upload(path, params);
|
||||
private parseFileData(response);
|
||||
}
|
||||
|
||||
export class OAuth2 {
|
||||
private credentials;
|
||||
private timeout;
|
||||
constructor(credentials: Option.OAuth2.Credentials, timeout?: number);
|
||||
getAuthorizationURL(options: {
|
||||
host: string;
|
||||
redirectUri?: string;
|
||||
state?: string;
|
||||
}): string;
|
||||
getAccessToken(options: {
|
||||
host: string;
|
||||
code: string;
|
||||
redirectUri?: string;
|
||||
}): Promise<Entity.OAuth2.AccessToken>;
|
||||
refreshAccessToken(options: {
|
||||
host: string;
|
||||
refreshToken: string;
|
||||
}): Promise<Entity.OAuth2.AccessToken>;
|
||||
}
|
||||
|
||||
import { PassThrough } from 'stream';
|
||||
export namespace Entity {
|
||||
export namespace File {
|
||||
export type FileData = NodeFileData | BrowserFileData;
|
||||
export interface NodeFileData {
|
||||
body: PassThrough;
|
||||
url: string;
|
||||
filename: string;
|
||||
}
|
||||
export interface BrowserFileData {
|
||||
body: any;
|
||||
url: string;
|
||||
blob?: () => Promise<Blob>;
|
||||
}
|
||||
}
|
||||
export namespace OAuth2 {
|
||||
export interface AccessToken {
|
||||
access_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
refresh_token: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export namespace Option {
|
||||
export type Order = "asc" | "desc";
|
||||
export enum ActivityType {
|
||||
Undefined = -1,
|
||||
IssueCreated = 1,
|
||||
IssueUpdated = 2,
|
||||
IssueCommented = 3,
|
||||
IssueDeleted = 4,
|
||||
WikiCreated = 5,
|
||||
WikiUpdated = 6,
|
||||
WikiDeleted = 7,
|
||||
FileAdded = 8,
|
||||
FileUpdated = 9,
|
||||
FileDeleted = 10,
|
||||
SvnCommitted = 11,
|
||||
GitPushed = 12,
|
||||
GitRepositoryCreated = 13,
|
||||
IssueMultiUpdated = 14,
|
||||
ProjectUserAdded = 15,
|
||||
ProjectUserRemoved = 16,
|
||||
NotifyAdded = 17,
|
||||
PullRequestAdded = 18,
|
||||
PullRequestUpdated = 19,
|
||||
PullRequestCommented = 20,
|
||||
PullRequestMerged = 21,
|
||||
}
|
||||
export namespace Notification {
|
||||
export interface GetNotificationsParams {
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface GetNotificationsCountParams {
|
||||
alreadyRead: boolean;
|
||||
resourceAlreadyRead: boolean;
|
||||
}
|
||||
}
|
||||
export namespace Space {
|
||||
export interface GetActivitiesParams {
|
||||
activityTypeId?: ActivityType[];
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface PutSpaceNotificationParams {
|
||||
content: string;
|
||||
}
|
||||
}
|
||||
export namespace User {
|
||||
export interface PostUserParams {
|
||||
userId: string;
|
||||
password: string;
|
||||
name: string;
|
||||
mailAddress: string;
|
||||
roleType: RoleType;
|
||||
}
|
||||
export interface PatchUserParams {
|
||||
password?: string;
|
||||
name?: string;
|
||||
mailAddress?: string;
|
||||
roleType?: RoleType;
|
||||
}
|
||||
export enum RoleType {
|
||||
Admin = 1,
|
||||
User = 2,
|
||||
Reporter = 3,
|
||||
Viewer = 4,
|
||||
GuestReporter = 5,
|
||||
GuestViewer = 6,
|
||||
}
|
||||
export interface GetUserActivitiesParams {
|
||||
activityTypeId?: ActivityType[];
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface GetUserStarsParams {
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface GetUserStarsCountParams {
|
||||
since?: string;
|
||||
until?: string;
|
||||
}
|
||||
export interface GetRecentlyViewedParams {
|
||||
order?: Order;
|
||||
offset?: number;
|
||||
count?: number;
|
||||
}
|
||||
}
|
||||
export namespace Group {
|
||||
export interface GetGroupsParams {
|
||||
order?: Order;
|
||||
offset?: number;
|
||||
count?: number;
|
||||
}
|
||||
export interface PostGroupsParams {
|
||||
name: string;
|
||||
members?: string[];
|
||||
}
|
||||
export interface PatchGroupParams {
|
||||
name?: string;
|
||||
members?: string[];
|
||||
}
|
||||
}
|
||||
export namespace Project {
|
||||
export type TextFormattingRule = "backlog" | "markdown";
|
||||
export interface PostProjectParams {
|
||||
name: string;
|
||||
key: string;
|
||||
chartEnabled: boolean;
|
||||
projectLeaderCanEditProjectLeader?: boolean;
|
||||
subtaskingEnabled: boolean;
|
||||
textFormattingRule: TextFormattingRule;
|
||||
}
|
||||
export interface PatchProjectParams {
|
||||
name?: string;
|
||||
key?: string;
|
||||
chartEnabled?: boolean;
|
||||
subtaskingEnabled?: boolean;
|
||||
projectLeaderCanEditProjectLeader?: boolean;
|
||||
textFormattingRule?: TextFormattingRule;
|
||||
archived?: boolean;
|
||||
}
|
||||
export interface GetProjectsParams {
|
||||
archived?: boolean;
|
||||
all?: boolean;
|
||||
}
|
||||
export interface DeleteProjectUsersParams {
|
||||
userId: number;
|
||||
}
|
||||
export interface PostProjectAdministrators {
|
||||
userId: number;
|
||||
}
|
||||
export interface DeleteProjectAdministrators {
|
||||
userId: number;
|
||||
}
|
||||
export type IssueTypeColor = "#e30000" | "#990000" | "#934981" | "#814fbc" | "#2779ca" | "#007e9a" | "#7ea800" | "#ff9200" | "#ff3265" | "#666665";
|
||||
export interface PostIssueTypeParams {
|
||||
name: string;
|
||||
color: IssueTypeColor;
|
||||
}
|
||||
export interface PatchIssueTypeParams {
|
||||
name?: string;
|
||||
color?: IssueTypeColor;
|
||||
}
|
||||
export interface DeleteIssueTypeParams {
|
||||
substituteIssueTypeId: number;
|
||||
}
|
||||
export interface PostCategoriesParams {
|
||||
name: string;
|
||||
}
|
||||
export interface PatchCategoriesParams {
|
||||
name: string;
|
||||
}
|
||||
export interface PostVersionsParams {
|
||||
name: string;
|
||||
description: string;
|
||||
startDate: string;
|
||||
releaseDueDate: string;
|
||||
}
|
||||
export interface PatchVersionsParams {
|
||||
name: string;
|
||||
description?: string;
|
||||
startDate?: string;
|
||||
releaseDueDate?: string;
|
||||
archived?: boolean;
|
||||
}
|
||||
export interface PostCustomFieldParams {
|
||||
typeId: FieldType;
|
||||
name: string;
|
||||
applicableIssueTypes?: number[];
|
||||
description?: string;
|
||||
required?: boolean;
|
||||
}
|
||||
export interface PostCustomFieldWithNumericParams extends PostCustomFieldParams {
|
||||
min?: number;
|
||||
max?: number;
|
||||
initialValue?: number;
|
||||
unit?: string;
|
||||
}
|
||||
export interface PostCustomFieldWithDateParams extends PostCustomFieldParams {
|
||||
min?: string;
|
||||
max?: string;
|
||||
initialValueType?: number;
|
||||
initialDate?: string;
|
||||
initialShift?: number;
|
||||
}
|
||||
export interface PostCustomFieldWithListParams extends PostCustomFieldParams {
|
||||
items?: string[];
|
||||
allowInput?: boolean;
|
||||
allowAddItem?: boolean;
|
||||
}
|
||||
export interface PatchCustomFieldParams {
|
||||
name?: string;
|
||||
applicableIssueTypes?: number[];
|
||||
description?: string;
|
||||
required?: boolean;
|
||||
}
|
||||
export interface PatchCustomFieldWithNumericParams extends PatchCustomFieldParams {
|
||||
min?: number;
|
||||
max?: number;
|
||||
initialValue?: number;
|
||||
unit?: string;
|
||||
}
|
||||
export interface PatchCustomFieldWithDateParams extends PatchCustomFieldParams {
|
||||
min?: string;
|
||||
max?: string;
|
||||
initialValueType?: number;
|
||||
initialDate?: string;
|
||||
initialShift?: number;
|
||||
}
|
||||
export interface PatchCustomFieldWithListParams extends PatchCustomFieldParams {
|
||||
items?: string[];
|
||||
allowInput?: boolean;
|
||||
allowAddItem?: boolean;
|
||||
}
|
||||
export interface PostCustomFieldItemParams {
|
||||
name: string;
|
||||
}
|
||||
export interface PatchCustomFieldItemParams {
|
||||
name: string;
|
||||
}
|
||||
export interface GetSharedFilesParams {
|
||||
order?: Order;
|
||||
offset?: number;
|
||||
count?: number;
|
||||
}
|
||||
export interface PostWebhookParams {
|
||||
name?: string;
|
||||
description?: string;
|
||||
hookUrl?: string;
|
||||
allEvent?: boolean;
|
||||
activityTypeIds?: number[];
|
||||
}
|
||||
export interface PatchWebhookParams {
|
||||
name?: string;
|
||||
description?: string;
|
||||
hookUrl?: string;
|
||||
allEvent?: boolean;
|
||||
activityTypeIds?: number[];
|
||||
}
|
||||
export enum FieldType {
|
||||
Text = 1,
|
||||
TextArea = 2,
|
||||
Numeric = 3,
|
||||
Date = 4,
|
||||
SingleList = 5,
|
||||
MultipleList = 6,
|
||||
CheckBox = 7,
|
||||
Radio = 8,
|
||||
}
|
||||
export interface PostStarParams {
|
||||
issueId?: number;
|
||||
commentId?: number;
|
||||
wikiId?: number;
|
||||
pullRequestId?: number;
|
||||
pullRequestCommentId?: number;
|
||||
}
|
||||
}
|
||||
export namespace Issue {
|
||||
export interface PostIssueParams {
|
||||
projectId: number;
|
||||
summary: string;
|
||||
priorityId: number;
|
||||
issueTypeId: number;
|
||||
parentIssueId?: number;
|
||||
description?: string;
|
||||
startDate?: string;
|
||||
dueDate?: string;
|
||||
estimatedHours?: number;
|
||||
actualHours?: number;
|
||||
categoryId?: number[];
|
||||
versionId?: number[];
|
||||
milestoneId?: number[];
|
||||
assigneeId?: number;
|
||||
notifiedUserId?: number[];
|
||||
attachmentId?: number[];
|
||||
[customField_: string]: any;
|
||||
}
|
||||
export interface PatchIssueParams {
|
||||
summary?: string;
|
||||
parentIssueId?: number;
|
||||
description?: string;
|
||||
statusId?: number;
|
||||
resolutionId?: number;
|
||||
startDate?: string;
|
||||
dueDate?: string;
|
||||
estimatedHours?: number;
|
||||
actualHours?: number;
|
||||
issueTypeId?: number;
|
||||
categoryId?: number[];
|
||||
versionId?: number[];
|
||||
milestoneId?: number[];
|
||||
priorityId?: number;
|
||||
assigneeId?: number;
|
||||
notifiedUserId?: number[];
|
||||
attachmentId?: number[];
|
||||
comment?: string;
|
||||
[customField_: string]: any;
|
||||
}
|
||||
export interface GetIssuesParams {
|
||||
projectId?: number[];
|
||||
issueTypeId?: number[];
|
||||
categoryId?: number[];
|
||||
versionId?: number[];
|
||||
milestoneId?: number[];
|
||||
statusId?: number[];
|
||||
priorityId?: number[];
|
||||
assigneeId?: number[];
|
||||
createdUserId?: number[];
|
||||
resolutionId?: number[];
|
||||
parentChild?: ParentChildType;
|
||||
attachment?: boolean;
|
||||
sharedFile?: boolean;
|
||||
sort?: SortKey;
|
||||
order?: Order;
|
||||
offset?: number;
|
||||
count?: number;
|
||||
createdSince?: string;
|
||||
createdUntil?: string;
|
||||
updatedSince?: string;
|
||||
updatedUntil?: string;
|
||||
startDateSince?: string;
|
||||
startDateUntil?: string;
|
||||
dueDateSince?: string;
|
||||
dueDateUntil?: string;
|
||||
id?: number[];
|
||||
parentIssueId?: number[];
|
||||
keyword: string;
|
||||
[customField_: string]: any;
|
||||
}
|
||||
export enum ParentChildType {
|
||||
All = 0,
|
||||
NotChild = 1,
|
||||
Child = 2,
|
||||
NotChildNotParent = 3,
|
||||
Parent = 4,
|
||||
}
|
||||
export type SortKey = "issueType" | "category" | "version" | "milestone" | "summary" | "status" | "priority" | "attachment" | "sharedFile" | "created" | "createdUser" | "updated" | "updatedUser" | "assignee" | "startDate" | "dueDate" | "estimatedHours" | "actualHours" | "childIssue";
|
||||
export interface GetIssueCommentsParams {
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface PostIssueCommentsParams {
|
||||
content: string;
|
||||
notifiedUserId?: number[];
|
||||
attachmentId?: number[];
|
||||
}
|
||||
export interface PatchIssueCommentParams {
|
||||
content: string;
|
||||
}
|
||||
export interface IssueCommentNotifications {
|
||||
notifiedUserId: number[];
|
||||
}
|
||||
export interface LinkIssueSharedFilesParams {
|
||||
fileId: number[];
|
||||
}
|
||||
}
|
||||
export namespace PullRequest {
|
||||
export interface GetPullRequestsParams {
|
||||
statusId?: number[];
|
||||
assigneeId?: number[];
|
||||
issueId?: number[];
|
||||
createdUserId?: number[];
|
||||
offset?: number;
|
||||
count?: number;
|
||||
}
|
||||
export interface PostPullRequestParams {
|
||||
summary: string;
|
||||
description: string;
|
||||
base: string;
|
||||
branch: string;
|
||||
issueId?: number;
|
||||
assigneeId?: number;
|
||||
notifiedUserId?: number[];
|
||||
attachmentId?: number[];
|
||||
}
|
||||
export interface PatchPullRequestParams {
|
||||
summary?: string;
|
||||
description?: string;
|
||||
issueId?: number;
|
||||
assigneeId?: number;
|
||||
notifiedUserId?: number[];
|
||||
comment?: string[];
|
||||
}
|
||||
export interface GetPullRequestCommentsParams {
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
export interface PostPullRequestCommentsParams {
|
||||
content: string;
|
||||
notifiedUserId?: number[];
|
||||
}
|
||||
export interface PatchPullRequestCommentsParams {
|
||||
content: string;
|
||||
}
|
||||
}
|
||||
export namespace Wiki {
|
||||
export interface PostWikiParams {
|
||||
projectId: number;
|
||||
name: string;
|
||||
content: string;
|
||||
mailNotify?: boolean;
|
||||
}
|
||||
export interface PatchWikiParams {
|
||||
name?: string;
|
||||
content?: string;
|
||||
mailNotify?: boolean;
|
||||
}
|
||||
export interface GetWikisHistoryParams {
|
||||
minId?: number;
|
||||
maxId?: number;
|
||||
count?: number;
|
||||
order?: Order;
|
||||
}
|
||||
}
|
||||
export namespace OAuth2 {
|
||||
export interface Credentials {
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export namespace Error {
|
||||
export class BacklogError extends global.Error {
|
||||
private _name;
|
||||
private _url;
|
||||
private _status;
|
||||
private _body;
|
||||
private _response;
|
||||
constructor(name: BacklogErrorNameType, response: IResponse, body?: {
|
||||
errors: BacklogErrorMessage[];
|
||||
});
|
||||
name: BacklogErrorNameType;
|
||||
url: string;
|
||||
status: number;
|
||||
body: {
|
||||
errors: BacklogErrorMessage[];
|
||||
};
|
||||
response: IResponse;
|
||||
}
|
||||
export class BacklogApiError extends BacklogError {
|
||||
constructor(response: IResponse, body?: {
|
||||
errors: BacklogErrorMessage[];
|
||||
});
|
||||
}
|
||||
export class BacklogAuthError extends BacklogError {
|
||||
constructor(response: IResponse, body?: {
|
||||
errors: BacklogErrorMessage[];
|
||||
});
|
||||
}
|
||||
export class UnexpectedError extends BacklogError {
|
||||
constructor(response: IResponse);
|
||||
}
|
||||
export interface BacklogErrorMessage {
|
||||
message: string;
|
||||
code: number;
|
||||
errorInfo: string;
|
||||
moreInfo: string;
|
||||
}
|
||||
export type BacklogErrorNameType = 'BacklogApiError' | 'BacklogAuthError' | 'UnexpectedError';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/// <reference path="./base16.d.ts" />
|
||||
|
||||
import * as base16 from 'base16';
|
||||
|
||||
const colorScheme: base16.ColorScheme = base16.solarized
|
||||
|
||||
const scheme: string = colorScheme.scheme
|
||||
const author: string = colorScheme.author
|
||||
const base00: string = colorScheme.base00
|
||||
const base01: string = colorScheme.base01
|
||||
const base02: string = colorScheme.base02
|
||||
const base03: string = colorScheme.base03
|
||||
const base04: string = colorScheme.base04
|
||||
const base05: string = colorScheme.base05
|
||||
const base06: string = colorScheme.base06
|
||||
const base07: string = colorScheme.base07
|
||||
const base08: string = colorScheme.base08
|
||||
const base09: string = colorScheme.base09
|
||||
const base0A: string = colorScheme.base0A
|
||||
const base0B: string = colorScheme.base0B
|
||||
const base0C: string = colorScheme.base0C
|
||||
const base0D: string = colorScheme.base0D
|
||||
const base0E: string = colorScheme.base0E
|
||||
const base0F: string = colorScheme.base0F
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user