mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merged branch DefinitelyTyped-types-2.0 into types-2.0
This commit is contained in:
@@ -4,36 +4,221 @@
|
||||
|
||||
> 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": false,
|
||||
"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.
|
||||
|
||||
|
||||
#### 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 Foo { new(): Foo }`:
|
||||
This defines a type of objects that are new-able. You probably want `declare class Foo { constructor(); }
|
||||
* `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 written as 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.
|
||||
|
||||
#### 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
+1
@@ -158,6 +158,7 @@ declare module 'angular' {
|
||||
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> {
|
||||
|
||||
@@ -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[];
|
||||
}
|
||||
}
|
||||
@@ -278,8 +278,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>;
|
||||
@@ -348,6 +354,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
@@ -1043,6 +1043,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.
|
||||
*/
|
||||
|
||||
@@ -1,10 +1,32 @@
|
||||
|
||||
|
||||
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"}
|
||||
});
|
||||
@@ -11,4 +11,12 @@ 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 @@ interface nameInterface {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -54,7 +54,6 @@ function callback(cb: AWSLambda.Callback) {
|
||||
cb(error);
|
||||
cb(null, anyObj);
|
||||
}
|
||||
|
||||
/* Compatibility functions */
|
||||
context.done();
|
||||
context.done(error);
|
||||
|
||||
Vendored
+2
-1
@@ -522,7 +522,8 @@ export declare module DynamoDB {
|
||||
|
||||
interface UpdateParam extends _DDBDC_Writer {
|
||||
Key: _DDBDC_Keys;
|
||||
AttributeUpdates: {
|
||||
UpdateExpression?: string;
|
||||
AttributeUpdates?: {
|
||||
[someKey: string]: {
|
||||
Action: "PUT" | "ADD" | "DELETE";
|
||||
Value: any
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/// <reference path="./bases.d.ts" />
|
||||
import * as bases from 'bases';
|
||||
|
||||
let bs16String: string = bases.toBase(200, 16); // => 'c8'
|
||||
let bs62String: string = bases.toBase(99999, 62); // => 'q0T'
|
||||
let customBaseString: string = bases.toAlphabet(300, 'aAbBcC'); // => 'Abba'
|
||||
|
||||
let frombs16Int: number = bases.fromBase('c8', 16); // => 200
|
||||
let frombs62Int: number = bases.fromBase('q0T', 62); // => 99999
|
||||
let customBaseInt: number = bases.fromAlphabet('Abba', 'aAbBcC'); // => 300
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for bases 0.2.1
|
||||
// Project: https://github.com/aseemk/bases.js
|
||||
// Definitions by: Hari Krishna <https://github.com/harikv>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "bases" {
|
||||
export function toAlphabet(num: number, alphabet: string): string;
|
||||
|
||||
export function fromAlphabet(str: string, alphabet: string): number;
|
||||
|
||||
export function toBase(num: number, base: number): string;
|
||||
|
||||
export function fromBase(str: string, base:number): number;
|
||||
|
||||
export let KNOWN_ALPHABETS: any;
|
||||
|
||||
export let NUMERALS: string;
|
||||
|
||||
export let LETTERS_LOWERCASE: string;
|
||||
|
||||
export let LETTERS_UPPERCASE: string;
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
/// <reference types="bit-array" />
|
||||
|
||||
import BitArray = require("bit-array");
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/// <reference path="bonjour.d.ts" />
|
||||
import * as bonjour from 'bonjour';
|
||||
|
||||
var bonjourOptions: bonjour.BonjourOptions;
|
||||
var bonjourInstance: bonjour.Bonjour;
|
||||
|
||||
var serviceOptions: bonjour.ServiceOptions;
|
||||
var service: bonjour.Service;
|
||||
|
||||
var browserOptions: bonjour.BrowserOptions;
|
||||
var browser: bonjour.Browser;
|
||||
|
||||
bonjourOptions = { interface: '192.168.1.1', port: 5353 };
|
||||
bonjourInstance = new bonjour.Bonjour(bonjourOptions);
|
||||
|
||||
serviceOptions = { name: 'My Web Server', type: 'http', port: 3000 };
|
||||
service = bonjourInstance.publish(serviceOptions);
|
||||
|
||||
browserOptions = { protocol: 'tcp', type: 'http' };
|
||||
browser = bonjour.find(browserOptions);
|
||||
|
||||
Vendored
+71
@@ -0,0 +1,71 @@
|
||||
// Type definitions for bonjour v3.5.0
|
||||
// Project: https://github.com/watson/bonjour
|
||||
// Definitions by: Quentin Lampin <https://github.com/quentin-ol/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "bonjour" {
|
||||
export interface BonjourOptions {
|
||||
multicast?: boolean;
|
||||
interface?: string;
|
||||
port?: number;
|
||||
ip?: string;
|
||||
ttl?: number;
|
||||
loopback?: boolean;
|
||||
reuseAddr?: boolean;
|
||||
}
|
||||
|
||||
export interface BrowserOptions {
|
||||
type?: string;
|
||||
subtypes?: string[];
|
||||
protocol?: string;
|
||||
txt?: Object;
|
||||
}
|
||||
|
||||
export interface ServiceOptions {
|
||||
name: string;
|
||||
host?: string;
|
||||
port: number;
|
||||
type: string;
|
||||
subtypes?: string[];
|
||||
protocol?: 'udp'|'tcp';
|
||||
txt?: Object;
|
||||
}
|
||||
|
||||
export interface Service {
|
||||
name: string;
|
||||
type: string;
|
||||
subtypes: string[];
|
||||
protocol: string;
|
||||
host: string;
|
||||
port: number;
|
||||
fqdn: string;
|
||||
rawTxt: Object;
|
||||
txt: Object;
|
||||
published: boolean;
|
||||
|
||||
stop: (cb: ()=>any) => void;
|
||||
start: () => void;
|
||||
}
|
||||
|
||||
export class Bonjour {
|
||||
|
||||
constructor(opts: BonjourOptions);
|
||||
publish(options: ServiceOptions):Service;
|
||||
unpublishAll(cb: ()=>any): void;
|
||||
find(options:BrowserOptions, onUp: ()=>any): Browser;
|
||||
findOne(options:any, cb: (service: Service)=>any): Browser;
|
||||
destroy():void;
|
||||
}
|
||||
|
||||
export class Browser {
|
||||
services: Service[];
|
||||
|
||||
start():void;
|
||||
update():void;
|
||||
stop():void;
|
||||
}
|
||||
|
||||
export function find(options: BrowserOptions, onUp?: ()=>any): Browser;
|
||||
export function findOne(options: BrowserOptions): Browser;
|
||||
|
||||
}
|
||||
Vendored
+1
@@ -40,6 +40,7 @@ interface BootboxConfirmOptions extends BootboxDialogOptions {
|
||||
interface BootboxPromptOptions extends BootboxBaseOptions {
|
||||
title: string;
|
||||
value?: string;
|
||||
inputType?: string;
|
||||
callback: (result: string) => any;
|
||||
buttons?: BootboxConfirmPromptButtonMap;
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -36,6 +36,7 @@ interface DatepickerOptions {
|
||||
multidateSeparator?: string;
|
||||
orientation?: string;
|
||||
assumeNearbyYear?: any;
|
||||
viewMode?: string;
|
||||
}
|
||||
|
||||
interface DatepickerCustomFormatOptions {
|
||||
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for Bootstrap Table v1.11.0
|
||||
// Project: http://bootstrap-table.wenzhixin.net.cn/
|
||||
// Definitions by: Talat Baig <https://github.com/talatbaig/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
interface JQuery {
|
||||
bootstrapTable(options?: any): JQuery;
|
||||
}
|
||||
|
||||
declare var bootstrapTable: JQueryStatic;
|
||||
@@ -48,10 +48,18 @@ braintree.client.create({
|
||||
selector: '#card-number'
|
||||
},
|
||||
cvv: {
|
||||
selector: '#cvv'
|
||||
selector: '#cvv',
|
||||
type: 'password'
|
||||
},
|
||||
expirationDate: {
|
||||
selector: '#expiration-date'
|
||||
expirationMonth: {
|
||||
selector: '#expiration-month',
|
||||
select: {
|
||||
options: ["01 - Jan", "02 - Feb", "03 - Mar", "04 - Apr", "05 - May", "06 - Jun", "07 - Jul", "08 - Aug", "09 - Sep", "10 - Oct", "11 - Nov", "12 - Dec"]
|
||||
}
|
||||
},
|
||||
expirationYear: {
|
||||
selector: '#expiration-year',
|
||||
select: true
|
||||
}
|
||||
}
|
||||
}, function (hostedFieldsErr?: BraintreeError, hostedFieldsInstance?: any) {
|
||||
|
||||
Vendored
+7
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Braintree-web v3.0.2
|
||||
// Type definitions for Braintree-web v3.5.0
|
||||
// Project: https://github.com/braintree/braintree-web
|
||||
// Definitions by: Guy Shahine <https://github.com/chlela>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -540,12 +540,17 @@ declare namespace BraintreeWeb {
|
||||
* @typedef {object} field
|
||||
* @property {string} selector A CSS selector to find the container where the hosted field will be inserted.
|
||||
* @property {string} [placeholder] Will be used as the `placeholder` attribute of the input. If `placeholder` is not natively supported by the browser, it will be polyfilled.
|
||||
* @property {boolean} [formatInput=true] - Enable or disable automatic formatting on this field. Note: Input formatting does not work properly on Android and iOS, so input formatting is automatically disabled on those browsers.
|
||||
* @property {string} [type] Will be used as the `type` attribute of the input. To mask `cvv` input, for instance, `type: "password"` can be used.
|
||||
* @property {boolean} [formatInput=true] - Enable or disable automatic formatting on this field.
|
||||
* @property {object|boolean} [select] If truthy, this field becomes a `<select>` dropdown list. This can only be used for `expirationMonth` and `expirationYear` fields.
|
||||
* @property {string[]} [select.options] An array of 12 strings, one per month. This can only be used for the `expirationMonth` field. For example, the array can look like `['01 - January', '02 - February', ...]`.
|
||||
*/
|
||||
interface HostedFieldsField {
|
||||
selector: string;
|
||||
placeholder?: string;
|
||||
type?: string;
|
||||
formatInput?: boolean;
|
||||
select?: boolean | { options: string[] };
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for bull 0.7.0
|
||||
// Type definitions for bull 1.0.0
|
||||
// Project: https://github.com/OptimalBits/bull
|
||||
// Definitions by: Bruno Grieder <https://github.com/bgrieder>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -24,7 +24,7 @@ declare module "bull" {
|
||||
|
||||
export interface Job {
|
||||
|
||||
id: string
|
||||
jobId: string
|
||||
|
||||
/**
|
||||
* The custom data passed when the job was created
|
||||
|
||||
@@ -55,7 +55,20 @@ var options:bunyan.LoggerOptions = {
|
||||
|
||||
var log = bunyan.createLogger(options);
|
||||
|
||||
var customSerializer = function(anything: any) {
|
||||
return { obj: anything};
|
||||
};
|
||||
|
||||
log.addSerializers({anything: customSerializer});
|
||||
log.addSerializers(bunyan.stdSerializers);
|
||||
log.addSerializers(
|
||||
{
|
||||
err: bunyan.stdSerializers.err,
|
||||
req: bunyan.stdSerializers.req,
|
||||
res: bunyan.stdSerializers.res
|
||||
}
|
||||
);
|
||||
|
||||
var child = log.child({name: 'child'});
|
||||
child.reopenFileStreams();
|
||||
log.addStream({path: '/dev/null'});
|
||||
|
||||
Vendored
+14
-4
@@ -11,7 +11,7 @@ import { EventEmitter } from 'events';
|
||||
declare class Logger extends EventEmitter {
|
||||
constructor(options: LoggerOptions);
|
||||
addStream(stream: Stream): void;
|
||||
addSerializers(serializers: Serializers): void;
|
||||
addSerializers(serializers:Serializers | StdSerializers):void;
|
||||
child(options: LoggerOptions, simple?: boolean): Logger;
|
||||
child(obj: Object, simple?: boolean): Logger;
|
||||
reopenFileStreams(): void;
|
||||
@@ -21,7 +21,7 @@ declare class Logger extends EventEmitter {
|
||||
levels(name: number | string, value: number | string): void;
|
||||
|
||||
fields: any;
|
||||
src: boolean;
|
||||
src:boolean;
|
||||
|
||||
trace(error: Error, format?: any, ...params: any[]): void;
|
||||
trace(buffer: Buffer, format?: any, ...params: any[]): void;
|
||||
@@ -58,8 +58,18 @@ interface LoggerOptions {
|
||||
src?: boolean;
|
||||
}
|
||||
|
||||
interface Serializer {
|
||||
(input:any): any;
|
||||
}
|
||||
|
||||
interface Serializers {
|
||||
[key: string]: (input: any) => string;
|
||||
[key:string]: Serializer;
|
||||
}
|
||||
|
||||
interface StdSerializers {
|
||||
err: Serializer;
|
||||
res: Serializer;
|
||||
req: Serializer;
|
||||
}
|
||||
|
||||
interface Stream {
|
||||
@@ -72,7 +82,7 @@ interface Stream {
|
||||
count?: number;
|
||||
}
|
||||
|
||||
export declare var stdSerializers: Serializers;
|
||||
export var stdSerializers:StdSerializers;
|
||||
|
||||
export declare var TRACE: number;
|
||||
export declare var DEBUG: number;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/// <reference path="./bwip-js.d.ts" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
'use strict';
|
||||
|
||||
import * as bwipjs from 'bwip-js';
|
||||
import * as http from 'http';
|
||||
import * as fs from 'fs';
|
||||
|
||||
bwipjs.loadFont('Inconsolata', 108,
|
||||
fs.readFileSync('fonts/Inconsolata.otf', 'binary'));
|
||||
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
// If the url does not begin /?bcid= then 404. Otherwise, we end up
|
||||
// returning 400 on requests like favicon.ico.
|
||||
if (req.url.indexOf('/?bcid=') != 0) {
|
||||
res.writeHead(404, { 'Content-Type':'text/plain' });
|
||||
res.end('BWIPJS: Unknown request format.', 'utf8');
|
||||
} else {
|
||||
bwipjs(req, res);
|
||||
}
|
||||
|
||||
}).listen(3030);
|
||||
|
||||
bwipjs.toBuffer({
|
||||
bcid: 'code128', // Barcode type
|
||||
text: '0123456789', // Text to encode
|
||||
scale: 3, // 3x scaling factor
|
||||
height: 10, // Bar height, in millimeters
|
||||
includetext: true, // Show human-readable text
|
||||
textxalign: 'center', // Always good to set this
|
||||
textfont: 'Inconsolata', // Use your custom font
|
||||
textsize: 13 // Font size, in points
|
||||
}, function (err:string|Error, png: Buffer) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
// `png` is a Buffer
|
||||
// png.length : PNG file length
|
||||
// png.readUInt32BE(16) : PNG image width
|
||||
// png.readUInt32BE(20) : PNG image height
|
||||
}
|
||||
});
|
||||
Vendored
+86
@@ -0,0 +1,86 @@
|
||||
// Type definitions for bwip-js 1.1.1
|
||||
// Project: https://github.com/metafloor/bwip-js
|
||||
// Definitions by: TANAKA Koichi <https://github.com/MugeSo/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'bwip-js' {
|
||||
import {IncomingMessage as Request, ServerResponse as Response} from 'http';
|
||||
|
||||
module BwipJs {
|
||||
export function loadFont(fontName:string, sizeMulti: number, fontFile: string): void;
|
||||
export function toBuffer(opts: ToBufferOptions, callback:(err: string|Error, png: Buffer) => void): void;
|
||||
interface ToBufferOptions {
|
||||
bcid: string;
|
||||
text: string;
|
||||
|
||||
parse?: boolean;
|
||||
parsefunc?: boolean;
|
||||
|
||||
height?: number;
|
||||
width?: number;
|
||||
|
||||
scaleX?: number;
|
||||
scaleY?: number;
|
||||
scale?: number;
|
||||
|
||||
rotate?: 'N'|'R'|'L'|'I';
|
||||
|
||||
paddingwidth?: number;
|
||||
paddingheight?: number;
|
||||
|
||||
monochrome?: boolean;
|
||||
alttext?: boolean;
|
||||
|
||||
includetext?: boolean;
|
||||
textfont?: string;
|
||||
textsize?: number;
|
||||
textgaps?: number;
|
||||
|
||||
textxalign?:'offleft'|'left'|'center'|'right'|'offright'|'justify';
|
||||
textyalign?:'below'|'center'|'above';
|
||||
textxoffset?: number;
|
||||
textyoffset?: number;
|
||||
|
||||
showborder?: boolean;
|
||||
borderwidth?: number;
|
||||
borderleft?: number;
|
||||
borderright?: number;
|
||||
bordertop?: number;
|
||||
boraderbottom?: number;
|
||||
|
||||
barcolor?: string;
|
||||
backgroundcolor?: string;
|
||||
bordercolor?: string;
|
||||
textcolor?: string;
|
||||
|
||||
addontextxoffset?: number;
|
||||
addontextyoffset?: number;
|
||||
addontextfont?: string;
|
||||
addontextsize?: number;
|
||||
|
||||
guardwhitespace?: boolean;
|
||||
guardwidth?: number;
|
||||
guardheight?: number;
|
||||
guardleftpos?: number;
|
||||
guardrightpos?: number;
|
||||
guardleftypos?: number;
|
||||
guardrightypos?: number;
|
||||
|
||||
sizelimit?: number;
|
||||
|
||||
includecheck?: boolean;
|
||||
includecheckintext?: boolean;
|
||||
|
||||
inkspread?: number;
|
||||
inkspreadh?: number;
|
||||
inkspreadv?: number;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function BwipJs(req: Request, res: Response, opts?:BwipJs.ToBufferOptions): void;
|
||||
|
||||
export = BwipJs;
|
||||
}
|
||||
@@ -6,8 +6,9 @@
|
||||
import fs = require( 'fs' );
|
||||
import byline = require( 'byline' );
|
||||
|
||||
//TODO can this be typed in an ambient way?
|
||||
//var stream = byline( fs.createReadStream( 'sample.txt', {encoding: 'utf8'} ) );
|
||||
var stream = byline();
|
||||
|
||||
var stream = byline( fs.createReadStream( 'sample.txt', {encoding: 'utf8'} ) );
|
||||
|
||||
var stream = byline.createStream( fs.createReadStream( 'sample.txt', {encoding: 'utf8'} ) );
|
||||
|
||||
|
||||
Vendored
+32
-25
@@ -7,31 +7,38 @@
|
||||
|
||||
|
||||
import stream = require("stream");
|
||||
declare function bl(): bl.LineStream;
|
||||
declare function bl(stream: NodeJS.ReadableStream, options?: bl.LineStreamOptions): bl.LineStream;
|
||||
|
||||
export interface LineStreamOptions extends stream.TransformOptions {
|
||||
keepEmptyLines?: boolean;
|
||||
declare namespace bl {
|
||||
|
||||
export interface LineStreamOptions extends stream.TransformOptions {
|
||||
keepEmptyLines?: boolean;
|
||||
}
|
||||
|
||||
export interface LineStream extends stream.Transform {
|
||||
}
|
||||
|
||||
export interface LineStreamCreatable extends LineStream {
|
||||
new (options?: LineStreamOptions): LineStream
|
||||
}
|
||||
|
||||
//TODO is it possible to declare static factory functions without name (directly on the module)
|
||||
//
|
||||
// JS:
|
||||
// // convinience API
|
||||
// module.exports = function(readStream, options) {
|
||||
// return module.exports.createStream(readStream, options);
|
||||
// };
|
||||
//
|
||||
// TS:
|
||||
// ():LineStream; // same as createStream():LineStream
|
||||
// (stream:stream.Stream, options?:LineStreamOptions):LineStream; // same as createStream(stream, options?):LineStream
|
||||
|
||||
export function createStream(): LineStream;
|
||||
export function createStream(stream: NodeJS.ReadableStream, options?: LineStreamOptions): LineStream;
|
||||
|
||||
export var LineStream: LineStreamCreatable;
|
||||
}
|
||||
|
||||
export interface LineStream extends stream.Transform {
|
||||
}
|
||||
|
||||
export interface LineStreamCreatable extends LineStream {
|
||||
new (options?: LineStreamOptions): LineStream
|
||||
}
|
||||
|
||||
//TODO is it possible to declare static factory functions without name (directly on the module)
|
||||
//
|
||||
// JS:
|
||||
// // convinience API
|
||||
// module.exports = function(readStream, options) {
|
||||
// return module.exports.createStream(readStream, options);
|
||||
// };
|
||||
//
|
||||
// TS:
|
||||
// ():LineStream; // same as createStream():LineStream
|
||||
// (stream:stream.Stream, options?:LineStreamOptions):LineStream; // same as createStream(stream, options?):LineStream
|
||||
|
||||
export declare function createStream(): LineStream;
|
||||
export declare function createStream(stream: NodeJS.ReadableStream, options?: LineStreamOptions): LineStream;
|
||||
|
||||
export declare var LineStream: LineStreamCreatable;
|
||||
export = bl;
|
||||
Vendored
+6
-3
@@ -1,10 +1,13 @@
|
||||
// Type definitions for C3js
|
||||
// Type definitions for C3js v0.4
|
||||
// Project: http://c3js.org/
|
||||
// Definitions by: Marc Climent <https://github.com/mcliment>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="d3"/>
|
||||
|
||||
export = c3;
|
||||
export as namespace c3;
|
||||
|
||||
declare namespace c3 {
|
||||
|
||||
type PrimitiveArray = Array<string | boolean | number>;
|
||||
@@ -385,10 +388,10 @@ declare namespace c3 {
|
||||
* - d is the data where mouse cursor moves out. In this callback, this will be the Chart object.
|
||||
*/
|
||||
onmouseout?: (d: any, element?: any) => void;
|
||||
|
||||
|
||||
onselected?: (d: any, element?: any) => void;
|
||||
|
||||
onunselected?: (d: any, element?: any) => void;
|
||||
onunselected?: (d: any, element?: any) => void;
|
||||
}
|
||||
|
||||
interface Axis {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/d3": "^3.5.36"
|
||||
}
|
||||
}
|
||||
+1
-6
@@ -4,11 +4,6 @@
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
@@ -16,4 +11,4 @@
|
||||
"index.d.ts",
|
||||
"c3-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/d3": "^3.5.36"
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"node_modules/@types",
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
@@ -16,4 +17,4 @@
|
||||
"index.d.ts",
|
||||
"cal-heatmap-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+68
-43
@@ -7,19 +7,20 @@
|
||||
declare class CamlBuilder {
|
||||
constructor();
|
||||
/** Generate CAML Query, starting from <Where> tag */
|
||||
public Where(): CamlBuilder.IFieldExpression;
|
||||
Where(): CamlBuilder.IFieldExpression;
|
||||
/** Generate <View> tag for SP.CamlQuery
|
||||
@param viewFields If omitted, default view fields are requested; otherwise, only values for the fields with the specified internal names are returned.
|
||||
Specifying view fields is a good practice, as it decreases traffic between server and client. */
|
||||
public View(viewFields?: string[]): CamlBuilder.IView;
|
||||
@param viewFields If omitted, default view fields are requested; otherwise, only values for the fields with the specified internal names are returned.
|
||||
Specifying view fields is a good practice, as it decreases traffic between server and client. */
|
||||
View(viewFields?: string[]): CamlBuilder.IView;
|
||||
/** Generate <ViewFields> tag for SPServices */
|
||||
public ViewFields(viewFields: string[]): CamlBuilder.IFinalizableToString;
|
||||
ViewFields(viewFields: string[]): CamlBuilder.IFinalizableToString;
|
||||
/** Use for:
|
||||
1. SPServices CAMLQuery attribute
|
||||
2. Creating partial expressions
|
||||
3. In conjunction with Any & All clauses
|
||||
*/
|
||||
1. SPServices CAMLQuery attribute
|
||||
2. Creating partial expressions
|
||||
3. In conjunction with Any & All clauses
|
||||
*/
|
||||
static Expression(): CamlBuilder.IFieldExpression;
|
||||
static FromXml(xml: string): CamlBuilder.IRawQuery;
|
||||
}
|
||||
declare namespace CamlBuilder {
|
||||
interface IView extends IJoinable, IFinalizable {
|
||||
@@ -29,24 +30,24 @@ declare namespace CamlBuilder {
|
||||
}
|
||||
interface IJoinable {
|
||||
/** Join the list you're querying with another list.
|
||||
Joins are only allowed through a lookup field relation.
|
||||
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
|
||||
@alias alias for the joined list */
|
||||
Joins are only allowed through a lookup field relation.
|
||||
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
|
||||
@alias alias for the joined list */
|
||||
InnerJoin(lookupFieldInternalName: string, alias: string): IJoin;
|
||||
/** Join the list you're querying with another list.
|
||||
Joins are only allowed through a lookup field relation.
|
||||
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
|
||||
@alias alias for the joined list */
|
||||
Joins are only allowed through a lookup field relation.
|
||||
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
|
||||
@alias alias for the joined list */
|
||||
LeftJoin(lookupFieldInternalName: string, alias: string): IJoin;
|
||||
}
|
||||
interface IJoin extends IJoinable {
|
||||
/** Select projected field for using in the main Query body
|
||||
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
|
||||
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
|
||||
Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView;
|
||||
}
|
||||
interface IProjectableView extends IView {
|
||||
/** Select projected field for using in the main Query body
|
||||
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
|
||||
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
|
||||
Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView;
|
||||
}
|
||||
enum ViewScope {
|
||||
@@ -57,7 +58,7 @@ declare namespace CamlBuilder {
|
||||
/** */
|
||||
FilesOnly = 2,
|
||||
}
|
||||
interface IQuery {
|
||||
interface IQuery extends IGroupable {
|
||||
Where(): IFieldExpression;
|
||||
}
|
||||
interface IFinalizableToString {
|
||||
@@ -70,21 +71,21 @@ declare namespace CamlBuilder {
|
||||
}
|
||||
interface ISortable extends IFinalizable {
|
||||
/** Adds OrderBy clause to the query
|
||||
@param fieldInternalName Internal field of the first field by that the data will be sorted (ascending)
|
||||
@param override This is only necessary for large lists. DON'T use it unless you know what it is for!
|
||||
@param useIndexForOrderBy This is only necessary for large lists. DON'T use it unless you know what it is for!
|
||||
@param fieldInternalName Internal field of the first field by that the data will be sorted (ascending)
|
||||
@param override This is only necessary for large lists. DON'T use it unless you know what it is for!
|
||||
@param useIndexForOrderBy This is only necessary for large lists. DON'T use it unless you know what it is for!
|
||||
*/
|
||||
OrderBy(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery;
|
||||
/** Adds OrderBy clause to the query (using descending order for the first field).
|
||||
@param fieldInternalName Internal field of the first field by that the data will be sorted (descending)
|
||||
@param override This is only necessary for large lists. DON'T use it unless you know what it is for!
|
||||
@param useIndexForOrderBy This is only necessary for large lists. DON'T use it unless you know what it is for!
|
||||
@param fieldInternalName Internal field of the first field by that the data will be sorted (descending)
|
||||
@param override This is only necessary for large lists. DON'T use it unless you know what it is for!
|
||||
@param useIndexForOrderBy This is only necessary for large lists. DON'T use it unless you know what it is for!
|
||||
*/
|
||||
OrderByDesc(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery;
|
||||
}
|
||||
interface IGroupable extends ISortable {
|
||||
/** Adds GroupBy clause to the query.
|
||||
@param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved. */
|
||||
@param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved. */
|
||||
GroupBy(fieldInternalName: any): IGroupedQuery;
|
||||
}
|
||||
interface IExpression extends IGroupable {
|
||||
@@ -134,17 +135,19 @@ declare namespace CamlBuilder {
|
||||
DateField(internalName: string): IDateTimeFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is DateTime */
|
||||
DateTimeField(internalName: string): IDateTimeFieldExpression;
|
||||
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is ModStat (moderation status) */
|
||||
ModStatField(internalName: string): IModStatFieldExpression;
|
||||
/** Used in queries for retrieving recurring calendar events.
|
||||
NOTICE: DateRangesOverlap with overlapType other than Now cannot be used with SP.CamlQuery, because it doesn't support
|
||||
CalendarDate and ExpandRecurrence query options. Lists.asmx, however, supports them, so you can still use DateRangesOverlap
|
||||
with SPServices.
|
||||
@param overlapType Defines type of overlap: return all events for a day, for a week, for a month or for a year
|
||||
@param calendarDate Defines date that will be used for determining events for which exactly day/week/month/year will be returned.
|
||||
This value is ignored for overlapType=Now, but for the other overlap types it is mandatory.
|
||||
@param eventDateField Internal name of "Start Time" field (default: "EventDate" - all OOTB Calendar lists use this name)
|
||||
@param endDateField Internal name of "End Time" field (default: "EndDate" - all OOTB Calendar lists use this name)
|
||||
@param recurrenceIDField Internal name of "Recurrence ID" field (default: "RecurrenceID" - all OOTB Calendar lists use this name)
|
||||
*/
|
||||
NOTICE: DateRangesOverlap with overlapType other than Now cannot be used with SP.CamlQuery, because it doesn't support
|
||||
CalendarDate and ExpandRecurrence query options. Lists.asmx, however, supports them, so you can still use DateRangesOverlap
|
||||
with SPServices.
|
||||
@param overlapType Defines type of overlap: return all events for a day, for a week, for a month or for a year
|
||||
@param calendarDate Defines date that will be used for determining events for which exactly day/week/month/year will be returned.
|
||||
This value is ignored for overlapType=Now, but for the other overlap types it is mandatory.
|
||||
@param eventDateField Internal name of "Start Time" field (default: "EventDate" - all OOTB Calendar lists use this name)
|
||||
@param endDateField Internal name of "End Time" field (default: "EndDate" - all OOTB Calendar lists use this name)
|
||||
@param recurrenceIDField Internal name of "Recurrence ID" field (default: "RecurrenceID" - all OOTB Calendar lists use this name)
|
||||
*/
|
||||
DateRangesOverlap(overlapType: DateRangesOverlapType, calendarDate: string, eventDateField?: string, endDateField?: string, recurrenceIDField?: string): IExpression;
|
||||
}
|
||||
interface IBooleanFieldExpression {
|
||||
@@ -201,25 +204,25 @@ declare namespace CamlBuilder {
|
||||
/** Checks whether the value of the field is equal to one of the specified values */
|
||||
In(arrayOfValues: Date[]): IExpression;
|
||||
/** Checks whether the value of the field is equal to the specified value.
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
EqualTo(value: string): IExpression;
|
||||
/** Checks whether the value of the field is not equal to the specified value.
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
NotEqualTo(value: string): IExpression;
|
||||
/** Checks whether the value of the field is greater than the specified value.
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
GreaterThan(value: string): IExpression;
|
||||
/** Checks whether the value of the field is less than the specified value.
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
LessThan(value: string): IExpression;
|
||||
/** Checks whether the value of the field is greater than or equal to the specified value.
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
GreaterThanOrEqualTo(value: string): IExpression;
|
||||
/** Checks whether the value of the field is less than or equal to the specified value.
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
LessThanOrEqualTo(value: string): IExpression;
|
||||
/** Checks whether the value of the field is equal to one of the specified values.
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
The datetime value should be defined in ISO 8601 format! */
|
||||
In(arrayOfValues: string[]): IExpression;
|
||||
}
|
||||
interface ITextFieldExpression {
|
||||
@@ -322,6 +325,27 @@ declare namespace CamlBuilder {
|
||||
/** DEPRECATED: "Neq" operation in CAML works exactly the same as "NotIncludes". To avoid confusion, please use NotIncludes. */
|
||||
NotEqualTo(value: any): IExpression;
|
||||
}
|
||||
interface IModStatFieldExpression {
|
||||
/** Represents moderation status ID. */
|
||||
ModStatId(): INumberFieldExpression;
|
||||
/** Checks whether the value of the field is Approved - same as ModStatId.EqualTo(0) */
|
||||
IsApproved(): IExpression;
|
||||
/** Checks whether the value of the field is Rejected - same as ModStatId.EqualTo(1) */
|
||||
IsRejected(): IExpression;
|
||||
/** Checks whether the value of the field is Pending - same as ModStatId.EqualTo(2) */
|
||||
IsPending(): IExpression;
|
||||
/** Represents moderation status as localized text. In most cases it is better to use ModStatId in the queries instead of ValueAsText. */
|
||||
ValueAsText(): ITextFieldExpression;
|
||||
}
|
||||
interface IRawQuery {
|
||||
/** Change Where clause */
|
||||
ReplaceWhere(): IFieldExpression;
|
||||
ModifyWhere(): IRawQueryModify;
|
||||
}
|
||||
interface IRawQueryModify {
|
||||
AppendOr(): IFieldExpression;
|
||||
AppendAnd(): IFieldExpression;
|
||||
}
|
||||
enum DateRangesOverlapType {
|
||||
/** Returns events for today */
|
||||
Now = 0,
|
||||
@@ -330,7 +354,7 @@ declare namespace CamlBuilder {
|
||||
/** Returns events for one week, specified by CalendarDate in QueryOptions */
|
||||
Week = 2,
|
||||
/** Returns events for one month, specified by CalendarDate in QueryOptions.
|
||||
Caution: usually also returns few days from previous and next months */
|
||||
Caution: usually also returns few days from previous and next months */
|
||||
Month = 3,
|
||||
/** Returns events for one year, specified by CalendarDate in QueryOptions */
|
||||
Year = 4,
|
||||
@@ -340,6 +364,7 @@ declare namespace CamlBuilder {
|
||||
static createViewFields(viewFields: string[]): IFinalizableToString;
|
||||
static createWhere(): IFieldExpression;
|
||||
static createExpression(): IFieldExpression;
|
||||
static createRawQuery(xml: string): IRawQuery;
|
||||
}
|
||||
class CamlValues {
|
||||
/** Dynamic value that represents Id of the current user */
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for canvas-gauges
|
||||
// Type definitions for canvas-gauges v2.0.8
|
||||
// Project: https://github.com/Mikhus/canvas-gauges
|
||||
// Definitions by: Mikhus <https://github.com/Mikhus>
|
||||
// Definitions: https://github.com/Mikhus/DefinitelyTyped
|
||||
|
||||
+2
-2
@@ -6,6 +6,6 @@ import * as util from 'util';
|
||||
var client = new cassandra.Client({ contactPoints: ['h1', 'h2'], keyspace: 'ks1'});
|
||||
|
||||
var query = 'SELECT email, last_name FROM user_profiles WHERE key=?';
|
||||
client.execute(query, ['guy'], {}, function(err, result) {
|
||||
console.log('got user profile with email ' + result.rows[0].get("email"));
|
||||
client.execute(query, ['guy'], function(err: any, result: any) {
|
||||
console.log('got user profile with email ' + result.rows[0].email);
|
||||
});
|
||||
Vendored
+1
-2
@@ -134,7 +134,7 @@ export namespace types {
|
||||
var LocalTime: LocalTimeStatic;
|
||||
var Long: _Long;
|
||||
var ResultSet: ResultSetStatic;
|
||||
var ResultStream: ResultStreamStatic;
|
||||
// var ResultStream: ResultStreamStatic;
|
||||
var Row: RowStatic;
|
||||
var TimeUuid: TimeUuidStatic;
|
||||
var Tuple: TupleStatic;
|
||||
@@ -365,7 +365,6 @@ export namespace types {
|
||||
buffer: Buffer;
|
||||
paused: boolean;
|
||||
|
||||
_read(): void;
|
||||
_valve(readNext: Function): void;
|
||||
add(chunk: Buffer): void;
|
||||
}
|
||||
|
||||
Vendored
+8
-6
@@ -345,6 +345,7 @@ interface ChartXAxe {
|
||||
stacked?: boolean;
|
||||
categoryPercentage?: number;
|
||||
barPercentage?: number;
|
||||
barThickness?: number;
|
||||
gridLines?: GridLineOptions;
|
||||
position?: string;
|
||||
ticks?: TickOptions;
|
||||
@@ -379,7 +380,7 @@ interface TimeScale extends ChartScales {
|
||||
parser?: string | ((arg: any) => any);
|
||||
round?: string;
|
||||
tooltipFormat?: string;
|
||||
unit?: TimeUnit;
|
||||
unit?: string | TimeUnit;
|
||||
unitStepSize?: number;
|
||||
}
|
||||
|
||||
@@ -390,11 +391,12 @@ interface RadialLinearScale {
|
||||
ticks?: TickOptions;
|
||||
}
|
||||
|
||||
declare var Chart: {
|
||||
new (context: CanvasRenderingContext2D, options: ChartConfiguration): {};
|
||||
declare class Chart {
|
||||
constructor (context: CanvasRenderingContext2D, options: ChartConfiguration);
|
||||
config: ChartConfiguration;
|
||||
destroy: () => {};
|
||||
update: (duration: any, lazy: any) => {};
|
||||
render: (duration: any, lazy: any) => {};
|
||||
update: (duration?: any, lazy?: any) => {};
|
||||
render: (duration?: any, lazy?: any) => {};
|
||||
stop: () => {};
|
||||
resize: () => {};
|
||||
clear: () => {};
|
||||
@@ -407,4 +409,4 @@ declare var Chart: {
|
||||
defaults: {
|
||||
global: ChartOptions;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/// <reference path="chunked-dc.d.ts" />
|
||||
|
||||
// Chunker
|
||||
|
||||
let chunker = new Chunker(1337, Uint8Array.of(1,2,3), 2);
|
||||
for (let chunk of chunker) {
|
||||
// Do smoething with chunk
|
||||
}
|
||||
while (chunker.hasNext) {
|
||||
let chunk = chunker.next().value;
|
||||
}
|
||||
|
||||
// Unchunker
|
||||
|
||||
let unchunker = new Unchunker();
|
||||
unchunker.onMessage = (message: Uint8Array, context: any[]) => {
|
||||
// Do something with the received message
|
||||
};
|
||||
let chunk = Uint8Array.of(1,2).buffer;
|
||||
unchunker.add(chunk);
|
||||
unchunker.gc(1024);
|
||||
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
// Type definitions for chunked-dc v0.1.2
|
||||
// Project: https://github.com/saltyrtc/chunked-dc-js
|
||||
// Definitions by: Danilo Bargen <https://github.com/dbrgn/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Interfaces
|
||||
declare namespace chunkedDc {
|
||||
|
||||
/** common.ts **/
|
||||
|
||||
interface CommonStatic {
|
||||
HEADER_LENGTH: number;
|
||||
}
|
||||
|
||||
/** chunker.ts **/
|
||||
|
||||
interface Chunker extends IterableIterator<Uint8Array> {
|
||||
hasNext: boolean;
|
||||
next(): IteratorResult<Uint8Array>;
|
||||
[Symbol.iterator](): IterableIterator<Uint8Array>;
|
||||
}
|
||||
|
||||
interface ChunkerStatic {
|
||||
new(id: number, message: Uint8Array, chunkSize: number): Chunker
|
||||
}
|
||||
|
||||
/** unchunker.ts **/
|
||||
|
||||
type MessageListener = (message: Uint8Array, context?: any) => void;
|
||||
|
||||
interface Unchunker {
|
||||
onMessage: MessageListener;
|
||||
add(chunk: ArrayBuffer, context?: any): void;
|
||||
gc(maxAge: number): number;
|
||||
}
|
||||
|
||||
interface UnchunkerStatic {
|
||||
new(): Unchunker
|
||||
}
|
||||
|
||||
/** main.ts **/
|
||||
|
||||
interface Standalone {
|
||||
Chunker: ChunkerStatic,
|
||||
Unchunker: UnchunkerStatic,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Entry point for the packed ES5 version:
|
||||
declare var chunkedDc: chunkedDc.Standalone;
|
||||
|
||||
// Entry point for the ES2015 version:
|
||||
declare var Chunker: chunkedDc.ChunkerStatic;
|
||||
declare var Unchunker: chunkedDc.UnchunkerStatic;
|
||||
@@ -0,0 +1 @@
|
||||
--target es2015 --noImplicitAny
|
||||
@@ -37,6 +37,23 @@ function test_CKEDITOR() {
|
||||
CKEDITOR.replaceAll((textarea, config) => false);
|
||||
}
|
||||
|
||||
function test_config() {
|
||||
var config1: CKEDITOR.config = {
|
||||
toolbar: 'basic',
|
||||
};
|
||||
var config2: CKEDITOR.config = {
|
||||
toolbar: [
|
||||
[ 'mode', 'document', 'doctools' ],
|
||||
[ 'clipboard', 'undo' ],
|
||||
'/',
|
||||
[ 'find', 'selection', 'spellchecker' ],
|
||||
[ 'basicstyles', 'cleanup' ],
|
||||
'/',
|
||||
[ 'list', 'indent', 'blocks', 'align', 'bidi' ],
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
function test_dom_comment() {
|
||||
var type = CKEDITOR.NODE_COMMENT;
|
||||
var nativeNode = document.createComment('Example');
|
||||
@@ -319,3 +336,30 @@ function test_focusManager() {
|
||||
var object: CKEDITOR.dom.domObject = focusManager.currentActive;
|
||||
var bool: boolean = focusManager.hasFocus;
|
||||
}
|
||||
|
||||
function test_basicWriter() {
|
||||
var writer = new CKEDITOR.htmlParser.basicWriter();
|
||||
writer.openTag('p', {});
|
||||
writer.attribute('class', 'MyClass');
|
||||
writer.openTagClose('p', false);
|
||||
writer.text('Hello');
|
||||
writer.closeTag('p');
|
||||
alert(writer.getHtml(true)); // '<p class="MyClass">Hello</p>'
|
||||
}
|
||||
|
||||
function test_htmlWriter() {
|
||||
var writer = new CKEDITOR.htmlWriter();
|
||||
writer.openTag('p', {});
|
||||
writer.attribute('class', 'MyClass');
|
||||
writer.openTagClose('p', false);
|
||||
writer.text('Hello');
|
||||
writer.closeTag('p');
|
||||
alert(writer.getHtml(true)); // '<p class="MyClass">Hello</p>'
|
||||
|
||||
writer.indentationChars = '\t';
|
||||
writer.lineBreakChars = '\r\n';
|
||||
writer.selfClosingEnd = '>';
|
||||
writer.indentation();
|
||||
writer.lineBreak();
|
||||
writer.setRules('img', {breakBeforeOpen: true, breakAfterOpen: true});
|
||||
}
|
||||
|
||||
Vendored
+21
-1
@@ -807,7 +807,7 @@ declare namespace CKEDITOR {
|
||||
templates_files?: Object;
|
||||
templates_replaceContent?: boolean;
|
||||
title?: string | boolean;
|
||||
toolbar?: string | (string[])[];
|
||||
toolbar?: string | (string | string[])[];
|
||||
toolbarCanCollapse?: boolean;
|
||||
toolbarGroupCycling?: boolean;
|
||||
toolbarGroups?: toolbarGroups[];
|
||||
@@ -1270,6 +1270,16 @@ declare namespace CKEDITOR {
|
||||
toHtml(data: string, fixForBody?: string): void;
|
||||
}
|
||||
|
||||
class htmlDataProcessor {
|
||||
dataFilter: htmlParser.filter;
|
||||
htmlFilter: htmlParser.filter;
|
||||
writer: htmlParser.basicWriter;
|
||||
|
||||
constructor(editor: editor);
|
||||
toDataFormat(html: string, options?: Object): string;
|
||||
toHtml(data: string, options?: Object): string;
|
||||
}
|
||||
|
||||
|
||||
class event {
|
||||
constructor();
|
||||
@@ -1803,6 +1813,16 @@ declare namespace CKEDITOR {
|
||||
|
||||
}
|
||||
|
||||
class htmlWriter extends htmlParser.basicWriter {
|
||||
indentationChars: string;
|
||||
lineBreakChars: string;
|
||||
selfClosingEnd: string;
|
||||
|
||||
indentation(): void;
|
||||
lineBreak(): void;
|
||||
setRules(tagName: string, rules: Object): void;
|
||||
}
|
||||
|
||||
|
||||
namespace tools {
|
||||
var callFunction: Function;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path="clipboard-js.d.ts" />
|
||||
|
||||
clipboard.copy("Hello World");
|
||||
clipboard.copy(document.body).then(() => console.log("success"));
|
||||
|
||||
clipboard.paste().then(val => console.log(val));
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for clipboard-js 0.3.1
|
||||
// Project: https://github.com/lgarron/clipboard.js
|
||||
// Definitions by: Mark Wong Siang Kai <https://github.com/markwongsk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace clipboard {
|
||||
|
||||
interface IClipboardJsStatic {
|
||||
copy(val: string | Element): Promise<void>;
|
||||
paste(): Promise<string>;
|
||||
}
|
||||
}
|
||||
|
||||
declare var clipboard: clipboard.IClipboardJsStatic;
|
||||
|
||||
declare module 'clipboard-js' {
|
||||
export = clipboard;
|
||||
}
|
||||
Vendored
+1
-1
@@ -430,7 +430,7 @@ declare namespace CodeMirror {
|
||||
|
||||
/** Replace the part of the document between from and to with the given string.
|
||||
from and to must be {line, ch} objects. to can be left off to simply insert the string at position from. */
|
||||
replaceRange(replacement: string, from: CodeMirror.Position, to: CodeMirror.Position): void;
|
||||
replaceRange(replacement: string, from: CodeMirror.Position, to?: CodeMirror.Position): void;
|
||||
|
||||
/** Get the content of line n. */
|
||||
getLine(n: number): string;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
navigator.screenshot.save(() => {/**/});
|
||||
navigator.screenshot.save(() => {/**/}, 'jpg', 50);
|
||||
navigator.screenshot.save(() => {/**/}, 'jpg', 50, 'myScreenShot');
|
||||
|
||||
navigator.screenshot.URI(() => {/**/});
|
||||
navigator.screenshot.URI(() => {/**/}, 50);
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
// Type definitions for com.darktalker.cordova.screenshot v0.1.5
|
||||
// Project: https://github.com/gitawego/cordova-screenshot
|
||||
// Definitions by: Ivana Dolezalova <https://github.com/akarienta>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace com.darktalker.cordova.screenshot {
|
||||
interface Plugin {
|
||||
/**
|
||||
* Takes a screenshot, saves it to device as JPG and provides a path to the file.
|
||||
*
|
||||
* @param saveCallback callback function, holds results
|
||||
* @param format format of to be taken image, possible values are 'jpg' and 'png' ('jpg' is default)
|
||||
* @param quality custom quality of to be taken image in percentage (100 is default)
|
||||
* @param filename custom filename of to be taken image, ('screenshot_<milliSecondsSince1970>.<format>' is default)
|
||||
*/
|
||||
save(saveCallback: (errorMessage: string, successObject: {success: boolean, filePath: string}) => void,
|
||||
format?: string,
|
||||
quality?: number,
|
||||
filename?: string): void;
|
||||
|
||||
/**
|
||||
* Takes a screenshot and provides it trough data URI as JPG. No data are saved in the device.
|
||||
*
|
||||
* @param uriCallback callback function, holds results
|
||||
* @param quality custom quality of to be taken image in percentage (100 is default)
|
||||
*/
|
||||
URI(uriCallback: (errorMessage: string, successObject: {URI: string}) => void,
|
||||
quality?: number): void;
|
||||
}
|
||||
}
|
||||
|
||||
interface Navigator {
|
||||
screenshot: com.darktalker.cordova.screenshot.Plugin;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"com.darktalker.cordova.screenshot-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -15,3 +15,5 @@ obj = contentType.parse(res);
|
||||
|
||||
var str: string = contentType.format({type: 'image/svg+xml'});
|
||||
|
||||
var media: contentType.MediaType;
|
||||
contentType.format(media);
|
||||
|
||||
Vendored
+3
-3
@@ -3,10 +3,10 @@
|
||||
// Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var x: ContentType.StaticFunctions;
|
||||
export = x;
|
||||
declare var ct: ct.StaticFunctions;
|
||||
export = ct;
|
||||
|
||||
declare namespace ContentType {
|
||||
declare namespace ct {
|
||||
interface StaticFunctions {
|
||||
parse(string: string): MediaType;
|
||||
parse(req: { headers: any; }): MediaType;
|
||||
|
||||
@@ -2,9 +2,15 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": false,
|
||||
"strictNullChecks": false,
|
||||
"noEmit": true
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
|
||||
@@ -2,12 +2,18 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": false,
|
||||
"strictNullChecks": false,
|
||||
"noEmit": true
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cordova-plugin-media-capture-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,15 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": false,
|
||||
"strictNullChecks": false,
|
||||
"noEmit": true
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
|
||||
Vendored
+1
-1
@@ -9,7 +9,7 @@ declare namespace cucumber {
|
||||
|
||||
export interface CallbackStepDefinition{
|
||||
pending : () => PromiseLike<any>;
|
||||
(errror?:any, pending?: string):void;
|
||||
(error?:any, pending?: string):void;
|
||||
}
|
||||
|
||||
export interface TableDefinition{
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/// <reference path="../d3/d3.d.ts" />
|
||||
/// <reference path="d3-box.d.ts" />
|
||||
|
||||
// Inspired by http://bl.ocks.org/mbostock/4061502
|
||||
|
||||
function iqr(k: number) {
|
||||
return function(d: any) {
|
||||
var q1 = d.quartiles[0],
|
||||
q3 = d.quartiles[2],
|
||||
iqr = (q3 - q1) * k;
|
||||
let i = -1,
|
||||
j = d.length;
|
||||
while (d[++i] < q1 - iqr);
|
||||
while (d[--j] > q3 + iqr);
|
||||
return [i, j];
|
||||
};
|
||||
}
|
||||
|
||||
var chart = d3.box()
|
||||
.whiskers(iqr(1.5))
|
||||
.width(100)
|
||||
.height(100);
|
||||
|
||||
chart.domain([1, 30]);
|
||||
|
||||
d3.selectAll("sth.").call(chart.duration(1000));
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
// Type definitions for d3-box
|
||||
// Project: https://github.com/JacksonGariety/d3-box
|
||||
// Definitions by: Linkun Chen <https://github.com/lk-chen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../d3/d3.d.ts"/>
|
||||
|
||||
declare namespace d3 {
|
||||
export function box(): Box;
|
||||
|
||||
interface Box {
|
||||
(sel: d3.Selection<any>): void;
|
||||
width(): number;
|
||||
width(x: number): Box;
|
||||
height(): number;
|
||||
height(x: number): Box;
|
||||
tickFormat(): (n: number) => string;
|
||||
tickFormat(fun: (n: number) => string): Box;
|
||||
duration(): number;
|
||||
duration(x: number): Box;
|
||||
domain(): () => number[];
|
||||
domain(x: number[]): Box;
|
||||
value(): (d: any) => number;
|
||||
value(x: (d: any) => number): Box;
|
||||
whiskers(): (d: any[], i?: number) => number[];
|
||||
whiskers(x: (d: any[], i?: number) => number[]): Box;
|
||||
quartiles(): (d: any[]) => number[];
|
||||
quantiles(x: (d: any[]) => number[]): Box;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ num = d3Format.precisionRound(0.0005, 3000);
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
let decimal: '.' | ',' = localeDef.decimal;
|
||||
let thousands: '.' | ',' = localeDef.thousands;
|
||||
let thousands: '.' | ',' | '\u00a0' = localeDef.thousands;
|
||||
let grouping: Array<number> = localeDef.grouping;
|
||||
let currency: [string, string] = localeDef.currency;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -15,7 +15,7 @@ export interface FormatLocaleDefinition {
|
||||
* The group separator (e.g., ","). Note that the thousands property is a misnomer, as\
|
||||
* the grouping definition allows groups other than thousands.
|
||||
*/
|
||||
thousands: '.' | ',';
|
||||
thousands: '.' | ',' | '\u00a0';
|
||||
/**
|
||||
* The array of group sizes (e.g., [3]), cycled as needed.
|
||||
*/
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for d3-tip
|
||||
// Type definitions for d3-tip v3.5.5
|
||||
// Project: https://github.com/Caged/d3-tip
|
||||
// Definitions by: Gert Braspenning <https://github.com/brspnnggrt>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/d3": "^3.5.36"
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,6 @@
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for d3JS cloud layout plugin by Jason Davies
|
||||
// Type definitions for d3JS cloud layout plugin by Jason Davies v1.2.2
|
||||
// Project: https://github.com/jasondavies/d3-cloud
|
||||
// Definitions by: hans windhoff <https://github.com/hansrwindhoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/d3": "^3.5.36"
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,6 @@
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
@@ -16,4 +11,4 @@
|
||||
"index.d.ts",
|
||||
"d3.cloud.layout-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/// <reference path="../d3/d3.d.ts" />
|
||||
/// <reference path="d3.slider.d.ts" />
|
||||
|
||||
d3.select('#slider1').call(d3.slider());
|
||||
d3.select('#slider2').call(d3.slider().value( [ 10, 25 ] ));
|
||||
d3.select('#slider3').call(d3.slider().axis(true).value( [ 10, 25 ] )
|
||||
.on("slide", function(evt, value) {
|
||||
d3.select('#slider3textmin').text(value[ 0 ]);
|
||||
d3.select('#slider3textmax').text(value[ 1 ]);
|
||||
}));
|
||||
d3.select('#slider4').call(d3.slider().on("slide", function(evt, value) {
|
||||
d3.select('#slider4text').text(value);
|
||||
}));
|
||||
d3.select('#slider5').call(d3.slider().axis(true));
|
||||
var axis = d3.svg.axis().orient("top").ticks(4);
|
||||
d3.select('#slider6').call(d3.slider().axis(axis));
|
||||
d3.select('#slider7').call(d3.slider().axis(true).min(2000).max(2100).step(5));
|
||||
d3.select('#slider8').call(d3.slider().value(50).orientation("vertical"));
|
||||
d3.select('#slider9').call(d3.slider().value( [10, 30] ).orientation("vertical"));
|
||||
d3.select('#slider10').call(d3.slider().scale(d3.time.scale().domain([new Date(1984,1,1), new Date(2014,1,1)])).axis(d3.svg.axis()));
|
||||
d3.select('#slider11').call(d3.slider().scale(d3.time.scale().domain([new Date(1984,1,1), new Date(2014,1,1)])).axis(d3.svg.axis()).snap(true).value(new Date(2000,1,1)));
|
||||
let essai = d3.slider().scale(d3.scale.ordinal().domain(["Gecko", "Webkit", "Blink", "Trident"]).rangePoints([0, 1], 0.5)).axis(d3.svg.axis()).snap(true).value("Gecko");
|
||||
d3.select('#slider12').call(essai);
|
||||
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
// Type definitions for d3-slider
|
||||
// Project: https://github.com/MasterMaps/d3-slider
|
||||
// Definitions by: Linkun Chen <https://github.com/lk-chen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../d3/d3.d.ts"/>
|
||||
|
||||
declare namespace d3 {
|
||||
export function slider(): Slider;
|
||||
|
||||
interface Slider {
|
||||
(sel: d3.Selection<any>): void;
|
||||
min(): number;
|
||||
min(val: number): Slider;
|
||||
max(): number;
|
||||
max(val: number): Slider;
|
||||
step(): number;
|
||||
step(val: number): Slider;
|
||||
animate(): boolean | number;
|
||||
animate(val: boolean | number): Slider;
|
||||
orientation(): string;
|
||||
orientation(val: string): Slider;
|
||||
axis(): boolean | d3.svg.Axis;
|
||||
axis(val: boolean | d3.svg.Axis): Slider;
|
||||
margin(): number;
|
||||
margin(val: number): Slider;
|
||||
value(): any;
|
||||
value(val: any): Slider;
|
||||
snap(): boolean;
|
||||
snap(val: boolean): Slider;
|
||||
scale(): any;
|
||||
scale(val: any): Slider;
|
||||
on(evt: ("slide" | "slideend"), callback: (evt: any, val: any) => void): Slider;
|
||||
}
|
||||
}
|
||||
+6
-2716
File diff suppressed because it is too large
Load Diff
+2722
File diff suppressed because it is too large
Load Diff
Vendored
+3375
File diff suppressed because it is too large
Load Diff
Vendored
+33
-3371
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/d3": ">=3.5.36 <4.0.0"
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -152,4 +152,4 @@ declare namespace d3kit {
|
||||
|
||||
declare module 'd3kit' {
|
||||
export = d3kit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/d3": "^3.5.36"
|
||||
}
|
||||
}
|
||||
+19
-18
@@ -1,19 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"d3kit.d.ts",
|
||||
"d3kit-tests.ts"
|
||||
]
|
||||
}
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"node_modules/@types",
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"d3kit.d.ts",
|
||||
"d3kit-tests.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
namespace DagreD3Tests {
|
||||
const gDagre = new dagreD3.graphlib.Graph();
|
||||
const graph = gDagre.graph();
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for dagre-d3.core.js
|
||||
// Type definitions for dagre-d3.core.js v0.4.10
|
||||
// Project: https://github.com/cpettitt/dagre-d3
|
||||
// Definitions by: Mark Wong Siang Kai <https://github.com/markwongsk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/d3": "^3.5.36"
|
||||
}
|
||||
}
|
||||
+19
-18
@@ -1,19 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dagre-d3-tests.ts"
|
||||
]
|
||||
}
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"node_modules/@types",
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dagre-d3-tests.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/d3": "^3.5.36"
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -10,10 +10,11 @@
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"node_modules/@types",
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import deepExtend = require('deep-extend');
|
||||
import * as deepExtend from 'deep-extend';
|
||||
var obj1 = {
|
||||
a: 1,
|
||||
b: 2,
|
||||
|
||||
Vendored
+1
@@ -11,4 +11,5 @@ declare function deepExtend<T, U>(target: T, source: U): T & U;
|
||||
declare function deepExtend<T, U, V>(target: T, source1: U, source2: V): T & U & V;
|
||||
declare function deepExtend<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
|
||||
declare function deepExtend(target: any, ...sources: any[]): any;
|
||||
declare namespace deepExtend {}
|
||||
export = deepExtend;
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
"index.d.ts",
|
||||
"deep-extend-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+15
@@ -53,6 +53,21 @@ declare namespace createjs {
|
||||
clone(): Bitmap;
|
||||
}
|
||||
|
||||
export class ScaleBitmap extends DisplayObject {
|
||||
constructor(imageOrUrl: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | Object | string, scale9Grid: Rectangle);
|
||||
|
||||
// properties
|
||||
image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
|
||||
sourceRect: Rectangle;
|
||||
drawWidth: number;
|
||||
drawHeight: number;
|
||||
scale9Grid: Rectangle;
|
||||
snapToPixel: boolean;
|
||||
|
||||
// methods
|
||||
setDrawSize (newWidth: number, newHeight: number): void;
|
||||
clone(): ScaleBitmap;
|
||||
}
|
||||
|
||||
export class BitmapText extends DisplayObject {
|
||||
constructor(text?:string, spriteSheet?:SpriteSheet);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user