A repeated Instance.
+ *
+ * InstanceForm is an utility class for repeated {@link Instance}. It is designed for shrinking
+ * volume of network message I/O by storing {@link count repeated count}.
+ *
+ * @author Jeongho Nam
+ */
+ class InstanceForm extends samchon.protocol.Entity {
+ /**
+ * A duplicated Instance.
+ */
+ private instance;
+ /**
+ * Repeated count of the {@link instance}.
+ */
+ private count;
+ /**
+ * Default Constructor.
+ */
+ constructor(instance?: Instance, count?: number);
+ /**
+ * @inheritdoc
+ */
+ construct(xml: samchon.library.XML): void;
+ private createInstance(xml);
+ key(): any;
+ getInstance(): Instance;
+ getCount(): number;
+ setCount(val: number): void;
+ $name: string;
+ $width: string;
+ $height: string;
+ $length: string;
+ $count: string;
+ /**
+ * @inheritdoc
+ */
+ TAG(): string;
+ /**
+ * @inheritdoc
+ */
+ toXML(): samchon.library.XML;
+ /**
+ * Repeated {@link instance} to {@link InstanceArray}.
+ *
+ * @details
+ *
Contains the {@link instance repeated instance} to an {@link InstanceArray} to make
+ * {@link instance} to participate in the packing process. The returned {@link InstanceArray} will be
+ * registered on {@link Packer.instanceArray}.
+ *
+ * @return An array of instance containing repeated {@link instance}.
+ */
+ toInstanceArray(): InstanceArray;
+ }
+}
+declare namespace bws.packer {
+ class WrapperArray extends samchon.protocol.EntityArrayCollection {
+ /**
+ * Default Constructor.
+ */
+ constructor();
+ /**
+ * @inheritdoc
+ */
+ createChild(xml: samchon.library.XML): Wrapper;
+ /**
+ * Get (calculate) price.
+ */
+ getPrice(): number;
+ /**
+ * Get (calculate) utilization rate.
+ */
+ getUtilization(): number;
+ /**
+ * @inheritdoc
+ */
+ TAG(): string;
+ /**
+ * @inheritdoc
+ */
+ CHILD_TAG(): string;
+ }
+}
+declare namespace bws.packer {
+ class GAWrapperArray extends WrapperArray {
+ protected instanceArray: InstanceArray;
+ protected result: std.HashMap;
+ private price;
+ /**
+ * @brief Validity of this sequence list.
+ */
+ private valid;
+ /**
+ * Construct from instances.
+ *
+ * @param instanceArray Instances to be wrapped.
+ */
+ constructor(instanceArray: InstanceArray);
+ /**
+ * @brief Copy Constructor.
+ */
+ constructor(genes: GAWrapperArray);
+ private constructResult();
+ /**
+ * @brief Get optimization result.
+ *
+ * @return result map.
+ */
+ getResult(): std.HashMap;
+ less(obj: GAWrapperArray): boolean;
+ }
+}
+declare namespace bws.packer {
+ /**
+ * An interface of physical 3D-instances.
+ *
+ * @author Jeongho Nam
+ */
+ interface Instance extends samchon.protocol.IEntity {
+ /**
+ * Get name.
+ */
+ getName(): string;
+ /**
+ * Get width, length on the X-axis in 3D.
+ */
+ getWidth(): number;
+ /**
+ * Get height, length on the Y-axis in 3D.
+ */
+ getHeight(): number;
+ /**
+ * Get length, length on the Z-axis in 3D.
+ */
+ getLength(): number;
+ /**
+ * Get (calculate) volume.
+ *
+ * @return width x height x length
+ */
+ getVolume(): number;
+ /**
+ * Set name.
+ */
+ setName(val: string): void;
+ /**
+ * Set width, length on the X-axis in 3D.
+ */
+ setWidth(val: number): void;
+ /**
+ * Set height, length on the Y-axis in 3D.
+ */
+ setHeight(val: number): void;
+ /**
+ * Set length, length on the Z-axis in 3D.
+ */
+ setLength(val: number): void;
+ /**
+ * A type, identifier of derived class.
+ *
+ * Derived types
+ *
+ * - {@link Product product}
+ * - {@link Wrapper wrapper}
+ *
+ */
+ TYPE(): string;
+ }
+}
+declare namespace bws.packer {
+ /**
+ * An array of Instance objects.
+ *
+ * @author Jeongho Nam
+ */
+ class InstanceArray extends samchon.protocol.EntityArray {
+ /**
+ * Default Constructor.
+ */
+ constructor();
+ /**
+ * @inheritdoc
+ */
+ createChild(xml: samchon.library.XML): Instance;
+ /**
+ * @inheritdoc
+ */
+ TAG(): string;
+ /**
+ * @inheritdoc
+ */
+ CHILD_TAG(): string;
+ }
+}
+declare namespace bws.packer {
+ /**
+ * A product.
+ *
+ * @author Jeongho Nam
+ */
+ class Product extends samchon.protocol.Entity implements Instance {
+ /**
+ * Name, key of the Product.
+ *
+ * The name must be unique because a name identifies a {@link Product}.
+ */
+ protected name: string;
+ /**
+ * Width of the Product, length on the X-axis in 3D.
+ */
+ protected width: number;
+ /**
+ * Height of the Product, length on the Y-axis in 3D.
+ */
+ protected height: number;
+ /**
+ * Length of the Product, length on the Z-axis in 3D.
+ */
+ protected length: number;
+ /**
+ * Default Constructor.
+ */
+ constructor();
+ /**
+ * Construct from members.
+ *
+ * @param name Name, identifier of the Product.
+ * @param width Width, length on the X-axis in 3D.
+ * @param height Height, length on the Y-axis in 3D.
+ * @param length Length, length on the Z-axis in 3D.
+ */
+ constructor(name: string, width: number, height: number, length: number);
+ /**
+ * Key of a Product is its name.
+ */
+ key(): any;
+ /**
+ * @inheritdoc
+ */
+ getName(): string;
+ /**
+ * @inheritdoc
+ */
+ getWidth(): number;
+ /**
+ * @inheritdoc
+ */
+ getHeight(): number;
+ /**
+ * @inheritdoc
+ */
+ getLength(): number;
+ /**
+ * @inheritdoc
+ */
+ getVolume(): number;
+ /**
+ * @inheritdoc
+ */
+ setName(val: string): void;
+ /**
+ * @inheritdoc
+ */
+ setWidth(val: number): void;
+ /**
+ * @inheritdoc
+ */
+ setHeight(val: number): void;
+ /**
+ * @inheritdoc
+ */
+ setLength(val: number): void;
+ /**
+ * @inheritdoc
+ */
+ TYPE(): string;
+ /**
+ * @inheritdoc
+ */
+ TAG(): string;
+ /**
+ * @inheritdoc
+ */
+ toXML(): samchon.library.XML;
+ }
+}
+declare namespace bws.packer {
+ /**
+ * Wrap represents an act wrap(ping).
+ *
+ * {@link Wrap} is a class represents an act wrapping an {@link Instance} to an {@link Wrapper}.
+ * To represent the relationship, Wrap uses Bridge and Capsular patterns to links and intermediates
+ * relationship between Wrapper and Instance.
+ *
+ * Wrap also helps packing optimization and 3d-visualization with its own members
+ * {@link orientation} and position variables {@link x}, {@link y} and {@link z}.
+ *
+ * @author Jeongho Nam
+ */
+ class Wrap extends samchon.protocol.Entity {
+ /**
+ * A wrapper wrapping the {@link instance}.
+ */
+ protected wrapper: Wrapper;
+ /**
+ * An instance wrapped into the {@link wrapper}.
+ */
+ protected instance: Instance;
+ /**
+ * Coordinate-X of the instance placement in the wrapper.
+ */
+ protected x: number;
+ /**
+ * Coordinate-Y of the instance placement in the wrapper.
+ */
+ protected y: number;
+ /**
+ * Coordinate-Z of the instance placement in the wrapper.
+ */
+ protected z: number;
+ /**
+ * Placement orientation of wrapped {@link instance}.
+ */
+ protected orientation: number;
+ /**
+ *
+ */
+ protected color: number;
+ /**
+ * Construct from a Wrapper.
+ *
+ * @param wrapper A wrapper who will contain an instance.
+ */
+ constructor(wrapper: Wrapper);
+ /**
+ * Construct from a Wrapper and Instance with its position and default orientation 1.
+ *
+ * @param wrapper A wrapper who contains the instance.
+ * @param instance An instance contained into the wrapper.
+ * @param x Coordinate-X of the {@link instance} placement in the {@link wrapper}.
+ * @param y Coordinate-Y of the {@link instance} placement in the {@link wrapper}.
+ * @param z Coordinate-Z of the {@link instance} placement in the {@link wrapper}.
+ */
+ constructor(wrapper: Wrapper, instance: Instance, x: number, y: number, z: number);
+ /**
+ * Construct from a Wrapper and Instance with its position and orientation.
+ *
+ * @param wrapper A wrapper who contains the instance.
+ * @param instance An instance contained into the wrapper.
+ * @param x Coordinate-X of the {@link instance} placement in the {@link wrapper}.
+ * @param y Coordinate-Y of the {@link instance} placement in the {@link wrapper}.
+ * @param z Coordinate-Z of the {@link instance} placement in the {@link wrapper}.
+ * @param orientation Placement orientation of wrapped {@link instance}.
+ */
+ constructor(wrapper: Wrapper, instance: Instance, x: number, y: number, z: number, orientation: number);
+ /**
+ * @inheritdoc
+ */
+ construct(xml: samchon.library.XML): void;
+ /**
+ * Factory method of wrapped Instance.
+ *
+ * @param type Type of contained Instance's type.
+ */
+ protected createInstance(type: string): Instance;
+ /**
+ * Set orientation.
+ *
+ * @param orientation Orientation code (1 to 6).
+ */
+ setOrientation(orientation: number): void;
+ /**
+ * Set position.
+ *
+ * @param x Coordinate-X of the instance placement in the wrapper.
+ * @param y Coordinate-Y of the instance placement in the wrapper.
+ * @param z Coordinate-Z of the instance placement in the wrapper.
+ */
+ setPosition(x: number, y: number, z: number): void;
+ /**
+ * @brief Estimate orientation by given size.
+ *
+ * @param width Width by placement.
+ * @param height Height by placement.
+ * @param length Length by placement.
+ */
+ estimateOrientation(width: number, height: number, length: number): void;
+ /**
+ * @brief Orientation change is occured in level of the packer.
+ *
+ * @details orientation Packer's new orientation.
+ */
+ changeWrapperOrientation(orientation: number): void;
+ /**
+ * Get wrapper.
+ */
+ getWrapper(): Wrapper;
+ /**
+ * Get instance.
+ */
+ getInstance(): Instance;
+ /**
+ * Get x.
+ */
+ getX(): number;
+ /**
+ * Get y.
+ */
+ getY(): number;
+ /**
+ * Get z.
+ */
+ getZ(): number;
+ /**
+ * Get orientation.
+ */
+ getOrientation(): number;
+ /**
+ * Get width.
+ */
+ getWidth(): number;
+ /**
+ * Get height.
+ */
+ getHeight(): number;
+ /**
+ * Get length.
+ */
+ getLength(): number;
+ /**
+ * Get volume.
+ */
+ getVolume(): number;
+ $instanceName: string;
+ $layoutScale: string;
+ $position: string;
+ /**
+ * @inheritdoc
+ */
+ TAG(): string;
+ /**
+ * @inheritdoc
+ */
+ toXML(): samchon.library.XML;
+ /**
+ * Thickness of boundary lines of a shape represents the {@link instance}.
+ */
+ private static BOUNDARY_THICKNESS;
+ /**
+ *
+ *
+ * @param geometry
+ *
+ * @return A shape and its boundary lines as 3D-objects.
+ */
+ toDisplayObjects(geometry: THREE.Geometry): std.Vector;
+ }
+}
+declare namespace bws.packer {
+ /**
+ * A wrapper wrapping instances.
+ *
+ * @author Jeongho Nam
+ */
+ class Wrapper extends samchon.protocol.EntityDeque implements Instance {
+ /**
+ * Name, key of the Wrapper.
+ *
+ * The name represents a type of Wrapper and identifies the Wrapper.
+ */
+ protected name: string;
+ /**
+ * Price, cost of using an Wrapper.
+ */
+ protected price: number;
+ /**
+ * Width of the Wrapper, length on the X-axis in 3D.
+ */
+ protected width: number;
+ /**
+ * Height of the Wrapper, length on the Y-axis in 3D.
+ */
+ protected height: number;
+ /**
+ * Length of the Wrapper, length on the Z-axis in 3D.
+ */
+ protected length: number;
+ /**
+ * Thickness, margin of a Wrapper causes shrinkness of containable volume.
+ *
+ * The thickness reduces each dimension's containable size (dimension - 2*thickness),
+ * so finally, it reduces total containable volume (-8 * thickness^3).
+ */
+ protected thickness: number;
+ /**
+ * Default Constructor.
+ */
+ constructor();
+ /**
+ * Copy Constructor.
+ */
+ constructor(wrapper: Wrapper);
+ /**
+ * Construct from members.
+ *
+ * @param name Name, identifier of a Wrapper.
+ * @param price Price, issued cost for a type of the Wrapper.
+ * @param width Width, dimensional length on the X-axis in 3D.
+ * @param height Height, dimensional length on the Y-axis in 3D.
+ * @param length Length, dimensional length on the Z-axis in 3D.
+ * @param thickness A thickness causes shrinkness on containable volume.
+ */
+ constructor(name: string, price: number, width: number, height: number, length: number, thickness: number);
+ construct(xml: samchon.library.XML): void;
+ /**
+ * @inheritdoc
+ */
+ createChild(xml: samchon.library.XML): Wrap;
+ /**
+ * Key of a Wrapper is its name.
+ */
+ key(): any;
+ /**
+ * Get name.
+ */
+ getName(): string;
+ /**
+ * Get price.
+ */
+ getPrice(): number;
+ /**
+ * Get width, length on X-axis in 3D.
+ */
+ getWidth(): number;
+ /**
+ * Get height, length on Y-axis in 3D.
+ */
+ getHeight(): number;
+ /**
+ * Get length, length on Z-axis in 3D.
+ */
+ getLength(): number;
+ /**
+ * Get thickness.
+ */
+ getThickness(): number;
+ /**
+ * Get (calculate) containable width, length on the X-axis in 3D.
+ *
+ * Calculates containable width considering the {@link thickness}.
+ *
+ * @return width - (2 x thickness)
+ */
+ getContainableWidth(): number;
+ /**
+ * Get (calculate) containable height, length on the Y-axis in 3D.
+ *
+ * Calculates containable height considering the {@link thickness}.
+ *
+ * @return height - (2 x thickness)
+ */
+ getContainableHeight(): number;
+ /**
+ * Get (calculate) containable length, length on the Z-axis in 3D.
+ *
+ * Calculates containable length considering the {@link thickness}.
+ *
+ * @return length - (2 x thickness)
+ */
+ getContainableLength(): number;
+ /**
+ * Get (calculate) volume.
+ *
+ * Notice
+ * If {@link thickness} of the Wrapper is not 0, the volume does not mean containable volume.
+ * In that case, use {@link containableVolume} instead.
+ *
+ * @return width x height x length
+ */
+ getVolume(): number;
+ /**
+ * Get (calculate) containable volume.
+ *
+ * Calculates containable volume considering the {@link thickness}.
+ *
+ * @return volume - {(2 x thickness) ^ 3}
+ */
+ getContainableVolume(): number;
+ /**
+ * Get utilization ratio of containable volume.
+ *
+ * @return utilization ratio.
+ */
+ getUtilization(): number;
+ equal_to(obj: Wrapper): boolean;
+ /**
+ * Wrapper is enough greater?
+ *
+ * Test whether the Wrapper is enough greater than an Instance to contain.
+ *
+ * @param instance An Instance to test.
+ * @return Enough greater or not.
+ */
+ containable(instance: Instance): boolean;
+ /**
+ * @inheritdoc
+ */
+ setName(val: string): void;
+ /**
+ * Set price.
+ */
+ setPrice(val: number): void;
+ /**
+ * @inheritdoc
+ */
+ setWidth(val: number): void;
+ /**
+ * @inheritdoc
+ */
+ setHeight(val: number): void;
+ /**
+ * @inheritdoc
+ */
+ setLength(val: number): void;
+ /**
+ * Set thickness.
+ */
+ setThickness(val: number): void;
+ $name: string;
+ $price: string;
+ $width: string;
+ $height: string;
+ $length: string;
+ $thickness: string;
+ $scale: string;
+ $spaceUtilization: string;
+ /**
+ * @inheritdoc
+ */
+ TYPE(): string;
+ /**
+ * @inheritdoc
+ */
+ TAG(): string;
+ /**
+ * @inheritdoc
+ */
+ CHILD_TAG(): string;
+ /**
+ * @inheritdoc
+ */
+ toXML(): samchon.library.XML;
+ private static scene;
+ private static renderer;
+ private static camera;
+ private static trackball;
+ private static mouse;
+ private static BOUNDARY_THICKNESS;
+ /**
+ * Convert to a canvas containing 3D elements.
+ *
+ * @param endIndex
+ *
+ * @return A 3D-canvans printing the Wrapper and its children {@link Wrap wrapped}
+ * {@link Instance instances} with those boundary lines.
+ */
+ toCanvas(endIndex?: number): HTMLCanvasElement;
+ private static handleMouseMove(event);
+ private static animate();
+ private static render();
+ }
+}
+declare namespace bws.packer {
+ /**
+ * A group of {@link Wrapper Wrappers} with same type.
+ *
+ * @author Jeongho Nam
+ */
+ class WrapperGroup extends WrapperArray {
+ /**
+ * A sample, standard of the WrapperGroup.
+ *
+ * The sample represents what type of Wrappers are grouped into the WrapperGroup.
+ */
+ protected sample: Wrapper;
+ /**
+ * Allocated instances.
+ */
+ protected allocatedInstanceArray: InstanceArray;
+ /**
+ * Default Constructor.
+ */
+ constructor();
+ /**
+ * Copy Constructor.
+ */
+ constructor(wrapperGroup: WrapperGroup);
+ /**
+ * Construct from a sample.
+ *
+ * @param sample A sample, standard of the WrapperGroup.
+ */
+ constructor(sample: Wrapper);
+ /**
+ * Construct from members of the {@link sample}.
+ *
+ * @param name Name, identifier of the sample.
+ * @param price Price, issued cost for a type of the sample.
+ * @param width Width, dimensional length on the X-axis in 3D, of the sample.
+ * @param height Height, dimensional length on the Y-axis in 3D, of the sample.
+ * @param length Length, dimensional length on the Z-axis in 3D, of the sample.
+ * @param thickness A thickness, causes shrinkness on containable volume, of the sample.
+ */
+ constructor(name: string, price: number, width: number, height: number, length: number, thickness: number);
+ /**
+ * Key of a WrapperGroup is dependent on its sample.
+ */
+ key(): any;
+ /**
+ * Get sample.
+ */
+ getSample(): Wrapper;
+ /**
+ * Get allocated instances.
+ */
+ getAllocatedInstanceArray(): InstanceArray;
+ /**
+ * Get (calculate) price.
+ *
+ * @return (Price of the sample) x (numbers of children Wrappers)
+ */
+ getPrice(): number;
+ /**
+ * @inheritdoc
+ */
+ getUtilization(): number;
+ /**
+ * Allocate instance(s) to the WrapperGroup.
+ *
+ * Inspect the instance is enough small to be wrapped into an empty wrapper. If the instance
+ * is enough small, registers the instance (or repeated instances) to the {@link reserveds} and
+ * returns true. If the instance is too large to be capsuled, returns false.
+ *
+ * Note
+ * The word the instance is enough small to be wrapped into the empty wrapper means
+ * the instance can be contained into an empty, a new wrapper contaning nothing literally.
+ *
+ * In the method allocate(), it doesn't consider how many instances are wrapped into ordinary
+ * wrapper and how much volumes are consumed.
+ *
+ * @param instance An Instance to allocate.
+ * @param n Repeating number of the instance.
+ *
+ * @return Whether the instance is enough small to be wrapped into a (new) wrapper
+ * of same type with the sample.
+ */
+ allocate(instance: Instance, n?: number): boolean;
+ /**
+ * Run optimization in level of the group.
+ *
+ * The optimization routine begins by creating a {@link Wrapper} like the {@link sample}. Then
+ * try to pack {@link allocatedInstanceArray allocated instances} to the {@link Wrapper} as a lot as
+ * possible. If there're some {@link Wrappers} can't be packed by overloading, then create a new
+ * {@link Wrapper} again and try to pack {@link allocatedInstanceArray instances} again, too.
+ *
+ * Repeats those steps until all {@link alloctedInstanceArray instances} are {@link Wrap packed}
+ * so that there's not any {@link Instance instance} left.
+ *
+ * Warning
+ * When call this {@link optimize optimize()} method, ordinary children {@link Wrapper} objects
+ * in the {@link WrapperGroup} will be substituted with the newly optimized {@link Wrapper} objects.
+ */
+ optimize(): void;
+ /**
+ * Wrap allocated instances into a new {@link Wrapper}.
+ *
+ * {@link Wrap Wraps} instances to a new Wrapper which is copied from the sample.
+ * After the wrapping is done, the new {@link Wrapper} is registered to the {@link WrapperGroup}
+ * as a child and instances failed to wrap by overloading is returned.
+ *
+ * @param instanceArray instances to {@link Wrap wrap} into a new {@link Wrapper}.
+ *
+ * @return Instances failed to {@link Wrap wrap} by overloading.
+ * @see boxologic
+ */
+ private pack(instanceArray);
+ /**
+ * @inheritdoc
+ */
+ TAG(): string;
+ }
+}
+declare namespace bws.packer {
+ abstract class Editor extends React.Component<{
+ dataProvider: samchon.protocol.EntityArrayCollection;
+ }, {}> {
+ private columns;
+ private selected_index;
+ /**
+ * Default Constructor.
+ */
+ constructor();
+ protected abstract createColumns(): AdazzleReactDataGrid.Column[];
+ private get_row(index);
+ private insert_instance(event);
+ private erase_instances(event);
+ private handle_data_change(event);
+ private handle_row_change(event);
+ private handle_select(event);
+ render(): JSX.Element;
+ }
+}
+declare namespace bws.packer {
+ interface ItemEditorProps extends React.Props {
+ application: PackerApplication;
+ instances: InstanceFormArray;
+ wrappers: WrapperArray;
+ }
+ class ItemEditor extends React.Component {
+ private clear(event);
+ private open(event);
+ private save(event);
+ private pack(event);
+ render(): JSX.Element;
+ }
+ class InstanceEditor extends Editor {
+ protected createColumns(): AdazzleReactDataGrid.Column[];
+ }
+ class WrapperEditor extends Editor {
+ protected createColumns(): AdazzleReactDataGrid.Column[];
+ }
+}
+declare namespace bws.packer {
+ class PackerApplication extends React.Component<{}, {}> {
+ private instances;
+ private wrappers;
+ private result;
+ /**
+ * Default Constructor.
+ */
+ constructor();
+ pack(): void;
+ drawWrapper(wrapper: Wrapper, index?: number): void;
+ render(): JSX.Element;
+ static main(): void;
+ }
+}
+declare namespace bws.packer {
+ class ResultViewer extends React.Component {
+ drawWrapper(wrapper: Wrapper, index?: number): void;
+ private clear(event);
+ private open(event);
+ private save(event);
+ refresh(): void;
+ render(): JSX.Element;
+ }
+ interface WrapperViewerProps extends React.Props {
+ application: PackerApplication;
+ wrappers: WrapperArray;
+ }
+}
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 4317128869..44f0d8e9a0 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -401,6 +401,7 @@ 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:](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)
@@ -1123,10 +1124,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya), [Matt Brooks](https://github.com/EnableSoftware)
* [:link:](moment-range/moment-range.d.ts) [Moment.js](https://github.com/gf3/moment-range) by [Bart van den Burg](https://github.com/Burgov), [Wilgert Velinga](https://github.com/wilgert)
* [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native/tree/2.1) by [Federico Caselli](https://github.com/CaselIT)
-* [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi)
+* [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [simonxca](https://github.com/simonxca), [horiuchi](https://github.com/horiuchi)
* [:link:](mongoose-auto-increment/mongoose-auto-increment.d.ts) [mongoose-auto-increment](https://github.com/codetunnel/mongoose-auto-increment) by [Aya Morisawa](https://github.com/AyaMorisawa)
* [:link:](mongoose-deep-populate/mongoose-deep-populate.d.ts) [mongoose-deep-populate](https://github.com/buunguyen/mongoose-deep-populate) by [Aya Morisawa](https://github.com/AyaMorisawa)
* [:link:](mongoose-mock/mongoose-mock.d.ts) [mongoose-mock](https://github.com/JohanObrink/mongoose-mock) by [jt000](https://github.com/jt000)
+* [:link:](mongoose-promise/mongoose-promise.d.ts) [mongoose-promise](http://mongoosejs.com/docs/api.html#promise-js) by [simonxca](https://github.com/simonxca)
* [:link:](morgan/morgan.d.ts) [morgan](https://github.com/expressjs/morgan) by [James Roland Cabresos](https://github.com/staticfunction)
* [:link:](mousetrap/mousetrap-global-bind.d.ts) [Mousetrap 1.4.6's global-bind extension](http://craig.is/killing/mice#extensions.global) by [Andrew Bradley](https://github.com/cspotcode)
* [:link:](mousetrap/mousetrap.d.ts) [Mousetrap 1.5.x](http://craig.is/killing/mice) by [Dániel Tar](https://github.com/qcz)
diff --git a/ace/ace.d.ts b/ace/ace.d.ts
index 6a09235977..1ac19c7c63 100644
--- a/ace/ace.d.ts
+++ b/ace/ace.d.ts
@@ -77,9 +77,6 @@ declare namespace AceAjax {
onTextInput(text: any): void;
}
- var KeyBinding: {
- new(editor: Editor): KeyBinding;
- }
export interface TextMode {
diff --git a/acl/acl.d.ts b/acl/acl.d.ts
index 06defa2449..d222f9ebb6 100644
--- a/acl/acl.d.ts
+++ b/acl/acl.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Qubo
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
///
///
diff --git a/adal-angular/adal-tests.ts b/adal-angular/adal-tests.ts
index 3b9e46c961..db984d95ba 100644
--- a/adal-angular/adal-tests.ts
+++ b/adal-angular/adal-tests.ts
@@ -20,4 +20,6 @@ Logging.level = 4;
auth.info("Logging message");
-var userName: string = auth.getCachedUser().userName;
\ No newline at end of file
+var userName: string = auth.getCachedUser().userName;
+var postLogoutRedirectUrl = auth.config.postLogoutRedirectUri;
+var isValidRequest = auth.getRequestInfo('hash').valid;
\ No newline at end of file
diff --git a/adal-angular/adal.d.ts b/adal-angular/adal.d.ts
index 76b86e7150..a896d687ec 100644
--- a/adal-angular/adal.d.ts
+++ b/adal-angular/adal.d.ts
@@ -13,29 +13,30 @@ declare module 'adal' {
declare namespace adal {
interface Config {
- tenant?: string,
- clientId: string,
- redirectUri?: string,
- cacheLocation?: string,
- displayCall?: (urlNavigate: string) => any,
- correlationId?: string,
- loginResource?: string,
- resource?: string
- endpoints?: any // If you need to send CORS api requests.
- extraQueryParameter?: string
+ tenant?: string;
+ clientId: string;
+ redirectUri?: string;
+ cacheLocation?: string;
+ displayCall?: (urlNavigate: string) => any;
+ correlationId?: string;
+ loginResource?: string;
+ resource?: string;
+ endpoints?: any; // If you need to send CORS api requests.
+ extraQueryParameter?: string;
+ postLogoutRedirectUri?: string; // redirect url after succesful logout operation
}
interface User {
- userName: string,
- profile: any
+ userName: string;
+ profile: any;
}
interface RequestInfo {
- valid: boolean,
- parameters: any,
- stateMatch: boolean,
- stateResponse: string,
- requestType: string
+ valid: boolean;
+ parameters: any;
+ stateMatch: boolean;
+ stateResponse: string;
+ requestType: string;
}
interface Logging {
@@ -64,6 +65,10 @@ declare namespace adal {
* Saves the resulting Idtoken in localStorage.
*/
login(): void;
+
+ /**
+ * Indicates whether login is in progress now or not.
+ */
loginInProgress(): boolean;
/**
@@ -131,9 +136,9 @@ declare namespace adal {
/**
* Gets requestInfo from given hash.
- * @returns {string} error message related to login
+ * @returns {RequestInfo} for appropriate hash.
*/
- getRequestInfo(hash: string): string;
+ getRequestInfo(hash: string): RequestInfo;
/**
* Saves token from hash that is received from redirect.
@@ -147,6 +152,11 @@ declare namespace adal {
*/
getResourceForEndpoint(endpoint: string): string;
+ /**
+ * Handles redirection after login operation.
+ * Gets access token from url and saves token to the (local/session) storage
+ * or saves error in case unsuccessful login.
+ */
handleWindowCallback(): void;
log(level: number, message: string, error: any): void;
diff --git a/agenda/agenda.d.ts b/agenda/agenda.d.ts
index 463ba43d2e..8dd58fdd80 100644
--- a/agenda/agenda.d.ts
+++ b/agenda/agenda.d.ts
@@ -319,6 +319,11 @@ declare module "agenda" {
* The date/time the job last failed.
*/
failedAt: Date;
+
+ /**
+ * Job's state
+ */
+ disabled: boolean
}
/**
@@ -409,6 +414,11 @@ declare module "agenda" {
* @param cb Called after the job has been saved to the database.
*/
touch(cb?: Callback): void;
+
+ /**
+ * Calculates next time the job should run
+ */
+ computeNextRunAt(): Job;
}
interface JobOptions {
diff --git a/ajv/ajv-tests.ts b/ajv/ajv-tests.ts
new file mode 100644
index 0000000000..e6413fd824
--- /dev/null
+++ b/ajv/ajv-tests.ts
@@ -0,0 +1,74 @@
+///
+
+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)
+ .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).then(() => { }, () => { });
diff --git a/ajv/ajv.d.ts b/ajv/ajv.d.ts
new file mode 100644
index 0000000000..d8bfd56ef3
--- /dev/null
+++ b/ajv/ajv.d.ts
@@ -0,0 +1,112 @@
+// Type definitions for ajv
+// Project: https://github.com/epoberezkin/ajv
+// Definitions by: York Yao
+// 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;
+ 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) & {
+ errors: ValidationError[];
+ }
+ type AjxKeywordDefinition = {
+ async?: boolean;
+ type: string;
+ compile?: (schema: any, parentsSchema: any) => ((data: any) => boolean | PromiseLike);
+ 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;
+}
diff --git a/alexa-sdk/alexa-sdk-tests.ts b/alexa-sdk/alexa-sdk-tests.ts
new file mode 100644
index 0000000000..e161c5bf38
--- /dev/null
+++ b/alexa-sdk/alexa-sdk-tests.ts
@@ -0,0 +1,25 @@
+///
+///
+
+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!');
+ }
+};
diff --git a/alexa-sdk/alexa-sdk.d.ts b/alexa-sdk/alexa-sdk.d.ts
new file mode 100644
index 0000000000..5866d8c4ee
--- /dev/null
+++ b/alexa-sdk/alexa-sdk.d.ts
@@ -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
+// 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;
+ }
+}
+
diff --git a/alt/alt.d.ts b/alt/alt.d.ts
index 20da159f35..575d476451 100644
--- a/alt/alt.d.ts
+++ b/alt/alt.d.ts
@@ -53,8 +53,8 @@ declare namespace AltJS {
export type Source = {[name:string]: () => SourceModel};
export interface SourceModel {
- local(state:any):any;
- remote(state:any):Promise;
+ local(state:any, ...args: any[]):any;
+ remote(state:any, ...args: any[]):Promise;
shouldFetch?(fetchFn:(...args:Array) => boolean):void;
loading?:(args:any) => void;
success?:(state:S) => void;
diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts
index 543467feac..4f5dbe90f7 100644
--- a/amcharts/AmCharts.d.ts
+++ b/amcharts/AmCharts.d.ts
@@ -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.)
diff --git a/amplitude-js/v2/amplitude-js-tests.ts b/amplitude-js/v2/amplitude-js-tests.ts
new file mode 100644
index 0000000000..3e69d7c867
--- /dev/null
+++ b/amplitude-js/v2/amplitude-js-tests.ts
@@ -0,0 +1,87 @@
+// Tests for Amplitude SDK TypeScript definitions
+
+///
+
+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' });
+ */
+ }
+}
diff --git a/amplitude-js/v2/amplitude-js.d.ts b/amplitude-js/v2/amplitude-js.d.ts
new file mode 100644
index 0000000000..613f5ad5d8
--- /dev/null
+++ b/amplitude-js/v2/amplitude-js.d.ts
@@ -0,0 +1,61 @@
+// Type definitions for Amplitude SDK 2.12.1
+// Project: https://github.com/amplitude/Amplitude-Javascript
+// Definitions by: Arvydas Sidorenko
+// 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;
+}
diff --git a/angular-environment/angular-environment.d.ts b/angular-environment/angular-environment.d.ts
index 483474410c..94972d1383 100644
--- a/angular-environment/angular-environment.d.ts
+++ b/angular-environment/angular-environment.d.ts
@@ -14,6 +14,11 @@ declare namespace angular.environment {
* loads the correct environment variables.
*/
check: () => void;
+ /**
+ * Retrieves the correct version of a
+ * variable for the current environment.
+ */
+ read: (key: string) => any;
}
interface Service {
/**
diff --git a/angular-es/angular-es-tests.ts b/angular-es/angular-es-tests.ts
new file mode 100644
index 0000000000..2e44d5d0a8
--- /dev/null
+++ b/angular-es/angular-es-tests.ts
@@ -0,0 +1,157 @@
+///
+
+//
+// @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 {
+}
diff --git a/angular-es/angular-es.d.ts b/angular-es/angular-es.d.ts
new file mode 100644
index 0000000000..0972b42da0
--- /dev/null
+++ b/angular-es/angular-es.d.ts
@@ -0,0 +1,187 @@
+// Type definitions for angular-es v0.0.3
+// Project: https://github.com/mbutsykin/angular-es
+// Definitions by: mbutsykin
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module 'angular-es' {
+
+ interface ClassDecorator {
+ (target: TFunction): TFunction|void;
+ }
+
+ interface MethodDecorator {
+ (target: Object, propertyKey: string|symbol, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor|void;
+ }
+
+ /**
+ * Decorated target
+ */
+ interface ngESDecorator extends ClassDecorator, MethodDecorator {
+ (target: Object|Function,
+ ngName?: string,
+ ngArguments?: Array,
+ ngType?: string,
+ injectAsProperty?: Array): 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} 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} dependencies - dependencies to inject
+ *
+ * @returns {ngESDecorator} - decorated class
+ */
+ function Inject(...dependencies: Array): ngESDecorator;
+
+ /**
+ * Inject dependencies as properties to target
+ *
+ * @param {Array} dependencies - dependencies to inject
+ *
+ * @returns {ngESDecorator} - decorated class
+ */
+ function InjectAsProperty(...dependencies: Array): 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,
+ }
+}
diff --git a/angular-feature-flags/angular-feature-flags-tests.ts b/angular-feature-flags/angular-feature-flags-tests.ts
new file mode 100644
index 0000000000..a36eaba3d0
--- /dev/null
+++ b/angular-feature-flags/angular-feature-flags-tests.ts
@@ -0,0 +1,31 @@
+///
+
+let myApp = angular.module('myApp', ['feature-flags']);
+
+const flagsData: Array = [
+ {
+ 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'));
+});
\ No newline at end of file
diff --git a/angular-feature-flags/angular-feature-flags.d.ts b/angular-feature-flags/angular-feature-flags.d.ts
new file mode 100644
index 0000000000..99ef300976
--- /dev/null
+++ b/angular-feature-flags/angular-feature-flags.d.ts
@@ -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
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+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): void;
+ }
+
+ export interface FeatureFlagsService {
+ set(flagsPromise: angular.IPromise | angular.IHttpPromise): void;
+ }
+}
\ No newline at end of file
diff --git a/angular-gettext/angular-gettext.d.ts b/angular-gettext/angular-gettext.d.ts
index 48734d4433..84721d8dc0 100644
--- a/angular-gettext/angular-gettext.d.ts
+++ b/angular-gettext/angular-gettext.d.ts
@@ -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;
diff --git a/angular-jwt/angular-jwt-tests.ts b/angular-jwt/angular-jwt-tests.ts
index 3a6b7d6bf1..818899e829 100644
--- a/angular-jwt/angular-jwt-tests.ts
+++ b/angular-jwt/angular-jwt-tests.ts
@@ -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();
\ No newline at end of file
diff --git a/angular-jwt/angular-jwt.d.ts b/angular-jwt/angular-jwt.d.ts
index eb02cf24df..d1f9eb085f 100644
--- a/angular-jwt/angular-jwt.d.ts
+++ b/angular-jwt/angular-jwt.d.ts
@@ -27,4 +27,11 @@ declare namespace angular.jwt {
interface IJwtInterceptor {
tokenGetter(...params : any[]): string;
}
+
+ interface IAuthManagerServiceProvider {
+ authenticate(): void;
+ unauthenticate(): void;
+ checkAuthOnRefresh(): void;
+ redirectWhenUnauthenticated(): void;
+ }
}
diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts
index 8e2bdfdf43..552ba7a95e 100644
--- a/angular-material/angular-material-tests.ts
+++ b/angular-material/angular-material-tests.ts
@@ -30,7 +30,11 @@ myApp.config((
myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.IBottomSheetService) => {
$scope['openBottomSheet'] = () => {
$mdBottomSheet.show({
- template: 'Hello!'
+ template: 'Hello!',
+ clickOutsideToClose: true,
+ disableBackdrop: true,
+ disableParentScroll: false,
+ parent: () => {}
});
};
$scope['hideBottomSheet'] = $mdBottomSheet.hide.bind($mdBottomSheet, 'hide');
@@ -115,15 +119,41 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
$scope['close'] = () => $mdSidenav(componentId).close();
$scope['isOpen'] = $mdSidenav(componentId).isOpen();
$scope['isLockedOpen'] = $mdSidenav(componentId).isLockedOpen();
+
+ $scope['asyncLookup'] = $mdSidenav(componentId, true).then((instance) => {
+ instance.toggle();
+ instance.open();
+ instance.close();
+ 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: 'Hello!
',
hasBackdrop: true,
disableParentScroll: true,
diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts
index 2769945a7b..3fa0290904 100644
--- a/angular-material/angular-material.d.ts
+++ b/angular-material/angular-material.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Angular Material 1.0.0-rc5+ (angular.material module)
+// Type definitions for Angular Material 1.1.0-rc5+ (angular.material module)
// Project: https://github.com/angular/material
// Definitions by: Alex Staroselsky , Blake Bigelow , Peter Hajdu
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -19,11 +19,12 @@ declare namespace angular.material {
preserveScope?: boolean; // default: false
controller?: string|Function;
locals?: {[index: string]: any};
- targetEvent?: MouseEvent;
- resolve?: {[index: string]: angular.IPromise}
+ clickOutsideToClose?: boolean;
+ disableBackdrop?: boolean;
+ escapeToClose?: boolean;
+ resolve?: {[index: string]: () => angular.IPromise};
controllerAs?: string;
- bindToController?: boolean;
- parent?: string|Element|JQuery; // default: root node
+ parent?: Function|string|Object; // default: root node
disableParentScroll?: boolean; // default: true
}
@@ -52,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}): T;
+ resolve(resolve?: {[index: string]: () => angular.IPromise}): T;
controllerAs(controllerAs?: string): T;
parent(parent?: string|Element|JQuery): T; // default: root node
onComplete(onComplete?: Function): T;
@@ -90,7 +91,7 @@ declare namespace angular.material {
controller?: string|Function;
locals?: {[index: string]: any};
bindToController?: boolean; // default: false
- resolve?: {[index: string]: angular.IPromise}
+ resolve?: {[index: string]: () => angular.IPromise}
controllerAs?: string;
parent?: string|Element|JQuery; // default: root node
onShowing?: Function;
@@ -131,9 +132,11 @@ declare namespace angular.material {
close(): angular.IPromise;
isOpen(): boolean;
isLockedOpen(): boolean;
+ onClose(onClose: Function): void;
}
interface ISidenavService {
+ (component: string, enableWait: boolean): angular.IPromise;
(component: string): ISidenavObject;
}
@@ -160,10 +163,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}
+ resolve?: {[index: string]: () => angular.IPromise}
controllerAs?: string;
parent?: string|Element|JQuery; // default: root node
}
@@ -173,7 +177,8 @@ declare namespace angular.material {
showSimple(content: string): angular.IPromise;
simple(): ISimpleToastPreset;
build(): IToastPreset;
- updateContent(): void;
+ updateContent(newContent: string): void;
+ updateTextContent(newContent: string): void
hide(response?: any): void;
cancel(response?: any): void;
}
@@ -245,6 +250,7 @@ declare namespace angular.material {
extendPalette(name: string, palette: IPalette): IPalette;
setDefaultTheme(theme: string): void;
alwaysWatchTheme(alwaysWatch: boolean): void;
+ setNonce(nonce: string): void;
}
interface IDateLocaleProvider {
@@ -288,14 +294,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}
+ resolve?: {[index: string]: () => angular.IPromise}
attachTo?: string|JQuery|Element;
+ propagateContainerEvents?: boolean;
panelClass?: string;
zIndex?: number; // default: 80
position?: IPanelPosition;
@@ -328,16 +336,18 @@ declare namespace angular.material {
addClass(newClass: string): void;
removeClass(oldClass: string): void;
toggleClass(toggleClass: string): void;
- focusOnOpen(): void;
+ updatePosition(position: IPanelPosition): void;
}
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;
@@ -357,5 +367,24 @@ declare namespace angular.material {
open(opt_config: IPanelConfig): angular.IPromise;
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,
+ };
}
}
diff --git a/angular-permission/angular-permission-tests.ts b/angular-permission/angular-permission-tests.ts
index cc9cd7c367..c6d5b91a8d 100644
--- a/angular-permission/angular-permission-tests.ts
+++ b/angular-permission/angular-permission-tests.ts
@@ -1,10 +1,11 @@
///
-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;
}
- 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 = PermissionStore.getStore();
+ let permissions: Array = 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 = RoleStore.getStore();
+ let roles: Array = RoleStore.getStore();
});
diff --git a/angular-permission/angular-permission.d.ts b/angular-permission/angular-permission.d.ts
index fecbafb29b..138c8892ce 100644
--- a/angular-permission/angular-permission.d.ts
+++ b/angular-permission/angular-permission.d.ts
@@ -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;
+}
diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts
index 51946281ce..0187e33cab 100644
--- a/angular-translate/angular-translate.d.ts
+++ b/angular-translate/angular-translate.d.ts
@@ -13,7 +13,7 @@ declare module "angular-translate" {
declare namespace angular.translate {
interface ITranslationTable {
- [key: string]: any;
+ [key: string]: string | ITranslationTable;
}
interface ILanguageKeyAlias {
@@ -95,8 +95,9 @@ declare namespace angular.translate {
use(key: string): ITranslateProvider;
storageKey(): string;
storageKey(key: string): void; // JeroMiya - the library should probably return ITranslateProvider but it doesn't here
+ uniformLanguageTag(options: string | Object): ITranslateProvider;
useUrlLoader(url: string): ITranslateProvider;
- useStaticFilesLoader(options: IStaticFilesLoaderOptions): ITranslateProvider;
+ useStaticFilesLoader(options: IStaticFilesLoaderOptions | { files: IStaticFilesLoaderOptions[] }): ITranslateProvider;
useLoader(loaderFactory: string, options?: any): ITranslateProvider;
useLocalStorage(): ITranslateProvider;
useCookieStorage(): ITranslateProvider;
diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts
index 38a1c321bd..d6c389146b 100644
--- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts
+++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts
@@ -393,6 +393,24 @@ declare namespace angular.ui.bootstrap {
*/
windowTopClass?: string;
+
+ /**
+ * Appends the modal to a specific element.
+ *
+ * @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 {
diff --git a/angular-ui-notification/angular-ui-notification-tests.ts b/angular-ui-notification/angular-ui-notification-tests.ts
new file mode 100644
index 0000000000..3039a74c9e
--- /dev/null
+++ b/angular-ui-notification/angular-ui-notification-tests.ts
@@ -0,0 +1,30 @@
+///
+
+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
Some other content
This is a link
', title: 'Html content'});
+
+ Notification.error({message: 'Error Bottom Right', positionY: 'bottom', positionX: 'right'});
+
+ Notification.error({message: 'Error notification 1s', replaceMessage: true});
+}
\ No newline at end of file
diff --git a/angular-ui-notification/angular-ui-notification.d.ts b/angular-ui-notification/angular-ui-notification.d.ts
new file mode 100644
index 0000000000..48215e6d42
--- /dev/null
+++ b/angular-ui-notification/angular-ui-notification.d.ts
@@ -0,0 +1,82 @@
+// Type definitions for angular-ui-notification
+// Project: https://github.com/alexcrack/angular-ui-notification
+// Definitions by: Kamil Rojewski
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare namespace angular.uiNotification {
+ // Taken from angular to avoid dependency
+ interface IPromise {
+ /**
+ * 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 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(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise;
+
+ /**
+ * Shorthand for promise.then(null, errorCallback)
+ */
+ catch(onRejected: (reason: any) => IPromise|TResult): IPromise;
+
+ /**
+ * 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;
+ }
+
+ 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;
+ info(message: Message): IPromise;
+ success(message: Message): IPromise;
+ warning(message: Message): IPromise;
+ error(message: Message): IPromise;
+
+ clearAll(): void;
+
+ (message: Message, type?: MessageType): IPromise;
+ }
+}
diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts
index 9c5db1754a..a588faa448 100644
--- a/angular-ui-router/angular-ui-router-tests.ts
+++ b/angular-ui-router/angular-ui-router-tests.ts
@@ -1,6 +1,7 @@
///
-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() {
diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts
index 88f00c9b5d..7e4f097c8c 100644
--- a/angular-ui-router/angular-ui-router.d.ts
+++ b/angular-ui-router/angular-ui-router.d.ts
@@ -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;
@@ -44,6 +38,10 @@ declare namespace angular.ui {
* Function, returns HTML content string
*/
templateProvider?: Function | Array;
+ /**
+ * String, component name
+ */
+ component?: string;
/**
* A controller paired to the state. Function, annotated array or name as String
*/
@@ -105,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;
diff --git a/angular-ui-scroll/angular-ui-scroll.d.ts b/angular-ui-scroll/angular-ui-scroll.d.ts
index 168c6ba271..5f24c8ec38 100644
--- a/angular-ui-scroll/angular-ui-scroll.d.ts
+++ b/angular-ui-scroll/angular-ui-scroll.d.ts
@@ -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.
*
diff --git a/angular-websocket/angular-websocket-tests.ts b/angular-websocket/angular-websocket-tests.ts
index 980e2001d3..e7cb30fe49 100644
--- a/angular-websocket/angular-websocket-tests.ts
+++ b/angular-websocket/angular-websocket-tests.ts
@@ -2,11 +2,35 @@
let dummySocket: ng.websocket.IWebSocket;
let dummyPromise: ng.IPromise;
+let dummyScope: ng.IScope;
-let provider: ng.websocket.IWebSocketProvider = (url: string) => {
+let provider: ng.websocket.IWebSocketProvider = (url: string, protocols?:string[] | ng.websocket.IWebSocketConfigOptions, options?: ng.websocket.IWebSocketConfigOptions) => {
return dummySocket;
}
+let socketWithProtocol = provider("wss://localhost", "protocol");
+let socketWithProtocols = provider("wss://localhost", ["protocol-a", "protocol-b"]);
+
+let socketWithOptions = provider("wss://localhost", {
+ scope: dummyScope,
+ rootScopeFailOver: true,
+ useApplyAsync: true,
+ initialTimeout: 100,
+ maxTimeout: 300000,
+ reconnectIfNotNormalClose: true,
+ binaryType: "blob"
+});
+
+let socketWithProtocolAndOptions = provider("wss://localhost", "protocol", {
+ scope: dummyScope,
+ rootScopeFailOver: true,
+ useApplyAsync: true,
+ initialTimeout: 100,
+ maxTimeout: 300000,
+ reconnectIfNotNormalClose: true,
+ binaryType: "blob"
+});
+
let socket = provider("wss://localhost");
socket.onOpen((event) => {})
diff --git a/angular-websocket/angular-websocket.d.ts b/angular-websocket/angular-websocket.d.ts
index a01e5eab3e..6929561f9c 100644
--- a/angular-websocket/angular-websocket.d.ts
+++ b/angular-websocket/angular-websocket.d.ts
@@ -7,6 +7,18 @@
declare namespace angular.websocket {
+ /**
+ * Options available to be specified for IWebSocketProvider.
+ */
+ type IWebSocketConfigOptions = {
+ scope?: ng.IScope;
+ rootScopeFailOver?: boolean;
+ useApplyAsync?: boolean;
+ initialTimeout?: number;
+ maxTimeout?: number;
+ binaryType?: "blob" | "arraybuffer";
+ reconnectIfNotNormalClose?: boolean;
+ }
interface IWebSocketProvider {
/**
* Creates and opens an IWebSocket instance.
@@ -14,7 +26,7 @@ declare namespace angular.websocket {
* @param url url to connect to
* @return websocket instance
*/
- (url: string): IWebSocket;
+ (url: string, protocols?: string | string[] | IWebSocketConfigOptions, options?: IWebSocketConfigOptions): IWebSocket;
}
/** Options available to be specified for IWebSocket.onMessage */
diff --git a/angular-xeditable/angular-xeditable-tests.ts b/angular-xeditable/angular-xeditable-tests.ts
new file mode 100644
index 0000000000..9264c47f41
--- /dev/null
+++ b/angular-xeditable/angular-xeditable-tests.ts
@@ -0,0 +1,15 @@
+///
+
+var myApp = angular.module('testModule', ['xeditable']);
+
+myApp.run(["editableOptions", (editableOptions: angular.xeditable.IEditableOptions) => {
+
+ editableOptions.activate = "select";
+ editableOptions.activationEvent = "click";
+ editableOptions.blurElem = "ignore";
+ editableOptions.blurForm = "submit";
+ editableOptions.buttons = "no";
+ editableOptions.icon_set = "font-awesome";
+ editableOptions.isDisabled = true;
+ editableOptions.theme = "bs3";
+}]);
\ No newline at end of file
diff --git a/angular-xeditable/angular-xeditable.d.ts b/angular-xeditable/angular-xeditable.d.ts
new file mode 100644
index 0000000000..026fc5d2fb
--- /dev/null
+++ b/angular-xeditable/angular-xeditable.d.ts
@@ -0,0 +1,98 @@
+// Type definitions for Angular xEditable 0.2.0 (angular.xeditable module)
+// Project: https://vitalets.github.io/angular-xeditable/
+// Definitions by: Joao Monteiro
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+declare namespace angular.xeditable {
+
+ interface IEditableOptions {
+
+ /**
+ * Theme. Possible values `bs3`, `bs2`, `default`
+ */
+ theme: string;
+
+ /**
+ * Icon Set. Possible values `font-awesome`, `default`.
+ */
+ icon_set: string;
+
+ /**
+ * Whether to show buttons for single editalbe element.
+ * Possible values `right` (default), `no`.
+ */
+ buttons: string;
+
+ /**
+ * Default value for `blur` attribute of single editable element.
+ * Can be `cancel|submit|ignore`.
+ */
+ blurElem: string;
+
+ /**
+ * Default value for `blur` attribute of editable form.
+ * Can be `cancel|submit|ignore`.
+ */
+ blurForm: string;
+
+ /**
+ * How input elements get activated. Possible values: `focus|select|none`.
+ */
+ activate: string;
+
+ /**
+ * Whether to disable x-editable. Can be overloaded on each element.
+ */
+ isDisabled: boolean;
+
+ /*
+ * Event, on which the edit mode gets activated.
+ * Can be any event.
+ */
+ activationEvent: string;
+ }
+
+ interface IEditableFormController extends angular.IFormController {
+
+ /**
+ * Shows form with editable controls.
+ */
+ $show(): void;
+
+ /**
+ * Hides form with editable controls without saving.
+ */
+ $hide(): void;
+
+ /**
+ * Sets focus on form field specified by `name`.
+ * When trying to set the focus on a form field of a new row in the editable table, the `$activate` call needs to be wrapped in a `$timeout` call so that the form is rendered before the `$activate` function is called.
+ *
+ * @param name name of field
+ */
+ $activate(name: string): void;
+
+ /**
+ * Triggers `oncancel` event and calls `$hide()`.
+ */
+ $cancel(): void;
+
+ $setWaiting(value: boolean): void;
+
+ /**
+ * Shows error message for particular field.
+ *
+ * @param name name of field
+ * @param msg error message
+ */
+ $setError(name: string, msg: string): void;
+
+ $submit(): void;
+
+ $save(): void;
+
+ }
+
+}
diff --git a/angularjs/angular-animate.d.ts b/angularjs/angular-animate.d.ts
index daae229f56..2451976bf5 100644
--- a/angularjs/angular-animate.d.ts
+++ b/angularjs/angular-animate.d.ts
@@ -69,8 +69,8 @@ declare namespace angular.animate {
* @param value If provided then set the animation on or off.
* @returns current animation state
*/
+ enabled(value?: boolean): boolean;
enabled(element: JQuery, value?: boolean): boolean;
- enabled(value: boolean): boolean;
/**
* Cancels the provided animation.
diff --git a/angularjs/angular-component-router.d.ts b/angularjs/angular-component-router.d.ts
index 3b037b58b1..94d7dd7359 100644
--- a/angularjs/angular-component-router.d.ts
+++ b/angularjs/angular-component-router.d.ts
@@ -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;
$routeConfig?: RouteDefinition[];
}
}
diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts
index 441a7e1d3d..f7e803c1c8 100644
--- a/angularjs/angular-resource.d.ts
+++ b/angularjs/angular-resource.d.ts
@@ -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>;
+ actions?: IActionHash, options?: IResourceOptions): IResourceClass>;
(url: string, paramDefaults?: any,
/** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
where deleteDescriptor : IActionDescriptor */
- actions?: any, options?: IResourceOptions): U;
+ actions?: IActionHash, options?: IResourceOptions): U;
(url: string, paramDefaults?: any,
/** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
where deleteDescriptor : IActionDescriptor */
- actions?: any, options?: IResourceOptions): IResourceClass;
+ actions?: IActionHash, options?: IResourceOptions): IResourceClass;
+ }
+
+ // 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): IModule;
}
+
+ namespace auto {
+ interface IInjectorService {
+ get(name: '$resource'): ng.resource.IResourceService;
+ }
+ }
}
interface Array
diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts
index 7eaf0be763..07f67a7375 100644
--- a/angularjs/angular-tests.ts
+++ b/angularjs/angular-tests.ts
@@ -867,6 +867,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'},
@@ -1098,6 +1118,12 @@ function parseTyping() {
}
}
+function parseWithParams() {
+ var $parse: angular.IParseService;
+ var compiledExp = $parse('a.b.c', () => null);
+ var compiledExp = $parse('a.b.c', null, false);
+}
+
function doBootstrap(element: Element | JQuery, mode: string): ng.auto.IInjectorService {
if (mode === 'debug') {
return angular.bootstrap(element, ['main', function($provide: ng.auto.IProvideService) {
@@ -1105,11 +1131,11 @@ function doBootstrap(element: Element | JQuery, mode: string): ng.auto.IInjector
$delegate['debug'] = true;
});
}, 'debug-helpers'], {
- debugInfoEnabled: true
+ strictDi: true
});
}
return angular.bootstrap(element, ['main'], {
- debugInfoEnabled: false
+ strictDi: false
});
}
diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts
index 15e9ec2043..c9e95bcc98 100644
--- a/angularjs/angular.d.ts
+++ b/angularjs/angular.d.ts
@@ -1,6 +1,6 @@
// Type definitions for Angular JS 1.5
// Project: http://angularjs.org
-// Definitions by: Diego Vilar
+// Definitions by: Diego Vilar , Georgii Dolzhykov
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -41,7 +41,6 @@ declare namespace angular {
interface IAngularBootstrapConfig {
strictDi?: boolean;
- debugInfoEnabled?: boolean;
}
///////////////////////////////////////////////////////////////////////////
@@ -119,14 +118,15 @@ declare namespace angular {
fromJson(json: string): any;
identity(arg?: T): T;
injector(modules?: any[], strictDi?: boolean): auto.IInjectorService;
- isArray(value: any): boolean;
- isDate(value: any): boolean;
+ isArray(value: any): value is Array;
+ 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(value: any): value is T;
+ isString(value: any): value is string;
isUndefined(value: any): boolean;
lowercase(str: string): string;
@@ -388,6 +388,7 @@ declare namespace angular {
$invalid: boolean;
$submitted: boolean;
$error: any;
+ $name: string;
$pending: any;
$addControl(control: INgModelController | IFormController): void;
$removeControl(control: INgModelController | IFormController): void;
@@ -874,7 +875,7 @@ declare namespace angular {
// see http://docs.angularjs.org/api/ng.$parseProvider
///////////////////////////////////////////////////////////////////////////
interface IParseService {
- (expression: string): ICompiledExpression;
+ (expression: string, interceptorFn?: (value: any, scope: IScope, locals: any) => any, expensiveChecks?: boolean): ICompiledExpression;
}
interface IParseProvider {
@@ -986,7 +987,10 @@ declare namespace angular {
// DocumentService
// see http://docs.angularjs.org/api/ng.$document
///////////////////////////////////////////////////////////////////////////
- interface IDocumentService extends JQuery {}
+ interface IDocumentService extends JQuery {
+ // Must return intersection type for index signature compatibility with JQuery
+ [index: number]: HTMLElement & Document;
+ }
///////////////////////////////////////////////////////////////////////////
// ExceptionHandlerService
@@ -1255,7 +1259,7 @@ declare namespace angular {
// This corresponds to $transclude (and also the transclude function passed to link).
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;
}
@@ -1408,6 +1412,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 {
@@ -1716,13 +1730,19 @@ declare namespace angular {
* Whether transclusion is enabled. Enabled by default.
*/
transclude?: boolean | string | {[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.
+ * Note that the required controllers will not be available during the instantiation of the controller,
+ * but they are guaranteed to be available just before the $onInit method is executed!
+ */
require?: {[controller: string]: string};
}
interface IComponentTemplateFn {
( $element?: JQuery, $attrs?: IAttributes ): string;
}
-
+
/**
* 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.
@@ -1736,12 +1756,12 @@ 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 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.
@@ -1757,6 +1777,10 @@ declare namespace angular {
*/
$postLink?(): void;
}
+
+ interface IOnChangesObject {
+ [property: string]: IChangesObject;
+ }
interface IChangesObject {
currentValue: any;
@@ -1816,7 +1840,7 @@ declare namespace angular {
bindToController?: boolean | Object;
link?: IDirectiveLinkFn | IDirectivePrePost;
multiElement?: boolean;
- name?: string;
+ directiveName?: string;
priority?: number;
/**
* @deprecated
diff --git a/angularjs/legacy/angular-1.4.d.ts b/angularjs/legacy/angular-1.4.d.ts
index 22c504712e..2cb129dca1 100644
--- a/angularjs/legacy/angular-1.4.d.ts
+++ b/angularjs/legacy/angular-1.4.d.ts
@@ -886,7 +886,7 @@ declare namespace angular {
// see http://docs.angularjs.org/api/ng.$parseProvider
///////////////////////////////////////////////////////////////////////////
interface IParseService {
- (expression: string): ICompiledExpression;
+ (expression: string, interceptorFn?: (value: any, scope: IScope, locals: any) => any, expensiveChecks?: boolean): ICompiledExpression;
}
interface IParseProvider {
diff --git a/anydb-sql-migrations/anydb-sql-migrations.d.ts b/anydb-sql-migrations/anydb-sql-migrations.d.ts
index 9ab421c3ac..98961266a9 100644
--- a/anydb-sql-migrations/anydb-sql-migrations.d.ts
+++ b/anydb-sql-migrations/anydb-sql-migrations.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Gorgi Kosev
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
///
declare module "anydb-sql-migrations" {
@@ -31,4 +31,4 @@ declare module "anydb-sql-migrations" {
items: MigrationTask[];
}) => any) => Promise;
};
-}
\ No newline at end of file
+}
diff --git a/aphrodite/aphrodite-tests.tsx b/aphrodite/aphrodite-tests.tsx
new file mode 100644
index 0000000000..76d28ca43f
--- /dev/null
+++ b/aphrodite/aphrodite-tests.tsx
@@ -0,0 +1,82 @@
+///
+///
+
+import * as React from "react";
+import { StyleSheet, css, StyleSheetServer, StyleSheetTestUtils } from "aphrodite";
+
+const styles = StyleSheet.create({
+ red: {
+ backgroundColor: 'red'
+ },
+ blue: {
+ backgroundColor: 'blue'
+ },
+ hover: {
+ ':hover': {
+ backgroundColor: 'red'
+ }
+ },
+ small: {
+ '@media (max-width: 600px)': {
+ backgroundColor: 'red',
+ }
+ }
+});
+
+const coolFont = {
+ fontFamily: "CoolFont",
+ fontStyle: "normal",
+ fontWeight: "normal",
+ src: "url('coolfont.woff2') format('woff2')"
+};
+
+const withFont = StyleSheet.create({
+ headingText: {
+ fontFamily: coolFont,
+ fontSize: 20
+ },
+ bodyText: {
+ fontFamily: [coolFont, "sans-serif"],
+ fontSize: 12
+ }
+});
+
+
+class App extends React.Component<{}, {}> {
+ render() {
+ return
+
+ This is red.
+
+
+ This turns red on hover.
+
+
+ This turns red when the browser is less than 600px width.
+
+
+ This is blue.
+
+
+ This is blue and turns red when the browser is less than
+ 600px width.
+
+
+ With font
+
+
;
+ }
+}
+
+const output = StyleSheetServer.renderStatic(() => {
+ return "test";
+});
+
+output.css.content;
+output.css.renderedClassNames;
+output.html;
+
+StyleSheet.rehydrate(output.css.renderedClassNames);
+
+StyleSheetTestUtils.suppressStyleInjection();
+StyleSheetTestUtils.clearBufferAndResumeStyleInjection();
diff --git a/aphrodite/aphrodite.d.ts b/aphrodite/aphrodite.d.ts
new file mode 100644
index 0000000000..89d8646e54
--- /dev/null
+++ b/aphrodite/aphrodite.d.ts
@@ -0,0 +1,76 @@
+// Type definitions for Aphrodite 0.5.0
+// Project: https://github.com/Khan/aphrodite
+// Definitions by: Alexey Svetliakov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+declare module "aphrodite" {
+ import * as React from "react";
+
+ /**
+ * Aphrodite style declaration
+ */
+ export interface StyleDeclaration {
+ [key: string]: React.CSSProperties;
+ }
+
+ interface StyleSheetStatic {
+ /**
+ * Create style sheet
+ */
+ create(styles: T): T;
+ /**
+ * Rehydrate class names from server renderer
+ */
+ rehydrate(renderedClassNames: string[]): void;
+ }
+
+ export var StyleSheet: StyleSheetStatic;
+ /**
+ * Get class names from passed styles
+ */
+ export function css(...styles: any[]): string;
+
+ interface StaticRendererResult {
+ html: string;
+ css: {
+ content: string;
+ renderedClassNames: string[];
+ }
+ }
+
+ /**
+ * Utilities for using Aphrodite server-side.
+ */
+ interface StyleSheetServerStatic {
+ renderStatic(renderFunc: () => string): StaticRendererResult;
+ }
+
+ export var StyleSheetServer: StyleSheetServerStatic;
+
+ interface StyleSheetTestUtilsStatic {
+ /**
+ * Prevent styles from being injected into the DOM.
+ *
+ * This is useful in situations where you'd like to test rendering UI
+ * components which use Aphrodite without any of the side-effects of
+ * Aphrodite happening. Particularly useful for testing the output of
+ * components when you have no DOM, e.g. testing in Node without a fake DOM.
+ *
+ * Should be paired with a subsequent call to
+ * clearBufferAndResumeStyleInjection.
+ */
+ suppressStyleInjection(): void;
+ /**
+ * Opposite method of preventStyleInject.
+ */
+ clearBufferAndResumeStyleInjection(): void;
+ }
+
+ export var StyleSheetTestUtils: StyleSheetTestUtilsStatic;
+}
+
+declare module "aphrodite/no-important" {
+ export * from "aphrodite";
+}
diff --git a/apigee-access/apigee-access-tests.ts b/apigee-access/apigee-access-tests.ts
new file mode 100644
index 0000000000..99baec8021
--- /dev/null
+++ b/apigee-access/apigee-access-tests.ts
@@ -0,0 +1,67 @@
+///
+import apigee from "apigee-access";
+
+//Sample code from
+// https://www.npmjs.com/package/apigee-access
+
+var request: any = null;
+
+// Variables
+var val1 = apigee.getVariable(request, 'TestVariable');
+
+apigee.setIntVariable(request, 'TestVariable', '123');
+apigee.setIntVariable(request, 'TestVariable2', 42);
+
+apigee.deleteVariable(request, 'TestVariable');
+
+// Mode
+console.log('The deployment mode is ' + apigee.getMode());
+
+// Cache
+var cache = apigee.getCache('cache');
+var customCache = apigee.getCache('MyCustomCache',
+ { resource: 'MyCustomrResource' });
+cache.put('key2', 'Hello, World!', 120);
+cache.put('key4', 'Hello, World!', function (err: any) {
+});
+
+cache.get('key', function (err: any, data: any) {
+});
+
+cache.remove('key');
+
+// Secure Vault
+var orgVault = apigee.getVault('vault1', 'organization');
+orgVault.get('key1', function (err: any, secretValue: any) {
+});
+
+// Quota Service
+var quota = apigee.getQuota();
+quota.apply({ identifier: 'Foo', allow: 10, timeUnit: 'hour' },
+ function (err: any, result: any) {
+ console.log('Quota applied: %j', result);
+ });
+
+quota.apply({
+ identifier: 'Foo',
+ timeUnit: 'hour',
+ allow: 100
+}, quotaResult);
+
+quota.apply({
+ identifier: 'Bar',
+ timeUnit: 'minute',
+ interval: 5,
+ allow: 500
+}, quotaResult);
+
+quota.apply({
+ identifier: 'Foo',
+ timeUnit: 'hour',
+ allow: 100,
+ weight: 10
+}, quotaResult);
+
+function quotaResult(err: any, r: any) {
+ if (err) { console.error('Quota failed'); }
+}
\ No newline at end of file
diff --git a/apigee-access/apigee-access.d.ts b/apigee-access/apigee-access.d.ts
new file mode 100644
index 0000000000..af34724023
--- /dev/null
+++ b/apigee-access/apigee-access.d.ts
@@ -0,0 +1,58 @@
+// Type definitions for apigee-access
+// Project: https://www.npmjs.com/package/apigee-access
+// Definitions by: Casper Skydt
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module ApigeeAccess {
+
+ function getVariable(request: any, name: string): string | number | boolean;
+ function setVariable(request: any, name: string, value: string | number | boolean ): void;
+ function setIntVariable(request: any, name: string, value: string | number): void;
+ function deleteVariable(request: any, name: string): void;
+ function getCache(name: string, options?: CacheOptions): any;
+ function getVault(name: string, scope?: "organization" | "environment"): SecureVault;
+ function getQuota(options?: any): QuotaService;
+ function getMode(): "apigee" | "standalone";
+
+ interface CacheOptions{
+ resource?: string;
+ scope?: "global" | "application" | "exclusive";
+ defaultTtl?: number;
+ timeout?: number;
+ }
+
+ interface Cache{
+ put(key: string, data: any, ttl?: number, callback?: (err: any) => void): void;
+ get(key: string, callback: (err: any, data: any) => void): void;
+ remove(key: string, callback?: (err: any) => void): void;
+ }
+
+ interface SecureVault{
+ getKeys(callback: (err: any, data: any) => void): void;
+ get(key: string, callback: (err: any, data: any) => void): void;
+ }
+
+ interface QuotaService{
+ apply(options?: QuotaServiceApplyOptions, callback?: (err: any, data: QuotaServiceApplyCallbackData) => void): void;
+ }
+
+ interface QuotaServiceApplyOptions{
+ identifier: string;
+ timeUnit: "minute" | "hour" | "day" | "week" | "month";
+ allow: number;
+ interval?: number;
+ weight?: number;
+ }
+
+ interface QuotaServiceApplyCallbackData{
+ used: number;
+ allowed: number;
+ isAllowed: boolean;
+ expiryTime: number;
+ timestamp: number;
+ }
+}
+
+declare module "apigee-access"{
+ export default ApigeeAccess;
+}
\ No newline at end of file
diff --git a/app-root-path/app-root-path-tests.ts b/app-root-path/app-root-path-tests.ts
new file mode 100644
index 0000000000..64d8cdab6b
--- /dev/null
+++ b/app-root-path/app-root-path-tests.ts
@@ -0,0 +1,10 @@
+///
+import * as root from 'app-root-path';
+
+let resolvedPath: string;
+resolvedPath = root.resolve('../dir');
+resolvedPath = root.path;
+resolvedPath = root.toString();
+let resolvedModule: any = root.require('app-root-path');
+root.setPath('C:\\app-root');
+
diff --git a/app-root-path/app-root-path.d.ts b/app-root-path/app-root-path.d.ts
new file mode 100644
index 0000000000..7cccc59e01
--- /dev/null
+++ b/app-root-path/app-root-path.d.ts
@@ -0,0 +1,39 @@
+// Type definitions for app-root-path 1.2.1
+// Project: https://github.com/inxilpro/node-app-root-path
+// Definitions by: Shant Marouti
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module 'app-root-path' {
+ interface RootPath {
+
+ /**
+ * Application root directory absolute path
+ * @type {string}
+ */
+ path: string;
+
+ /**
+ * Resolves relative path from root to absolute path
+ * @param {string} pathToModule
+ * @returns {string}
+ */
+ resolve(pathToModule: string): string;
+
+ /**
+ * Resolve module by relative addressing from root
+ * @param {string} pathToModule
+ * @returns {*}
+ */
+ require(pathToModule: string): any;
+
+ /**
+ * Explicitly set root path
+ * @param {string} explicitlySetPath
+ */
+ setPath(explicitlySetPath: string): void;
+
+ toString(): string;
+ }
+ var RootPath: RootPath;
+ export = RootPath;
+}
\ No newline at end of file
diff --git a/applicationinsights-js/applicationinsights-js.d.ts b/applicationinsights-js/applicationinsights-js.d.ts
index d9ad3c1c9d..ba154e5fe6 100644
--- a/applicationinsights-js/applicationinsights-js.d.ts
+++ b/applicationinsights-js/applicationinsights-js.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for ApplicationInsights-JS v0.22.14
+// Type definitions for ApplicationInsights-JS v0.23.2
// Project: https://github.com/Microsoft/ApplicationInsights-JS
// Definitions by: Kamil Szostak
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -788,3 +788,9 @@ declare module Microsoft.ApplicationInsights {
_onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error): any;
}
}
+
+declare module 'applicationinsights-js' {
+ export let AppInsights: Microsoft.ApplicationInsights.IAppInsights;
+}
+
+declare var appInsights: Microsoft.ApplicationInsights.IAppInsights;
\ No newline at end of file
diff --git a/arcgis-js-api/arcgis-js-api.d.ts b/arcgis-js-api/arcgis-js-api.d.ts
index 01d8a02c12..65765fbb09 100644
--- a/arcgis-js-api/arcgis-js-api.d.ts
+++ b/arcgis-js-api/arcgis-js-api.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for ArcGIS API for JavaScript v3.16
+// Type definitions for ArcGIS API for JavaScript v3.17
// Project: http://js.arcgis.com
// Definitions by: Esri
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -18,7 +18,6 @@ declare module "esri" {
import BasemapLayer = require("esri/dijit/BasemapLayer");
import Symbol = require("esri/symbols/Symbol");
import BookmarkItem = require("esri/dijit/BookmarkItem");
- import Units = require("esri/units");
import Color = require("esri/Color");
import LocationProviderBase = require("esri/tasks/locationproviders/LocationProviderBase");
import PictureMarkerSymbol = require("esri/symbols/PictureMarkerSymbol");
@@ -45,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 WMSLayerInfo = require("esri/layers/WMSLayerInfo");
import WMTSLayerInfo = require("esri/layers/WMTSLayerInfo");
export interface AGSMouseEvent extends MouseEvent {
@@ -354,7 +354,7 @@ declare module "esri" {
/** Radius of the circle. */
radius?: number;
/** Unit of the radius. */
- radiusUnit?: Units;
+ radiusUnit?: string;
}
export interface CircleOptions2 {
/** The center point of the circle. */
@@ -366,7 +366,7 @@ declare module "esri" {
/** The radius of the circle. */
radius?: number;
/** Unit of the radius. */
- radiusUnit?: Units;
+ radiusUnit?: string;
}
export interface ClassedColorSliderOptions {
/** Data map containing renderer information. */
@@ -643,6 +643,8 @@ declare module "esri" {
minStops?: number;
/** When true, stops on the route are re-ordered to provide an optimal route. */
optimalRoute?: boolean;
+ /** If specified, this specifies the portal where the produced route layers are going to be stored and accessed. */
+ portalUrl?: string;
/** URL link to a custom print page. */
printPage?: string;
/** If available, this print task is used to display an overview map of the route on the directions print page (Added at v3.11). */
@@ -677,6 +679,8 @@ declare module "esri" {
showReturnToStartOption?: boolean;
/** Display the 'Show Reverse Stops' button. */
showReverseStopsButton?: boolean;
+ /** Applicable if the widget works with a Network Analyst Server federated with ArcGIS Online or Portal. */
+ showSaveButton?: boolean;
/** Highlight the route segment when a directions step is clicked. */
showSegmentHighlight?: boolean;
/** Display a popup with segment details when a direction step is clicked. */
@@ -911,6 +915,8 @@ declare module "esri" {
layer: FeatureLayer;
}
export interface FeatureTableOptions {
+ /** The number of features a service will try to fetch. */
+ batchCount?: number;
/** Object defining the date options specifically for formatting date and time editors. */
dateOptions?: any;
/** Sets the editing state for the FeatureTable. */
@@ -931,12 +937,18 @@ declare module "esri" {
menuFunctions?: any[];
/** Attribute fields to include in the FeatureTable. */
outFields?: string[];
+ /** Displays or hides the attachment column. */
+ showAttachments?: 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. */
+ showFeatureCount?: boolean;
/** Displays or hides the FeatureTable header. */
showGridHeader?: boolean;
/** Displays or hides 'Options' drop-down menu of the FeatureTable. */
showGridMenu?: 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. */
syncSelection?: boolean;
/** Enables pan/zoom to selected features on the map when the table in 'sync selection' mode. */
@@ -1187,10 +1199,20 @@ declare module "esri" {
gdbVersion?: string;
}
export interface ImageServiceMeasureOptions {
+ /** The angular unit in which directions of line segments will be calculated. */
+ angularUnit?: string;
+ /** The area unit in which areas of polygons will be calculated. */
+ areaUnit?: string;
+ /** Defines whether to show the widget result in a popup or in the widget's result area when the widget has 'toolbar' layout. */
+ displayMeasureResultInPopup?: boolean;
/** Symbol to be used when drawing a polygon or extent. */
fillSymbol?: SimpleFillSymbol;
/** Image service layer with which the toolbar is associated. */
layer: ArcGISImageServiceLayer;
+ /** Defines the layout of the widget. */
+ layout?: string;
+ /** The linear unit in which height, length, or perimeters will be calculated. */
+ linearUnit?: string;
/** Symbol to be used when drawing a line. */
lineSymbol?: SimpleLineSymbol;
/** Map instance with which the toolbar is associate. */
@@ -1402,9 +1424,9 @@ declare module "esri" {
/** Flag for showing full list of units in the Location tool. */
advancedLocationUnits?: boolean;
/** The default area unit for the measure area tool. */
- defaultAreaUnit?: Units;
+ defaultAreaUnit?: string;
/** The default length unit for the measure distance tool. */
- defaultLengthUnit?: Units;
+ defaultLengthUnit?: string;
/** Allows the user to immediately measure previously-created geometry on dijit creation. */
geometry?: Point | Polyline | Polygon;
/** Line symbol used to draw the lines for the measure line and measure distance tools. */
@@ -2190,6 +2212,28 @@ declare module "esri" {
/** The well-known ID of the spatial reference used by the WFSLayer. */
wkid?: string;
}
+ export interface WMSLayerInfoOptions {
+ /** All the bounding extents defined for this layer. */
+ allExtents?: Extent[];
+ /** A description of the WMS layer. */
+ description?: string;
+ /** The extent of the WMS Layer. */
+ extent?: Extent;
+ /** The URL to the legend image. */
+ legendURL?: string;
+ /** The name of the WMS layer. */
+ name: string;
+ /** Returns true if the layer can be queried and the service supports GetFeatureInfo with either text/html or text/plain formats. */
+ queryable?: boolean;
+ /** Indicates if this layer should be included in the popup. */
+ showPopup?: boolean;
+ /** All the spatial references defined for this layer. */
+ spatialReferences?: SpatialReference[];
+ /** WMSLayerInfos of the layer's sub layers. */
+ subLayers?: WMSLayerInfo[];
+ /** The title of the WMS layer. */
+ title?: string;
+ }
export interface WMSLayerOptions {
/** Specify the map image format, valid options are png,jpg,bmp,gif,svg. */
format?: string;
@@ -3732,6 +3776,8 @@ declare module "esri/dijit/Directions" {
maxStopsReached: boolean;
/** Read-only: The graphic for the calculated route. */
mergedRouteGraphic: Graphic;
+ /** If specified, this specifies the portal where the produced route layers are going to be stored and accessed. */
+ portalUrl: string;
/** Routing parameters for the widget. */
routeParams: RouteParameters;
/** Routing task for the widget. */
@@ -3744,6 +3790,8 @@ declare module "esri/dijit/Directions" {
showClearButton: boolean;
/** If true, the toggle button group allowing user to choose between Miles and Kilometers is shown. */
showMilesKilometersOption: boolean;
+ /** Applicable if the widget works with a Network Analyst Server federated with ArcGIS Online or Portal. */
+ showSaveButton: boolean;
/** If true, and supported by the service, then two toggle button groups are shown: one to allow user to choose between driving a car, a truck, or walking, and one more group to choose between fastest or shortest routes. */
showTravelModesOption: boolean;
/** An array of graphics that define the stop locations along the route. */
@@ -3792,6 +3840,11 @@ declare module "esri/dijit/Directions" {
* @param index The index of the route segment to highlight.
*/
highlightSegment(index: number): void;
+ /**
+ * Loads a stored route layer from either ArcGIS Online or Portal
+ * @param itemId The itemId of the stored route layer from either ArcGIS Online or Portal.
+ */
+ loadRoute(itemId: string): any;
/**
* Remove the stop at the specified index.
* @param index The index of the stop to remove.
@@ -3801,6 +3854,16 @@ declare module "esri/dijit/Directions" {
removeStops(): any;
/** Resets the directions widget removing any directions, stops and map graphics. */
reset(): any;
+ /**
+ * Specify the language used for the directions.
+ * @param locale The locale used for the directions.
+ */
+ setDirectionsLanguage(locale: string): any;
+ /**
+ * Specify the length units used for the directions widget.
+ * @param units The length units used for the directions widget.
+ */
+ setDirectionsLengthUnits(units: string): any;
/**
* If widget runs with Travel Modes enabled, call this method to switch to particular Travel mode programmatically.
* @param travelModeName Travel mode.
@@ -3843,10 +3906,16 @@ declare module "esri/dijit/Directions" {
on(type: "directions-finish", listener: (event: { result: RouteResult; target: Directions }) => void): esri.Handle;
/** Fires when the route services starts to calculate the route. */
on(type: "directions-start", listener: (event: { target: Directions }) => void): esri.Handle;
+ /** Fires after a user clicks the Save or Save as New button and subsequently does not have permission to create an item in ArcGIS Online or Portal. */
+ on(type: "feature-collection-created", listener: (event: { target: Directions }) => void): esri.Handle;
/** Fires when the directions widget has fully loaded. */
on(type: "load", listener: (event: { target: Directions }) => void): esri.Handle;
/** Fires when the widget starts or stops listening for map clicks. */
on(type: "map-click-active", listener: (event: { mapClickActive: boolean; target: Directions }) => void): esri.Handle;
+ /** Fires after a user clicks the Save or Save as New button for the first time in order to store a new route in either ArcGIS Online or Portal. */
+ on(type: "route-item-created", listener: (event: { target: Directions }) => void): esri.Handle;
+ /** Fires when a existing route layer item is successfully updated in ArcGIS Online or Portal after user clicks the Save button. */
+ on(type: "route-item-updated", listener: (event: { target: Directions }) => void): esri.Handle;
/** Fired when you hover over a route segment in the directions display. */
on(type: "segment-highlight", listener: (event: { graphic: Graphic; target: Directions }) => void): esri.Handle;
/** Fires when a route segment is selected in the directions display. */
@@ -3901,6 +3970,8 @@ declare module "esri/dijit/FeatureTable" {
/** Creates an instance of the FeatureTable widget within the provided DOM node. */
class FeatureTable {
+ /** The number of features a service will try to fetch. */
+ batchCount: number;
/** Read-only: A reference to the column objects and their parameters. */
columns: any[];
/** Read-only: Reference to the dataStore used by the dGrid. */
@@ -3909,6 +3980,8 @@ declare module "esri/dijit/FeatureTable" {
dateOptions: any;
/** Sets the editing state for the FeatureTable. */
editable: boolean;
+ /** Event trigger(s) used to display editing interface for an individual cell. */
+ editOn: string | any;
/** Read-only: Number of records displayed in FeatureTable. */
featureCount: number;
/** The featureLayer that the table is associated with. */
@@ -3937,12 +4010,18 @@ declare module "esri/dijit/FeatureTable" {
selectedRowIds: number[];
/** Read-only: Each element in the array is an object that contains name-value pair of fields and field values associated with the selected rows. */
selectedRows: any[];
- /** Displays the data type of the field right under the field label in the column header. */
+ /** Displays or hides the attachment column. */
+ showAttachments: 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. */
+ showFeatureCount: boolean;
/** Displays or hides the FeatureTable header. */
showGridHeader: boolean;
/** Displays or hides 'Options' drop-down menu of the FeatureTable. */
showGridMenu: 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. */
syncSelection: boolean;
/** Enables pans to selected features on the map when the table in 'sync selection' mode. */
@@ -3953,6 +4032,29 @@ 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(). */
+ 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.
+ */
+ filterSelectedRecords(toggle: boolean): void;
+ /**
+ * Queries and gets selected features from the FeatureLayer instead of the store.
+ * @param id Array of row ids
+ */
+ getFeatureDataById(id: number[]): any;
+ /**
+ * Gets row object by the row ID.
+ * @param id row ID
+ */
+ getRowDataById(id: number): any;
+ /** Refreshes the data in the grid. */
+ refresh(): void;
+ /** Resizes the grid's container. */
+ resize(): void;
/** Finalizes the creation of the widget. */
startup(): void;
/** Fires when the grid column is resized. */
@@ -4286,8 +4388,13 @@ declare module "esri/dijit/ImageServiceMeasure" {
/**
* Creates an instance of the ImageServiceMeasure widget.
* @param params An Object containing constructor options.
+ * @param srcNode Reference or id of the HTML element where the widget should be rendered.
*/
- constructor(params: esri.ImageServiceMeasureOptions);
+ constructor(params: esri.ImageServiceMeasureOptions, srcNode: Node | string);
+ /** Destroys the ImageServiceMeasure widget. */
+ destroy(): void;
+ /** Finalizes the creation of the widget. */
+ startup(): void;
}
export = ImageServiceMeasure;
}
@@ -4528,9 +4635,14 @@ declare module "esri/dijit/LayerSwipe" {
declare module "esri/dijit/Legend" {
import esri = require("esri");
+ import Map = require("esri/map");
/** The legend dijit displays a label and symbol for some or all of the layers in the map. */
class Legend {
+ /** Specify a subset of the layers in the map to display in the legend. */
+ layerInfos: any[];
+ /** Reference to the map. */
+ map: Map;
/**
* Creates a new Legend dijit.
* @param params Parameters used to configure the dijit.
@@ -4555,7 +4667,7 @@ declare module "esri/dijit/LocateButton" {
import Symbol = require("esri/symbols/Symbol");
import Graphic = require("esri/graphic");
- /** LocateButton provides a simple button to locate and zoom to the users current location. */
+ /** LocateButton provides a simple button to locate and zoom to the user's location. */
class LocateButton {
/** Centers the map to the location when a new position is returned. */
centerAt: boolean;
@@ -6767,7 +6879,7 @@ declare module "esri/dijit/editing/Add" {
import esri = require("esri");
import OperationBase = require("esri/OperationBase");
- /** The esri/dijit/editing namespace contains editing related operations that inherit from OperationBase. */
+ /** This class is used with the UndoManager to provide undo/redo functionality of Add operations when editing. */
class Add extends OperationBase {
/**
* Create a new Add operation.
@@ -6810,7 +6922,7 @@ declare module "esri/dijit/editing/Cut" {
import esri = require("esri");
import OperationBase = require("esri/OperationBase");
- /** The esri/dijit/editing namespace contains editing related operations that inherit from OperationBase. */
+ /** This class is used with the UndoManager to provide undo/redo functionality of Cut operations when editing. */
class Cut extends OperationBase {
/**
* Create a new Cut operation.
@@ -6829,7 +6941,7 @@ declare module "esri/dijit/editing/Delete" {
import esri = require("esri");
import OperationBase = require("esri/OperationBase");
- /** The esri/dijit/editing namespace contains editing related operations that inherit from OperationBase. */
+ /** This class is used with the UndoManager to provide undo/redo functionality of Delete operations when editing. */
class Delete extends OperationBase {
/**
* Create a new Delete operation.
@@ -6929,7 +7041,7 @@ declare module "esri/dijit/editing/Union" {
import esri = require("esri");
import OperationBase = require("esri/OperationBase");
- /** The esri/dijit/editing namespace contains editing related operations that inherit from OperationBase. */
+ /** This class is used with the UndoManager to provide undo/redo functionality of Union operations when editing. */
class Union extends OperationBase {
/**
* Create a new Union operation.
@@ -6948,7 +7060,7 @@ declare module "esri/dijit/editing/Update" {
import esri = require("esri");
import OperationBase = require("esri/OperationBase");
- /** The esri/dijit/editing namespace contains editing related operations that inherit from OperationBase. */
+ /** This class is used with the UndoManager to provide undo/redo functionality of Update operations when editing. */
class Update extends OperationBase {
/**
* Create a new Update operation.
@@ -8353,8 +8465,9 @@ declare module "esri/geometry/webMercatorUtils" {
/**
* Converts geometry from Web Mercator units to geographic units.
* @param geometry The geometry to convert.
+ * @param isLinear Indicates whether to work with linear values, i.e., do not normalize.
*/
- webMercatorToGeographic(geometry: Geometry): Geometry;
+ webMercatorToGeographic(geometry: Geometry, isLinear?: boolean): Geometry;
/**
* Translates the given Web Mercator coordinates to Longitude and Latitude.
* @param x The x coordinate value to convert.
@@ -10809,8 +10922,6 @@ declare module "esri/layers/VectorTileLayer" {
initialExtent: Extent;
/** The spatial reference of the layer. */
spatialReference: SpatialReference;
- /** The style object of the service with fully qualified URLs for glyphs and sprite. */
- style: any;
/** Contains information about the tiling scheme for the layer. */
tileInfo: TileInfo;
/** The URL to the vector tile service or style JSON that will be used to draw the layer. */
@@ -10821,6 +10932,8 @@ declare module "esri/layers/VectorTileLayer" {
* @param options Optional parameters.
*/
constructor(url: string | any, options?: esri.VectorTileLayerOptions);
+ /** Returns an object that contains the current style information for the layer. */
+ getStyle(): any;
/**
* Changes the style properties used to render the layers.
* @param styleUrl A url to a JSON file containing the stylesheet information to render the layer.
@@ -10835,14 +10948,15 @@ declare module "esri/layers/VectorTileLayer" {
declare module "esri/layers/WFSLayer" {
import esri = require("esri");
+ import GraphicsLayer = require("esri/layers/GraphicsLayer");
import Field = require("esri/layers/Field");
import Extent = require("esri/geometry/Extent");
import Graphic = require("esri/graphic");
import InfoTemplate = require("esri/InfoTemplate");
import Renderer = require("esri/renderers/Renderer");
- /** (Currently in beta) A layer for OGC Web Feature Services (WFS). */
- class WFSLayer {
+ /** (Currently in beta) A layer for OGC Web Feature Services (WFS). */
+ class WFSLayer extends GraphicsLayer {
/** An array of fields in the layer. */
fields: Field[];
/** The full extent of the layer. */
@@ -10864,17 +10978,11 @@ declare module "esri/layers/WFSLayer" {
* @param options See options table below for full descriptions of the properties needed for this object.
*/
constructor(options: esri.WFSLayerOptions);
- /** Creates the getFeature parameter based on the version, nsLayerName, nsGeometryFieldName, mode, wkid, inverseFilter, maxFeatures constructor parameters. */
- buildRequest(): string;
/**
- * Gets the WFS layer capabilities.
- * @param callback An array of WFS layers in JSON format.
+ * Creates a WFSLayer using the provided JSON object.
+ * @param json The input JSON.
*/
- getCapabilities(callback?: Function): void;
- /** Performs the getFeature request. */
- getFeature(): void;
- /** Returns a JSON Object containing all of the WFS parameters. */
- getWFSParameters(): any;
+ fromJson(json: Object): void;
/** Redraws all the graphics in the layer. */
redraw(): void;
/** Refreshes the features in the WFS layer. */
@@ -10885,8 +10993,8 @@ declare module "esri/layers/WFSLayer" {
setPointSymbol(): void;
/** Sets the default polygon symbol to be used if no renderer is specified. */
setPolygonSymbol(): void;
- /** Sets the WFS parameters using the provided JSON Object. */
- setWFSParameters(): void;
+ /** Converts the WFSLayer instance to a JSON object. */
+ toJson(): any;
}
export = WFSLayer;
}
@@ -10952,6 +11060,7 @@ declare module "esri/layers/WMSLayer" {
}
declare module "esri/layers/WMSLayerInfo" {
+ import esri = require("esri");
import Extent = require("esri/geometry/Extent");
/** The WMSLayerInfo class defines and provides information about layers in a WMS service. */
@@ -10966,6 +11075,10 @@ declare module "esri/layers/WMSLayerInfo" {
legendURL: string;
/** The layer name. */
name: string;
+ /** Returns true if the layer can be queried and the service supports GetFeatureInfo with either text/html or text/plain formats */
+ queryable: boolean;
+ /** Indicates if this layer should be included in the popup. */
+ showPopup: boolean;
/** An array of WKIDs of all spatial references defined for the layer. */
spatialReferences: number[];
/** WMSLayerInfos of the layer's sub layers. */
@@ -10974,9 +11087,9 @@ declare module "esri/layers/WMSLayerInfo" {
title: string;
/**
* Creates a new WMSLayerInfo object.
- * @param layer WMSLayerInfo layer object.
+ * @param options See options list for parameters.
*/
- constructor(layer: any);
+ constructor(options?: esri.WMSLayerInfoOptions);
}
export = WMSLayerInfo;
}
@@ -11584,7 +11697,7 @@ declare module "esri/opsdashboard/DataSourceProxy" {
displayFieldName: string;
/** Read-only: The collection of fields. */
fields: Field[];
- /** The geometry type. */
+ /** Read-only: The geometry type. */
geometryType: string;
/** Read-only: The id of the data source. */
id: string;
@@ -11611,8 +11724,8 @@ declare module "esri/opsdashboard/DataSourceProxy" {
executeQuery(query: Query): any;
/** An object that contains service level metadata about whether or not the layer supports queries using statistics, order by fields, DISTINCT, pagination, query with distance, and returning queries with extents. */
getAdvancedQueryCapabilities(): any;
- /** Retrieve the associated data source that supports selection. */
- getAssociatedSelectionDataSourceProxy(): any;
+ /** Retrieve the associated id of the data source that supports selection. */
+ getAssociatedSelectionDataSourceId(): any;
/** Get the associated popupInfo for the data source if any available. */
getPopupInfo(): any;
/** Get the associated render object for the data source if any available. */
@@ -11666,12 +11779,17 @@ 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: 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. */
getDataSourceProxies(): any;
- /** Get the data source corresponding to the data source id from the host application. */
- getDataSourceProxy(): any;
+ /**
+ * Get the data source corresponding to the data source id from the host application.
+ * @param dataSourceId The data source id
+ */
+ getDataSourceProxy(dataSourceId: string): any;
/** Get the collection of map widgets from the host application. */
getMapWidgetProxies(): any;
/**
@@ -11791,7 +11909,7 @@ declare module "esri/opsdashboard/GraphicsLayerProxy" {
minScale: number;
/** Read-only: The current host graphics layer opacity ratio. */
opacity: number;
- /** The current renderer used by the host graphics layer. */
+ /** Read-only: The current renderer used by the host graphics layer. */
renderer: Renderer;
/** Read-only: The current host graphics layer visibility. */
visible: boolean;
@@ -11928,8 +12046,6 @@ declare module "esri/opsdashboard/MapWidgetProxy" {
destroyGraphicsLayerProxy(graphicsLayerProxy: GraphicsLayerProxy): void;
/** Gets the current host map extent. */
getMapExtent(): any;
- /** Called by the host application when the extent of the host map has changed. */
- mapExtentChanged(): void;
/**
* Pans the map to a new location.
* @param mapPoint A new location with the same spatial reference as the host map.
@@ -14088,7 +14204,7 @@ declare module "esri/tasks/FindTask" {
url: string;
/**
* Creates a new FindTask object.
- * @param url URL to the ArcGIS Server REST resource that represents a layer in a service.
+ * @param url URL to the ArcGIS Server REST resource that represents a map service.
* @param options Optional parameters.
*/
constructor(url: string, options?: esri.FindTaskOptions);
@@ -15343,6 +15459,8 @@ declare module "esri/tasks/RouteParameters" {
startTimeIsUTC: boolean;
/** The set of stops loaded as network locations during analysis. */
stops: any;
+ /** If true , the TimeWindowStart and TimeWindowEnd attributes of a stop are in UTC time (milliseconds). */
+ timeWindowsAreUTC: boolean;
/** Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. */
travelMode: any;
/** If true, the hierarchy attribute for the network should be used in analysis. */
@@ -16696,7 +16814,7 @@ declare module "esri/tasks/query" {
static SPATIAL_REL_TOUCHES: any;
/** The feature from feature class 1 is completely enclosed by the feature from feature class 2. */
static SPATIAL_REL_WITHIN: any;
- /** Distance to buffer input geometry. */
+ /** Buffer distance for input geometries. */
distance: number;
/** The geometry to apply to the spatial filter. */
geometry: Geometry;
@@ -16738,7 +16856,7 @@ declare module "esri/tasks/query" {
text: string;
/** Specify a time extent for the query. */
timeExtent: TimeExtent;
- /** Distance unit. */
+ /** The unit for calculating the buffer distance. */
units: string;
/** A where clause for the query. */
where: string;
@@ -17055,7 +17173,7 @@ declare module "esri/toolbars/navigation" {
* @param symbol The SimpleFillSymbol used for the rubber band zoom.
*/
setZoomSymbol(symbol: Symbol): void;
- /** Zoom to full extent of base layer. */
+ /** Zoom to initial extent of base layer. */
zoomToFullExtent(): void;
/** Zoom to next extent in extent history. */
zoomToNextExtent(): void;
diff --git a/archiver/archiver.d.ts b/archiver/archiver.d.ts
index d5133555a4..b31c8ad619 100644
--- a/archiver/archiver.d.ts
+++ b/archiver/archiver.d.ts
@@ -24,7 +24,7 @@ declare module "archiver" {
interface Archiver extends STREAM.Transform {
pipe(writeStream: FS.WriteStream): void;
- append(readStream: FS.ReadStream, name: nameInterface): void;
+ append(source: FS.ReadStream | Buffer | string, name: nameInterface): void;
finalize(): void;
}
diff --git a/asana/asana.d.ts b/asana/asana.d.ts
index 61cb54d26f..8b618b81a3 100644
--- a/asana/asana.d.ts
+++ b/asana/asana.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Qubo
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
///
declare module "asana" {
diff --git a/async/async-tests.ts b/async/async-tests.ts
index e7af9120a1..63640cecf6 100644
--- a/async/async-tests.ts
+++ b/async/async-tests.ts
@@ -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'),
diff --git a/async/async.d.ts b/async/async.d.ts
index 6288a269a1..96da35c1ea 100644
--- a/async/async.d.ts
+++ b/async/async.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Async 1.4.2
+// Type definitions for Async 2.0.1
// Project: https://github.com/caolan/async
// Definitions by: Boris Yankov , Arseniy Maximov , Joe Herman
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -37,6 +37,13 @@ interface AsyncQueue {
pause(): void
resume(): void;
kill(): void;
+ workersList(): {
+ data: T,
+ callback: Function
+ }[];
+ error(error: Error, data: any): void;
+ unsaturated(): void;
+ buffer: number;
}
interface AsyncPriorityQueue {
@@ -54,6 +61,14 @@ interface AsyncPriorityQueue {
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 {
@@ -85,6 +100,9 @@ interface Async {
map(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any;
mapSeries(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any;
mapLimit(arr: T[], limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any;
+ mapValuesLimit(obj: {[name: string]: T}, limit: number, iteratee: (value: string, key: T, callback: AsyncResultCallback) => void, callback: AsyncResultCallback): void;
+ mapValues(obj: {[name: string]: T}, iteratee: (value: string, key: T, callback: AsyncResultCallback) => void, callback: AsyncResultCallback): void;
+ mapValuesSeries: typeof async.mapValues;
filter(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any;
select(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any;
filterSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any;
@@ -100,11 +118,17 @@ interface Async {
reduceRight(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any;
foldr(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any;
detect(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any;
+ find: typeof async.detect;
detectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any;
+ findSeries: typeof async.detectSeries;
detectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any;
+ findLimit: typeof async.detectLimit;
sortBy(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any;
some(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any;
someLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any;
+ anyLimit: typeof async.someLimit;
+ someSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any;
+ anySeries: typeof async.someSeries;
any(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any;
every(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => any): any;
everyLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (result: boolean) => any): any;
@@ -134,18 +158,35 @@ interface Async {
queue(worker: AsyncWorker, concurrency?: number): AsyncQueue;
priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue;
cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo;
- auto(tasks: any, callback?: (error: Error, results: any) => void): void;
+ auto(tasks: any, concurrency?: number, callback?: (error: Error, results: any) => void): void;
+ autoInject(tasks: any, callback?: (error: Error, results: any) => void): void;
retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: (error: Error, results: any) => void): void;
retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: (error: Error, results: any) => void): void;
- iterator(tasks: Function[]): Function;
+ retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction;
apply(fn: Function, ...arguments: any[]): AsyncFunction;
- nextTick(callback: Function): void;
- setImmediate(callback: Function): void;
+ nextTick(callback: Function, ...args: any[]): void;
+ setImmediate: typeof async.nextTick;
+
+ allLimit(arr: T[], limit: number, iteratee: AsyncBooleanIterator, cb?: (result: boolean) => any) : any;
+ everySeries(arr: T[], iteratee: AsyncBooleanIterator, cb?: (result: boolean) => any) : any
+ allSeries: typeof async.everySeries;
+
+ reflect(fn: AsyncFunction) : (callback: (err: void, result: {error?: Error, value?: T}) => void) => void;
+ reflectAll(tasks: AsyncFunction[]): ((callback: (err: void, result: {error?: Error, value?: T}) => void) => void)[];
+
+ timeout(fn: AsyncFunction, milliseconds: number, info: any): AsyncFunction;
times (n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void;
timesSeries(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void;
timesLimit(n: number, limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void;
+ transform(arr: T[], iteratee: (acc: R[], item: T, key: string, callback: (error?: Error) => void) => void): void;
+ transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: string, callback: (error?: Error) => void) => void): void;
+ transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: Error) => void) => void): void;
+ transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: Error) => void) => void): void;
+
+ race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void;
+
// Utils
memoize(fn: Function, hasher?: Function): Function;
unmemoize(fn: Function): Function;
@@ -155,7 +196,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;
diff --git a/atom/atom.d.ts b/atom/atom.d.ts
index 389d6ef16e..ac899ba5ac 100644
--- a/atom/atom.d.ts
+++ b/atom/atom.d.ts
@@ -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;
diff --git a/auth0-js/auth0-js-tests.ts b/auth0-js/auth0-js-tests.ts
new file mode 100644
index 0000000000..c92251db91
--- /dev/null
+++ b/auth0-js/auth0-js-tests.ts
@@ -0,0 +1,23 @@
+///
+
+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);
+ });
diff --git a/auth0-js/auth0-js.d.ts b/auth0-js/auth0-js.d.ts
new file mode 100644
index 0000000000..250c7a850e
--- /dev/null
+++ b/auth0-js/auth0-js.d.ts
@@ -0,0 +1,133 @@
+// Type definitions for Auth0.js
+// Project: https://github.com/auth0/auth0.js
+// Definitions by: Robert McLaws
+// 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
+}
diff --git a/auth0.lock/auth0.lock-tests.ts b/auth0.lock/auth0.lock-tests.ts
index fd646ee1bb..d466cf5937 100644
--- a/auth0.lock/auth0.lock-tests.ts
+++ b/auth0.lock/auth0.lock-tests.ts
@@ -1,13 +1,165 @@
-///
+///
///
-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 terms of service ...",
+ 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);
diff --git a/auth0.lock/auth0.lock.d.ts b/auth0.lock/auth0.lock.d.ts
index 15f767984b..2d74f6e6a5 100644
--- a/auth0.lock/auth0.lock.d.ts
+++ b/auth0.lock/auth0.lock.d.ts
@@ -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
+// Definitions by: Brian Caruso
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
+
+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;
diff --git a/auth0.widget/auth0.widget-tests.ts b/auth0.widget/auth0.widget-tests.ts
index 012e9b9769..f44601986e 100644
--- a/auth0.widget/auth0.widget-tests.ts
+++ b/auth0.widget/auth0.widget-tests.ts
@@ -1,4 +1,4 @@
-///
+///
///
var widget: Auth0WidgetStatic = new Auth0Widget({
diff --git a/auth0.widget/auth0.widget.d.ts b/auth0.widget/auth0.widget.d.ts
index 20694526c3..e36a7f868a 100644
--- a/auth0.widget/auth0.widget.d.ts
+++ b/auth0.widget/auth0.widget.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Robert McLaws
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
interface Auth0WidgetStatic {
diff --git a/auth0/auth0-tests.ts b/auth0/auth0-tests.ts
index 9cd903b306..a1357246f3 100644
--- a/auth0/auth0-tests.ts
+++ b/auth0/auth0-tests.ts
@@ -1,23 +1,51 @@
-///
+///
-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.
+ });
diff --git a/auth0/auth0.d.ts b/auth0/auth0.d.ts
index 0608674ae7..e367d30411 100644
--- a/auth0/auth0.d.ts
+++ b/auth0/auth0.d.ts
@@ -1,131 +1,95 @@
-// Type definitions for Auth0.js
-// Project: http://auth0.com
-// Definitions by: Robert McLaws
+// Type definitions for auth0 v2.3.1
+// Project: https://github.com/auth0/node-auth0
+// Definitions by: Seth Westphal
// 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 */
+///
+
+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;
+ getUsers(params?: GetUsersData, cb?: (err: Error, users: User[]) => void): void;
+ createUser(data: UserData): Promise;
+ 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;
+ requestChangePasswordEmail(data: RequestChangePasswordEmailData, cb: (err: Error, message: string) => void): void;
+ }
-declare module "auth0" {
- export = Auth0
}
diff --git a/autobahn/autobahn.d.ts b/autobahn/autobahn.d.ts
index 97837b52d0..bb7a0c86ae 100644
--- a/autobahn/autobahn.d.ts
+++ b/autobahn/autobahn.d.ts
@@ -45,7 +45,7 @@ declare namespace autobahn {
interface IInvocation {
caller?: number;
- progress?: boolean;
+ progress?: (args : any[], kwargs : any) => void;
procedure: string;
}
@@ -163,6 +163,7 @@ declare namespace autobahn {
}
interface IPublishOptions {
+ acknowledge?: boolean;
exclude?: number[];
eligible?: number[];
disclose_me?: Boolean;
diff --git a/autobind-decorator/autobind-decorator-tests.ts b/autobind-decorator/autobind-decorator-tests.ts
new file mode 100644
index 0000000000..e428604802
--- /dev/null
+++ b/autobind-decorator/autobind-decorator-tests.ts
@@ -0,0 +1,43 @@
+///
+
+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'
diff --git a/autobind-decorator/autobind-decorator.d.ts b/autobind-decorator/autobind-decorator.d.ts
new file mode 100644
index 0000000000..51ba89c9bf
--- /dev/null
+++ b/autobind-decorator/autobind-decorator.d.ts
@@ -0,0 +1,10 @@
+// Type definitions for autobind-decorator v1.3.3
+// Project: https://github.com/andreypopp/autobind-decorator
+// Definitions by: Ivo Stratev
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module 'autobind-decorator' {
+ function autobind(target: TFunction): TFunction | void;
+ function autobind(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor | void;
+ export = autobind;
+}
diff --git a/autobind-decorator/autobind-decorator.ts.tscparams b/autobind-decorator/autobind-decorator.ts.tscparams
new file mode 100644
index 0000000000..1ee3d05cb6
--- /dev/null
+++ b/autobind-decorator/autobind-decorator.ts.tscparams
@@ -0,0 +1 @@
+--experimentalDecorators
diff --git a/autosize/autosize-tests.ts b/autosize/autosize-tests.ts
new file mode 100644
index 0000000000..23686fbd88
--- /dev/null
+++ b/autosize/autosize-tests.ts
@@ -0,0 +1,10 @@
+///
+
+// from a NodeList
+autosize(document.querySelectorAll('textarea'));
+
+// from a single Node
+autosize(document.querySelector('textarea'));
+
+// from a single element
+autosize(document.getElementById('my-textarea'));
diff --git a/autosize/autosize.d.ts b/autosize/autosize.d.ts
new file mode 100644
index 0000000000..0a8a696c3d
--- /dev/null
+++ b/autosize/autosize.d.ts
@@ -0,0 +1,17 @@
+// Type definitions for jquery.autosize 3.0.7
+// Project: http://www.jacklmoore.com/autosize/
+// Definitions by: Aaron T. King
+// 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;
+}
diff --git a/avoscloud-sdk/avoscloud-sdk.d.ts b/avoscloud-sdk/avoscloud-sdk.d.ts
index af904a6c8c..deb416290d 100644
--- a/avoscloud-sdk/avoscloud-sdk.d.ts
+++ b/avoscloud-sdk/avoscloud-sdk.d.ts
@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "avoscloud-sdk" {
- namespace AV{
+ namespace AV {
var applicationId: string;
var applicationKey: string;
@@ -301,6 +301,7 @@ declare module "avoscloud-sdk" {
fetch(options?: Object.FetchOptions): Promise;
get(attr: string): any;
getACL(): ACL;
+ getObjectId(): string;
has(attr: string): boolean;
hasChanged(attr: string): boolean;
increment(attr: string, amount?: number): any;
@@ -529,6 +530,7 @@ declare module "avoscloud-sdk" {
constructor(objectClass: any);
+ static and(...var_args: Query[]): Query;
static or(...var_args: Query[]): Query;
addAscending(key: string): Query;
@@ -628,7 +630,7 @@ declare module "avoscloud-sdk" {
signUp(attrs: any, options?: SuccessFailureOptions): Promise;
logIn(options?: SuccessFailureOptions): Promise